plugins: remove deprecated route registrations
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
---
|
||||
'@backstage/plugin-api-docs': minor
|
||||
'@backstage/plugin-cost-insights': minor
|
||||
'@backstage/plugin-gcp-projects': minor
|
||||
'@backstage/plugin-gitops-profiles': minor
|
||||
'@backstage/plugin-newrelic': minor
|
||||
'@backstage/plugin-welcome': minor
|
||||
---
|
||||
|
||||
**BREAKING CHANGE** Remove deprecated route registrations, meaning that it is no longer enough to only import the plugin in the app and the exported page extension must be used instead.
|
||||
@@ -22,7 +22,6 @@ import {
|
||||
createRoutableExtension,
|
||||
} from '@backstage/core';
|
||||
import { defaultDefinitionWidgets } from './components/ApiDefinitionCard';
|
||||
import { ApiExplorerPage as Page } from './components/ApiExplorerPage/ApiExplorerPage';
|
||||
import { apiDocsConfigRef } from './config';
|
||||
import { createComponentRouteRef, rootRoute } from './routes';
|
||||
|
||||
@@ -48,9 +47,6 @@ export const apiDocsPlugin = createPlugin({
|
||||
externalRoutes: {
|
||||
createComponent: createComponentRouteRef,
|
||||
},
|
||||
register({ router }) {
|
||||
router.addRoute(rootRoute, Page);
|
||||
},
|
||||
});
|
||||
|
||||
export const ApiExplorerPage = apiDocsPlugin.provide(
|
||||
|
||||
@@ -19,9 +19,6 @@ import {
|
||||
createRouteRef,
|
||||
createRoutableExtension,
|
||||
} from '@backstage/core';
|
||||
import { CostInsightsPage as CostInsightsPageComponent } from './components/CostInsightsPage';
|
||||
import { ProjectGrowthInstructionsPage as ProjectGrowthInstructionsPageComponent } from './components/ProjectGrowthInstructionsPage';
|
||||
import { LabelDataflowInstructionsPage as LabelDataflowInstructionsPageComponent } from './components/LabelDataflowInstructionsPage';
|
||||
|
||||
export const rootRouteRef = createRouteRef({
|
||||
path: '/cost-insights',
|
||||
@@ -40,16 +37,7 @@ export const unlabeledDataflowAlertRef = createRouteRef({
|
||||
|
||||
export const costInsightsPlugin = createPlugin({
|
||||
id: 'cost-insights',
|
||||
register({ router, featureFlags }) {
|
||||
router.addRoute(rootRouteRef, CostInsightsPageComponent);
|
||||
router.addRoute(
|
||||
projectGrowthAlertRef,
|
||||
ProjectGrowthInstructionsPageComponent,
|
||||
);
|
||||
router.addRoute(
|
||||
unlabeledDataflowAlertRef,
|
||||
LabelDataflowInstructionsPageComponent,
|
||||
);
|
||||
register({ featureFlags }) {
|
||||
featureFlags.register('cost-insights-currencies');
|
||||
},
|
||||
routes: {
|
||||
|
||||
@@ -21,10 +21,7 @@ import {
|
||||
googleAuthApiRef,
|
||||
} from '@backstage/core';
|
||||
import { gcpApiRef, GcpClient } from './api';
|
||||
import { NewProjectPage } from './components/NewProjectPage';
|
||||
import { ProjectDetailsPage } from './components/ProjectDetailsPage';
|
||||
import { ProjectListPage } from './components/ProjectListPage';
|
||||
import { rootRouteRef, projectRouteRef, newProjectRouteRef } from './routes';
|
||||
import { rootRouteRef } from './routes';
|
||||
|
||||
export const gcpProjectsPlugin = createPlugin({
|
||||
id: 'gcp-projects',
|
||||
@@ -40,11 +37,6 @@ export const gcpProjectsPlugin = createPlugin({
|
||||
},
|
||||
}),
|
||||
],
|
||||
register({ router }) {
|
||||
router.addRoute(rootRouteRef, ProjectListPage);
|
||||
router.addRoute(projectRouteRef, ProjectDetailsPage);
|
||||
router.addRoute(newProjectRouteRef, NewProjectPage);
|
||||
},
|
||||
});
|
||||
|
||||
export const GcpProjectsPage = gcpProjectsPlugin.provide(
|
||||
|
||||
@@ -19,9 +19,6 @@ import {
|
||||
createApiFactory,
|
||||
createRoutableExtension,
|
||||
} from '@backstage/core';
|
||||
import ProfileCatalog from './components/ProfileCatalog';
|
||||
import ClusterPage from './components/ClusterPage';
|
||||
import ClusterList from './components/ClusterList';
|
||||
import {
|
||||
gitOpsClusterListRoute,
|
||||
gitOpsClusterDetailsRoute,
|
||||
@@ -34,11 +31,6 @@ export const gitopsProfilesPlugin = createPlugin({
|
||||
apis: [
|
||||
createApiFactory(gitOpsApiRef, new GitOpsRestApi('http://localhost:3008')),
|
||||
],
|
||||
register({ router }) {
|
||||
router.addRoute(gitOpsClusterListRoute, ClusterList);
|
||||
router.addRoute(gitOpsClusterDetailsRoute, ClusterPage);
|
||||
router.addRoute(gitOpsClusterCreateRoute, ProfileCatalog);
|
||||
},
|
||||
routes: {
|
||||
listPage: gitOpsClusterListRoute,
|
||||
detailsPage: gitOpsClusterDetailsRoute,
|
||||
|
||||
@@ -22,7 +22,6 @@ import {
|
||||
createRoutableExtension,
|
||||
} from '@backstage/core';
|
||||
import { NewRelicClient, newRelicApiRef } from './api';
|
||||
import NewRelicComponent from './components/NewRelicComponent';
|
||||
|
||||
export const rootRouteRef = createRouteRef({
|
||||
path: '/newrelic',
|
||||
@@ -38,9 +37,6 @@ export const newRelicPlugin = createPlugin({
|
||||
factory: ({ discoveryApi }) => new NewRelicClient({ discoveryApi }),
|
||||
}),
|
||||
],
|
||||
register({ router }) {
|
||||
router.addRoute(rootRouteRef, NewRelicComponent);
|
||||
},
|
||||
routes: {
|
||||
root: rootRouteRef,
|
||||
},
|
||||
|
||||
@@ -19,7 +19,6 @@ import {
|
||||
createRoutableExtension,
|
||||
createRouteRef,
|
||||
} from '@backstage/core';
|
||||
import WelcomePageComponent from './components/WelcomePage';
|
||||
|
||||
export const rootRouteRef = createRouteRef({
|
||||
title: 'Welcome',
|
||||
@@ -27,8 +26,7 @@ export const rootRouteRef = createRouteRef({
|
||||
|
||||
export const welcomePlugin = createPlugin({
|
||||
id: 'welcome',
|
||||
register({ router, featureFlags }) {
|
||||
router.addRoute(rootRouteRef, WelcomePageComponent);
|
||||
register({ featureFlags }) {
|
||||
featureFlags.register('enable-welcome-box');
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user