diff --git a/interfaces/IBF-dashboard/src/app/components/leaflet-popup/glofas-station-popup-content/glofas-station-popup-content.component.html b/interfaces/IBF-dashboard/src/app/components/leaflet-popup/glofas-station-popup-content/glofas-station-popup-content.component.html index 78f1c8325..655871856 100644 --- a/interfaces/IBF-dashboard/src/app/components/leaflet-popup/glofas-station-popup-content/glofas-station-popup-content.component.html +++ b/interfaces/IBF-dashboard/src/app/components/leaflet-popup/glofas-station-popup-content/glofas-station-popup-content.component.html @@ -1,21 +1,24 @@ - {{ data?.leadTime }} forecast of - river discharge - in m3/s + {{ + 'map-popups.glofas-station.river-discharge' + | translate: { leadTime: getLeadTimeString() } + }} + - (Corresponding to a return period of - {{ data?.station?.dynamicData?.forecastReturnPeriod }} - years) + {{ + 'map-popups.glofas-station.forecast-return' + | translate + : { returnPeriod: data?.station?.dynamicData?.forecastReturnPeriod } + }} diff --git a/interfaces/IBF-dashboard/src/app/components/leaflet-popup/glofas-station-popup-content/glofas-station-popup-content.component.ts b/interfaces/IBF-dashboard/src/app/components/leaflet-popup/glofas-station-popup-content/glofas-station-popup-content.component.ts index 2fe3875d1..b2549880d 100644 --- a/interfaces/IBF-dashboard/src/app/components/leaflet-popup/glofas-station-popup-content/glofas-station-popup-content.component.ts +++ b/interfaces/IBF-dashboard/src/app/components/leaflet-popup/glofas-station-popup-content/glofas-station-popup-content.component.ts @@ -1,4 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; +import { TranslateService } from '@ngx-translate/core'; import { EapAlertClass, EapAlertClasses } from '../../../models/country.model'; import { Station } from '../../../models/poi.model'; import { LeadTime } from '../../../types/lead-time'; @@ -27,6 +28,8 @@ export class GlofasStationPopupContentComponent implements OnInit { value: 0, }; + constructor(private translate: TranslateService) {} + ngOnInit(): void { if (!this.data) { return; @@ -69,4 +72,14 @@ export class GlofasStationPopupContentComponent implements OnInit { } public addComma = (n) => Math.round(n).toLocaleString('en-US'); + + public getLeadTimeString(): string { + if (!this.data || !this.data?.leadTime) { + return ''; + } + + const [value, unit] = this.data.leadTime.split('-'); + + return `${value} ${unit}${Number(value) > 1 ? 's' : ''}`; + } } diff --git a/interfaces/IBF-dashboard/src/app/components/leaflet-popup/threshold-bar/threshold-bar.component.html b/interfaces/IBF-dashboard/src/app/components/leaflet-popup/threshold-bar/threshold-bar.component.html index 655d5e5d4..f19f3b84d 100644 --- a/interfaces/IBF-dashboard/src/app/components/leaflet-popup/threshold-bar/threshold-bar.component.html +++ b/interfaces/IBF-dashboard/src/app/components/leaflet-popup/threshold-bar/threshold-bar.component.html @@ -2,12 +2,14 @@ - {{ barValue }} + {{ barValue }}{{ unit }} {{ thresholdDescription }}: - {{ thresholdValue }} + {{ thresholdValue }}{{ unit }} diff --git a/interfaces/IBF-dashboard/src/app/components/leaflet-popup/threshold-bar/threshold-bar.component.ts b/interfaces/IBF-dashboard/src/app/components/leaflet-popup/threshold-bar/threshold-bar.component.ts index 11c91200a..674769b46 100644 --- a/interfaces/IBF-dashboard/src/app/components/leaflet-popup/threshold-bar/threshold-bar.component.ts +++ b/interfaces/IBF-dashboard/src/app/components/leaflet-popup/threshold-bar/threshold-bar.component.ts @@ -12,6 +12,7 @@ export class ThresholdBarComponent implements OnInit { @Input() public barValue: string; @Input() public thresholdDescription: string; @Input() public thresholdValue: number; + @Input() public unit?: string; @Input() public thresholdPosition: number; // width percentage to position threshold on bar public barBackgroundStyle: string; diff --git a/interfaces/IBF-dashboard/src/assets/i18n/en.json b/interfaces/IBF-dashboard/src/assets/i18n/en.json index 469bd0827..8c9c67ea1 100644 --- a/interfaces/IBF-dashboard/src/assets/i18n/en.json +++ b/interfaces/IBF-dashboard/src/assets/i18n/en.json @@ -396,7 +396,11 @@ "tooltip": "Current water level in meters above sea level (mMSL) is measured by a gauge during the latest model run. The difference compared to 24 hours ago is shown in green for decrease or red for increase. The reference water level is the typical level for this station during this season." }, "glofas-station": { - "no-data": "No water discharge data available" + "no-data": "No water discharge data available", + "river-discharge": "Forecasted river discharge in {{ leadTime }}", + "river-discharge-explanation": "The amount of water moving down a river at a given time and place", + "forecast-return": "(Corresponding to a return period of {{returnPeriod}} years)", + "threshold-description": "Trigger activation threshold" } }, "breadcrumbs": { diff --git a/services/API-service/src/api/admin-area-dynamic-data/dto/example/UGA/floods/upload-population_affected-2.json b/services/API-service/src/api/admin-area-dynamic-data/dto/example/UGA/floods/upload-population_affected-2.json index 69f88cbf5..d84297c46 100644 --- a/services/API-service/src/api/admin-area-dynamic-data/dto/example/UGA/floods/upload-population_affected-2.json +++ b/services/API-service/src/api/admin-area-dynamic-data/dto/example/UGA/floods/upload-population_affected-2.json @@ -177,7 +177,7 @@ }, { "placeCode": "21UGA006001", - "amount": 1000 + "amount": 2145 }, { "placeCode": "21UGA006002", @@ -197,7 +197,7 @@ }, { "placeCode": "21UGA006006", - "amount": 1000 + "amount": 2201 }, { "placeCode": "21UGA006007", @@ -205,7 +205,7 @@ }, { "placeCode": "21UGA006008", - "amount": 1000 + "amount": 3380 }, { "placeCode": "21UGA006009", diff --git a/services/API-service/src/api/admin-area-dynamic-data/dto/example/UGA/floods/upload-population_affected-3.json b/services/API-service/src/api/admin-area-dynamic-data/dto/example/UGA/floods/upload-population_affected-3.json index bb334e716..ac7234bd2 100644 --- a/services/API-service/src/api/admin-area-dynamic-data/dto/example/UGA/floods/upload-population_affected-3.json +++ b/services/API-service/src/api/admin-area-dynamic-data/dto/example/UGA/floods/upload-population_affected-3.json @@ -201,7 +201,7 @@ }, { "placeCode": "UG202901", - "amount": 100 + "amount": 2145 }, { "placeCode": "UG203001", @@ -333,7 +333,7 @@ }, { "placeCode": "UG205201", - "amount": 100 + "amount": 2201 }, { "placeCode": "UG205301", @@ -353,7 +353,7 @@ }, { "placeCode": "UG205601", - "amount": 100 + "amount": 3380 }, { "placeCode": "UG205701", diff --git a/services/API-service/src/api/admin-area-dynamic-data/dto/example/UGA/floods/upload-population_affected-4.json b/services/API-service/src/api/admin-area-dynamic-data/dto/example/UGA/floods/upload-population_affected-4.json index 8b0cd93ee..027bf571a 100644 --- a/services/API-service/src/api/admin-area-dynamic-data/dto/example/UGA/floods/upload-population_affected-4.json +++ b/services/API-service/src/api/admin-area-dynamic-data/dto/example/UGA/floods/upload-population_affected-4.json @@ -1169,71 +1169,71 @@ }, { "placeCode": "UG20290101", - "amount": 10 + "amount": 230 }, { "placeCode": "UG20290102", - "amount": 10 + "amount": 38 }, { "placeCode": "UG20290103", - "amount": 10 + "amount": 228 }, { "placeCode": "UG20290104", - "amount": 10 + "amount": 126 }, { "placeCode": "UG20290105", - "amount": 10 + "amount": 117 }, { "placeCode": "UG20290106", - "amount": 10 + "amount": 43 }, { "placeCode": "UG20290107", - "amount": 10 + "amount": 178 }, { "placeCode": "UG20290108", - "amount": 10 + "amount": 223 }, { "placeCode": "UG20290109", - "amount": 10 + "amount": 87 }, { "placeCode": "UG20290110", - "amount": 10 + "amount": 179 }, { "placeCode": "UG20290111", - "amount": 10 + "amount": 188 }, { "placeCode": "UG20290112", - "amount": 10 + "amount": 118 }, { "placeCode": "UG20290113", - "amount": 10 + "amount": 36 }, { "placeCode": "UG20290114", - "amount": 10 + "amount": 137 }, { "placeCode": "UG20290115", - "amount": 10 + "amount": 5 }, { "placeCode": "UG20290116", - "amount": 10 + "amount": 183 }, { "placeCode": "UG20290117", - "amount": 10 + "amount": 29 }, { "placeCode": "UG20300101", @@ -2181,71 +2181,71 @@ }, { "placeCode": "UG20520101", - "amount": 10 + "amount": 141 }, { "placeCode": "UG20520102", - "amount": 10 + "amount": 114 }, { "placeCode": "UG20520103", - "amount": 10 + "amount": 75 }, { "placeCode": "UG20520104", - "amount": 10 + "amount": 174 }, { "placeCode": "UG20520105", - "amount": 10 + "amount": 112 }, { "placeCode": "UG20520106", - "amount": 10 + "amount": 11 }, { "placeCode": "UG20520107", - "amount": 10 + "amount": 149 }, { "placeCode": "UG20520108", - "amount": 10 + "amount": 119 }, { "placeCode": "UG20520109", - "amount": 10 + "amount": 191 }, { "placeCode": "UG20520110", - "amount": 10 + "amount": 95 }, { "placeCode": "UG20520111", - "amount": 10 + "amount": 168 }, { "placeCode": "UG20520112", - "amount": 10 + "amount": 43 }, { "placeCode": "UG20520113", - "amount": 10 + "amount": 151 }, { "placeCode": "UG20520114", - "amount": 10 + "amount": 155 }, { "placeCode": "UG20520115", - "amount": 10 + "amount": 133 }, { "placeCode": "UG20520116", - "amount": 10 + "amount": 189 }, { "placeCode": "UG20520117", - "amount": 10 + "amount": 181 }, { "placeCode": "UG20530101", @@ -2449,71 +2449,71 @@ }, { "placeCode": "UG20560101", - "amount": 10 + "amount": 350 }, { "placeCode": "UG20560102", - "amount": 10 + "amount": 317 }, { "placeCode": "UG20560103", - "amount": 10 + "amount": 118 }, { "placeCode": "UG20560104", - "amount": 10 + "amount": 198 }, { "placeCode": "UG20560105", - "amount": 10 + "amount": 150 }, { "placeCode": "UG20560106", - "amount": 10 + "amount": 11 }, { "placeCode": "UG20560107", - "amount": 10 + "amount": 89 }, { "placeCode": "UG20560108", - "amount": 10 + "amount": 189 }, { "placeCode": "UG20560109", - "amount": 10 + "amount": 107 }, { "placeCode": "UG20560110", - "amount": 10 + "amount": 35 }, { "placeCode": "UG20560111", - "amount": 10 + "amount": 51 }, { "placeCode": "UG20560112", - "amount": 10 + "amount": 195 }, { "placeCode": "UG20560113", - "amount": 10 + "amount": 357 }, { "placeCode": "UG20560114", - "amount": 10 + "amount": 287 }, { "placeCode": "UG20560115", - "amount": 10 + "amount": 96 }, { "placeCode": "UG20560116", - "amount": 10 + "amount": 417 }, { "placeCode": "UG20560117", - "amount": 10 + "amount": 413 }, { "placeCode": "UG20570101", diff --git a/services/API-service/src/api/glofas-station/dto/station-forecast.dto.ts b/services/API-service/src/api/glofas-station/dto/station-forecast.dto.ts index 611aa3b4f..fc3e96d6e 100644 --- a/services/API-service/src/api/glofas-station/dto/station-forecast.dto.ts +++ b/services/API-service/src/api/glofas-station/dto/station-forecast.dto.ts @@ -24,9 +24,8 @@ export class GlofasStationForecastDto { public eapAlertClass: string; @ApiProperty({ example: 10 }) - @IsNumber() @IsOptional() - public forecastReturnPeriod: number; + public forecastReturnPeriod: number | string; @ApiProperty({ example: 100 }) @IsNumber() diff --git a/services/API-service/src/api/point-data/dto/example/glofas-stations/glofas-stations-UGA-triggered.json b/services/API-service/src/api/point-data/dto/example/glofas-stations/glofas-stations-UGA-triggered.json index 72480b517..1eb6e6a70 100644 --- a/services/API-service/src/api/point-data/dto/example/glofas-stations/glofas-stations-UGA-triggered.json +++ b/services/API-service/src/api/point-data/dto/example/glofas-stations/glofas-stations-UGA-triggered.json @@ -1,10 +1,10 @@ [ { "stationCode": "G5075", - "forecastLevel": 500, + "forecastLevel": 175, "eapAlertClass": "min", - "forecastReturnPeriod": null, - "triggerLevel": 400 + "forecastReturnPeriod": 2, + "triggerLevel": 520 }, { "stationCode": "G5160", @@ -43,10 +43,10 @@ }, { "stationCode": "G5230", - "forecastLevel": 410, + "forecastLevel": 250, "eapAlertClass": "med", - "forecastReturnPeriod": null, - "triggerLevel": 400 + "forecastReturnPeriod": 3, + "triggerLevel": 300 }, { "stationCode": "G5317",