feat(techdocs): filter fetched entity kinds and fields

Signed-off-by: Phil Kuang <pkuang@factset.com>
This commit is contained in:
Phil Kuang
2021-06-29 14:36:35 -04:00
parent a9697e6107
commit a444c7431a
2 changed files with 8 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-techdocs': patch
---
Filter fetched entity fields to optimize loading techdocs list
@@ -124,7 +124,9 @@ export const TechDocsCustomHome = ({
const configApi: ConfigApi = useApi(configApiRef);
const { value: entities, loading, error } = useAsync(async () => {
const response = await catalogApi.getEntities();
const response = await catalogApi.getEntities({
fields: ['apiVersion', 'kind', 'metadata', 'spec.owner', 'spec.type'],
});
return response.items.filter((entity: Entity) => {
return !!entity.metadata.annotations?.['backstage.io/techdocs-ref'];
});