fix(techdocs): fetch entity relations field to determine owned docs
Signed-off-by: Phil Kuang <pkuang@factset.com>
This commit is contained in:
@@ -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'];
|
||||
|
||||
Reference in New Issue
Block a user