catalog-client: change entities interface, add fields support (#3296)

This commit is contained in:
Fredrik Adelöw
2020-11-18 19:58:36 +01:00
committed by GitHub
parent 16bb5a0c8e
commit 717e43de14
19 changed files with 298 additions and 235 deletions
@@ -52,7 +52,7 @@ describe('RollbarHome component', () => {
catalogApiRef,
({
async getEntities() {
return [];
return { items: [] };
},
} as Partial<CatalogApi>) as CatalogApi,
],
@@ -28,8 +28,8 @@ export function useRollbarEntities() {
configApi.getString('organization.name');
const { value, loading, error } = useAsync(async () => {
const entities = await catalogApi.getEntities();
return entities.filter(entity => {
const response = await catalogApi.getEntities();
return response.items.filter(entity => {
return !!entity.metadata.annotations?.[ROLLBAR_ANNOTATION];
});
}, [catalogApi]);