diff --git a/.changeset/spotty-buses-drive.md b/.changeset/spotty-buses-drive.md new file mode 100644 index 0000000000..2f882be9a3 --- /dev/null +++ b/.changeset/spotty-buses-drive.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog': patch +--- + +Enable loading state for paginated catalog tables by passing `isLoading` prop diff --git a/plugins/catalog/src/components/CatalogTable/CursorPaginatedCatalogTable.tsx b/plugins/catalog/src/components/CatalogTable/CursorPaginatedCatalogTable.tsx index 4ad1d60d2d..da9f13e85c 100644 --- a/plugins/catalog/src/components/CatalogTable/CursorPaginatedCatalogTable.tsx +++ b/plugins/catalog/src/components/CatalogTable/CursorPaginatedCatalogTable.tsx @@ -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} /> ); diff --git a/plugins/catalog/src/components/CatalogTable/OffsetPaginatedCatalogTable.tsx b/plugins/catalog/src/components/CatalogTable/OffsetPaginatedCatalogTable.tsx index 1528fb59f9..0faa0043a1 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 } = 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} /> ); }