Merge pull request #6454 from kuangp/fix/techdocs

fix(techdocs): fetch entity relations field to determine owned docs
This commit is contained in:
Eric Peterson
2021-07-15 09:22:29 +02:00
committed by GitHub
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'];