Skip to content

Commit 11b2495

Browse files
Update Icon help and change text
Add unavailable status if alerts can't load
1 parent 8da88e6 commit 11b2495

File tree

2 files changed

+35
-26
lines changed

2 files changed

+35
-26
lines changed

ui/src/components/DashboardGlobalHealth.tsx

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ import {
55
EmphaseText,
66
LargerText,
77
SmallerText,
8-
Tooltip,
98
StatusWrapper,
109
Loader,
1110
AppContainer,
1211
spacing,
1312
Stack,
14-
Icon,
13+
IconHelp,
1514
} from '@scality/core-ui';
16-
import { GlobalHealthBar as GlobalHealthBarRecharts } from '@scality/core-ui/dist/components/globalhealthbar/GlobalHealthBarRecharts.component';
15+
import {
16+
Alert,
17+
GlobalHealthBar as GlobalHealthBarRecharts,
18+
} from '@scality/core-ui/dist/components/globalhealthbar/GlobalHealthBarRecharts.component';
1719
import {
1820
highestAlertToStatus,
1921
useAlertLibrary,
@@ -80,44 +82,51 @@ const DashboardGlobalHealth = () => {
8082
>
8183
<StyledEmphaseText>Global Health</StyledEmphaseText>
8284

83-
<Tooltip
85+
<IconHelp
8486
placement="bottom"
85-
overlay={
86-
<SmallerText>
87+
tooltipMessage={
88+
<Stack direction="vertical" gap="r4">
8789
{intl
8890
.formatMessage({
8991
id: 'global_health_explanation',
9092
})
9193
.split('\n')
9294
.map((line, key) => (
93-
<Box key={`globalheathexplanation-${key}`} mb={8}>
95+
<SmallerText key={`globalheathexplanation-${key}`}>
9496
{line}
95-
</Box>
97+
</SmallerText>
9698
))}
97-
</SmallerText>
99+
</Stack>
98100
}
99-
overlayStyle={{
100-
minWidth: '30rem',
101-
display: 'block',
102-
}}
103-
>
104-
<Icon name="Info" color="buttonSecondary" />
105-
</Tooltip>
101+
/>
106102
<CircleStatus status={platformStatus} />
107103
</Stack>
108104

109-
{historyAlertStatus === 'loading' && (
110-
<Box ml={8}>
105+
{historyAlertStatus === 'loading' ? (
106+
<Box ml={8} height={50}>
111107
<Loader size={'larger'} />
112108
</Box>
109+
) : (
110+
<GlobalHealthBarRecharts
111+
id={'platform_globalhealth'}
112+
alerts={
113+
historyAlertStatus === 'error'
114+
? // @ts-expect-error - FIXME when you are working on it
115+
([
116+
{
117+
startsAt: startingTimeISO,
118+
endsAt: currentTimeISO,
119+
severity: 'unavailable',
120+
description:
121+
'Failed to load alert history for the selected period',
122+
},
123+
] as Alert[])
124+
: alerts || []
125+
}
126+
start={new Date(startingTimeISO)}
127+
end={new Date(currentTimeISO)}
128+
/>
113129
)}
114-
115-
<GlobalHealthBarRecharts
116-
id={'platform_globalhealth'}
117-
alerts={alerts || []}
118-
start={new Date(startingTimeISO)}
119-
end={new Date(currentTimeISO)}
120-
/>
121130
</HealthBarContainer>
122131
</Box>
123132
<Box flex="2" ml={24}>

ui/src/translations/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@
183183
"view_details": "View details",
184184
"start": "Start",
185185
"no_data_available_for_metrics": "No data available for displaying the Metrics",
186-
"global_health_explanation": "The global health is the overall status of the platform over a specific period.\nThe statuses of the volumes and nodes, the network and the services are monitored.\n A green circle means the platform is healthy.\n A yellow circle means the platform is degraded but not at risk.\n A red circle means the platform is degraded and at risk.\nHover or click on an alert segment on the global health bar for more details.",
186+
"global_health_explanation": "The global health is the overall status of the platform over a specific period.\nThe statuses of the volumes and nodes, the network and the services are monitored.\n A green circle means the platform is healthy.\n A yellow circle means the platform is degraded but not at risk.\n A red circle means the platform is degraded and at risk.\nHover on an alert segment on the global health bar for more details.",
187187
"metric_quantile_explanation": "Displays resource usage statistics for large clusters (8+ nodes).\nQ90 (resp. Q5) is the 90th (resp. 5th) quantile, meaning that 90% (resp. 5%) of the nodes consume less resources than this value.\nQuantiles diverging from the median indicate cluster imbalance with respect to resource usage.\nHover over the chart to identify the nodes that are respectively above and below the Q90 and the Q5 thresholds.",
188188
"network_quantile_explanation": "Displays bandwidth statistics for large clusters (8+ nodes).\nQ90 (resp. Q5) is the 90th (resp. 5th) quantile, meaning that 90% (resp. 5%) of the nodes consume less bandwidth than this value.\nQuantiles diverging from the median indicate cluster imbalance with respect to network usage.\nHover over the chart to identify the nodes that are respectively above and below the Q90 and the Q5 thresholds.",
189189
"error_occur_outpassing_threshold": "Sorry an error occurred and we failed to retrieve the nodes outpassing this threshold.",

0 commit comments

Comments
 (0)