Skip to content

Commit

Permalink
Merge pull request #80 from ceph/add-table-cell-border
Browse files Browse the repository at this point in the history
Add table cell border (and other table UI improvements)
  • Loading branch information
zmc authored Aug 13, 2024
2 parents 2d10f49 + a4c1cf1 commit 2342cb6
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/components/JobList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ const columns: MRT_ColumnDef<Job>[] = [
<div>
{log_url? (
<IconLink to={dirName(log_url)}>
<DescriptionIcon fontSize="small" />
<DescriptionIcon fontSize="small" style={{marginLeft: '5px'}} />
</IconLink>
) : null}
{sentry_url ? (
<IconLink to={sentry_url}>
<img
src={`${sentryIcon}`}
alt="Sentry icon"
style={{height: '20px', width: '20px'}}
style={{height: '20px', width: '20px', marginLeft: '5px'}}
/>
</IconLink>
) : null}
Expand Down
54 changes: 32 additions & 22 deletions src/components/RunList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ const NON_FILTER_PARAMS = [
];

const columns: MRT_ColumnDef<Run>[] = [
{
accessorKey: "name",
header: "link",
maxSize: 12,
enableColumnFilter: false,
enableColumnActions: false,
Cell: ({ row }) => {
return (
<IconLink to={`/runs/${row.original.name}`}>
<OpenInNewIcon fontSize="small" style={{marginLeft: "5px"}} />
</IconLink>
);
},
},
{
header: "status",
accessorKey: "status",
Expand All @@ -40,33 +54,27 @@ const columns: MRT_ColumnDef<Run>[] = [
return row.original.status.replace("finished ", "");
},
filterSelectOptions: Object.values(RunStatuses),
size: 40,
enableColumnActions: false,
},
{
accessorKey: "user",
header: "user",
size: 60,
enableColumnFilter: false,
},
{
accessorKey: "name",
header: "link",
size: 30,
maxSize: 45,
enableColumnFilter: false,
Cell: ({ row }) => {
return (
<IconLink to={`/runs/${row.original.name}`}>
<OpenInNewIcon fontSize="small" />
</IconLink>
);
},
enableColumnActions: false,
},
{
id: "scheduled",
header: "scheduled",
accessorFn: (row: Run) => formatDate(row.scheduled),
filterVariant: 'date',
sortingFn: "datetime",
size: 125,
Cell: ({ row }) => {
const date_: string[] = row.original.scheduled.split(" ");
return <div> {date_[0]} <br /> {date_[1]} </div>
},
size: 50,
},
{
id: "started",
Expand Down Expand Up @@ -95,7 +103,7 @@ const columns: MRT_ColumnDef<Run>[] = [
},
enableColumnFilter: false,
sortingFn: "datetime",
size: 70,
size: 30,
},
{
accessorKey: "suite",
Expand All @@ -115,8 +123,10 @@ const columns: MRT_ColumnDef<Run>[] = [
{
accessorKey: "sha1",
header: "hash",
size: 30,
maxSize: 50,
maxSize: 30,
Cell: ({ row }) => {
return row.original.sha1.slice(0, 8);
},
},
{
accessorKey: "results.queued",
Expand All @@ -133,25 +143,25 @@ const columns: MRT_ColumnDef<Run>[] = [
{
accessorKey: "results.fail",
header: "fail",
size: 40,
size: 30,
enableColumnFilter: false,
},
{
accessorKey: "results.dead",
header: "dead",
size: 40,
size: 30,
enableColumnFilter: false,
},
{
accessorKey: "results.running",
header: "running",
size: 40,
size: 30,
enableColumnFilter: false,
},
{
accessorKey: "results.waiting",
header: "waiting",
size: 40,
size: 30,
enableColumnFilter: false,
},
];
Expand Down
1 change: 1 addition & 0 deletions src/lib/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default function useDefaultTableOptions<TData extends MRT_RowData>(): Par
paddingRight: 0,
paddingTop: '5px',
color: "black",
borderLeft: "0.3px solid " + theme.palette.background.default,
},
'tr td:has(svg)': {
padding: 0,
Expand Down

0 comments on commit 2342cb6

Please sign in to comment.