Skip to content

Commit b7ccb0f

Browse files
committed
Fix types and minor issues on mobile
1 parent a0ce84e commit b7ccb0f

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

codersdk/audit.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ const (
2929
type AuditDiff map[string]AuditDiffField
3030

3131
type AuditDiffField struct {
32-
Old any
33-
New any
34-
Secret bool
32+
Old any `json:"old"`
33+
New any `json:"new"`
34+
Secret bool `json:"secret"`
3535
}
3636

3737
type AuditLog struct {

site/src/api/typesGenerated.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ export type AuditDiff = Record<string, AuditDiffField>
4040
// From codersdk/audit.go
4141
export interface AuditDiffField {
4242
// eslint-disable-next-line
43-
readonly Old: any
43+
readonly old: any
4444
// eslint-disable-next-line
45-
readonly New: any
46-
readonly Secret: boolean
45+
readonly new: any
46+
readonly secret: boolean
4747
}
4848

4949
// From codersdk/audit.go

site/src/components/AuditLogRow/AuditLogDiff.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const AuditLogDiff: React.FC<{ diff: AuditLog["diff"] }> = ({ diff }) =>
2222
<div key={attrName} className={styles.diffRow}>
2323
<div className={styles.diffLine}>{index + 1}</div>
2424
<div className={styles.diffIcon}>-</div>
25-
<div className={styles.diffContent}>
25+
<div>
2626
{attrName}:{" "}
2727
<span className={combineClasses([styles.diffValue, styles.diffValueOld])}>
2828
{getDiffValue(valueDiff.old)}
@@ -36,7 +36,7 @@ export const AuditLogDiff: React.FC<{ diff: AuditLog["diff"] }> = ({ diff }) =>
3636
<div key={attrName} className={styles.diffRow}>
3737
<div className={styles.diffLine}>{index + 1}</div>
3838
<div className={styles.diffIcon}>+</div>
39-
<div className={styles.diffContent}>
39+
<div>
4040
{attrName}:{" "}
4141
<span className={combineClasses([styles.diffValue, styles.diffValueNew])}>
4242
{getDiffValue(valueDiff.new)}
@@ -76,9 +76,9 @@ const useStyles = makeStyles((theme) => ({
7676

7777
diffLine: {
7878
opacity: 0.5,
79-
8079
width: theme.spacing(8),
8180
textAlign: "right",
81+
flexShrink: 0,
8282
},
8383

8484
diffIcon: {
@@ -87,8 +87,6 @@ const useStyles = makeStyles((theme) => ({
8787
fontSize: theme.typography.body1.fontSize,
8888
},
8989

90-
diffContent: {},
91-
9290
diffNew: {
9391
backgroundColor: theme.palette.success.dark,
9492
color: theme.palette.success.contrastText,

site/src/components/AuditLogRow/AuditLogRow.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,12 @@ export const AuditLogRow: React.FC<AuditLogRowProps> = ({
102102
</div>
103103
</Stack>
104104

105-
<Stack direction="column" alignItems="flex-end" spacing={1}>
105+
<Stack
106+
direction="column"
107+
alignItems="flex-end"
108+
spacing={1}
109+
className={styles.auditLogRight}
110+
>
106111
<Pill
107112
type={pillTypeByHttpStatus(auditLog.status_code)}
108113
text={auditLog.status_code.toString()}
@@ -159,10 +164,15 @@ const useStyles = makeStyles((theme) => ({
159164
display: "block",
160165
},
161166

167+
auditLogRight: {
168+
width: "auto",
169+
},
170+
162171
auditLogExtraInfo: {
163172
...theme.typography.body2,
164173
fontFamily: "inherit",
165174
color: theme.palette.text.secondary,
175+
whiteSpace: "nowrap",
166176
},
167177

168178
disabledDropdownIcon: {

0 commit comments

Comments
 (0)