diff --git a/.changeset/afraid-rings-taste.md b/.changeset/afraid-rings-taste.md new file mode 100644 index 0000000000..172151fa1e --- /dev/null +++ b/.changeset/afraid-rings-taste.md @@ -0,0 +1,10 @@ +--- +'@backstage/plugin-catalog-import': patch +--- + +Flatten the options of the `CatalogImportPage` from the `options` property to the `pullRequest` property. + +```diff +- ++ +``` diff --git a/plugins/catalog-import/README.md b/plugins/catalog-import/README.md index 3befeb7918..97371ce0e7 100644 --- a/plugins/catalog-import/README.md +++ b/plugins/catalog-import/README.md @@ -52,7 +52,7 @@ The pull request feature can be disabled by options that are passed to the `Cata } + element={} /> ``` @@ -68,13 +68,11 @@ This can be configured by options that are passed to the `CatalogImportPage`: path="/catalog-import" element={ ({ - title: 'My title', - body: 'My **markdown** body', - }), - }, + pullRequest={{ + preparePullRequest: () => ({ + title: 'My title', + body: 'My **markdown** body', + }), }} /> } diff --git a/plugins/catalog-import/src/components/ImportComponentPage.tsx b/plugins/catalog-import/src/components/ImportComponentPage.tsx index db6f8a8439..1d1a8056bd 100644 --- a/plugins/catalog-import/src/components/ImportComponentPage.tsx +++ b/plugins/catalog-import/src/components/ImportComponentPage.tsx @@ -48,11 +48,7 @@ function repositories(configApi: ConfigApi): string[] { return repos; } -export const ImportComponentPage = ({ - opts, -}: { - opts?: StepperProviderOpts; -}) => { +export const ImportComponentPage = (opts: StepperProviderOpts) => { const configApi = useApi(configApiRef); const appTitle = configApi.getOptional('app.title') || 'Backstage'; diff --git a/plugins/catalog-import/src/components/Router.tsx b/plugins/catalog-import/src/components/Router.tsx index 294ccfcb31..fc74c32b30 100644 --- a/plugins/catalog-import/src/components/Router.tsx +++ b/plugins/catalog-import/src/components/Router.tsx @@ -19,8 +19,8 @@ import { Route, Routes } from 'react-router-dom'; import { ImportComponentPage } from './ImportComponentPage'; import { StepperProviderOpts } from './ImportStepper/defaults'; -export const Router = ({ options }: { options?: StepperProviderOpts }) => ( +export const Router = (opts: StepperProviderOpts) => ( - } /> + } /> );