feat(techdocs): filter fetched entity kinds and fields
Signed-off-by: Phil Kuang <pkuang@factset.com>
This commit is contained in:
@@ -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'];
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user