diff --git a/src/components/host/HostIcons.js b/src/components/host/HostIcons.js index 4e8ee6cc9a32f22e35bf0d9057c3ca27d983c6cc..4bd1cd169c13a0e835d2a582b0830c36f9de77e5 100644 --- a/src/components/host/HostIcons.js +++ b/src/components/host/HostIcons.js @@ -11,7 +11,7 @@ import { export function HostStatusIcon({ host }) { const theme = useTheme(); - let { status, alert, alerts } = host; + let { status, alertSeverity, alerts } = host; const iconConfig = { available: { @@ -39,28 +39,31 @@ export function HostStatusIcon({ host }) { let state = null; status = status?.toLowerCase(); - if (typeof alerts === "object") alert = alerts?.[0]?.type; + if (typeof alerts === "object") alertSeverity = alerts?.[0]?.type; - alert = alert?.toLowerCase(); + alertSeverity = alertSeverity?.toLowerCase(); - if (status === "available" && (alert === undefined || alert === "info")) { + if ( + status === "available" && + (alertSeverity === undefined || alertSeverity === "info") + ) { // Available status / no error or warning state = "available"; } else if ( status === "available" && - (alert === "warning" || alert === "error") + (alertSeverity === "warning" || alertSeverity === "error") ) { // Available status / with error or warning state = "alert"; } else if ( status === "unreachable" && - (alert === undefined || alert === "info") + (alertSeverity === undefined || alertSeverity === "info") ) { // Unreachable status / no error or warning state = "inactive"; } else if ( status === "unreachable" && - (alert === "warning" || alert === "error") + (alertSeverity === "warning" || alertSeverity === "error") ) { // Unreachable status / with error or warning state = "inactive alert"; diff --git a/src/components/host/HostTable.js b/src/components/host/HostTable.js index 784b48cb29dbf51b8f0b40d67dbd34037afbc2e9..bdfc80331de04ec29686da3398f29dc573ac7408 100644 --- a/src/components/host/HostTable.js +++ b/src/components/host/HostTable.js @@ -43,8 +43,8 @@ export function createRow(hostContainer) { host: noWrapText(host.name), description: rowDescription(host.description), network: noWrapText(host.network), - discrepancy: hostContainer.alert === "WARNING", - inconsistentState: hostContainer.alert === "ERROR", + discrepancy: hostContainer.alertSeverity === "WARNING", + inconsistentState: hostContainer.alertSeverity === "ERROR", shortenLongData: true, iocNotDeployed: !hostContainer.iocDeployed }; diff --git a/src/mocks/fixtures/PagedCSEntryHostResponse.json b/src/mocks/fixtures/PagedCSEntryHostResponse.json index a29cac7c358769730b4c00af58374b101a51db3d..2be8c48f33b5e7b73638e33ca0de7e58577b66ff 100644 --- a/src/mocks/fixtures/PagedCSEntryHostResponse.json +++ b/src/mocks/fixtures/PagedCSEntryHostResponse.json @@ -15,7 +15,7 @@ "deviceType": "VirtualMachine" }, "status": "AVAILABLE", - "alert": null + "alertSeverity": null }, { "csEntryHost": { @@ -28,7 +28,7 @@ "deviceType": "VirtualMachine" }, "status": "AVAILABLE", - "alert": "ERROR" + "alertSeverity": "ERROR" }, { "csEntryHost": { @@ -41,7 +41,7 @@ "deviceType": "MTCA-IFC" }, "status": "UNREACHABLE", - "alert": "ERROR" + "alertSeverity": "WARNING" }, { "csEntryHost": { @@ -54,7 +54,7 @@ "deviceType": "MTCA-IFC" }, "status": "UNREACHABLE", - "alert": "ERROR" + "alertSeverity": "ERROR" }, { "csEntryHost": { @@ -67,7 +67,7 @@ "deviceType": "MTCA-IFC" }, "status": "UNREACHABLE", - "alert": "ERROR" + "alertSeverity": "ERROR" }, { "csEntryHost": { @@ -80,7 +80,7 @@ "deviceType": "VirtualMachine" }, "status": "AVAILABLE", - "alert": "ERROR" + "alertSeverity": "ERROR" }, { "csEntryHost": { @@ -93,7 +93,7 @@ "deviceType": "MTCA-AMC" }, "status": "AVAILABLE", - "alert": null + "alertSeverity": null }, { "csEntryHost": { @@ -106,7 +106,7 @@ "deviceType": "MTCA-AMC" }, "status": "AVAILABLE", - "alert": null + "alertSeverity": null }, { "csEntryHost": { @@ -119,7 +119,7 @@ "deviceType": "MTCA-AMC" }, "status": "AVAILABLE", - "alert": null + "alertSeverity": null }, { "csEntryHost": { @@ -132,7 +132,7 @@ "deviceType": "VirtualMachine" }, "status": "AVAILABLE", - "alert": null + "alertSeverity": null }, { "csEntryHost": { @@ -145,7 +145,7 @@ "deviceType": "VirtualMachine" }, "status": "AVAILABLE", - "alert": null + "alertSeverity": null }, { "csEntryHost": { @@ -158,7 +158,7 @@ "deviceType": "VirtualMachine" }, "status": "AVAILABLE", - "alert": null + "alertSeverity": null }, { "csEntryHost": { @@ -171,7 +171,7 @@ "deviceType": "MTCA-AMC" }, "status": "AVAILABLE", - "alert": "ERROR" + "alertSeverity": "ERROR" }, { "csEntryHost": { @@ -184,7 +184,7 @@ "deviceType": "MTCA-AMC" }, "status": "AVAILABLE", - "alert": "ERROR" + "alertSeverity": "ERROR" }, { "csEntryHost": { @@ -197,7 +197,7 @@ "deviceType": "MTCA-AMC" }, "status": "UNREACHABLE", - "alert": "ERROR" + "alertSeverity": "ERROR" }, { "csEntryHost": { @@ -210,7 +210,7 @@ "deviceType": "VirtualMachine" }, "status": "AVAILABLE", - "alert": "ERROR" + "alertSeverity": "ERROR" }, { "csEntryHost": { @@ -223,7 +223,7 @@ "deviceType": "VirtualMachine" }, "status": "AVAILABLE", - "alert": null + "alertSeverity": null }, { "csEntryHost": { @@ -236,7 +236,7 @@ "deviceType": "VirtualMachine" }, "status": "AVAILABLE", - "alert": null + "alertSeverity": null }, { "csEntryHost": { @@ -249,7 +249,7 @@ "deviceType": "VirtualMachine" }, "status": "AVAILABLE", - "alert": null + "alertSeverity": null }, { "csEntryHost": { @@ -262,7 +262,7 @@ "deviceType": "MTCA-AMC" }, "status": "UNREACHABLE", - "alert": "ERROR" + "alertSeverity": "ERROR" }, { "csEntryHost": { @@ -275,7 +275,7 @@ "deviceType": "VirtualMachine" }, "status": "AVAILABLE", - "alert": "ERROR" + "alertSeverity": "ERROR" }, { "csEntryHost": { @@ -288,7 +288,7 @@ "deviceType": "VirtualMachine" }, "status": "AVAILABLE", - "alert": null + "alertSeverity": null }, { "csEntryHost": { @@ -301,7 +301,7 @@ "deviceType": "MTCA-AMC" }, "status": "UNREACHABLE", - "alert": "ERROR" + "alertSeverity": "ERROR" }, { "csEntryHost": { @@ -314,7 +314,7 @@ "deviceType": "MTCA-IFC" }, "status": "UNREACHABLE", - "alert": "ERROR" + "alertSeverity": "ERROR" }, { "csEntryHost": { @@ -327,7 +327,7 @@ "deviceType": "MTCA-AMC" }, "status": "UNREACHABLE", - "alert": "ERROR" + "alertSeverity": "ERROR" } ] }