New arg entityFilterKind for ownershipcard

Signed-off-by: Jan Vilimek <jan.vilimek@oriflame.com>
This commit is contained in:
Jan Vilimek
2021-12-11 12:48:14 +01:00
committed by Jan Vilimek
parent da156f2831
commit 26b04d2341
@@ -128,10 +128,12 @@ const getQueryParams = (
export const OwnershipCard = ({
variant,
entityFilterKind
}: {
/** @deprecated The entity is now grabbed from context instead */
entity?: Entity;
variant?: InfoCardVariants;
entityFilterKind?: string[];
}) => {
const { entity } = useEntity();
const catalogApi = useApi(catalogApiRef);
@@ -142,7 +144,7 @@ export const OwnershipCard = ({
error,
value: componentsWithCounters,
} = useAsync(async () => {
const kinds = ['Component', 'API'];
const kinds = entityFilterKind ?? ['Component', 'API'];
const entitiesList = await catalogApi.getEntities({
filter: {
kind: kinds,