From c991df871f8b24544f82a58160746f90a4f6ce04 Mon Sep 17 00:00:00 2001 From: "roylisto.pradana" Date: Wed, 30 Jun 2021 10:27:16 +0700 Subject: [PATCH] use GroupEntity as casting to catalogItem Signed-off-by: roylisto.pradana --- .../components/GroupsExplorerContent/GroupsDiagram.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/explore/src/components/GroupsExplorerContent/GroupsDiagram.tsx b/plugins/explore/src/components/GroupsExplorerContent/GroupsDiagram.tsx index 32931e8f3a..28de4e4661 100644 --- a/plugins/explore/src/components/GroupsExplorerContent/GroupsDiagram.tsx +++ b/plugins/explore/src/components/GroupsExplorerContent/GroupsDiagram.tsx @@ -18,6 +18,7 @@ import { RELATION_CHILD_OF, stringifyEntityRef, parseEntityRef, + GroupEntity, } from '@backstage/catalog-model'; import { catalogApiRef, @@ -96,7 +97,7 @@ function RenderNode(props: DependencyGraphTypes.RenderNodeProps) { alignmentBaseline="baseline" style={{ fontWeight: 'bold' }} > - {props.node.profile?.displayName ?? props.node.name} + {props.node.name} @@ -146,8 +147,9 @@ export function GroupsDiagram() { nodes.push({ id: stringifyEntityRef(catalogItem), kind: catalogItem.kind, - name: formatEntityRefTitle(catalogItem, { defaultKind: 'Group' }), - profile: catalogItem.spec?.profile, + name: + (catalogItem as GroupEntity).spec?.profile?.displayName || + formatEntityRefTitle(catalogItem, { defaultKind: 'Group' }), }); // Edge to parent