From 1f75b79cf0a66bf39786e5b8c9afd0cfd1eb9706 Mon Sep 17 00:00:00 2001 From: arsforza Date: Mon, 22 Jan 2024 09:33:56 +0100 Subject: [PATCH 1/2] fix: set grey outline on hover for < 1 AB#25833 --- interfaces/IBF-dashboard/src/app/services/map.service.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/interfaces/IBF-dashboard/src/app/services/map.service.ts b/interfaces/IBF-dashboard/src/app/services/map.service.ts index b2d40b2f0..0cc579303 100644 --- a/interfaces/IBF-dashboard/src/app/services/map.service.ts +++ b/interfaces/IBF-dashboard/src/app/services/map.service.ts @@ -1016,6 +1016,11 @@ export class MapService { color: this.stoppedTriggerColor, weight: 5, }; + } else if (!area.triggerValue || area.triggerValue < 1) { + return { + color: this.nonTriggeredAreaColor, + weight: 5, + }; } else if (!this.eventState?.event?.thresholdReached) { return { color: this.nonTriggeredAreaColor, From 2b97eebb74d23d2e721d237d01c71ca42259bfa7 Mon Sep 17 00:00:00 2001 From: arsforza Date: Mon, 22 Jan 2024 11:06:07 +0100 Subject: [PATCH 2/2] fix: use early returns AB#25833 --- .../src/app/services/map.service.ts | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/interfaces/IBF-dashboard/src/app/services/map.service.ts b/interfaces/IBF-dashboard/src/app/services/map.service.ts index 0cc579303..f572bf4e1 100644 --- a/interfaces/IBF-dashboard/src/app/services/map.service.ts +++ b/interfaces/IBF-dashboard/src/app/services/map.service.ts @@ -1011,26 +1011,26 @@ export class MapService { color: triggered ? this.triggeredAreaColor : this.nonTriggeredAreaColor, weight: 5, }; - } else if (area.stopped) { + } + if (area.stopped) { return { color: this.stoppedTriggerColor, weight: 5, }; - } else if (!area.triggerValue || area.triggerValue < 1) { - return { - color: this.nonTriggeredAreaColor, - weight: 5, - }; - } else if (!this.eventState?.event?.thresholdReached) { + } + if ( + !area.triggerValue || + area.triggerValue < 1 || + !this.eventState?.event?.thresholdReached + ) { return { color: this.nonTriggeredAreaColor, weight: 5, }; - } else { - return { - color: this.triggeredAreaColor, - weight: 5, - }; } + return { + color: this.triggeredAreaColor, + weight: 5, + }; }; }