Skip to content

Commit 3287f99

Browse files
authored
feat(NodeEndpointsTooltipContent): add fields (#1566)
1 parent b31d2cf commit 3287f99

File tree

2 files changed

+26
-10
lines changed

2 files changed

+26
-10
lines changed

src/components/TooltipsContent/NodeEndpointsTooltipContent/NodeEndpointsTooltipContent.tsx

+23-9
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,28 @@ interface NodeEdpointsTooltipProps {
2121
export const NodeEndpointsTooltipContent = ({data, nodeHref}: NodeEdpointsTooltipProps) => {
2222
const isUserAllowedToMakeChanges = useTypedSelector(selectIsUserAllowedToMakeChanges);
2323
const info: (DefinitionListItemProps & {key: string})[] = [];
24+
if (data?.Host) {
25+
info.push({
26+
name: i18n('field_host'),
27+
children: data.Host,
28+
copyText: data.Host,
29+
key: 'Host',
30+
});
31+
}
32+
if (data?.Tenants?.[0]) {
33+
info.push({
34+
name: i18n('field_database'),
35+
children: data.Tenants[0],
36+
key: 'Database',
37+
});
38+
}
39+
if (data?.Roles?.length) {
40+
info.push({
41+
name: i18n('field_roles'),
42+
children: data.Roles.join(', '),
43+
key: 'Roles',
44+
});
45+
}
2446

2547
if (data?.Rack) {
2648
info.push({name: i18n('field_rack'), children: data.Rack, key: 'Rack'});
@@ -33,14 +55,6 @@ export const NodeEndpointsTooltipContent = ({data, nodeHref}: NodeEdpointsToolti
3355
}
3456
});
3557
}
36-
if (data?.Host) {
37-
info.push({
38-
name: i18n('field_host'),
39-
children: data.Host,
40-
copyText: data.Host,
41-
key: 'Host',
42-
});
43-
}
4458

4559
if (isUserAllowedToMakeChanges && nodeHref) {
4660
info.push({
@@ -56,7 +70,7 @@ export const NodeEndpointsTooltipContent = ({data, nodeHref}: NodeEdpointsToolti
5670
{info.map(({children, key, ...rest}) => {
5771
return (
5872
<DefinitionList.Item key={key} {...rest}>
59-
<span className={b('definition')}>{children}</span>
73+
<div className={b('definition')}>{children}</div>
6074
</DefinitionList.Item>
6175
);
6276
})}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"field_rack": "Rack",
33
"field_host": "Host",
4-
"context_developer-ui": "Developer UI"
4+
"context_developer-ui": "Developer UI",
5+
"field_database": "Database",
6+
"field_roles": "Roles"
57
}

0 commit comments

Comments
 (0)