Merge pull request #24088 from backstage/catalog/next-entity-presentation

[Catalog] Wire up the entity presentation API in new frontend system apps
This commit is contained in:
Fredrik Adelöw
2024-04-08 22:45:26 +02:00
committed by GitHub
2 changed files with 20 additions and 2 deletions
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog': patch
---
Fixed a bug that prevented the default `entityPresentationApi` from being set in apps using the new frontend system.
+15 -2
View File
@@ -24,9 +24,13 @@ import { CatalogClient } from '@backstage/catalog-client';
import { createApiExtension } from '@backstage/frontend-plugin-api';
import {
catalogApiRef,
entityPresentationApiRef,
starredEntitiesApiRef,
} from '@backstage/plugin-catalog-react';
import { DefaultStarredEntitiesApi } from '../apis';
import {
DefaultEntityPresentationApi,
DefaultStarredEntitiesApi,
} from '../apis';
export const catalogApi = createApiExtension({
factory: createApiFactory({
@@ -48,4 +52,13 @@ export const catalogStarredEntitiesApi = createApiExtension({
}),
});
export default [catalogApi, catalogStarredEntitiesApi];
export const entityPresentationApi = createApiExtension({
factory: createApiFactory({
api: entityPresentationApiRef,
deps: { catalogApiImp: catalogApiRef },
factory: ({ catalogApiImp }) =>
DefaultEntityPresentationApi.create({ catalogApi: catalogApiImp }),
}),
});
export default [catalogApi, catalogStarredEntitiesApi, entityPresentationApi];