From ff304cfc3fe20ededb5ff47c4008016264a7edaf Mon Sep 17 00:00:00 2001 From: Phil Kuang Date: Thu, 26 Aug 2021 10:55:34 -0400 Subject: [PATCH] fix(OwnershipCard): support namespaced owners in links Signed-off-by: Phil Kuang --- .changeset/wicked-singers-push.md | 5 +++++ .../org/src/components/Cards/OwnershipCard/OwnershipCard.tsx | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/wicked-singers-push.md diff --git a/.changeset/wicked-singers-push.md b/.changeset/wicked-singers-push.md new file mode 100644 index 0000000000..3c34a959ed --- /dev/null +++ b/.changeset/wicked-singers-push.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-org': patch +--- + +Fix OwnershipCard links to support namespaced owners diff --git a/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx b/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx index 83768f1513..32a2061297 100644 --- a/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx +++ b/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx @@ -20,6 +20,7 @@ import { isOwnerOf, useEntity, catalogRouteRef, + formatEntityRefTitle, } from '@backstage/plugin-catalog-react'; import { BackstageTheme, genPageTheme } from '@backstage/theme'; import { @@ -117,7 +118,7 @@ const getQueryParams = ( owner: Entity, selectedEntity: EntityTypeProps, ): string => { - const ownerName = owner.metadata.name; + const ownerName = formatEntityRefTitle(owner, { defaultKind: 'group' }); const { kind, type } = selectedEntity; const queryParams = qs.stringify({ filters: {