Skip to content

Commit

Permalink
fix: show severity level small edits AB#25832
Browse files Browse the repository at this point in the history
  • Loading branch information
jannisvisser committed Jan 19, 2024
1 parent 18aca1a commit d5cef4f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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[
Expand Down
3 changes: 1 addition & 2 deletions services/API-service/src/api/event/event.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ export class EventService {
disasterType: DisasterType,
lastTriggeredDate: DateDto,
): Promise<TriggeredArea[]> {
// TODO: also return triggerValue here
const actionUnit = await this.getActionUnit(disasterType);
const areas = await this.adminAreaDynamicDataRepo
.createQueryBuilder('dynamic')
Expand Down Expand Up @@ -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,
Expand Down
12 changes: 8 additions & 4 deletions services/API-service/src/scripts/json/countries.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
},
Expand Down

0 comments on commit d5cef4f

Please sign in to comment.