From f6d26940925a774d6e69c34cb53bc957b5409b2f Mon Sep 17 00:00:00 2001 From: Shailendra Ahir Date: Wed, 30 Mar 2022 06:52:52 +0530 Subject: [PATCH] #10453 Added props to DefaultCatalogPage.tsx and updated changeset Signed-off-by: Shailendra Ahir --- .changeset/moody-apes-tickle.md | 5 +++++ plugins/catalog/api-report.md | 2 ++ .../components/CatalogPage/DefaultCatalogPage.tsx | 14 ++++++++++++-- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 .changeset/moody-apes-tickle.md diff --git a/.changeset/moody-apes-tickle.md b/.changeset/moody-apes-tickle.md new file mode 100644 index 0000000000..03600c411a --- /dev/null +++ b/.changeset/moody-apes-tickle.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog': patch +--- + +Added options property to CatalogTable and DefaultCatalogPage to support customization of the Catalog Table. Related issue #10453 diff --git a/plugins/catalog/api-report.md b/plugins/catalog/api-report.md index 2780c85184..08ec68990c 100644 --- a/plugins/catalog/api-report.md +++ b/plugins/catalog/api-report.md @@ -164,6 +164,8 @@ export interface DefaultCatalogPageProps { columns?: TableColumn[]; // (undocumented) initiallySelectedFilter?: UserListFilterKind; + // (undocumented) + options?: TableProps['options']; } // @public diff --git a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx index 2a2861ac29..b2c1f92f9a 100644 --- a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx @@ -48,10 +48,16 @@ export interface DefaultCatalogPageProps { initiallySelectedFilter?: UserListFilterKind; columns?: TableColumn[]; actions?: TableProps['actions']; + options?: TableProps['options']; } export function DefaultCatalogPage(props: DefaultCatalogPageProps) { - const { columns, actions, initiallySelectedFilter = 'owned' } = props; + const { + columns, + actions, + initiallySelectedFilter = 'owned', + options = {}, + } = props; const orgName = useApi(configApiRef).getOptionalString('organization.name') ?? 'Backstage'; const createComponentLink = useRouteRef(createComponentRouteRef); @@ -76,7 +82,11 @@ export function DefaultCatalogPage(props: DefaultCatalogPageProps) { - +