Add a user-settings core nav item
As user-settings should show up in the core nav, add a user-settings nav item to the declarative integration plugin. Signed-off-by: Craig Tracey <craig@arctir.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-user-settings': patch
|
||||
---
|
||||
|
||||
add user-settings declarative integration core nav item
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
```ts
|
||||
import { BackstagePlugin } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
|
||||
import { RouteRef } from '@backstage/frontend-plugin-api';
|
||||
import { TranslationRef } from '@backstage/core-plugin-api/alpha';
|
||||
|
||||
@@ -16,6 +17,11 @@ const _default: BackstagePlugin<
|
||||
>;
|
||||
export default _default;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export const settingsNavItem: ExtensionDefinition<{
|
||||
title: string;
|
||||
}>;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export const userSettingsTranslationRef: TranslationRef<
|
||||
'user-settings',
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
import {
|
||||
coreExtensionData,
|
||||
createExtensionInput,
|
||||
createNavItemExtension,
|
||||
createPageExtension,
|
||||
createPlugin,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
@@ -23,6 +24,7 @@ import {
|
||||
convertLegacyRouteRef,
|
||||
compatWrapper,
|
||||
} from '@backstage/core-compat-api';
|
||||
import SettingsIcon from '@material-ui/icons/Settings';
|
||||
import { settingsRouteRef } from './plugin';
|
||||
|
||||
import React from 'react';
|
||||
@@ -50,12 +52,19 @@ const userSettingsPage = createPageExtension({
|
||||
),
|
||||
});
|
||||
|
||||
/** @alpha */
|
||||
export const settingsNavItem = createNavItemExtension({
|
||||
routeRef: convertLegacyRouteRef(settingsRouteRef),
|
||||
title: 'Settings',
|
||||
icon: SettingsIcon,
|
||||
});
|
||||
|
||||
/**
|
||||
* @alpha
|
||||
*/
|
||||
export default createPlugin({
|
||||
id: 'user-settings',
|
||||
extensions: [userSettingsPage],
|
||||
extensions: [userSettingsPage, settingsNavItem],
|
||||
routes: {
|
||||
root: convertLegacyRouteRef(settingsRouteRef),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user