From 854ef5ddfff9ebcf357ba8b6c39da719ca0054c3 Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Fri, 11 Feb 2022 15:03:04 +0100 Subject: [PATCH] reuse format logic from serializeEntityRef Signed-off-by: Johan Haals --- .../src/components/EntityRefLink/format.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/plugins/catalog-react/src/components/EntityRefLink/format.ts b/plugins/catalog-react/src/components/EntityRefLink/format.ts index d94a576677..4787474c68 100644 --- a/plugins/catalog-react/src/components/EntityRefLink/format.ts +++ b/plugins/catalog-react/src/components/EntityRefLink/format.ts @@ -18,7 +18,6 @@ import { Entity, EntityName, ENTITY_DEFAULT_NAMESPACE, - stringifyEntityRef, } from '@backstage/catalog-model'; export function formatEntityRefTitle( @@ -45,13 +44,9 @@ export function formatEntityRefTitle( } kind = kind.toLocaleLowerCase('en-US'); - - return `${stringifyEntityRef({ - kind: - defaultKind && defaultKind.toLocaleLowerCase('en-US') === kind - ? '' - : kind, - name, - namespace, - })}`; + kind = + defaultKind && defaultKind.toLocaleLowerCase('en-US') === kind + ? undefined + : kind; + return `${kind ? `${kind}:` : ''}${namespace ? `${namespace}/` : ''}${name}`; }