diff --git a/.changeset/moody-apes-tickle.md b/.changeset/moody-apes-tickle.md new file mode 100644 index 0000000000..bdf593c9ad --- /dev/null +++ b/.changeset/moody-apes-tickle.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog': patch +--- + +Added tableOptions 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 a316ab0d03..d1e733a553 100644 --- a/plugins/catalog/api-report.md +++ b/plugins/catalog/api-report.md @@ -138,6 +138,8 @@ export interface CatalogTableProps { actions?: TableProps['actions']; // (undocumented) columns?: TableColumn[]; + // (undocumented) + tableOptions?: TableProps['options']; } // @public (undocumented) @@ -164,6 +166,8 @@ export interface DefaultCatalogPageProps { initialKind?: string; // (undocumented) initiallySelectedFilter?: UserListFilterKind; + // (undocumented) + tableOptions?: TableProps['options']; } // @public diff --git a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx index 8d65e54980..5250dcec0d 100644 --- a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx @@ -49,6 +49,7 @@ export interface DefaultCatalogPageProps { columns?: TableColumn[]; actions?: TableProps['actions']; initialKind?: string; + tableOptions?: TableProps['options']; } export function DefaultCatalogPage(props: DefaultCatalogPageProps) { @@ -57,6 +58,7 @@ export function DefaultCatalogPage(props: DefaultCatalogPageProps) { actions, initiallySelectedFilter = 'owned', initialKind = 'component', + tableOptions = {}, } = props; const orgName = useApi(configApiRef).getOptionalString('organization.name') ?? 'Backstage'; @@ -84,7 +86,11 @@ export function DefaultCatalogPage(props: DefaultCatalogPageProps) { - + diff --git a/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx b/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx index 9d59d57647..433032a69e 100644 --- a/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx +++ b/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx @@ -50,6 +50,7 @@ import Star from '@material-ui/icons/Star'; export interface CatalogTableProps { columns?: TableColumn[]; actions?: TableProps['actions']; + tableOptions?: TableProps['options']; } const YellowStar = withStyles({ @@ -60,7 +61,7 @@ const YellowStar = withStyles({ /** @public */ export const CatalogTable = (props: CatalogTableProps) => { - const { columns, actions } = props; + const { columns, actions, tableOptions } = props; const { isStarredEntity, toggleStarredEntity } = useStarredEntities(); const { loading, error, entities, filters } = useEntityList(); @@ -176,6 +177,7 @@ export const CatalogTable = (props: CatalogTableProps) => { showEmptyDataSourceMessage: !loading, padding: 'dense', pageSizeOptions: [20, 50, 100], + ...tableOptions, }} title={`${titlePreamble} (${entities.length})`} data={rows}