From 3df7b26de5e433be9b67fd2a76c3885b8d1af92b Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 20 Oct 2023 15:13:00 +0200 Subject: [PATCH] catalog: target use-case configuration of entity page cards Co-authored-by: Philipp Hugenroth Signed-off-by: Patrik Oldsberg --- packages/app-next/app-config.yaml | 9 +++++++-- plugins/catalog/src/alpha/entityCards.tsx | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/app-next/app-config.yaml b/packages/app-next/app-config.yaml index 0c75e1c96c..a46e119ac0 100644 --- a/packages/app-next/app-config.yaml +++ b/packages/app-next/app-config.yaml @@ -10,10 +10,15 @@ app: - apis.plugin.graphiql.browse.gitlab: true # Entity page cards - - 'entity.cards.about' + - entity.cards.about + - entity.cards.labels + - entity.cards.links: + config: + filter: + - isKind: component # Entity page content - - 'entity.content.techdocs' + - entity.content.techdocs # scmAuthExtension: >- # createScmAuthExtension({ diff --git a/plugins/catalog/src/alpha/entityCards.tsx b/plugins/catalog/src/alpha/entityCards.tsx index cc30928fcf..c7b75679a7 100644 --- a/plugins/catalog/src/alpha/entityCards.tsx +++ b/plugins/catalog/src/alpha/entityCards.tsx @@ -27,6 +27,7 @@ export const EntityAboutCard = createEntityCardExtension({ export const EntityLinksCard = createEntityCardExtension({ id: 'links', + filter: ({ entity }) => Boolean(entity.metadata.links), loader: async () => import('../components/EntityLinksCard').then(m => { return ; @@ -35,6 +36,7 @@ export const EntityLinksCard = createEntityCardExtension({ export const EntityLabelsCard = createEntityCardExtension({ id: 'labels', + filter: ({ entity }) => Boolean(entity.metadata.labels), loader: async () => import('../components/EntityLabelsCard').then(m => (