Skip to content

Commit 0dc64c6

Browse files
committed
MK8S-197 - Fix the bug to display UI regardless of loading alerts successfully
1 parent e001070 commit 0dc64c6

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

ui/src/containers/VolumePageRSP.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const VolumePageRSP = (props) => {
5454
const alertsVolume = useAlerts({
5555
persistentvolumeclaim: PVCName,
5656
});
57-
const alertlist = alertsVolume && alertsVolume.alerts;
57+
const alertlist = alertsVolume?.alerts ?? [];
5858
const criticalAlerts = alertlist.filter(
5959
(alert) => alert.severity === 'critical',
6060
);

ui/src/hooks.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,9 @@ export const useVolumesWithAlerts = (nodeName?: string) => {
121121
// @ts-expect-error - FIXME when you are working on it
122122
getVolumeListData(state, null, nodeName),
123123
);
124-
//This forces alerts to have been fetched at least once (watchdog alert should be present)
125-
// before rendering volume list
126-
// TODO enhance this using useAlerts status
127-
if (!alerts || alerts.length === 0) return [];
128124
// @ts-expect-error - FIXME when you are working on it
129125
const volumeListWithStatus = volumeListData.map((volume) => {
130-
const volumeAlerts = filterAlerts(alerts, {
126+
const volumeAlerts = filterAlerts(alerts || [], {
131127
persistentvolumeclaim: volume.persistentvolumeclaim,
132128
});
133129
// For the unbound volume, the health status should be none.

0 commit comments

Comments
 (0)