From 3287f9921ef1a92942c6fee4205e6a26465877d6 Mon Sep 17 00:00:00 2001 From: Hellen Date: Fri, 1 Nov 2024 12:09:02 +0300 Subject: [PATCH] feat(NodeEndpointsTooltipContent): add fields (#1566) --- .../NodeEndpointsTooltipContent.tsx | 32 +++++++++++++------ .../NodeEndpointsTooltipContent/i18n/en.json | 4 ++- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/components/TooltipsContent/NodeEndpointsTooltipContent/NodeEndpointsTooltipContent.tsx b/src/components/TooltipsContent/NodeEndpointsTooltipContent/NodeEndpointsTooltipContent.tsx index be2c5b775..49411f1a9 100644 --- a/src/components/TooltipsContent/NodeEndpointsTooltipContent/NodeEndpointsTooltipContent.tsx +++ b/src/components/TooltipsContent/NodeEndpointsTooltipContent/NodeEndpointsTooltipContent.tsx @@ -21,6 +21,28 @@ interface NodeEdpointsTooltipProps { export const NodeEndpointsTooltipContent = ({data, nodeHref}: NodeEdpointsTooltipProps) => { const isUserAllowedToMakeChanges = useTypedSelector(selectIsUserAllowedToMakeChanges); const info: (DefinitionListItemProps & {key: string})[] = []; + if (data?.Host) { + info.push({ + name: i18n('field_host'), + children: data.Host, + copyText: data.Host, + key: 'Host', + }); + } + if (data?.Tenants?.[0]) { + info.push({ + name: i18n('field_database'), + children: data.Tenants[0], + key: 'Database', + }); + } + if (data?.Roles?.length) { + info.push({ + name: i18n('field_roles'), + children: data.Roles.join(', '), + key: 'Roles', + }); + } if (data?.Rack) { info.push({name: i18n('field_rack'), children: data.Rack, key: 'Rack'}); @@ -33,14 +55,6 @@ export const NodeEndpointsTooltipContent = ({data, nodeHref}: NodeEdpointsToolti } }); } - if (data?.Host) { - info.push({ - name: i18n('field_host'), - children: data.Host, - copyText: data.Host, - key: 'Host', - }); - } if (isUserAllowedToMakeChanges && nodeHref) { info.push({ @@ -56,7 +70,7 @@ export const NodeEndpointsTooltipContent = ({data, nodeHref}: NodeEdpointsToolti {info.map(({children, key, ...rest}) => { return ( - {children} +
{children}
); })} diff --git a/src/components/TooltipsContent/NodeEndpointsTooltipContent/i18n/en.json b/src/components/TooltipsContent/NodeEndpointsTooltipContent/i18n/en.json index ad48d4961..2d9186bc5 100644 --- a/src/components/TooltipsContent/NodeEndpointsTooltipContent/i18n/en.json +++ b/src/components/TooltipsContent/NodeEndpointsTooltipContent/i18n/en.json @@ -1,5 +1,7 @@ { "field_rack": "Rack", "field_host": "Host", - "context_developer-ui": "Developer UI" + "context_developer-ui": "Developer UI", + "field_database": "Database", + "field_roles": "Roles" }