Merge pull request #2345 from spotify/shmidt-i/fix-register-component-plugin-catalog-link

Fix link to catalog after component was registered
This commit is contained in:
Ivan Shmidt
2020-09-09 14:58:00 +02:00
committed by GitHub
10 changed files with 124 additions and 43 deletions
@@ -4,6 +4,7 @@ import {
AlertDisplay,
OAuthRequestDialog,
SidebarPage,
createRouteRef,
} from '@backstage/core';
import { apis } from './apis';
import * as plugins from './plugins';
@@ -11,8 +12,9 @@ import { AppSidebar } from './sidebar';
import { Route, Routes, Navigate } from 'react-router';
import { Router as CatalogRouter } from '@backstage/plugin-catalog';
import { Router as DocsRouter } from '@backstage/plugin-techdocs';
import { Router as RegisterComponentRouter } from '@backstage/plugin-register-component';
import { Router as TechRadarRouter } from '@backstage/plugin-tech-radar';
import { EntityPage } from './components/catalog/EntityPage';
const app = createApp({
@@ -24,6 +26,12 @@ const AppProvider = app.getProvider();
const AppRouter = app.getRouter();
const deprecatedAppRoutes = app.getRoutes();
const catalogRouteRef = createRouteRef({
path: '/catalog',
title: 'Service Catalog',
});
const App: FC<{}> = () => (
<AppProvider>
<AlertDisplay />
@@ -42,6 +50,10 @@ const App: FC<{}> = () => (
path="/tech-radar"
element={<TechRadarRouter width={1500} height={800} />}
/>
<Route
path="/register-component"
element={<RegisterComponentRouter catalogRouteRef={catalogRouteRef} />}
/>
{deprecatedAppRoutes}
</Routes>
</SidebarPage>