Skip to content
Snippets Groups Projects
Commit 49130741 authored by Johanna Szepanski's avatar Johanna Szepanski Committed by EREBUS_DMN\jsz
Browse files

updated status logic and story to accommodate BE fix for stopped IOCs

parent 39a7d11d
No related branches found
No related tags found
2 merge requests!542Prepare 4.1.0,!521CE-3061: Update ioc alerts and status separately
...@@ -66,10 +66,7 @@ export const getStatus = (state, alert) => { ...@@ -66,10 +66,7 @@ export const getStatus = (state, alert) => {
) { ) {
// Active status / running // Active status / running
return STATUS.active; return STATUS.active;
} else if ( } else if (isActive !== false && !isActive) {
isActive === false &&
(alertSeverity === undefined || alertSeverity === SEVERITY.info)
) {
// stopped/paused // stopped/paused
return STATUS.disabled; return STATUS.disabled;
} else if ( } else if (
...@@ -87,21 +84,13 @@ export const getStatus = (state, alert) => { ...@@ -87,21 +84,13 @@ export const getStatus = (state, alert) => {
// warning // warning
return STATUS.warning; return STATUS.warning;
} else if ( } else if (
(!isActive || isActive === null) && isActive === false &&
(alertSeverity === undefined || alertSeverity === SEVERITY.info) (!alertSeverity || alertSeverity === SEVERITY.info)
) { ) {
// Inactive status
return STATUS.inactive; return STATUS.inactive;
} else if ( } else if (isActive === false && alertSeverity === SEVERITY.alert) {
(!isActive || isActive === null) &&
alertSeverity === SEVERITY.alert
) {
// inactive with warning/error
return STATUS.inactiveAlert; return STATUS.inactiveAlert;
} else if ( } else if (isActive === false && alertSeverity === SEVERITY.warning) {
(!isActive || isActive === null) &&
alertSeverity === SEVERITY.warning
) {
return STATUS.inactiveWarning; return STATUS.inactiveWarning;
} else { } else {
// unknown fallback state // unknown fallback state
......
...@@ -17,19 +17,8 @@ ...@@ -17,19 +17,8 @@
}, },
{ {
"iocId": 15, "iocId": 15,
"alertSeverity": "WARNING", "alertSeverity": null,
"alerts": [ "alerts": []
{
"type": "WARNING",
"message": "This is warning 1",
"link": null
},
{
"type": "WARNING",
"message": "This is warning 2",
"link": null
}
]
}, },
{ {
"iocId": 18, "iocId": 18,
...@@ -55,16 +44,32 @@ ...@@ -55,16 +44,32 @@
}, },
{ {
"iocId": 21, "iocId": 21,
"alertSeverity": null, "alertSeverity": "ERROR",
"alerts": [] "alerts": [
{
"type": "INFO",
"message": "IOC is not deployed",
"link": null
},
{
"type": "ERROR",
"message": "IOC's latest deployment failed, IOC may be in inconsistent state",
"link": null
},
{
"type": "WARNING",
"message": "This is a warning message",
"link": null
}
]
}, },
{ {
"iocId": 49, "iocId": 49,
"alertSeverity": "INFO", "alertSeverity": "WARNING",
"alerts": [ "alerts": [
{ {
"type": "INFO", "type": "WARNING",
"message": "IOC is not deployed", "message": "This is a warning message",
"link": null "link": null
} }
] ]
...@@ -86,18 +91,7 @@ ...@@ -86,18 +91,7 @@
}, },
{ {
"iocId": 43, "iocId": 43,
"alertSeverity": "ERROR", "alertSeverity": null,
"alerts": [ "alerts": []
{
"type": "ERROR",
"message": "IOC's latest deployment failed, IOC may be in inconsistent state",
"link": null
},
{
"type": "WARNING",
"message": "This is a warning message",
"link": null
}
]
} }
] ]
...@@ -9,7 +9,15 @@ ...@@ -9,7 +9,15 @@
}, },
{ {
"iocId": 18, "iocId": 18,
"isActive": null "alertSeverity": "INFO",
"alerts": [
{
"type": "INFO",
"message": "IOC is not deployed",
"link": null
}
],
"isActive": false
}, },
{ {
"iocId": 39, "iocId": 39,
...@@ -17,11 +25,27 @@ ...@@ -17,11 +25,27 @@
}, },
{ {
"iocId": 21, "iocId": 21,
"isActive": null "alertSeverity": "INFO",
"alerts": [
{
"type": "INFO",
"message": "IOC is not deployed",
"link": null
}
],
"isActive": false
}, },
{ {
"iocId": 49, "iocId": 49,
"isActive": null "alertSeverity": "INFO",
"alerts": [
{
"type": "INFO",
"message": "IOC is not deployed",
"link": null
}
],
"isActive": false
}, },
{ {
"iocId": 40, "iocId": 40,
......
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