diff --git a/src/components/JobList/index.tsx b/src/components/JobList/index.tsx index 345319d..d53c969 100644 --- a/src/components/JobList/index.tsx +++ b/src/components/JobList/index.tsx @@ -70,6 +70,23 @@ const columns: MRT_ColumnDef[] = [ ); }, }, + { + header: "tasks", + id: "tasks", + accessorFn: (row: Job) => { + const tasks = Object.values(row.tasks || {}); + const keys = tasks.map(task => Object.keys(task)[0]); + const result = keys.join(', '); + return result + }, + size: 150, + enableColumnFilter: true, + }, + { + header: "description", + accessorKey: "description", + size: 120, + }, { header: "posted", id: "posted", @@ -209,8 +226,8 @@ export default function JobList({ query, sortMode }: JobListProps) { ...options, columns, data: data, - rowCount: data.length, enableFacetedValues: true, + enableGlobalFilter: true, initialState: { ...options.initialState, columnVisibility: { @@ -218,6 +235,8 @@ export default function JobList({ query, sortMode }: JobListProps) { updated: false, duration: false, waiting: false, + tasks: false, + description: false, }, pagination: { pageIndex: 0, diff --git a/src/lib/paddles.d.ts b/src/lib/paddles.d.ts index aa3c086..7eb5cbf 100644 --- a/src/lib/paddles.d.ts +++ b/src/lib/paddles.d.ts @@ -23,9 +23,15 @@ export const JobStatuses = [ export type JobStatus = (typeof JobStatuses)[number]; +export type Task = { + [key: string]: any; +} + export type Job = { id?: string; job_id: number; + tasks: Task; + description: string; name: string; suite: string; branch: string;