Merge pull request #10291 from RoadieHQ/allow-customizing-default-catalog-component
Expose initialFiliter from Catalog Page
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog': minor
|
||||
---
|
||||
|
||||
Expose 'initalFilter' through initialKind prop on Catalog Page.
|
||||
@@ -161,6 +161,8 @@ export interface DefaultCatalogPageProps {
|
||||
// (undocumented)
|
||||
columns?: TableColumn<CatalogTableRow>[];
|
||||
// (undocumented)
|
||||
initialKind?: string;
|
||||
// (undocumented)
|
||||
initiallySelectedFilter?: UserListFilterKind;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,10 +48,16 @@ export interface DefaultCatalogPageProps {
|
||||
initiallySelectedFilter?: UserListFilterKind;
|
||||
columns?: TableColumn<CatalogTableRow>[];
|
||||
actions?: TableProps<CatalogTableRow>['actions'];
|
||||
initialKind?: string;
|
||||
}
|
||||
|
||||
export function DefaultCatalogPage(props: DefaultCatalogPageProps) {
|
||||
const { columns, actions, initiallySelectedFilter = 'owned' } = props;
|
||||
const {
|
||||
columns,
|
||||
actions,
|
||||
initiallySelectedFilter = 'owned',
|
||||
initialKind = 'component',
|
||||
} = props;
|
||||
const orgName =
|
||||
useApi(configApiRef).getOptionalString('organization.name') ?? 'Backstage';
|
||||
const createComponentLink = useRouteRef(createComponentRouteRef);
|
||||
@@ -60,7 +66,9 @@ export function DefaultCatalogPage(props: DefaultCatalogPageProps) {
|
||||
<PageWithHeader title={`${orgName} Catalog`} themeId="home">
|
||||
<EntityListProvider>
|
||||
<Content>
|
||||
<ContentHeader titleComponent={<CatalogKindHeader />}>
|
||||
<ContentHeader
|
||||
titleComponent={<CatalogKindHeader initialFilter={initialKind} />}
|
||||
>
|
||||
<CreateButton
|
||||
title="Create Component"
|
||||
to={createComponentLink && createComponentLink()}
|
||||
|
||||
Reference in New Issue
Block a user