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:
@@ -13,7 +13,6 @@ import { ExtensionBlueprintParams } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionInput } from '@backstage/frontend-plugin-api';
|
||||
import { FilterPredicate } from '@backstage/filter-predicates';
|
||||
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';
|
||||
@@ -259,31 +258,6 @@ const _default: OverridableFrontendPlugin<
|
||||
filter?: FilterPredicate | ((entity: Entity) => boolean);
|
||||
};
|
||||
}>;
|
||||
'nav-item:techdocs': 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:techdocs': OverridableExtensionDefinition<{
|
||||
kind: 'page';
|
||||
name: undefined;
|
||||
|
||||
@@ -21,7 +21,6 @@ import {
|
||||
createFrontendPlugin,
|
||||
ApiBlueprint,
|
||||
PageBlueprint,
|
||||
NavItemBlueprint,
|
||||
PluginHeaderActionBlueprint,
|
||||
createExtensionInput,
|
||||
coreExtensionData,
|
||||
@@ -139,6 +138,8 @@ const techDocsPage = PageBlueprint.make({
|
||||
params: {
|
||||
path: '/docs',
|
||||
routeRef: rootRouteRef,
|
||||
title: 'Docs',
|
||||
icon: <RiArticleLine />,
|
||||
loader: () =>
|
||||
import('./components/TechDocsIndexPageContent').then(m => (
|
||||
<m.TechDocsIndexPageContent />
|
||||
@@ -265,15 +266,6 @@ const techDocsEntityContentEmptyState = createExtension({
|
||||
factory: () => [],
|
||||
});
|
||||
|
||||
/** @alpha */
|
||||
const techDocsNavItem = NavItemBlueprint.make({
|
||||
params: {
|
||||
icon: () => <RiArticleLine />,
|
||||
title: 'Docs',
|
||||
routeRef: rootRouteRef,
|
||||
},
|
||||
});
|
||||
|
||||
const techDocsSupportAction = PluginHeaderActionBlueprint.make({
|
||||
params: defineParams =>
|
||||
defineParams({
|
||||
@@ -293,7 +285,6 @@ export default createFrontendPlugin({
|
||||
techDocsClientApi,
|
||||
techDocsStorageApi,
|
||||
TechDocsAddonsApiExtension,
|
||||
techDocsNavItem,
|
||||
techDocsSupportAction,
|
||||
techDocsPage,
|
||||
techDocsReaderPage,
|
||||
|
||||
Reference in New Issue
Block a user