From 0ed0f57d2b5c6cb562148db875bef34c44b8c79f Mon Sep 17 00:00:00 2001 From: Lache Melvin Date: Mon, 27 Nov 2023 13:44:27 +1300 Subject: [PATCH 1/2] add required 'total' field to pagination data --- .../packages/system/src/NotificationEvents/ListView/ListView.tsx | 1 + frontend/packages/system/src/Notifications/ListView/ListView.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/frontend/packages/system/src/NotificationEvents/ListView/ListView.tsx b/frontend/packages/system/src/NotificationEvents/ListView/ListView.tsx index d9fc73b5..6c7f0c79 100644 --- a/frontend/packages/system/src/NotificationEvents/ListView/ListView.tsx +++ b/frontend/packages/system/src/NotificationEvents/ListView/ListView.tsx @@ -93,6 +93,7 @@ export const ListView = ({}: ListViewProps) => { page: queryParams.page, offset: queryParams.offset, first: queryParams.first, + total: data?.totalCount, }; return ( diff --git a/frontend/packages/system/src/Notifications/ListView/ListView.tsx b/frontend/packages/system/src/Notifications/ListView/ListView.tsx index 227b3e5e..8259f9fc 100644 --- a/frontend/packages/system/src/Notifications/ListView/ListView.tsx +++ b/frontend/packages/system/src/Notifications/ListView/ListView.tsx @@ -86,6 +86,7 @@ export const ListView = ({ kind }: ListViewProps) => { page: queryParams.page, offset: queryParams.offset, first: queryParams.first, + total: data?.totalCount, }; return ( From 38fcf9e14513671e601f508e7d3141e74ac56073 Mon Sep 17 00:00:00 2001 From: Lache Melvin Date: Mon, 27 Nov 2023 13:45:39 +1300 Subject: [PATCH 2/2] fix pagination type to require total --- frontend/packages/common/src/ui/layout/tables/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/packages/common/src/ui/layout/tables/types.ts b/frontend/packages/common/src/ui/layout/tables/types.ts index 8bd5586f..9244afe1 100644 --- a/frontend/packages/common/src/ui/layout/tables/types.ts +++ b/frontend/packages/common/src/ui/layout/tables/types.ts @@ -25,7 +25,7 @@ export interface TableProps { isLoading?: boolean; noDataMessage?: string; noDataElement?: JSX.Element; - pagination?: Pagination & { total?: number }; + pagination?: Pagination & { total: number | undefined }; onChangePage?: (page: number) => void; onRowClick?: null | ((row: T) => void); }