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
+11 -6
View File
@@ -30,6 +30,13 @@ import graphqlApiEntity from './graphql-example-api.yaml';
import openapiApiEntity from './openapi-example-api.yaml';
import otherApiEntity from './other-example-api.yaml';
const mockEntities = ([
openapiApiEntity,
asyncapiApiEntity,
graphqlApiEntity,
otherApiEntity,
] as unknown) as Entity[];
createDevApp()
.registerApi({
api: catalogApiRef,
@@ -38,14 +45,12 @@ createDevApp()
(({
async getEntities() {
return {
items: [
openapiApiEntity,
asyncapiApiEntity,
graphqlApiEntity,
otherApiEntity,
],
items: mockEntities.slice(),
};
},
async getEntityByName(name: string) {
return mockEntities.find(e => e.metadata.name === name);
},
} as unknown) as typeof catalogApiRef.T),
})
.registerApi({
-4
View File
@@ -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(