From d5cef4fbcef3b14f0f45d905dc534a1566cfa273 Mon Sep 17 00:00:00 2001 From: jannisvisser Date: Fri, 19 Jan 2024 13:16:15 +0100 Subject: [PATCH] fix: show severity level small edits AB#25832 --- .../src/app/services/eap-actions.service.ts | 4 ++-- services/API-service/src/api/event/event.service.ts | 3 +-- services/API-service/src/scripts/json/countries.json | 12 ++++++++---- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/interfaces/IBF-dashboard/src/app/services/eap-actions.service.ts b/interfaces/IBF-dashboard/src/app/services/eap-actions.service.ts index 615332d25..004a855b4 100644 --- a/interfaces/IBF-dashboard/src/app/services/eap-actions.service.ts +++ b/interfaces/IBF-dashboard/src/app/services/eap-actions.service.ts @@ -184,13 +184,13 @@ export class EapActionsService { }; private mapSeverityLevel = (triggeredArea: TriggeredArea) => { - const triggerValue = triggeredArea.triggerValue; + // If no match is found, then no severity level will be shown if (this.countryDisasterSettings.eapAlertClasses) { for (const alertClass of Object.keys( this.countryDisasterSettings.eapAlertClasses, )) { if ( - triggerValue === + triggeredArea.triggerValue === this.countryDisasterSettings.eapAlertClasses[alertClass].value ) { triggeredArea.severityLevel = this.countryDisasterSettings.eapAlertClasses[ diff --git a/services/API-service/src/api/event/event.service.ts b/services/API-service/src/api/event/event.service.ts index b6a431cde..7ef67e74a 100644 --- a/services/API-service/src/api/event/event.service.ts +++ b/services/API-service/src/api/event/event.service.ts @@ -335,7 +335,6 @@ export class EventService { disasterType: DisasterType, lastTriggeredDate: DateDto, ): Promise { - // TODO: also return triggerValue here const actionUnit = await this.getActionUnit(disasterType); const areas = await this.adminAreaDynamicDataRepo .createQueryBuilder('dynamic') @@ -387,7 +386,7 @@ export class EventService { name: area.name, nameParent: null, actionsValue: area.value, - triggerValue: 1, + triggerValue: null, // leave empty for now, as we don't show triggerValue on deeper levels stopped: area.stopped, startDate: area.startDate, stoppedDate: area.stoppedDate, diff --git a/services/API-service/src/scripts/json/countries.json b/services/API-service/src/scripts/json/countries.json index 5d1756911..d01897587 100644 --- a/services/API-service/src/scripts/json/countries.json +++ b/services/API-service/src/scripts/json/countries.json @@ -268,19 +268,23 @@ "eapAlertClasses": { "no": { "label": "No action", - "color": "ibf-no-alert-primary" + "color": "ibf-no-alert-primary", + "value": 0 }, "min": { "label": "Met office to monitor", - "color": "ibf-yellow" + "color": "ibf-yellow", + "value": 0.3 }, "med": { "label": "Alert IFRC / Prep evacuation / Warn communities", - "color": "ibf-orange" + "color": "ibf-orange", + "value": 0.7 }, "max": { "label": "Activate EAP", - "color": "ibf-trigger-alert-primary" + "color": "ibf-trigger-alert-primary", + "value": 1 } } },