pass headerOptions to TemplatePage
Signed-off-by: Alex Rybchenko <arybchenko@box.com>
This commit is contained in:
@@ -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" />}
|
||||
|
||||
Reference in New Issue
Block a user