From 885e695803cf113571313d368911ac114e39e1ce Mon Sep 17 00:00:00 2001 From: Oliver Sand Date: Mon, 1 Feb 2021 17:28:36 +0100 Subject: [PATCH] Display the namespace of an entity if required --- .../src/components/ApiExplorerTable/ApiExplorerTable.tsx | 8 ++++++-- .../catalog/src/components/CatalogTable/CatalogTable.tsx | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/plugins/api-docs/src/components/ApiExplorerTable/ApiExplorerTable.tsx b/plugins/api-docs/src/components/ApiExplorerTable/ApiExplorerTable.tsx index 6baacf5961..101c28332a 100644 --- a/plugins/api-docs/src/components/ApiExplorerTable/ApiExplorerTable.tsx +++ b/plugins/api-docs/src/components/ApiExplorerTable/ApiExplorerTable.tsx @@ -42,6 +42,7 @@ import { ApiTypeTitle } from '../ApiDefinitionCard'; type EntityRow = { entity: ApiEntityV1alpha1; resolved: { + name: string; partOfSystemRelationTitle?: string; partOfSystemRelations: EntityName[]; ownedByRelationsTitle?: string; @@ -52,10 +53,10 @@ type EntityRow = { const columns: TableColumn[] = [ { title: 'Name', - field: 'entity.metadata.name', + field: 'resolved.name', highlight: true, render: ({ entity }) => ( - {entity.metadata.name} + ), }, { @@ -167,6 +168,9 @@ export const ApiExplorerTable = ({ return { entity: entity as ApiEntityV1alpha1, resolved: { + name: formatEntityRefTitle(entity, { + defaultKind: 'API', + }), ownedByRelationsTitle: ownedByRelations .map(r => formatEntityRefTitle(r, { defaultKind: 'group' })) .join(', '), diff --git a/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx b/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx index 5fc4445053..30a19145f2 100644 --- a/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx +++ b/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx @@ -42,6 +42,7 @@ import { type EntityRow = { entity: Entity; resolved: { + name: string; partOfSystemRelationTitle?: string; partOfSystemRelations: EntityName[]; ownedByRelationsTitle?: string; @@ -52,10 +53,10 @@ type EntityRow = { const columns: TableColumn[] = [ { title: 'Name', - field: 'entity.metadata.name', + field: 'resolved.name', highlight: true, render: ({ entity }) => ( - {entity.metadata.name} + ), }, { @@ -177,6 +178,9 @@ export const CatalogTable = ({ return { entity, resolved: { + name: formatEntityRefTitle(entity, { + defaultKind: 'Component', + }), ownedByRelationsTitle: ownedByRelations .map(r => formatEntityRefTitle(r, { defaultKind: 'group' })) .join(', '),