From 50b668777a3607f8d9169abef67592f5a4bf0f33 Mon Sep 17 00:00:00 2001 From: Nick Bodiford Date: Wed, 13 Mar 2024 15:05:29 -0500 Subject: [PATCH 1/2] Resolved an issue where the `PaginatedCatalogTable` was not propagating table options to its child table. Signed-off-by: Nick Bodiford --- .changeset/fresh-worms-build.md | 5 +++++ .../src/components/CatalogTable/PaginatedCatalogTable.tsx | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/fresh-worms-build.md diff --git a/.changeset/fresh-worms-build.md b/.changeset/fresh-worms-build.md new file mode 100644 index 0000000000..a2518e46cb --- /dev/null +++ b/.changeset/fresh-worms-build.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog': patch +--- + +Resolved an issue where the `PaginatedCatalogTable` was not propagating table options to its child table. diff --git a/plugins/catalog/src/components/CatalogTable/PaginatedCatalogTable.tsx b/plugins/catalog/src/components/CatalogTable/PaginatedCatalogTable.tsx index fa40756a44..382b970f75 100644 --- a/plugins/catalog/src/components/CatalogTable/PaginatedCatalogTable.tsx +++ b/plugins/catalog/src/components/CatalogTable/PaginatedCatalogTable.tsx @@ -32,7 +32,7 @@ type PaginatedCatalogTableProps = { * @internal */ export function PaginatedCatalogTable(props: PaginatedCatalogTableProps) { - const { columns, data, next, prev, title, isLoading } = props; + const { columns, data, next, prev, title, isLoading, options } = props; const { updateFilters } = useEntityList(); return ( @@ -46,6 +46,7 @@ export function PaginatedCatalogTable(props: PaginatedCatalogTableProps) { showFirstLastPageButtons: false, pageSize: Number.MAX_SAFE_INTEGER, emptyRowsWhenPaging: false, + ...options, }} onSearchChange={(searchText: string) => updateFilters({ From 9e601c59af1d67f7132b4df757dec3776e9ac41f Mon Sep 17 00:00:00 2001 From: Nick Bodiford Date: Wed, 13 Mar 2024 17:07:09 -0500 Subject: [PATCH 2/2] Let through the table options that dont interfere with server side pagination. Signed-off-by: Nick Bodiford --- .../src/components/CatalogTable/PaginatedCatalogTable.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/catalog/src/components/CatalogTable/PaginatedCatalogTable.tsx b/plugins/catalog/src/components/CatalogTable/PaginatedCatalogTable.tsx index 382b970f75..34087f1b36 100644 --- a/plugins/catalog/src/components/CatalogTable/PaginatedCatalogTable.tsx +++ b/plugins/catalog/src/components/CatalogTable/PaginatedCatalogTable.tsx @@ -41,12 +41,13 @@ export function PaginatedCatalogTable(props: PaginatedCatalogTableProps) { columns={columns} data={data} options={{ + ...options, + // These settings are configured to force server side pagination paginationPosition: 'both', pageSizeOptions: [], showFirstLastPageButtons: false, pageSize: Number.MAX_SAFE_INTEGER, emptyRowsWhenPaging: false, - ...options, }} onSearchChange={(searchText: string) => updateFilters({