From defc243ccee024b8441bec07e34a25d8cd975b91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=B6disch=2C=20Alexander?= Date: Tue, 17 Jun 2025 11:11:53 +0200 Subject: [PATCH] fix: hide pagination query params if pagination mode is set to none MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Vödisch, Alexander --- .changeset/open-seas-ring.md | 5 +++++ plugins/catalog-react/src/hooks/useEntityListProvider.tsx | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changeset/open-seas-ring.md diff --git a/.changeset/open-seas-ring.md b/.changeset/open-seas-ring.md new file mode 100644 index 0000000000..8367d3c76b --- /dev/null +++ b/.changeset/open-seas-ring.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-react': patch +--- + +fix: hide pagination query params if pagination mode is set to none diff --git a/plugins/catalog-react/src/hooks/useEntityListProvider.tsx b/plugins/catalog-react/src/hooks/useEntityListProvider.tsx index 560e2ba987..56af7e9a73 100644 --- a/plugins/catalog-react/src/hooks/useEntityListProvider.tsx +++ b/plugins/catalog-react/src/hooks/useEntityListProvider.tsx @@ -346,7 +346,11 @@ export const EntityListProvider = ( ignoreQueryPrefix: true, }); const newParams = qs.stringify( - { ...oldParams, filters: queryParams, cursor, offset, limit }, + { + ...oldParams, + filters: queryParams, + ...(paginationMode === 'none' ? {} : { cursor, limit, offset }), + }, { addQueryPrefix: true, arrayFormat: 'repeat' }, ); const newUrl = `${window.location.pathname}${newParams}`;