From 537c37b0f128e5d791ecfb332c505cfae30573c7 Mon Sep 17 00:00:00 2001 From: Phil Kuang Date: Tue, 13 Jul 2021 11:23:57 -0400 Subject: [PATCH] fix(techdocs): fetch entity relations field to determine owned docs Signed-off-by: Phil Kuang --- .changeset/fifty-hornets-punch.md | 5 +++++ .../techdocs/src/home/components/TechDocsCustomHome.tsx | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .changeset/fifty-hornets-punch.md diff --git a/.changeset/fifty-hornets-punch.md b/.changeset/fifty-hornets-punch.md new file mode 100644 index 0000000000..0decaeb635 --- /dev/null +++ b/.changeset/fifty-hornets-punch.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-techdocs': patch +--- + +Fix displaying owned documents list by fetching associated entity relations diff --git a/plugins/techdocs/src/home/components/TechDocsCustomHome.tsx b/plugins/techdocs/src/home/components/TechDocsCustomHome.tsx index 90b968de6c..c5d05f1474 100644 --- a/plugins/techdocs/src/home/components/TechDocsCustomHome.tsx +++ b/plugins/techdocs/src/home/components/TechDocsCustomHome.tsx @@ -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'];