Skip to content

Commit

Permalink
feat(NodeEndpointsTooltipContent): add fields (#1566)
Browse files Browse the repository at this point in the history
  • Loading branch information
Raubzeug authored Nov 1, 2024
1 parent b31d2cf commit 3287f99
Showing 2 changed files with 26 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -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 (
<DefinitionList.Item key={key} {...rest}>
<span className={b('definition')}>{children}</span>
<div className={b('definition')}>{children}</div>
</DefinitionList.Item>
);
})}
Original file line number Diff line number Diff line change
@@ -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"
}

0 comments on commit 3287f99

Please sign in to comment.