Skip to content
Snippets Groups Projects
Commit 6507fc8b authored by Imre Toth's avatar Imre Toth
Browse files

CE-1780: Rename alert severity

parent 52f9e85c
No related branches found
No related tags found
2 merge requests!407CE-2141: 3.0.0,!318CE-1780: Rename alert severity
Pipeline #155966 passed
......@@ -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";
......
......@@ -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
};
......
......@@ -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"
}
]
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment