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({