Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add table cell border (and other table UI improvements) #80

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading