Skip to content

Commit 2342cb6

Browse files
authored
Merge pull request #80 from ceph/add-table-cell-border
Add table cell border (and other table UI improvements)
2 parents 2d10f49 + a4c1cf1 commit 2342cb6

File tree

3 files changed

+35
-24
lines changed

3 files changed

+35
-24
lines changed

src/components/JobList/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ const columns: MRT_ColumnDef<Job>[] = [
3939
<div>
4040
{log_url? (
4141
<IconLink to={dirName(log_url)}>
42-
<DescriptionIcon fontSize="small" />
42+
<DescriptionIcon fontSize="small" style={{marginLeft: '5px'}} />
4343
</IconLink>
4444
) : null}
4545
{sentry_url ? (
4646
<IconLink to={sentry_url}>
4747
<img
4848
src={`${sentryIcon}`}
4949
alt="Sentry icon"
50-
style={{height: '20px', width: '20px'}}
50+
style={{height: '20px', width: '20px', marginLeft: '5px'}}
5151
/>
5252
</IconLink>
5353
) : null}

src/components/RunList/index.tsx

+32-22
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,20 @@ const NON_FILTER_PARAMS = [
3232
];
3333

3434
const columns: MRT_ColumnDef<Run>[] = [
35+
{
36+
accessorKey: "name",
37+
header: "link",
38+
maxSize: 12,
39+
enableColumnFilter: false,
40+
enableColumnActions: false,
41+
Cell: ({ row }) => {
42+
return (
43+
<IconLink to={`/runs/${row.original.name}`}>
44+
<OpenInNewIcon fontSize="small" style={{marginLeft: "5px"}} />
45+
</IconLink>
46+
);
47+
},
48+
},
3549
{
3650
header: "status",
3751
accessorKey: "status",
@@ -40,33 +54,27 @@ const columns: MRT_ColumnDef<Run>[] = [
4054
return row.original.status.replace("finished ", "");
4155
},
4256
filterSelectOptions: Object.values(RunStatuses),
57+
size: 40,
58+
enableColumnActions: false,
4359
},
4460
{
4561
accessorKey: "user",
4662
header: "user",
47-
size: 60,
48-
enableColumnFilter: false,
49-
},
50-
{
51-
accessorKey: "name",
52-
header: "link",
53-
size: 30,
63+
maxSize: 45,
5464
enableColumnFilter: false,
55-
Cell: ({ row }) => {
56-
return (
57-
<IconLink to={`/runs/${row.original.name}`}>
58-
<OpenInNewIcon fontSize="small" />
59-
</IconLink>
60-
);
61-
},
65+
enableColumnActions: false,
6266
},
6367
{
6468
id: "scheduled",
6569
header: "scheduled",
6670
accessorFn: (row: Run) => formatDate(row.scheduled),
6771
filterVariant: 'date',
6872
sortingFn: "datetime",
69-
size: 125,
73+
Cell: ({ row }) => {
74+
const date_: string[] = row.original.scheduled.split(" ");
75+
return <div> {date_[0]} <br /> {date_[1]} </div>
76+
},
77+
size: 50,
7078
},
7179
{
7280
id: "started",
@@ -95,7 +103,7 @@ const columns: MRT_ColumnDef<Run>[] = [
95103
},
96104
enableColumnFilter: false,
97105
sortingFn: "datetime",
98-
size: 70,
106+
size: 30,
99107
},
100108
{
101109
accessorKey: "suite",
@@ -115,8 +123,10 @@ const columns: MRT_ColumnDef<Run>[] = [
115123
{
116124
accessorKey: "sha1",
117125
header: "hash",
118-
size: 30,
119-
maxSize: 50,
126+
maxSize: 30,
127+
Cell: ({ row }) => {
128+
return row.original.sha1.slice(0, 8);
129+
},
120130
},
121131
{
122132
accessorKey: "results.queued",
@@ -133,25 +143,25 @@ const columns: MRT_ColumnDef<Run>[] = [
133143
{
134144
accessorKey: "results.fail",
135145
header: "fail",
136-
size: 40,
146+
size: 30,
137147
enableColumnFilter: false,
138148
},
139149
{
140150
accessorKey: "results.dead",
141151
header: "dead",
142-
size: 40,
152+
size: 30,
143153
enableColumnFilter: false,
144154
},
145155
{
146156
accessorKey: "results.running",
147157
header: "running",
148-
size: 40,
158+
size: 30,
149159
enableColumnFilter: false,
150160
},
151161
{
152162
accessorKey: "results.waiting",
153163
header: "waiting",
154-
size: 40,
164+
size: 30,
155165
enableColumnFilter: false,
156166
},
157167
];

src/lib/table.ts

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export default function useDefaultTableOptions<TData extends MRT_RowData>(): Par
3838
paddingRight: 0,
3939
paddingTop: '5px',
4040
color: "black",
41+
borderLeft: "0.3px solid " + theme.palette.background.default,
4142
},
4243
'tr td:has(svg)': {
4344
padding: 0,

0 commit comments

Comments
 (0)