Enable loading state for paginated catalog tables by passing isLoading prop

Signed-off-by: SzymonGr <szymong@onet.pl>
This commit is contained in:
SzymonGr
2024-09-10 23:07:46 +02:00
parent f094dfd54a
commit 0ff53c800a
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}
/>
);
}