pass headerOptions to TemplatePage

Signed-off-by: Alex Rybchenko <arybchenko@box.com>
This commit is contained in:
Alex Rybchenko
2022-11-18 13:33:11 +01:00
parent 94a2e86ce1
commit a63e2df559
3 changed files with 19 additions and 4 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder': patch
---
fixed `headerOptions` not passed to `TemplatePage` component
@@ -163,6 +163,7 @@ export const Router = (props: RouterProps) => {
<TemplatePage
customFieldExtensions={fieldExtensions}
layouts={customLayouts}
headerOptions={props.headerOptions}
/>
</SecretsContextProvider>
}
@@ -51,13 +51,21 @@ const useTemplateParameterSchema = (templateRef: string) => {
return { schema: value, loading, error };
};
type Props = {
customFieldExtensions?: FieldExtensionOptions<any, any>[];
layouts?: LayoutOptions[];
headerOptions?: {
pageTitleOverride?: string;
title?: string;
subtitle?: string;
};
};
export const TemplatePage = ({
customFieldExtensions = [],
layouts = [],
}: {
customFieldExtensions?: FieldExtensionOptions<any, any>[];
layouts?: LayoutOptions[];
}) => {
headerOptions,
}: Props) => {
const apiHolder = useApiHolder();
const secretsContext = useContext(SecretsContext);
const errorApi = useApi(errorApiRef);
@@ -136,6 +144,7 @@ export const TemplatePage = ({
pageTitleOverride="Create a New Component"
title="Create a New Component"
subtitle="Create new software components using standard templates"
{...headerOptions}
/>
<Content>
{loading && <LinearProgress data-testid="loading-progress" />}