Remove NavItemBlueprint in favor of page-based nav discovery
Drop the deprecated NavItemBlueprint from the public API and migrate core plugins to set title and icon on PageBlueprint instead. AppNav keeps backward compatibility for legacy nav-item extensions via an internal core.nav-item.target data ref. Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -20,7 +20,6 @@ import { FormField } from '@backstage/plugin-scaffolder-react/alpha';
|
||||
import { formFieldsApiRef } from '@backstage/plugin-scaffolder-react/alpha';
|
||||
import type { FormProps as FormProps_2 } from '@rjsf/core';
|
||||
import { FormProps as FormProps_3 } from '@backstage/plugin-scaffolder-react';
|
||||
import { IconComponent } from '@backstage/frontend-plugin-api';
|
||||
import { IconElement } from '@backstage/frontend-plugin-api';
|
||||
import { IconLinkVerticalProps } from '@backstage/core-components';
|
||||
import { JSX as JSX_2 } from 'react';
|
||||
@@ -173,31 +172,6 @@ const _default: OverridableFrontendPlugin<
|
||||
filter?: FilterPredicate | ((entity: Entity) => boolean);
|
||||
};
|
||||
}>;
|
||||
'nav-item:scaffolder': OverridableExtensionDefinition<{
|
||||
kind: 'nav-item';
|
||||
name: undefined;
|
||||
config: {
|
||||
title: string | undefined;
|
||||
};
|
||||
configInput: {
|
||||
title?: string | undefined;
|
||||
};
|
||||
output: ExtensionDataRef<
|
||||
{
|
||||
title: string;
|
||||
icon: IconComponent;
|
||||
routeRef: RouteRef_2<undefined>;
|
||||
},
|
||||
'core.nav-item.target',
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: {
|
||||
title: string;
|
||||
icon: IconComponent;
|
||||
routeRef: RouteRef_2<undefined>;
|
||||
};
|
||||
}>;
|
||||
'page:scaffolder': OverridableExtensionDefinition<{
|
||||
config: {
|
||||
path: string | undefined;
|
||||
|
||||
@@ -20,7 +20,6 @@ import {
|
||||
discoveryApiRef,
|
||||
fetchApiRef,
|
||||
identityApiRef,
|
||||
NavItemBlueprint,
|
||||
PageBlueprint,
|
||||
SubPageBlueprint,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
@@ -52,7 +51,8 @@ export const scaffolderPage = PageBlueprint.makeWithOverrides({
|
||||
return originalFactory({
|
||||
routeRef: rootRouteRef,
|
||||
path: '/create',
|
||||
title: 'Create',
|
||||
title: 'Create...',
|
||||
icon: <CreateComponentIcon fontSize="inherit" />,
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -154,14 +154,6 @@ export const scaffolderTemplatingExtensionsSubPage = SubPageBlueprint.make({
|
||||
},
|
||||
});
|
||||
|
||||
export const scaffolderNavItem = NavItemBlueprint.make({
|
||||
params: {
|
||||
routeRef: rootRouteRef,
|
||||
title: 'Create...',
|
||||
icon: CreateComponentIcon,
|
||||
},
|
||||
});
|
||||
|
||||
export const repoUrlPickerFormField = FormFieldBlueprint.make({
|
||||
name: 'repo-url-picker',
|
||||
params: {
|
||||
|
||||
@@ -39,7 +39,6 @@ import {
|
||||
repoOwnerPickerFormField,
|
||||
repoUrlPickerFormField,
|
||||
scaffolderApi,
|
||||
scaffolderNavItem,
|
||||
scaffolderPage,
|
||||
scaffolderTemplatesSubPage,
|
||||
scaffolderTasksSubPage,
|
||||
@@ -89,7 +88,6 @@ export default createFrontendPlugin({
|
||||
scaffolderActionsSubPage,
|
||||
scaffolderEditorSubPage,
|
||||
scaffolderTemplatingExtensionsSubPage,
|
||||
scaffolderNavItem,
|
||||
scaffolderEntityIconLink,
|
||||
formDecoratorsApi,
|
||||
formFieldsApi,
|
||||
|
||||
Reference in New Issue
Block a user