plugins: remove unnecessary use of convertLegacyRouteRef(s)
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -11,7 +11,8 @@ import { ExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { JSX as JSX_2 } from 'react';
|
||||
import { OverridableExtensionDefinition } from '@backstage/frontend-plugin-api';
|
||||
import { OverridableFrontendPlugin } from '@backstage/frontend-plugin-api';
|
||||
import { RouteRef } from '@backstage/frontend-plugin-api';
|
||||
import { RouteRef } from '@backstage/core-plugin-api';
|
||||
import { RouteRef as RouteRef_2 } from '@backstage/frontend-plugin-api';
|
||||
|
||||
// @alpha (undocumented)
|
||||
const _default: OverridableFrontendPlugin<
|
||||
@@ -48,7 +49,7 @@ const _default: OverridableFrontendPlugin<
|
||||
| ExtensionDataRef<string, 'core.routing.path', {}>
|
||||
| ExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
| ExtensionDataRef<
|
||||
RouteRef<AnyRouteRefParams>,
|
||||
RouteRef_2<AnyRouteRefParams>,
|
||||
'core.routing.ref',
|
||||
{
|
||||
optional: true;
|
||||
@@ -59,7 +60,7 @@ const _default: OverridableFrontendPlugin<
|
||||
defaultPath?: [Error: `Use the 'path' param instead`];
|
||||
path: string;
|
||||
loader: () => Promise<JSX.Element>;
|
||||
routeRef?: RouteRef;
|
||||
routeRef?: RouteRef_2;
|
||||
};
|
||||
}>;
|
||||
}
|
||||
|
||||
@@ -22,16 +22,12 @@ import {
|
||||
fetchApiRef,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
import { rootRouteRef } from './routes';
|
||||
import {
|
||||
convertLegacyRouteRef,
|
||||
convertLegacyRouteRefs,
|
||||
} from '@backstage/core-compat-api';
|
||||
import { NotificationsClient, notificationsApiRef } from './api';
|
||||
|
||||
const page = PageBlueprint.make({
|
||||
params: {
|
||||
path: '/notifications',
|
||||
routeRef: convertLegacyRouteRef(rootRouteRef),
|
||||
routeRef: rootRouteRef,
|
||||
loader: () =>
|
||||
import('./components/NotificationsPage').then(m => (
|
||||
<m.NotificationsPage />
|
||||
@@ -53,9 +49,9 @@ const api = ApiBlueprint.make({
|
||||
export default createFrontendPlugin({
|
||||
pluginId: 'notifications',
|
||||
info: { packageJson: () => import('../package.json') },
|
||||
routes: convertLegacyRouteRefs({
|
||||
routes: {
|
||||
root: rootRouteRef,
|
||||
}),
|
||||
},
|
||||
// TODO(Rugvip): Nav item (i.e. NotificationsSidebarItem) currently needs to be installed manually
|
||||
extensions: [page, api],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user