Merge pull request #26609 from SzymonGr/master

[Catalog] Enable loading state for paginated catalog table
This commit is contained in:
Patrik Oldsberg
2024-09-12 14:11:58 +03:00
committed by GitHub
3 changed files with 8 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog': patch
---
Enable loading state for paginated catalog tables by passing `isLoading` prop
@@ -62,6 +62,7 @@ export function CursorPaginatedCatalogTable(props: PaginatedCatalogTableProps) {
/* this will enable the next button accordingly */
totalCount={next ? Number.MAX_VALUE : Number.MAX_SAFE_INTEGER}
localization={{ pagination: { labelDisplayedRows: '' } }}
isLoading={isLoading}
{...restProps}
/>
);
@@ -29,7 +29,7 @@ import {
export function OffsetPaginatedCatalogTable(
props: TableProps<CatalogTableRow>,
) {
const { columns, data } = props;
const { columns, data, isLoading } = props;
const { updateFilters, setLimit, setOffset, limit, totalItems, offset } =
useEntityList();
const [page, setPage] = React.useState(
@@ -68,6 +68,7 @@ export function OffsetPaginatedCatalogTable(
}}
totalCount={totalItems}
localization={{ pagination: { labelDisplayedRows: '' } }}
isLoading={isLoading}
/>
);
}