From f12cb33bd57949c0f6844f61de3423ffce542a3b Mon Sep 17 00:00:00 2001 From: Prasetya Aria Wibawa Date: Thu, 24 Mar 2022 14:56:43 +0700 Subject: [PATCH] passing down isGroup value from ownershipCard to useGetEntities Signed-off-by: Prasetya Aria Wibawa --- .../org/src/components/Cards/OwnershipCard/ComponentsGrid.tsx | 3 +++ .../org/src/components/Cards/OwnershipCard/OwnershipCard.tsx | 1 + .../org/src/components/Cards/OwnershipCard/useGetEntities.ts | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/org/src/components/Cards/OwnershipCard/ComponentsGrid.tsx b/plugins/org/src/components/Cards/OwnershipCard/ComponentsGrid.tsx index e62013d688..4b14487a29 100644 --- a/plugins/org/src/components/Cards/OwnershipCard/ComponentsGrid.tsx +++ b/plugins/org/src/components/Cards/OwnershipCard/ComponentsGrid.tsx @@ -89,16 +89,19 @@ const EntityCountTile = ({ export const ComponentsGrid = ({ entity, relationsType, + isGroup, entityFilterKind, }: { entity: Entity; relationsType: string; + isGroup: boolean; entityFilterKind?: string[]; }) => { const catalogLink = useRouteRef(catalogIndexRouteRef); const { componentsWithCounters, loading, error } = useGetEntities( entity, relationsType, + isGroup, entityFilterKind, ); diff --git a/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx b/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx index f188e6de01..13e8502b7a 100644 --- a/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx +++ b/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx @@ -97,6 +97,7 @@ export const OwnershipCard = ({ diff --git a/plugins/org/src/components/Cards/OwnershipCard/useGetEntities.ts b/plugins/org/src/components/Cards/OwnershipCard/useGetEntities.ts index d8a269c868..48760002fa 100644 --- a/plugins/org/src/components/Cards/OwnershipCard/useGetEntities.ts +++ b/plugins/org/src/components/Cards/OwnershipCard/useGetEntities.ts @@ -128,6 +128,7 @@ const getAggregatedOwnersEntityRef = async ( export function useGetEntities( entity: Entity, relationsType: string, + isGroup: boolean, entityFilterKind?: string[], ): { componentsWithCounters: @@ -143,7 +144,6 @@ export function useGetEntities( } { const catalogApi = useApi(catalogApiRef); const kinds = entityFilterKind ?? ['Component', 'API', 'System']; - const isGroup = entity.kind === 'Group'; const { loading,