diff --git a/.changeset/catalog-next-presentation-tho.md b/.changeset/catalog-next-presentation-tho.md new file mode 100644 index 0000000000..0694240b21 --- /dev/null +++ b/.changeset/catalog-next-presentation-tho.md @@ -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. diff --git a/plugins/catalog/src/alpha/apis.tsx b/plugins/catalog/src/alpha/apis.tsx index ae8dcf9a9a..92880ba728 100644 --- a/plugins/catalog/src/alpha/apis.tsx +++ b/plugins/catalog/src/alpha/apis.tsx @@ -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];