app: migrate to use top-level page extensions

This commit is contained in:
Patrik Oldsberg
2021-02-22 00:55:01 +01:00
parent 3a58084b65
commit abd655e42d
+30 -21
View File
@@ -17,7 +17,6 @@
import {
AlertDisplay,
createApp,
createRouteRef,
FlatRoutes,
OAuthRequestDialog,
SignInPage,
@@ -29,13 +28,12 @@ import {
} from '@backstage/plugin-catalog';
import { CatalogImportPage } from '@backstage/plugin-catalog-import';
import { ExplorePage } from '@backstage/plugin-explore';
import { Router as GraphiQLRouter } from '@backstage/plugin-graphiql';
import { Router as LighthouseRouter } from '@backstage/plugin-lighthouse';
import { Router as RegisterComponentRouter } from '@backstage/plugin-register-component';
import { GraphiQLPage } from '@backstage/plugin-graphiql';
import { LighthousePage } from '@backstage/plugin-lighthouse';
import { ScaffolderPage, scaffolderPlugin } from '@backstage/plugin-scaffolder';
import { Router as TechRadarRouter } from '@backstage/plugin-tech-radar';
import { Router as DocsRouter } from '@backstage/plugin-techdocs';
import { Router as SettingsRouter } from '@backstage/plugin-user-settings';
import { TechRadarPage } from '@backstage/plugin-tech-radar';
import { TechdocsPage } from '@backstage/plugin-techdocs';
import { UserSettingsPage } from '@backstage/plugin-user-settings';
import React from 'react';
import { hot } from 'react-hot-loader/root';
import { Navigate, Route } from 'react-router';
@@ -45,6 +43,15 @@ import Root from './components/Root';
import { providers } from './identityProviders';
import * as plugins from './plugins';
import AlarmIcon from '@material-ui/icons/Alarm';
import { ApiExplorerPage } from '@backstage/plugin-api-docs';
import { GcpProjectsPage } from '@backstage/plugin-gcp-projects';
import { NewRelicPage } from '@backstage/plugin-newrelic';
import { SearchPage } from '@backstage/plugin-search';
import {
CostInsightsLabelDataflowInstructionsPage,
CostInsightsPage,
CostInsightsProjectGrowthInstructionsPage,
} from '@backstage/plugin-cost-insights';
const app = createApp({
apis,
@@ -74,12 +81,6 @@ const app = createApp({
const AppProvider = app.getProvider();
const AppRouter = app.getRouter();
const deprecatedAppRoutes = app.getRoutes();
const catalogRouteRef = createRouteRef({
path: '/catalog',
title: 'Service Catalog',
});
const routes = (
<FlatRoutes>
@@ -92,21 +93,29 @@ const routes = (
<EntityPage />
</Route>
<Route path="/catalog-import" element={<CatalogImportPage />} />
<Route path="/docs" element={<DocsRouter />} />
<Route path="/docs" element={<TechdocsPage />} />
<Route path="/create" element={<ScaffolderPage />} />
<Route path="/explore" element={<ExplorePage />} />
<Route
path="/tech-radar"
element={<TechRadarRouter width={1500} height={800} />}
element={<TechRadarPage width={1500} height={800} />}
/>
<Route path="/graphiql" element={<GraphiQLRouter />} />
<Route path="/lighthouse" element={<LighthouseRouter />} />
<Route path="/graphiql" element={<GraphiQLPage />} />
<Route path="/lighthouse" element={<LighthousePage />} />
<Route path="/api-docs" element={<ApiExplorerPage />} />
<Route path="/gcp-projects" element={<GcpProjectsPage />} />
<Route path="/newrelic" element={<NewRelicPage />} />
<Route path="/search" element={<SearchPage />} />
<Route path="/cost-insights" element={<CostInsightsPage />} />
<Route
path="/register-component"
element={<RegisterComponentRouter catalogRouteRef={catalogRouteRef} />}
path="/cost-insights/investigating-growth"
element={<CostInsightsProjectGrowthInstructionsPage />}
/>
<Route path="/settings" element={<SettingsRouter />} />
{...deprecatedAppRoutes}
<Route
path="/cost-insights/labeling-jobs"
element={<CostInsightsLabelDataflowInstructionsPage />}
/>
<Route path="/settings" element={<UserSettingsPage />} />
</FlatRoutes>
);