From 5c81e9e16593aafb7582cedfee847445c9c8ef32 Mon Sep 17 00:00:00 2001 From: Chris Suich Date: Wed, 7 May 2025 10:34:07 -0400 Subject: [PATCH] use getCompoundEntityRef Signed-off-by: Chris Suich --- plugins/techdocs-react/src/helpers.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/techdocs-react/src/helpers.ts b/plugins/techdocs-react/src/helpers.ts index 7c3ca71553..8c4c9ee8f1 100644 --- a/plugins/techdocs-react/src/helpers.ts +++ b/plugins/techdocs-react/src/helpers.ts @@ -17,8 +17,8 @@ import { Config } from '@backstage/config'; import { CompoundEntityRef, - DEFAULT_NAMESPACE, Entity, + getCompoundEntityRef, parseEntityRef, } from '@backstage/catalog-model'; import { @@ -88,9 +88,7 @@ export const buildTechDocsURL = ( return undefined; } - let namespace = entity.metadata.namespace || DEFAULT_NAMESPACE; - let kind = entity.kind; - let name = entity.metadata.name; + let { namespace, kind, name } = getCompoundEntityRef(entity); if (entity.metadata.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION]) { try {