From e4ddf2285436c3d34a2fb361277e17b9dfda2869 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 1 Aug 2025 14:41:21 +0200 Subject: [PATCH] frontend-plugin-api,catalog-react: remove default* prefix from blueprint params Signed-off-by: Patrik Oldsberg --- .changeset/cold-heads-arrive.md | 5 +++ .changeset/cruel-zoos-argue.md | 21 +++++++++ .changeset/major-comics-stay.md | 5 +++ .changeset/sixty-clowns-float.md | 5 +++ .../architecture/15-plugins.md | 4 +- .../architecture/23-extension-blueprints.md | 12 +++--- .../architecture/25-extension-overrides.md | 4 +- .../frontend-system/architecture/36-routes.md | 6 +-- .../building-apps/06-plugin-conversion.md | 6 +-- .../building-plugins/01-index.md | 6 +-- .../building-plugins/05-migrating.md | 2 +- .../app-next-example-plugin/report.api.md | 3 +- .../app-next-example-plugin/src/plugin.tsx | 2 +- packages/app-next/src/App.tsx | 4 +- .../app-next/src/examples/pagesPlugin.tsx | 6 +-- packages/core-compat-api/report.api.md | 3 +- .../src/collectEntityPageContents.ts | 4 +- .../src/collectLegacyRoutes.tsx | 2 +- .../src/convertLegacyPageExtension.test.tsx | 2 +- .../src/convertLegacyPageExtension.tsx | 8 +++- .../src/convertLegacyPlugin.test.tsx | 2 +- .../frontend-defaults/src/createApp.test.tsx | 14 +++--- .../frontend-defaults/src/resolution.test.ts | 4 +- packages/frontend-plugin-api/report.api.md | 7 +-- .../src/blueprints/PageBlueprint.test.tsx | 6 +-- .../src/blueprints/PageBlueprint.tsx | 22 +++++----- .../src/wiring/createExtensionBlueprint.ts | 4 +- plugins/api-docs/README-alpha.md | 2 +- plugins/api-docs/report-alpha.api.md | 21 ++++++--- plugins/api-docs/src/alpha.tsx | 10 ++--- plugins/app-visualizer/report.api.md | 3 +- plugins/app-visualizer/src/plugin.tsx | 2 +- plugins/catalog-graph/README-alpha.md | 2 +- plugins/catalog-graph/report-alpha.api.md | 3 +- plugins/catalog-graph/src/alpha.tsx | 2 +- plugins/catalog-import/report-alpha.api.md | 3 +- plugins/catalog-import/src/alpha.tsx | 2 +- plugins/catalog-react/report-alpha.api.md | 15 ++++--- .../EntityContentBlueprint.test.tsx | 24 +++++------ .../blueprints/EntityContentBlueprint.ts | 43 +++++++++++-------- ...nvertLegacyEntityContentExtension.test.tsx | 4 +- .../convertLegacyEntityContentExtension.tsx | 18 ++++++-- .../report-alpha.api.md | 3 +- .../src/alpha/plugin.tsx | 2 +- plugins/catalog/report-alpha.api.md | 15 ++++--- plugins/catalog/src/alpha/entityContents.tsx | 6 +-- plugins/catalog/src/alpha/pages.test.tsx | 16 +++---- plugins/catalog/src/alpha/pages.tsx | 4 +- plugins/devtools/report-alpha.api.md | 3 +- plugins/devtools/src/alpha/plugin.tsx | 2 +- plugins/home/report-alpha.api.md | 3 +- plugins/home/src/alpha.tsx | 2 +- plugins/kubernetes/report-alpha.api.md | 12 ++++-- .../kubernetes/src/alpha/entityContents.tsx | 6 +-- plugins/kubernetes/src/alpha/pages.tsx | 2 +- plugins/notifications/report-alpha.api.md | 3 +- plugins/notifications/src/alpha.tsx | 2 +- plugins/scaffolder/report-alpha.api.md | 3 +- plugins/scaffolder/src/alpha/extensions.tsx | 2 +- .../blueprints/SearchFilterBlueprint.test.tsx | 2 +- .../SearchFilterResultTypeBlueprint.test.tsx | 2 +- .../SearchResultListItemBlueprint.test.tsx | 2 +- plugins/search/report-alpha.api.md | 6 ++- plugins/search/src/alpha.tsx | 2 +- plugins/techdocs/report-alpha.api.md | 15 ++++--- plugins/techdocs/src/alpha/index.tsx | 8 ++-- plugins/user-settings/report-alpha.api.md | 3 +- plugins/user-settings/src/alpha.tsx | 2 +- 68 files changed, 275 insertions(+), 176 deletions(-) create mode 100644 .changeset/cold-heads-arrive.md create mode 100644 .changeset/cruel-zoos-argue.md create mode 100644 .changeset/major-comics-stay.md create mode 100644 .changeset/sixty-clowns-float.md diff --git a/.changeset/cold-heads-arrive.md b/.changeset/cold-heads-arrive.md new file mode 100644 index 0000000000..1e1f5ff6e2 --- /dev/null +++ b/.changeset/cold-heads-arrive.md @@ -0,0 +1,5 @@ +--- +'@backstage/frontend-plugin-api': minor +--- + +**BREAKING**: The `defaultPath` param of `PageBlueprint` has been renamed to `path`. This change does not affect the compatibility of extensions created with older versions of this blueprint. diff --git a/.changeset/cruel-zoos-argue.md b/.changeset/cruel-zoos-argue.md new file mode 100644 index 0000000000..eb59d2d85b --- /dev/null +++ b/.changeset/cruel-zoos-argue.md @@ -0,0 +1,21 @@ +--- +'@backstage/plugin-catalog-unprocessed-entities': patch +'@backstage/frontend-defaults': patch +'@backstage/core-compat-api': patch +'@backstage/plugin-app-visualizer': patch +'@backstage/plugin-catalog-import': patch +'@backstage/plugin-catalog-graph': patch +'@backstage/plugin-notifications': patch +'@backstage/plugin-user-settings': patch +'@backstage/plugin-search-react': patch +'@backstage/plugin-kubernetes': patch +'@backstage/plugin-scaffolder': patch +'@backstage/plugin-api-docs': patch +'@backstage/plugin-devtools': patch +'@backstage/plugin-techdocs': patch +'@backstage/plugin-catalog': patch +'@backstage/plugin-search': patch +'@backstage/plugin-home': patch +--- + +Internal update to align with new blueprint parameter naming in the new frontend system. diff --git a/.changeset/major-comics-stay.md b/.changeset/major-comics-stay.md new file mode 100644 index 0000000000..b8000bd0c5 --- /dev/null +++ b/.changeset/major-comics-stay.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-compat-api': minor +--- + +**BREAKING**: The `defaultPath` override of `convertLegacyPageExtension` has been renamed to `path`, in order to align with the same update that was made to the `PageBlueprint`. diff --git a/.changeset/sixty-clowns-float.md b/.changeset/sixty-clowns-float.md new file mode 100644 index 0000000000..4f0489f38c --- /dev/null +++ b/.changeset/sixty-clowns-float.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-react': minor +--- + +**BREAKING ALPHA**: The `defaultPath`, `defaultTitle`, and `defaultGroup` params of `PageBlueprint` has been renamed to `path`, `title`, and `group`. The `convertLegacyEntityContentExtension` utility has also received the same change. This change does not affect the compatibility of extensions created with older versions of this blueprint. diff --git a/docs/frontend-system/architecture/15-plugins.md b/docs/frontend-system/architecture/15-plugins.md index 13c93c6962..d88fbfb596 100644 --- a/docs/frontend-system/architecture/15-plugins.md +++ b/docs/frontend-system/architecture/15-plugins.md @@ -21,7 +21,7 @@ Frontend plugin instances are created with the `createFrontendPlugin` function, // This creates a new extension, see "Extension Blueprints" documentation for more details const myPage = PageBlueprint.make({ params: { - defaultPath: '/my-page', + path: '/my-page', loader: () => import('./MyPage').then(m => ), }, }); @@ -107,7 +107,7 @@ export default plugin.withOverrides({ // Override the catalog index page with a completely custom implementation PageBlueprint.make({ params: { - defaultPath: '/catalog', + path: '/catalog', routeRef: plugin.routes.catalogIndex, loader: () => import('./CustomCatalogIndexPage').then(m => ), }, diff --git a/docs/frontend-system/architecture/23-extension-blueprints.md b/docs/frontend-system/architecture/23-extension-blueprints.md index f7d019d6bc..cf0602eebb 100644 --- a/docs/frontend-system/architecture/23-extension-blueprints.md +++ b/docs/frontend-system/architecture/23-extension-blueprints.md @@ -18,7 +18,7 @@ The following is a simple example of how one might use the blueprint `make` meth ```tsx const myPageExtension = PageBlueprint.make({ params: { - defaultPath: '/my-page', + path: '/my-page', loader: () => import('./components/MyPage').then(m => ), }, }); @@ -44,7 +44,7 @@ const myPageExtension = PageBlueprint.makeWithOverrides({ // Call and forward the result from the original factory, providing // the blueprint parameters as the first argument. return originalFactory({ - defaultPath: '/my-page', + path: '/my-page', loader: () => import('./components/MyPage').then(m => ( // We can now access values from the factory context when providing @@ -101,7 +101,7 @@ The following is an example of how one might create a new extension blueprint: ```tsx export interface MyWidgetBlueprintParams { - defaultTitle: string; + title: string; element: JSX.Element; } @@ -119,7 +119,7 @@ export const MyWidgetBlueprint = createExtensionBlueprint({ // Note that while this is a valid pattern, you might often want to // return separate pieces of data instead, more on that below. coreExtensionData.reactElement( - + {params.element} , ), @@ -175,7 +175,7 @@ To do that, we create a new extension data reference for our widget title. This ```tsx export interface MyWidgetBlueprintParams { - defaultTitle: string; + title: string; element: JSX.Element; } @@ -194,7 +194,7 @@ export const MyWidgetBlueprint = createExtensionBlueprint({ output: [widgetTitleRef, coreExtensionData.reactElement], factory(params: MyWidgetBlueprintParams, { config }) { return [ - widgetTitleRef(config.title ?? params.defaultTitle), + widgetTitleRef(config.title ?? params.title), coreExtensionData.reactElement(params.element), ]; }, diff --git a/docs/frontend-system/architecture/25-extension-overrides.md b/docs/frontend-system/architecture/25-extension-overrides.md index 6b07fe4faa..b2584ab689 100644 --- a/docs/frontend-system/architecture/25-extension-overrides.md +++ b/docs/frontend-system/architecture/25-extension-overrides.md @@ -89,7 +89,7 @@ const exampleExtension = PageBlueprint.make({ params: { loader: () => import('./components/ExamplePage').then(m => ), - defaultPath: '/example', + path: '/example', }, }); ``` @@ -318,7 +318,7 @@ import { const customSearchPage = PageBlueprint.make({ params: { - defaultPath: '/search', + path: '/search', loader: () => import('./CustomSearchPage').then(m => ), }, diff --git a/docs/frontend-system/architecture/36-routes.md b/docs/frontend-system/architecture/36-routes.md index 53b5d00cdf..9ba03285a4 100644 --- a/docs/frontend-system/architecture/36-routes.md +++ b/docs/frontend-system/architecture/36-routes.md @@ -47,7 +47,7 @@ import { indexRouteRef } from './routes'; const catalogIndexPage = createPageExtension({ // The `name` option is omitted because this is an index page - defaultPath: '/entities', + path: '/entities', // highlight-next-line routeRef: indexRouteRef, loader: () => import('./components').then(m => ), @@ -197,7 +197,7 @@ import { import { indexRouteRef, createComponentExternalRouteRef } from './routes'; const catalogIndexPage = createPageExtension({ - defaultPath: '/entities', + path: '/entities', routeRef: indexRouteRef, loader: () => import('./components').then(m => ), }); @@ -404,7 +404,7 @@ import { import { indexRouteRef, detailsSubRouteRef } from './routes'; const catalogIndexPage = createPageExtension({ - defaultPath: '/entities', + path: '/entities', routeRef: indexRouteRef, loader: () => import('./components').then(m => ), }); diff --git a/docs/frontend-system/building-apps/06-plugin-conversion.md b/docs/frontend-system/building-apps/06-plugin-conversion.md index 720a29ddb7..a5d9ba6a5d 100644 --- a/docs/frontend-system/building-apps/06-plugin-conversion.md +++ b/docs/frontend-system/building-apps/06-plugin-conversion.md @@ -42,7 +42,7 @@ The conversion functions such as `convertLegacyPageExtension` will attempt to in ```ts const convertedIndexPage = convertLegacyPageExtension(TechDocsIndexPage, { name: 'index', - defaultPath: '/docs', + path: '/docs', }); ``` @@ -72,10 +72,10 @@ const convertedTechdocsPlugin = convertLegacyPlugin(techdocsPlugin, { extensions: [ convertLegacyPageExtension(TechDocsIndexPage, { name: 'index', - defaultPath: '/docs', + path: '/docs', }), convertLegacyPageExtension(TechDocsReaderPage, { - defaultPath: '/docs/:namespace/:kind/:name/*', + path: '/docs/:namespace/:kind/:name/*', }), convertLegacyEntityContentExtension(EntityTechdocsContent), ], diff --git a/docs/frontend-system/building-plugins/01-index.md b/docs/frontend-system/building-plugins/01-index.md index ecabf0e2ef..37b1c08f4e 100644 --- a/docs/frontend-system/building-plugins/01-index.md +++ b/docs/frontend-system/building-plugins/01-index.md @@ -75,7 +75,7 @@ const examplePage = PageBlueprint.make({ routeRef: rootRouteRef, // This is the default path of this page, but integrators are free to override it - defaultPath: '/example', + path: '/example', // Page extensions are always dynamically loaded using React.lazy(). // All of the functionality of this page is implemented in the @@ -198,8 +198,8 @@ import { EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha'; // route reference if you want to be able to generate a URL that links to the content. const exampleEntityContent = EntityContentBlueprint.make({ params: { - defaultPath: 'example', - defaultTitle: 'Example', + path: 'example', + title: 'Example', loader: () => import('./components/ExampleEntityContent').then(m => ( diff --git a/docs/frontend-system/building-plugins/05-migrating.md b/docs/frontend-system/building-plugins/05-migrating.md index 2215c548ae..4675f8d29d 100644 --- a/docs/frontend-system/building-plugins/05-migrating.md +++ b/docs/frontend-system/building-plugins/05-migrating.md @@ -119,7 +119,7 @@ const fooPage = PageBlueprint.make({ params: { // This is the path that was previously defined in the app code. // It's labelled as the default one because it can be changed via configuration. - defaultPath: '/foo', + path: '/foo', // You can reuse the existing routeRef by wrapping it with convertLegacyRouteRef. routeRef: convertLegacyRouteRef(rootRouteRef), // these inputs usually match the props required by the component. diff --git a/packages/app-next-example-plugin/report.api.md b/packages/app-next-example-plugin/report.api.md index 636d735914..1ff68cca5b 100644 --- a/packages/app-next-example-plugin/report.api.md +++ b/packages/app-next-example-plugin/report.api.md @@ -37,7 +37,8 @@ const examplePlugin: FrontendPlugin< >; inputs: {}; params: { - defaultPath: string; + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; loader: () => Promise; routeRef?: RouteRef; }; diff --git a/packages/app-next-example-plugin/src/plugin.tsx b/packages/app-next-example-plugin/src/plugin.tsx index 7e1e7a1bd6..40000dcd91 100644 --- a/packages/app-next-example-plugin/src/plugin.tsx +++ b/packages/app-next-example-plugin/src/plugin.tsx @@ -21,7 +21,7 @@ import { export const ExamplePage = PageBlueprint.make({ params: { - defaultPath: '/example', + path: '/example', loader: () => import('./Component').then(m => ), }, }); diff --git a/packages/app-next/src/App.tsx b/packages/app-next/src/App.tsx index 1eeedfa9be..54b346002b 100644 --- a/packages/app-next/src/App.tsx +++ b/packages/app-next/src/App.tsx @@ -85,10 +85,10 @@ const convertedTechdocsPlugin = convertLegacyPlugin(techdocsPlugin, { // TODO: We likely also need a way to convert an entire tree similar to collectLegacyRoutes convertLegacyPageExtension(TechDocsIndexPage, { name: 'index', - defaultPath: '/docs', + path: '/docs', }), convertLegacyPageExtension(TechDocsReaderPage, { - defaultPath: '/docs/:namespace/:kind/:name/*', + path: '/docs/:namespace/:kind/:name/*', }), convertLegacyEntityContentExtension(EntityTechdocsContent), ], diff --git a/packages/app-next/src/examples/pagesPlugin.tsx b/packages/app-next/src/examples/pagesPlugin.tsx index 1247d1bfb5..35426b589b 100644 --- a/packages/app-next/src/examples/pagesPlugin.tsx +++ b/packages/app-next/src/examples/pagesPlugin.tsx @@ -58,7 +58,7 @@ function PluginInfo() { const IndexPage = PageBlueprint.make({ name: 'index', params: { - defaultPath: '/', + path: '/', routeRef: indexRouteRef, loader: async () => { const Component = () => { @@ -95,7 +95,7 @@ const IndexPage = PageBlueprint.make({ const Page1 = PageBlueprint.make({ name: 'page1', params: { - defaultPath: '/page1', + path: '/page1', routeRef: page1RouteRef, loader: async () => { const Component = () => { @@ -131,7 +131,7 @@ const Page1 = PageBlueprint.make({ const ExternalPage = PageBlueprint.make({ name: 'pageX', params: { - defaultPath: '/pageX', + path: '/pageX', routeRef: pageXRouteRef, loader: async () => { const Component = () => { diff --git a/packages/core-compat-api/report.api.md b/packages/core-compat-api/report.api.md index e1fb583f4e..3e74caaa61 100644 --- a/packages/core-compat-api/report.api.md +++ b/packages/core-compat-api/report.api.md @@ -59,7 +59,8 @@ export function convertLegacyPageExtension( LegacyExtension: ComponentType<{}>, overrides?: { name?: string; - defaultPath?: string; + path?: string; + defaultPath?: [Error: `Use the 'path' override instead`]; }, ): ExtensionDefinition; diff --git a/packages/core-compat-api/src/collectEntityPageContents.ts b/packages/core-compat-api/src/collectEntityPageContents.ts index 582dee38f9..71cd1767e1 100644 --- a/packages/core-compat-api/src/collectEntityPageContents.ts +++ b/packages/core-compat-api/src/collectEntityPageContents.ts @@ -115,8 +115,8 @@ export function collectEntityPageContents( name, factory(originalFactory, { apis }) { return originalFactory({ - defaultPath: normalizeRoutePath(pageNode.path), - defaultTitle: pageNode.title, + path: normalizeRoutePath(pageNode.path), + title: pageNode.title, filter: mergedIf && (entity => mergedIf(entity, { apis })), loader: () => Promise.resolve(pageNode.children), }); diff --git a/packages/core-compat-api/src/collectLegacyRoutes.tsx b/packages/core-compat-api/src/collectLegacyRoutes.tsx index e0705df307..2e60136fb9 100644 --- a/packages/core-compat-api/src/collectLegacyRoutes.tsx +++ b/packages/core-compat-api/src/collectLegacyRoutes.tsx @@ -235,7 +235,7 @@ export function collectLegacyRoutes( factory(originalFactory, { inputs: _inputs }) { // todo(blam): why do we not use the inputs here? return originalFactory({ - defaultPath: normalizeRoutePath(path), + path: normalizeRoutePath(path), routeRef: routeRef ? convertLegacyRouteRef(routeRef) : undefined, loader: async () => compatWrapper( diff --git a/packages/core-compat-api/src/convertLegacyPageExtension.test.tsx b/packages/core-compat-api/src/convertLegacyPageExtension.test.tsx index 4248cef098..18957d7532 100644 --- a/packages/core-compat-api/src/convertLegacyPageExtension.test.tsx +++ b/packages/core-compat-api/src/convertLegacyPageExtension.test.tsx @@ -75,7 +75,7 @@ describe('convertLegacyPageExtension', () => { const converted = convertLegacyPageExtension(LegacyExtension, { name: 'other', - defaultPath: '/other', + path: '/other', }); const tester = createExtensionTester(converted); diff --git a/packages/core-compat-api/src/convertLegacyPageExtension.tsx b/packages/core-compat-api/src/convertLegacyPageExtension.tsx index f14b297047..299fcab58f 100644 --- a/packages/core-compat-api/src/convertLegacyPageExtension.tsx +++ b/packages/core-compat-api/src/convertLegacyPageExtension.tsx @@ -32,7 +32,11 @@ export function convertLegacyPageExtension( LegacyExtension: ComponentType<{}>, overrides?: { name?: string; - defaultPath?: string; + path?: string; + /** + * @deprecated Use the `path` param instead. + */ + defaultPath?: [Error: `Use the 'path' override instead`]; }, ): ExtensionDefinition { const element = ; @@ -55,7 +59,7 @@ export function convertLegacyPageExtension( return PageBlueprint.make({ name: overrides?.name ?? kebabName, params: { - defaultPath: overrides?.defaultPath ?? `/${kebabName}`, + path: overrides?.path ?? `/${kebabName}`, routeRef: mountPoint && convertLegacyRouteRef(mountPoint), loader: async () => compatWrapper(element), }, diff --git a/packages/core-compat-api/src/convertLegacyPlugin.test.tsx b/packages/core-compat-api/src/convertLegacyPlugin.test.tsx index 3f85e07ca5..81684216eb 100644 --- a/packages/core-compat-api/src/convertLegacyPlugin.test.tsx +++ b/packages/core-compat-api/src/convertLegacyPlugin.test.tsx @@ -70,7 +70,7 @@ describe('convertLegacyPlugin', () => { { extensions: [ PageBlueprint.make({ - params: { defaultPath: '/test', loader: async () => ({} as any) }, + params: { path: '/test', loader: async () => ({} as any) }, }), ], }, diff --git a/packages/frontend-defaults/src/createApp.test.tsx b/packages/frontend-defaults/src/createApp.test.tsx index 9440dc841f..89ac0a5b39 100644 --- a/packages/frontend-defaults/src/createApp.test.tsx +++ b/packages/frontend-defaults/src/createApp.test.tsx @@ -92,7 +92,7 @@ describe('createApp', () => { extensions: [ PageBlueprint.make({ params: { - defaultPath: '/', + path: '/', loader: async () =>
First Page
, }, }), @@ -103,7 +103,7 @@ describe('createApp', () => { extensions: [ PageBlueprint.make({ params: { - defaultPath: '/', + path: '/', loader: async () =>
Last Page
, }, }), @@ -146,7 +146,7 @@ describe('createApp', () => { extensions: [ PageBlueprint.make({ params: { - defaultPath: '/', + path: '/', loader: async () => , }, }), @@ -177,7 +177,7 @@ describe('createApp', () => { extensions: [ PageBlueprint.make({ params: { - defaultPath: '/', + path: '/', loader: async () =>
{config.getString('key')}
, }, }), @@ -289,7 +289,7 @@ describe('createApp', () => { extensions: [ PageBlueprint.make({ params: { - defaultPath: '/', + path: '/', loader: async () =>
Derp
, }, }), @@ -315,7 +315,7 @@ describe('createApp', () => { extensions: [ PageBlueprint.make({ params: { - defaultPath: '/', + path: '/', loader: async () => { const Component = () => { appTreeApi = useApi(appTreeApiRef); @@ -477,7 +477,7 @@ describe('createApp', () => { PageBlueprint.make({ name: 'test-page', params: { - defaultPath: '/', + path: '/', loader: async () => <>Test Page, }, }), diff --git a/packages/frontend-defaults/src/resolution.test.ts b/packages/frontend-defaults/src/resolution.test.ts index 991cb2d827..eb9e58f949 100644 --- a/packages/frontend-defaults/src/resolution.test.ts +++ b/packages/frontend-defaults/src/resolution.test.ts @@ -41,7 +41,7 @@ describe('resolveAsyncFeatures', () => { extensions: [ PageBlueprint.make({ params: { - defaultPath: '/', + path: '/', loader: () => new Promise(() => {}), }, }), @@ -79,7 +79,7 @@ describe('resolveAsyncFeatures', () => { extensions: [ PageBlueprint.make({ params: { - defaultPath: '/', + path: '/', loader: () => new Promise(() => {}), }, }), diff --git a/packages/frontend-plugin-api/report.api.md b/packages/frontend-plugin-api/report.api.md index 8cc777076b..84858a9e7d 100644 --- a/packages/frontend-plugin-api/report.api.md +++ b/packages/frontend-plugin-api/report.api.md @@ -922,7 +922,7 @@ export interface ExtensionBlueprint< ? TParamsInput : T['params'] extends ExtensionBlueprintParamsDefiner ? 'Error: This blueprint uses advanced parameter types and requires you to pass parameters as using the following callback syntax: `.make({ params: define => define() })`' - : TParamsInput; + : T['params']; }): ExtensionDefinition<{ kind: T['kind']; name: string | undefined extends TName ? undefined : TName; @@ -971,7 +971,7 @@ export interface ExtensionBlueprint< ? TParamsInput : T['params'] extends ExtensionBlueprintParamsDefiner ? 'Error: This blueprint uses advanced parameter types and requires you to pass parameters as using the following callback syntax: `originalFactory(define => define())`' - : TParamsInput, + : T['params'], context?: { config?: T['config']; inputs?: ResolveInputValueOverrides>; @@ -1546,7 +1546,8 @@ export { OpenIdConnectApi }; export const PageBlueprint: ExtensionBlueprint<{ kind: 'page'; params: { - defaultPath: string; + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; loader: () => Promise; routeRef?: RouteRef; }; diff --git a/packages/frontend-plugin-api/src/blueprints/PageBlueprint.test.tsx b/packages/frontend-plugin-api/src/blueprints/PageBlueprint.test.tsx index d3e1a6c954..680d93cd1c 100644 --- a/packages/frontend-plugin-api/src/blueprints/PageBlueprint.test.tsx +++ b/packages/frontend-plugin-api/src/blueprints/PageBlueprint.test.tsx @@ -34,7 +34,7 @@ describe('PageBlueprint', () => { name: 'test-page', params: { loader: () => Promise.resolve(
Test
), - defaultPath: '/test', + path: '/test', routeRef: mockRouteRef, }, }); @@ -90,7 +90,7 @@ describe('PageBlueprint', () => { name: 'test-page', params: { loader: () => Promise.resolve(
Test
), - defaultPath: '/test', + path: '/test', routeRef: mockRouteRef, }, }); @@ -123,7 +123,7 @@ describe('PageBlueprint', () => { {inputs.cards.map(c => c.get(coreExtensionData.reactElement))} ), - defaultPath: '/test', + path: '/test', routeRef: mockRouteRef, }); }, diff --git a/packages/frontend-plugin-api/src/blueprints/PageBlueprint.tsx b/packages/frontend-plugin-api/src/blueprints/PageBlueprint.tsx index 303e99daaa..92e2ab6172 100644 --- a/packages/frontend-plugin-api/src/blueprints/PageBlueprint.tsx +++ b/packages/frontend-plugin-api/src/blueprints/PageBlueprint.tsx @@ -37,21 +37,23 @@ export const PageBlueprint = createExtensionBlueprint({ }, }, *factory( - { - defaultPath, - loader, - routeRef, - }: { - defaultPath: string; + params: { + /** + * @deprecated Use the `path` param instead. + */ + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; loader: () => Promise; routeRef?: RouteRef; }, { config, node }, ) { - yield coreExtensionData.routePath(config.path ?? defaultPath); - yield coreExtensionData.reactElement(ExtensionBoundary.lazy(node, loader)); - if (routeRef) { - yield coreExtensionData.routeRef(routeRef); + yield coreExtensionData.routePath(config.path ?? params.path); + yield coreExtensionData.reactElement( + ExtensionBoundary.lazy(node, params.loader), + ); + if (params.routeRef) { + yield coreExtensionData.routeRef(params.routeRef); } }, }); diff --git a/packages/frontend-plugin-api/src/wiring/createExtensionBlueprint.ts b/packages/frontend-plugin-api/src/wiring/createExtensionBlueprint.ts index 159596caf4..861722e021 100644 --- a/packages/frontend-plugin-api/src/wiring/createExtensionBlueprint.ts +++ b/packages/frontend-plugin-api/src/wiring/createExtensionBlueprint.ts @@ -235,7 +235,7 @@ export interface ExtensionBlueprint< ? TParamsInput : T['params'] extends ExtensionBlueprintParamsDefiner ? 'Error: This blueprint uses advanced parameter types and requires you to pass parameters as using the following callback syntax: `.make({ params: define => define() })`' - : TParamsInput; + : T['params']; }): ExtensionDefinition<{ kind: T['kind']; name: string | undefined extends TName ? undefined : TName; @@ -288,7 +288,7 @@ export interface ExtensionBlueprint< ? TParamsInput : T['params'] extends ExtensionBlueprintParamsDefiner ? 'Error: This blueprint uses advanced parameter types and requires you to pass parameters as using the following callback syntax: `originalFactory(define => define())`' - : TParamsInput, + : T['params'], context?: { config?: T['config']; inputs?: ResolveInputValueOverrides>; diff --git a/plugins/api-docs/README-alpha.md b/plugins/api-docs/README-alpha.md index 5cdd386b89..fef8d491b8 100644 --- a/plugins/api-docs/README-alpha.md +++ b/plugins/api-docs/README-alpha.md @@ -287,7 +287,7 @@ export default createFrontendModule({ createPageExtension({ // Omitting name since we are overriding a plugin index page // It's up to you whether to use the original default path or not, but links that are hardcoded to the default path won't work if you change it - defaultPath: '/api-docs', + path: '/api-docs', // Associating the page with a different route ref may result in the sidebar item or external plugin route pointing to an unreachable page routeRef: convertLegacyRouteRef(rootRoute), // Custom page components are loaded here diff --git a/plugins/api-docs/report-alpha.api.md b/plugins/api-docs/report-alpha.api.md index c383ea810c..7aed601475 100644 --- a/plugins/api-docs/report-alpha.api.md +++ b/plugins/api-docs/report-alpha.api.md @@ -382,10 +382,13 @@ const _default: FrontendPlugin< >; inputs: {}; params: { + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; + defaultTitle?: [Error: `Use the 'title' param instead`]; + title: string; + defaultGroup?: [Error: `Use the 'group' param instead`]; + group?: keyof defaultEntityContentGroups | (string & {}); loader: () => Promise; - defaultPath: string; - defaultTitle: string; - defaultGroup?: keyof defaultEntityContentGroups | (string & {}); routeRef?: RouteRef; filter?: string | EntityPredicate | ((entity: Entity) => boolean); }; @@ -443,10 +446,13 @@ const _default: FrontendPlugin< >; inputs: {}; params: { + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; + defaultTitle?: [Error: `Use the 'title' param instead`]; + title: string; + defaultGroup?: [Error: `Use the 'group' param instead`]; + group?: keyof defaultEntityContentGroups | (string & {}); loader: () => Promise; - defaultPath: string; - defaultTitle: string; - defaultGroup?: keyof defaultEntityContentGroups | (string & {}); routeRef?: RouteRef; filter?: string | EntityPredicate | ((entity: Entity) => boolean); }; @@ -505,7 +511,8 @@ const _default: FrontendPlugin< kind: 'page'; name: undefined; params: { - defaultPath: string; + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; loader: () => Promise; routeRef?: RouteRef; }; diff --git a/plugins/api-docs/src/alpha.tsx b/plugins/api-docs/src/alpha.tsx index 4ff73f0e26..08a10335d8 100644 --- a/plugins/api-docs/src/alpha.tsx +++ b/plugins/api-docs/src/alpha.tsx @@ -79,7 +79,7 @@ const apiDocsExplorerPage = PageBlueprint.makeWithOverrides({ }, factory(originalFactory, { config }) { return originalFactory({ - defaultPath: '/api-docs', + path: '/api-docs', routeRef: convertLegacyRouteRef(rootRoute), loader: () => import('./components/ApiExplorerPage').then(m => @@ -186,8 +186,8 @@ const apiDocsProvidingComponentsEntityCard = EntityCardBlueprint.make({ const apiDocsDefinitionEntityContent = EntityContentBlueprint.make({ name: 'definition', params: { - defaultPath: '/definition', - defaultTitle: 'Definition', + path: '/definition', + title: 'Definition', filter: 'kind:api', loader: async () => import('./components/ApiDefinitionCard').then(m => @@ -205,8 +205,8 @@ const apiDocsDefinitionEntityContent = EntityContentBlueprint.make({ const apiDocsApisEntityContent = EntityContentBlueprint.make({ name: 'apis', params: { - defaultPath: '/apis', - defaultTitle: 'APIs', + path: '/apis', + title: 'APIs', filter: 'kind:component', loader: async () => import('./components/ApisCards').then(m => diff --git a/plugins/app-visualizer/report.api.md b/plugins/app-visualizer/report.api.md index 370647afc9..1def27d020 100644 --- a/plugins/app-visualizer/report.api.md +++ b/plugins/app-visualizer/report.api.md @@ -58,7 +58,8 @@ const visualizerPlugin: FrontendPlugin< >; inputs: {}; params: { - defaultPath: string; + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; loader: () => Promise; routeRef?: RouteRef; }; diff --git a/plugins/app-visualizer/src/plugin.tsx b/plugins/app-visualizer/src/plugin.tsx index faaf2a5788..58e1b2effa 100644 --- a/plugins/app-visualizer/src/plugin.tsx +++ b/plugins/app-visualizer/src/plugin.tsx @@ -26,7 +26,7 @@ const rootRouteRef = createRouteRef(); const appVisualizerPage = PageBlueprint.make({ params: { - defaultPath: '/visualizer', + path: '/visualizer', routeRef: rootRouteRef, loader: () => import('./components/AppVisualizerPage').then(m => ( diff --git a/plugins/catalog-graph/README-alpha.md b/plugins/catalog-graph/README-alpha.md index bab9a26fd1..945cdace71 100644 --- a/plugins/catalog-graph/README-alpha.md +++ b/plugins/catalog-graph/README-alpha.md @@ -306,7 +306,7 @@ export default createFrontendModule({ extensions: [ createPageExtension({ // Omitting name since it is an index page - defaultPath: '/catalog-graph', + path: '/catalog-graph', routeRef: convertLegacyRouteRef(catalogGraphRouteRef), createSchemaFromZod(z => z.object({ path: z.string().default('/catalog-graph') diff --git a/plugins/catalog-graph/report-alpha.api.md b/plugins/catalog-graph/report-alpha.api.md index 230edde3da..0c6bf3be26 100644 --- a/plugins/catalog-graph/report-alpha.api.md +++ b/plugins/catalog-graph/report-alpha.api.md @@ -189,7 +189,8 @@ const _default: FrontendPlugin< kind: 'page'; name: undefined; params: { - defaultPath: string; + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; loader: () => Promise; routeRef?: RouteRef; }; diff --git a/plugins/catalog-graph/src/alpha.tsx b/plugins/catalog-graph/src/alpha.tsx index 6ee16be1c4..5fc43f1b4a 100644 --- a/plugins/catalog-graph/src/alpha.tsx +++ b/plugins/catalog-graph/src/alpha.tsx @@ -75,7 +75,7 @@ const CatalogGraphPage = PageBlueprint.makeWithOverrides({ }, factory(originalFactory, { config }) { return originalFactory({ - defaultPath: '/catalog-graph', + path: '/catalog-graph', routeRef: convertLegacyRouteRef(catalogGraphRouteRef), loader: () => import('./components/CatalogGraphPage').then(m => diff --git a/plugins/catalog-import/report-alpha.api.md b/plugins/catalog-import/report-alpha.api.md index 2e75f9481c..c3a270c920 100644 --- a/plugins/catalog-import/report-alpha.api.md +++ b/plugins/catalog-import/report-alpha.api.md @@ -134,7 +134,8 @@ const _default: FrontendPlugin< >; inputs: {}; params: { - defaultPath: string; + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; loader: () => Promise; routeRef?: RouteRef; }; diff --git a/plugins/catalog-import/src/alpha.tsx b/plugins/catalog-import/src/alpha.tsx index 6f96bfbed1..f4079e529f 100644 --- a/plugins/catalog-import/src/alpha.tsx +++ b/plugins/catalog-import/src/alpha.tsx @@ -42,7 +42,7 @@ export * from './translation'; // whether this type of override is typically done with an input or by overriding the entire extension. const catalogImportPage = PageBlueprint.make({ params: { - defaultPath: '/catalog-import', + path: '/catalog-import', routeRef: convertLegacyRouteRef(rootRouteRef), loader: () => import('./components/ImportPage').then(m => diff --git a/plugins/catalog-react/report-alpha.api.md b/plugins/catalog-react/report-alpha.api.md index fa7d770ed0..89885c2096 100644 --- a/plugins/catalog-react/report-alpha.api.md +++ b/plugins/catalog-react/report-alpha.api.md @@ -104,8 +104,10 @@ export function convertLegacyEntityContentExtension( overrides?: { name?: string; filter?: string | EntityPredicate | ((entity: Entity) => boolean); - defaultPath?: string; - defaultTitle?: string; + path?: string; + title?: string; + defaultPath?: [Error: `Use the 'path' override instead`]; + defaultTitle?: [Error: `Use the 'title' override instead`]; }, ): ExtensionDefinition; @@ -185,10 +187,13 @@ export type EntityCardType = 'summary' | 'info' | 'content'; export const EntityContentBlueprint: ExtensionBlueprint<{ kind: 'entity-content'; params: { + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; + defaultTitle?: [Error: `Use the 'title' param instead`]; + title: string; + defaultGroup?: [Error: `Use the 'group' param instead`]; + group?: keyof typeof defaultEntityContentGroups | (string & {}); loader: () => Promise; - defaultPath: string; - defaultTitle: string; - defaultGroup?: keyof typeof defaultEntityContentGroups | (string & {}); routeRef?: RouteRef; filter?: string | EntityPredicate | ((entity: Entity) => boolean); }; diff --git a/plugins/catalog-react/src/alpha/blueprints/EntityContentBlueprint.test.tsx b/plugins/catalog-react/src/alpha/blueprints/EntityContentBlueprint.test.tsx index 4fb21f1744..729f15079f 100644 --- a/plugins/catalog-react/src/alpha/blueprints/EntityContentBlueprint.test.tsx +++ b/plugins/catalog-react/src/alpha/blueprints/EntityContentBlueprint.test.tsx @@ -32,8 +32,8 @@ describe('EntityContentBlueprint', () => { const extension = EntityContentBlueprint.make({ name: 'test', params: { - defaultPath: '/test', - defaultTitle: 'Test', + path: '/test', + title: 'Test', loader: async () =>
Test!
, }, }); @@ -253,8 +253,8 @@ describe('EntityContentBlueprint', () => { const extension = EntityContentBlueprint.make({ name: 'test', params: { - defaultPath: '/test', - defaultTitle: 'Test', + path: '/test', + title: 'Test', routeRef: mockRouteRef, loader: async () =>
Test!
, }, @@ -277,8 +277,8 @@ describe('EntityContentBlueprint', () => { EntityContentBlueprint.make({ name: 'test', params: { - defaultPath: '/test', - defaultTitle: 'Test', + path: '/test', + title: 'Test', loader: async () =>
Test!
, filter: 'test', }, @@ -291,8 +291,8 @@ describe('EntityContentBlueprint', () => { EntityContentBlueprint.make({ name: 'test', params: { - defaultPath: '/test', - defaultTitle: 'Test', + path: '/test', + title: 'Test', loader: async () =>
Test!
, }, }), @@ -305,8 +305,8 @@ describe('EntityContentBlueprint', () => { EntityContentBlueprint.make({ name: 'test', params: { - defaultPath: '/test', - defaultTitle: 'Test', + path: '/test', + title: 'Test', filter: mockFilter, loader: async () =>
Test!
, }, @@ -328,8 +328,8 @@ describe('EntityContentBlueprint', () => { }, factory(originalFactory, { inputs, config }) { return originalFactory({ - defaultPath: '/test', - defaultTitle: 'Test', + path: '/test', + title: 'Test', loader: async () => (
config: {config.mock} diff --git a/plugins/catalog-react/src/alpha/blueprints/EntityContentBlueprint.ts b/plugins/catalog-react/src/alpha/blueprints/EntityContentBlueprint.ts index 4ff9d83282..dadf059922 100644 --- a/plugins/catalog-react/src/alpha/blueprints/EntityContentBlueprint.ts +++ b/plugins/catalog-react/src/alpha/blueprints/EntityContentBlueprint.ts @@ -64,38 +64,45 @@ export const EntityContentBlueprint = createExtensionBlueprint({ }, }, *factory( - { - loader, - defaultPath, - defaultTitle, - defaultGroup, - filter, - routeRef, - }: { + params: { + /** + * @deprecated Use the `path` param instead. + */ + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; + /** + * @deprecated Use the `path` param instead. + */ + defaultTitle?: [Error: `Use the 'title' param instead`]; + title: string; + /** + * @deprecated Use the `path` param instead. + */ + defaultGroup?: [Error: `Use the 'group' param instead`]; + group?: keyof typeof defaultEntityContentGroups | (string & {}); loader: () => Promise; - defaultPath: string; - defaultTitle: string; - defaultGroup?: keyof typeof defaultEntityContentGroups | (string & {}); routeRef?: RouteRef; filter?: string | EntityPredicate | ((entity: Entity) => boolean); }, { node, config }, ) { - const path = config.path ?? defaultPath; - const title = config.title ?? defaultTitle; - const group = config.group ?? defaultGroup; + const path = config.path ?? params.path; + const title = config.title ?? params.title; + const group = config.group ?? params.group; - yield coreExtensionData.reactElement(ExtensionBoundary.lazy(node, loader)); + yield coreExtensionData.reactElement( + ExtensionBoundary.lazy(node, params.loader), + ); yield coreExtensionData.routePath(path); yield entityContentTitleDataRef(title); - if (routeRef) { - yield coreExtensionData.routeRef(routeRef); + if (params.routeRef) { + yield coreExtensionData.routeRef(params.routeRef); } - yield* resolveEntityFilterData(filter, config, node); + yield* resolveEntityFilterData(params.filter, config, node); if (group) { yield entityContentGroupDataRef(group); diff --git a/plugins/catalog-react/src/alpha/converters/convertLegacyEntityContentExtension.test.tsx b/plugins/catalog-react/src/alpha/converters/convertLegacyEntityContentExtension.test.tsx index 971e8a5eca..81da89d052 100644 --- a/plugins/catalog-react/src/alpha/converters/convertLegacyEntityContentExtension.test.tsx +++ b/plugins/catalog-react/src/alpha/converters/convertLegacyEntityContentExtension.test.tsx @@ -82,8 +82,8 @@ describe('convertLegacyEntityContentExtension', () => { const converted = convertLegacyEntityContentExtension(LegacyExtension, { name: 'other', - defaultPath: '/other', - defaultTitle: 'Other', + path: '/other', + title: 'Other', filter: 'my-filter', }); diff --git a/plugins/catalog-react/src/alpha/converters/convertLegacyEntityContentExtension.tsx b/plugins/catalog-react/src/alpha/converters/convertLegacyEntityContentExtension.tsx index 719eb9c6d5..d9638286cb 100644 --- a/plugins/catalog-react/src/alpha/converters/convertLegacyEntityContentExtension.tsx +++ b/plugins/catalog-react/src/alpha/converters/convertLegacyEntityContentExtension.tsx @@ -37,8 +37,18 @@ export function convertLegacyEntityContentExtension( overrides?: { name?: string; filter?: string | EntityPredicate | ((entity: Entity) => boolean); - defaultPath?: string; - defaultTitle?: string; + path?: string; + title?: string; + + /** + * @deprecated Use the `path` param instead. + */ + defaultPath?: [Error: `Use the 'path' override instead`]; + + /** + * @deprecated Use the `path` param instead. + */ + defaultTitle?: [Error: `Use the 'title' override instead`]; }, ): ExtensionDefinition { const element = ; @@ -77,8 +87,8 @@ export function convertLegacyEntityContentExtension( name: overrides?.name ?? name, params: { filter: overrides?.filter, - defaultPath: overrides?.defaultPath ?? `/${kebabCase(infix)}`, - defaultTitle: overrides?.defaultTitle ?? startCase(infix), + path: overrides?.path ?? `/${kebabCase(infix)}`, + title: overrides?.title ?? startCase(infix), routeRef: mountPoint && convertLegacyRouteRef(mountPoint), loader: async () => compatWrapper(element), }, diff --git a/plugins/catalog-unprocessed-entities/report-alpha.api.md b/plugins/catalog-unprocessed-entities/report-alpha.api.md index fa64ed329a..7ce172f4a9 100644 --- a/plugins/catalog-unprocessed-entities/report-alpha.api.md +++ b/plugins/catalog-unprocessed-entities/report-alpha.api.md @@ -82,7 +82,8 @@ const _default: FrontendPlugin< >; inputs: {}; params: { - defaultPath: string; + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; loader: () => Promise; routeRef?: RouteRef; }; diff --git a/plugins/catalog-unprocessed-entities/src/alpha/plugin.tsx b/plugins/catalog-unprocessed-entities/src/alpha/plugin.tsx index cfe81eccc8..f3f68cc23f 100644 --- a/plugins/catalog-unprocessed-entities/src/alpha/plugin.tsx +++ b/plugins/catalog-unprocessed-entities/src/alpha/plugin.tsx @@ -51,7 +51,7 @@ export const catalogUnprocessedEntitiesApi = ApiBlueprint.make({ /** @alpha */ export const catalogUnprocessedEntitiesPage = PageBlueprint.make({ params: { - defaultPath: '/catalog-unprocessed-entities', + path: '/catalog-unprocessed-entities', routeRef: convertLegacyRouteRef(rootRouteRef), loader: () => import('../components/UnprocessedEntities').then(m => diff --git a/plugins/catalog/report-alpha.api.md b/plugins/catalog/report-alpha.api.md index cfbbc5388e..44247ad676 100644 --- a/plugins/catalog/report-alpha.api.md +++ b/plugins/catalog/report-alpha.api.md @@ -893,10 +893,13 @@ const _default: FrontendPlugin< kind: 'entity-content'; name: 'overview'; params: { + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; + defaultTitle?: [Error: `Use the 'title' param instead`]; + title: string; + defaultGroup?: [Error: `Use the 'group' param instead`]; + group?: keyof defaultEntityContentGroups | (string & {}); loader: () => Promise; - defaultPath: string; - defaultTitle: string; - defaultGroup?: keyof defaultEntityContentGroups | (string & {}); routeRef?: RouteRef; filter?: string | EntityPredicate | ((entity: Entity) => boolean); }; @@ -1070,7 +1073,8 @@ const _default: FrontendPlugin< kind: 'page'; name: undefined; params: { - defaultPath: string; + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; loader: () => Promise; routeRef?: RouteRef; }; @@ -1190,7 +1194,8 @@ const _default: FrontendPlugin< kind: 'page'; name: 'entity'; params: { - defaultPath: string; + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; loader: () => Promise; routeRef?: RouteRef; }; diff --git a/plugins/catalog/src/alpha/entityContents.tsx b/plugins/catalog/src/alpha/entityContents.tsx index 165ed33e04..bc4556fdda 100644 --- a/plugins/catalog/src/alpha/entityContents.tsx +++ b/plugins/catalog/src/alpha/entityContents.tsx @@ -47,9 +47,9 @@ export const catalogOverviewEntityContent = }, factory: (originalFactory, { node, inputs }) => { return originalFactory({ - defaultPath: '/', - defaultTitle: 'Overview', - defaultGroup: 'overview', + path: '/', + title: 'Overview', + group: 'overview', loader: async () => { const LazyDefaultLayoutComponent = reactLazy(() => import('./DefaultEntityContentLayout').then(m => ({ diff --git a/plugins/catalog/src/alpha/pages.test.tsx b/plugins/catalog/src/alpha/pages.test.tsx index 47b3efbd0a..cc83b9168b 100644 --- a/plugins/catalog/src/alpha/pages.test.tsx +++ b/plugins/catalog/src/alpha/pages.test.tsx @@ -116,8 +116,8 @@ describe('Entity page', () => { const overviewEntityContent = EntityContentBlueprint.make({ name: 'overview', params: { - defaultPath: '/overview', - defaultTitle: 'Overview', + path: '/overview', + title: 'Overview', loader: async () =>
Mock Overview content
, }, }); @@ -125,9 +125,9 @@ describe('Entity page', () => { const techdocsEntityContent = EntityContentBlueprint.make({ name: 'techdocs', params: { - defaultPath: '/techdocs', - defaultTitle: 'TechDocs', - defaultGroup: 'documentation', + path: '/techdocs', + title: 'TechDocs', + group: 'documentation', loader: async () =>
Mock TechDocs content
, }, }); @@ -135,9 +135,9 @@ describe('Entity page', () => { const apidocsEntityContent = EntityContentBlueprint.make({ name: 'apidocs', params: { - defaultPath: '/apidocs', - defaultTitle: 'ApiDocs', - defaultGroup: 'documentation', + path: '/apidocs', + title: 'ApiDocs', + group: 'documentation', loader: async () =>
Mock ApiDocs content
, }, }); diff --git a/plugins/catalog/src/alpha/pages.tsx b/plugins/catalog/src/alpha/pages.tsx index f0c5316a84..e4e1a78151 100644 --- a/plugins/catalog/src/alpha/pages.tsx +++ b/plugins/catalog/src/alpha/pages.tsx @@ -58,7 +58,7 @@ export const catalogPage = PageBlueprint.makeWithOverrides({ }, factory(originalFactory, { inputs, config }) { return originalFactory({ - defaultPath: '/catalog', + path: '/catalog', routeRef: convertLegacyRouteRef(rootRouteRef), loader: async () => { const { BaseCatalogPage } = await import('../components/CatalogPage'); @@ -107,7 +107,7 @@ export const catalogEntityPage = PageBlueprint.makeWithOverrides({ }, factory(originalFactory, { config, inputs }) { return originalFactory({ - defaultPath: '/catalog/:namespace/:kind/:name', + path: '/catalog/:namespace/:kind/:name', routeRef: convertLegacyRouteRef(entityRouteRef), loader: async () => { const { EntityLayout } = await import('./components/EntityLayout'); diff --git a/plugins/devtools/report-alpha.api.md b/plugins/devtools/report-alpha.api.md index 2ede4d34b2..d9393e9c96 100644 --- a/plugins/devtools/report-alpha.api.md +++ b/plugins/devtools/report-alpha.api.md @@ -82,7 +82,8 @@ const _default: FrontendPlugin< >; inputs: {}; params: { - defaultPath: string; + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; loader: () => Promise; routeRef?: RouteRef; }; diff --git a/plugins/devtools/src/alpha/plugin.tsx b/plugins/devtools/src/alpha/plugin.tsx index d2f09521dd..f5fcc0600b 100644 --- a/plugins/devtools/src/alpha/plugin.tsx +++ b/plugins/devtools/src/alpha/plugin.tsx @@ -48,7 +48,7 @@ export const devToolsApi = ApiBlueprint.make({ /** @alpha */ export const devToolsPage = PageBlueprint.make({ params: { - defaultPath: '/devtools', + path: '/devtools', routeRef: convertLegacyRouteRef(rootRouteRef), loader: () => import('../components/DevToolsPage').then(m => diff --git a/plugins/home/report-alpha.api.md b/plugins/home/report-alpha.api.md index 010918b029..67c0bad3e5 100644 --- a/plugins/home/report-alpha.api.md +++ b/plugins/home/report-alpha.api.md @@ -98,7 +98,8 @@ const _default: FrontendPlugin< kind: 'page'; name: undefined; params: { - defaultPath: string; + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; loader: () => Promise; routeRef?: RouteRef; }; diff --git a/plugins/home/src/alpha.tsx b/plugins/home/src/alpha.tsx index d093f353a2..903ed2c7fc 100644 --- a/plugins/home/src/alpha.tsx +++ b/plugins/home/src/alpha.tsx @@ -54,7 +54,7 @@ const homePage = PageBlueprint.makeWithOverrides({ }, factory: (originalFactory, { inputs }) => { return originalFactory({ - defaultPath: '/home', + path: '/home', routeRef: rootRouteRef, loader: () => import('./components/').then(m => diff --git a/plugins/kubernetes/report-alpha.api.md b/plugins/kubernetes/report-alpha.api.md index 37bb084bd7..cd24f070a9 100644 --- a/plugins/kubernetes/report-alpha.api.md +++ b/plugins/kubernetes/report-alpha.api.md @@ -153,10 +153,13 @@ const _default: FrontendPlugin< >; inputs: {}; params: { + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; + defaultTitle?: [Error: `Use the 'title' param instead`]; + title: string; + defaultGroup?: [Error: `Use the 'group' param instead`]; + group?: keyof defaultEntityContentGroups | (string & {}); loader: () => Promise; - defaultPath: string; - defaultTitle: string; - defaultGroup?: keyof defaultEntityContentGroups | (string & {}); routeRef?: RouteRef; filter?: string | EntityPredicate | ((entity: Entity) => boolean); }; @@ -182,7 +185,8 @@ const _default: FrontendPlugin< >; inputs: {}; params: { - defaultPath: string; + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; loader: () => Promise; routeRef?: RouteRef; }; diff --git a/plugins/kubernetes/src/alpha/entityContents.tsx b/plugins/kubernetes/src/alpha/entityContents.tsx index ad35b401be..d75893c6e4 100644 --- a/plugins/kubernetes/src/alpha/entityContents.tsx +++ b/plugins/kubernetes/src/alpha/entityContents.tsx @@ -21,9 +21,9 @@ import { isKubernetesAvailable } from '../Router'; export const entityKubernetesContent = EntityContentBlueprint.make({ name: 'kubernetes', params: { - defaultPath: '/kubernetes', - defaultTitle: 'Kubernetes', - defaultGroup: 'deployment', + path: '/kubernetes', + title: 'Kubernetes', + group: 'deployment', filter: isKubernetesAvailable, loader: () => import('./KubernetesContentPage').then(m => diff --git a/plugins/kubernetes/src/alpha/pages.tsx b/plugins/kubernetes/src/alpha/pages.tsx index 83a2e1aa94..6a2d98ddcc 100644 --- a/plugins/kubernetes/src/alpha/pages.tsx +++ b/plugins/kubernetes/src/alpha/pages.tsx @@ -23,7 +23,7 @@ import { rootCatalogKubernetesRouteRef } from '../plugin'; export const kubernetesPage = PageBlueprint.make({ params: { - defaultPath: '/kubernetes', + path: '/kubernetes', // you can reuse the existing routeRef // by wrapping into the convertLegacyRouteRef. routeRef: convertLegacyRouteRef(rootCatalogKubernetesRouteRef), diff --git a/plugins/notifications/report-alpha.api.md b/plugins/notifications/report-alpha.api.md index b512d97ce3..ebd74cb780 100644 --- a/plugins/notifications/report-alpha.api.md +++ b/plugins/notifications/report-alpha.api.md @@ -60,7 +60,8 @@ const _default: FrontendPlugin< >; inputs: {}; params: { - defaultPath: string; + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; loader: () => Promise; routeRef?: RouteRef; }; diff --git a/plugins/notifications/src/alpha.tsx b/plugins/notifications/src/alpha.tsx index 68d0ccab8d..79e0fb7559 100644 --- a/plugins/notifications/src/alpha.tsx +++ b/plugins/notifications/src/alpha.tsx @@ -30,7 +30,7 @@ import { NotificationsClient, notificationsApiRef } from './api'; const page = PageBlueprint.make({ params: { - defaultPath: '/notifications', + path: '/notifications', routeRef: convertLegacyRouteRef(rootRouteRef), loader: () => import('./components/NotificationsPage').then(m => ( diff --git a/plugins/scaffolder/report-alpha.api.md b/plugins/scaffolder/report-alpha.api.md index 38b1ee717b..bc82654a11 100644 --- a/plugins/scaffolder/report-alpha.api.md +++ b/plugins/scaffolder/report-alpha.api.md @@ -231,7 +231,8 @@ const _default: FrontendPlugin< kind: 'page'; name: undefined; params: { - defaultPath: string; + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; loader: () => Promise; routeRef?: RouteRef; }; diff --git a/plugins/scaffolder/src/alpha/extensions.tsx b/plugins/scaffolder/src/alpha/extensions.tsx index 351ad4ed56..b988e33217 100644 --- a/plugins/scaffolder/src/alpha/extensions.tsx +++ b/plugins/scaffolder/src/alpha/extensions.tsx @@ -46,7 +46,7 @@ export const scaffolderPage = PageBlueprint.makeWithOverrides({ ); return originalFactory({ routeRef: convertLegacyRouteRef(rootRouteRef), - defaultPath: '/create', + path: '/create', loader: () => import('../components/Router/Router').then(m => compatWrapper( diff --git a/plugins/search-react/src/alpha/blueprints/SearchFilterBlueprint.test.tsx b/plugins/search-react/src/alpha/blueprints/SearchFilterBlueprint.test.tsx index e8ca2d5888..adfceeec47 100644 --- a/plugins/search-react/src/alpha/blueprints/SearchFilterBlueprint.test.tsx +++ b/plugins/search-react/src/alpha/blueprints/SearchFilterBlueprint.test.tsx @@ -73,7 +73,7 @@ describe('SearchFilterBlueprint', () => { }, factory(originalFactory, { inputs }) { return originalFactory({ - defaultPath: '/', + path: '/', loader: async () => { const searchFilters = inputs.searchFilters.map( t => t.get(searchFilterDataRef).component, diff --git a/plugins/search-react/src/alpha/blueprints/SearchFilterResultTypeBlueprint.test.tsx b/plugins/search-react/src/alpha/blueprints/SearchFilterResultTypeBlueprint.test.tsx index 3ebc4c5a24..d9f8e97080 100644 --- a/plugins/search-react/src/alpha/blueprints/SearchFilterResultTypeBlueprint.test.tsx +++ b/plugins/search-react/src/alpha/blueprints/SearchFilterResultTypeBlueprint.test.tsx @@ -77,7 +77,7 @@ describe('SearchFilterResultTypeBlueprint', () => { }, factory(originalFactory, { inputs }) { return originalFactory({ - defaultPath: '/', + path: '/', loader: async () => { const resultTypes = inputs.resultTypes.map(t => t.get(searchResultTypeDataRef), diff --git a/plugins/search-react/src/alpha/blueprints/SearchResultListItemBlueprint.test.tsx b/plugins/search-react/src/alpha/blueprints/SearchResultListItemBlueprint.test.tsx index 1accf8f3d4..112c0a8470 100644 --- a/plugins/search-react/src/alpha/blueprints/SearchResultListItemBlueprint.test.tsx +++ b/plugins/search-react/src/alpha/blueprints/SearchResultListItemBlueprint.test.tsx @@ -91,7 +91,7 @@ describe('SearchResultListItemBlueprint', () => { }, factory(originalFactory, { inputs }) { return originalFactory({ - defaultPath: '/', + path: '/', loader: async () => { const items = inputs.items.map(i => i.get(searchResultListItemDataRef), diff --git a/plugins/search/report-alpha.api.md b/plugins/search/report-alpha.api.md index 1edc5e678d..9e9a938aa2 100644 --- a/plugins/search/report-alpha.api.md +++ b/plugins/search/report-alpha.api.md @@ -134,7 +134,8 @@ const _default: FrontendPlugin< kind: 'page'; name: undefined; params: { - defaultPath: string; + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; loader: () => Promise; routeRef?: RouteRef; }; @@ -252,7 +253,8 @@ export const searchPage: ExtensionDefinition<{ kind: 'page'; name: undefined; params: { - defaultPath: string; + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; loader: () => Promise; routeRef?: RouteRef; }; diff --git a/plugins/search/src/alpha.tsx b/plugins/search/src/alpha.tsx index 5028a404d4..0ca3315126 100644 --- a/plugins/search/src/alpha.tsx +++ b/plugins/search/src/alpha.tsx @@ -115,7 +115,7 @@ export const searchPage = PageBlueprint.makeWithOverrides({ }, factory(originalFactory, { config, inputs }) { return originalFactory({ - defaultPath: '/search', + path: '/search', routeRef: convertLegacyRouteRef(rootRouteRef), loader: async () => { const getResultItemComponent = (result: SearchResult) => { diff --git a/plugins/techdocs/report-alpha.api.md b/plugins/techdocs/report-alpha.api.md index fd63ec1daa..0e1a311abf 100644 --- a/plugins/techdocs/report-alpha.api.md +++ b/plugins/techdocs/report-alpha.api.md @@ -176,10 +176,13 @@ const _default: FrontendPlugin< kind: 'entity-content'; name: undefined; params: { + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; + defaultTitle?: [Error: `Use the 'title' param instead`]; + title: string; + defaultGroup?: [Error: `Use the 'group' param instead`]; + group?: keyof defaultEntityContentGroups | (string & {}); loader: () => Promise; - defaultPath: string; - defaultTitle: string; - defaultGroup?: keyof defaultEntityContentGroups | (string & {}); routeRef?: RouteRef; filter?: string | EntityPredicate | ((entity: Entity) => boolean); }; @@ -265,7 +268,8 @@ const _default: FrontendPlugin< >; inputs: {}; params: { - defaultPath: string; + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; loader: () => Promise; routeRef?: RouteRef; }; @@ -303,7 +307,8 @@ const _default: FrontendPlugin< kind: 'page'; name: 'reader'; params: { - defaultPath: string; + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; loader: () => Promise; routeRef?: RouteRef; }; diff --git a/plugins/techdocs/src/alpha/index.tsx b/plugins/techdocs/src/alpha/index.tsx index 38dcd40dc4..d1b2d6c09f 100644 --- a/plugins/techdocs/src/alpha/index.tsx +++ b/plugins/techdocs/src/alpha/index.tsx @@ -137,7 +137,7 @@ export const techDocsSearchResultListItemExtension = */ const techDocsPage = PageBlueprint.make({ params: { - defaultPath: '/docs', + path: '/docs', routeRef: convertLegacyRouteRef(rootRouteRef), loader: () => import('../home/components/TechDocsIndexPage').then(m => @@ -165,7 +165,7 @@ const techDocsReaderPage = PageBlueprint.makeWithOverrides({ }); return originalFactory({ - defaultPath: '/docs/:namespace/:kind/:name', + path: '/docs/:namespace/:kind/:name', routeRef: convertLegacyRouteRef(rootDocsRouteRef), loader: async () => await import('../Router').then(({ TechDocsReaderRouter }) => { @@ -199,8 +199,8 @@ const techDocsEntityContent = EntityContentBlueprint.makeWithOverrides({ factory(originalFactory, context) { return originalFactory( { - defaultPath: 'docs', - defaultTitle: 'TechDocs', + path: 'docs', + title: 'TechDocs', routeRef: convertLegacyRouteRef(rootCatalogDocsRouteRef), loader: () => import('../Router').then(({ EmbeddedDocsRouter }) => { diff --git a/plugins/user-settings/report-alpha.api.md b/plugins/user-settings/report-alpha.api.md index 036ff2ff58..9e8e09cb29 100644 --- a/plugins/user-settings/report-alpha.api.md +++ b/plugins/user-settings/report-alpha.api.md @@ -70,7 +70,8 @@ const _default: FrontendPlugin< kind: 'page'; name: undefined; params: { - defaultPath: string; + defaultPath?: [Error: `Use the 'path' param instead`]; + path: string; loader: () => Promise; routeRef?: RouteRef; }; diff --git a/plugins/user-settings/src/alpha.tsx b/plugins/user-settings/src/alpha.tsx index f351dad40a..e71c61febc 100644 --- a/plugins/user-settings/src/alpha.tsx +++ b/plugins/user-settings/src/alpha.tsx @@ -39,7 +39,7 @@ const userSettingsPage = PageBlueprint.makeWithOverrides({ }, factory(originalFactory, { inputs }) { return originalFactory({ - defaultPath: '/settings', + path: '/settings', routeRef: convertLegacyRouteRef(settingsRouteRef), loader: () => import('./components/SettingsPage').then(m =>