Skip to content

Commit

Permalink
Improve column sizes in RunList
Browse files Browse the repository at this point in the history
Also move "link" column to left most.

Signed-off-by: Vallari Agrawal <val.agl002@gmail.com>
  • Loading branch information
VallariAg committed Aug 8, 2024
1 parent 89f20b8 commit a4c1cf1
Show file tree
Hide file tree
Showing 2 changed files with 34 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

0 comments on commit a4c1cf1

Please sign in to comment.