Flatten the options of the CatalogImportPage
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
---
|
||||
'@backstage/plugin-catalog-import': patch
|
||||
---
|
||||
|
||||
Flatten the options of the `CatalogImportPage` from the `options` property to the `pullRequest` property.
|
||||
|
||||
```diff
|
||||
- <CatalogImportPage options={{ pullRequest: { disable: true } }} />
|
||||
+ <CatalogImportPage pullRequest={{ disable: true }} />
|
||||
```
|
||||
@@ -52,7 +52,7 @@ The pull request feature can be disabled by options that are passed to the `Cata
|
||||
|
||||
<Route
|
||||
path="/catalog-import"
|
||||
element={<CatalogImportPage options={{ pullRequest: { disable: true } }} />}
|
||||
element={<CatalogImportPage pullRequest={{ disable: true }} />}
|
||||
/>
|
||||
```
|
||||
|
||||
@@ -68,13 +68,11 @@ This can be configured by options that are passed to the `CatalogImportPage`:
|
||||
path="/catalog-import"
|
||||
element={
|
||||
<CatalogImportPage
|
||||
options={{
|
||||
pullRequest: {
|
||||
preparePullRequest: () => ({
|
||||
title: 'My title',
|
||||
body: 'My **markdown** body',
|
||||
}),
|
||||
},
|
||||
pullRequest={{
|
||||
preparePullRequest: () => ({
|
||||
title: 'My title',
|
||||
body: 'My **markdown** body',
|
||||
}),
|
||||
}}
|
||||
/>
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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) => (
|
||||
<Routes>
|
||||
<Route element={<ImportComponentPage opts={options} />} />
|
||||
<Route element={<ImportComponentPage {...opts} />} />
|
||||
</Routes>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user