fix(techdocs): fetch entity relations field to determine owned docs

Signed-off-by: Phil Kuang <pkuang@factset.com>
This commit is contained in:
Phil Kuang
2021-07-13 11:23:57 -04:00
parent 7a6a3586ac
commit 537c37b0f1
2 changed files with 13 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-techdocs': patch
---
Fix displaying owned documents list by fetching associated entity relations
@@ -125,7 +125,14 @@ export const TechDocsCustomHome = ({
const { value: entities, loading, error } = useAsync(async () => {
const response = await catalogApi.getEntities({
fields: ['apiVersion', 'kind', 'metadata', 'spec.owner', 'spec.type'],
fields: [
'apiVersion',
'kind',
'metadata',
'relations',
'spec.owner',
'spec.type',
],
});
return response.items.filter((entity: Entity) => {
return !!entity.metadata.annotations?.['backstage.io/techdocs-ref'];