Skip to content

Commit ab78f9c

Browse files
refactor: Improve long rows in audit log (#4904)
1 parent 587924f commit ab78f9c

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

site/src/components/AuditLogRow/AuditLogDiff.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ const useStyles = makeStyles((theme) => ({
8686
flex: 1,
8787
paddingTop: theme.spacing(2),
8888
paddingBottom: theme.spacing(2.5),
89+
paddingRight: theme.spacing(2),
8990
lineHeight: "160%",
91+
alignSelf: "stretch",
9092
},
9193

9294
diffOld: {
@@ -101,7 +103,7 @@ const useStyles = makeStyles((theme) => ({
101103

102104
diffLine: {
103105
opacity: 0.5,
104-
width: theme.spacing(8),
106+
width: theme.spacing(6),
105107
textAlign: "right",
106108
flexShrink: 0,
107109
},
@@ -110,6 +112,7 @@ const useStyles = makeStyles((theme) => ({
110112
width: theme.spacing(4),
111113
textAlign: "center",
112114
fontSize: theme.typography.body1.fontSize,
115+
flexShrink: 0,
113116
},
114117

115118
diffNew: {

site/src/components/AuditLogRow/AuditLogRow.stories.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ const Template: Story<AuditLogRowProps> = (args) => (
3434

3535
export const NoDiff = Template.bind({})
3636
NoDiff.args = {
37-
auditLog: MockAuditLog,
37+
auditLog: {
38+
...MockAuditLog,
39+
diff: {},
40+
},
3841
}
3942

4043
export const WithDiff = Template.bind({})
@@ -43,6 +46,22 @@ WithDiff.args = {
4346
defaultIsDiffOpen: true,
4447
}
4548

49+
export const WithLongDiffRow = Template.bind({})
50+
WithLongDiffRow.args = {
51+
auditLog: {
52+
...MockAuditLog2,
53+
diff: {
54+
...MockAuditLog2.diff,
55+
icon: {
56+
old: "https://www.docker.com/wp-content/uploads/2022/03/Moby-logo.png",
57+
new: "https://www.docker.com/wp-content/uploads/2022/03/vertical-logo-monochromatic.png",
58+
secret: false,
59+
},
60+
},
61+
},
62+
defaultIsDiffOpen: true,
63+
}
64+
4665
export const WithWorkspaceBuild = Template.bind({})
4766
WithWorkspaceBuild.args = {
4867
auditLog: MockAuditLogWithWorkspaceBuild,

0 commit comments

Comments
 (0)