From a4647dfa739cd730c09918c5c4b8df03e0161f2d Mon Sep 17 00:00:00 2001 From: Tyler Davis Date: Fri, 8 Nov 2024 19:46:03 +1100 Subject: [PATCH] Enable customization of CatalogTable pagination Signed-off-by: Tyler Davis --- .../components/CatalogTable/CursorPaginatedCatalogTable.tsx | 2 +- .../components/CatalogTable/OffsetPaginatedCatalogTable.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/catalog/src/components/CatalogTable/CursorPaginatedCatalogTable.tsx b/plugins/catalog/src/components/CatalogTable/CursorPaginatedCatalogTable.tsx index da9f13e85c..7198f8a60c 100644 --- a/plugins/catalog/src/components/CatalogTable/CursorPaginatedCatalogTable.tsx +++ b/plugins/catalog/src/components/CatalogTable/CursorPaginatedCatalogTable.tsx @@ -39,9 +39,9 @@ export function CursorPaginatedCatalogTable(props: PaginatedCatalogTableProps) { columns={columns} data={data} options={{ + paginationPosition: 'both', ...options, // These settings are configured to force server side pagination - paginationPosition: 'both', pageSizeOptions: [], showFirstLastPageButtons: false, pageSize: Number.MAX_SAFE_INTEGER, diff --git a/plugins/catalog/src/components/CatalogTable/OffsetPaginatedCatalogTable.tsx b/plugins/catalog/src/components/CatalogTable/OffsetPaginatedCatalogTable.tsx index 0faa0043a1..a86dd60b50 100644 --- a/plugins/catalog/src/components/CatalogTable/OffsetPaginatedCatalogTable.tsx +++ b/plugins/catalog/src/components/CatalogTable/OffsetPaginatedCatalogTable.tsx @@ -29,7 +29,7 @@ import { export function OffsetPaginatedCatalogTable( props: TableProps, ) { - const { columns, data, isLoading } = props; + const { columns, data, isLoading, options } = props; const { updateFilters, setLimit, setOffset, limit, totalItems, offset } = useEntityList(); const [page, setPage] = React.useState( @@ -53,6 +53,7 @@ export function OffsetPaginatedCatalogTable( pageSizeOptions: [5, 10, 20, 50, 100], pageSize: limit, emptyRowsWhenPaging: false, + ...options, }} onSearchChange={(searchText: string) => updateFilters({