Merge pull request #21351 from fedy97/hotfix/show-header-options

fix: theme id and headerOptions in TemplateListPage
This commit is contained in:
Ben Lambert
2023-11-16 17:22:56 +01:00
committed by GitHub
4 changed files with 20 additions and 1 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/plugin-scaffolder': patch
---
Added `headerOptions` to `TemplateListPage` to optionally override default values.
Changed `themeId` of TemplateListPage from `website` to `home`.
+5
View File
@@ -70,6 +70,11 @@ export type TemplateListPageProps = {
actions?: boolean;
tasks?: boolean;
};
headerOptions?: {
pageTitleOverride?: string;
title?: string;
subtitle?: string;
};
};
// @alpha (undocumented)
@@ -133,6 +133,7 @@ export const Router = (props: PropsWithChildren<RouterProps>) => {
contextMenu={props.contextMenu}
groups={props.groups}
templateFilter={props.templateFilter}
headerOptions={props.headerOptions}
/>
}
/>
@@ -67,6 +67,11 @@ export type TemplateListPageProps = {
actions?: boolean;
tasks?: boolean;
};
headerOptions?: {
pageTitleOverride?: string;
title?: string;
subtitle?: string;
};
};
const defaultGroup: TemplateGroupFilter = {
@@ -93,6 +98,7 @@ export const TemplateListPage = (props: TemplateListPageProps) => {
TemplateCardComponent,
groups: givenGroups = [],
templateFilter,
headerOptions,
} = props;
const navigate = useNavigate();
const editorLink = useRouteRef(editRouteRef);
@@ -151,11 +157,12 @@ export const TemplateListPage = (props: TemplateListPageProps) => {
return (
<EntityListProvider>
<Page themeId="website">
<Page themeId="home">
<Header
pageTitleOverride="Create a new component"
title="Create a new component"
subtitle="Create new software components using standard templates in your organization"
{...headerOptions}
>
<ScaffolderPageContextMenu {...scaffolderPageContextMenuProps} />
</Header>