Merge pull request #17474 from backstage/freben/hack-presentation

An `entityPresentationApiRef`, for rendering rich entity refs
This commit is contained in:
Fredrik Adelöw
2023-10-24 11:26:41 +02:00
committed by GitHub
44 changed files with 2001 additions and 468 deletions
+17
View File
@@ -0,0 +1,17 @@
---
'@backstage/plugin-catalog-react': minor
---
Added an `EntityPresentationApi` and associated `entityPresentationApiRef`. This
API lets you control how references to entities (e.g. in links, headings,
iconography etc) are represented in the user interface.
Usage of this API is initially added to the `EntityRefLink` and `EntityRefLinks`
components, so that they can render richer, more correct representation of
entity refs. There's also a new `EntityDisplayName` component, which works just like
the `EntityRefLink` but without the link.
Along with that change, the `fetchEntities` and `getTitle` props of
`EntityRefLinksProps` are deprecated and no longer used, since the same need
instead is fulfilled (and by default always enabled) by the
`entityPresentationApiRef`.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-plugin-api': minor
---
`IconComponent` can now have a `fontSize` of `inherit`, which is useful for in-line icons.
+10
View File
@@ -0,0 +1,10 @@
---
'@backstage/plugin-catalog': minor
---
Added the `DefaultEntityPresentationApi`, which is an implementation of the
`EntityPresentationApi` that `@backstage/plugin-catalog-react` exposes through
its `entityPresentationApiRef`. This implementation is also by default made
available automatically by the catalog plugin, unless you replace it with a
custom one. It batch fetches and caches data from the catalog as needed for
display, and is customizable by adopters to add their own rendering functions.