Merge pull request #6124 from backstage/rugvip/noroutes

plugins,dev-utils: remove usage of deprecated route registrations
This commit is contained in:
Patrik Oldsberg
2021-06-21 23:39:33 +02:00
committed by GitHub
14 changed files with 89 additions and 134 deletions
+20 -1
View File
@@ -13,10 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import { createDevApp } from '@backstage/dev-utils';
import { ExampleCostInsightsClient } from '../src/example';
import { costInsightsApiRef } from '../src/api';
import { costInsightsPlugin } from '../src/plugin';
import {
costInsightsPlugin,
CostInsightsPage,
CostInsightsProjectGrowthInstructionsPage,
CostInsightsLabelDataflowInstructionsPage,
} from '../src/plugin';
createDevApp()
.registerPlugin(costInsightsPlugin)
@@ -25,4 +32,16 @@ createDevApp()
deps: {},
factory: () => new ExampleCostInsightsClient(),
})
.addPage({
title: 'Cost Insights',
element: <CostInsightsPage />,
})
.addPage({
title: 'Growth',
element: <CostInsightsProjectGrowthInstructionsPage />,
})
.addPage({
title: 'Labelling',
element: <CostInsightsLabelDataflowInstructionsPage />,
})
.render();
+1 -13
View File
@@ -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: {