feat(ticket): show open and closed status in ticket list
This commit is contained in:
@@ -73,6 +73,17 @@ export function useTicketColumns(): ColumnDef<TicketListItem>[] {
|
|||||||
meta: { disableTruncate: true },
|
meta: { disableTruncate: true },
|
||||||
cell: ({ row }) => <TicketAttention ticket={row.original} />,
|
cell: ({ row }) => <TicketAttention ticket={row.original} />,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
accessorKey: 'is_closed',
|
||||||
|
header: 'Status',
|
||||||
|
size: 100,
|
||||||
|
meta: { disableTruncate: true },
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<Badge variant={row.original.is_closed ? 'secondary' : 'default'}>
|
||||||
|
{row.original.is_closed ? 'Closed' : 'Open'}
|
||||||
|
</Badge>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: 'created_by',
|
id: 'created_by',
|
||||||
header: 'Uploaded By',
|
header: 'Uploaded By',
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ function buildTicketListItem(
|
|||||||
chainage_name: event.chainage_name ?? null,
|
chainage_name: event.chainage_name ?? null,
|
||||||
default_defect_class: event.default_defect_class ?? null,
|
default_defect_class: event.default_defect_class ?? null,
|
||||||
detection_count: event.detection_count,
|
detection_count: event.detection_count,
|
||||||
|
is_closed: event.is_closed ?? false,
|
||||||
created_by_name: event.created_by_name ?? null,
|
created_by_name: event.created_by_name ?? null,
|
||||||
created_by_email: event.created_by_email ?? null,
|
created_by_email: event.created_by_email ?? null,
|
||||||
created_at: event.created_at ?? event.updated_at,
|
created_at: event.created_at ?? event.updated_at,
|
||||||
@@ -124,6 +125,7 @@ function mergeTicketListItem(
|
|||||||
default_defect_class:
|
default_defect_class:
|
||||||
event.default_defect_class ?? current.default_defect_class,
|
event.default_defect_class ?? current.default_defect_class,
|
||||||
detection_count: event.detection_count ?? current.detection_count,
|
detection_count: event.detection_count ?? current.detection_count,
|
||||||
|
is_closed: event.is_closed ?? current.is_closed,
|
||||||
created_by_name: event.created_by_name ?? current.created_by_name,
|
created_by_name: event.created_by_name ?? current.created_by_name,
|
||||||
created_by_email: event.created_by_email ?? current.created_by_email,
|
created_by_email: event.created_by_email ?? current.created_by_email,
|
||||||
created_at: event.created_at ?? current.created_at,
|
created_at: event.created_at ?? current.created_at,
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ export type TicketTableStatusEvent = {
|
|||||||
chainage_name?: string | null;
|
chainage_name?: string | null;
|
||||||
default_defect_class?: string | null;
|
default_defect_class?: string | null;
|
||||||
detection_count?: number;
|
detection_count?: number;
|
||||||
|
is_closed?: boolean;
|
||||||
created_by_name?: string | null;
|
created_by_name?: string | null;
|
||||||
created_by_email?: string | null;
|
created_by_email?: string | null;
|
||||||
created_at?: string;
|
created_at?: string;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export interface TicketListItem {
|
|||||||
chainage_name: string | null;
|
chainage_name: string | null;
|
||||||
default_defect_class: string | null;
|
default_defect_class: string | null;
|
||||||
detection_count: number;
|
detection_count: number;
|
||||||
|
is_closed: boolean;
|
||||||
created_by_name: string | null;
|
created_by_name: string | null;
|
||||||
created_by_email: string | null;
|
created_by_email: string | null;
|
||||||
created_at: string;
|
created_at: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user