Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/rodekruis/IBF-system into…
Browse files Browse the repository at this point in the history
… refactor.drought-sticky-action-seasons
  • Loading branch information
arsforza committed Aug 8, 2022
2 parents 10685ba + fc2b15f commit 24737f9
Show file tree
Hide file tree
Showing 35 changed files with 13,659 additions and 3,716 deletions.
117 changes: 54 additions & 63 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,57 @@
## [0.173.1](https://github.com/rodekruis/IBF-system/compare/v0.173.0...v0.173.1) (2022-08-08)


### Bug Fixes

* adjust speech bubbles in multi-event AB[#14710](https://github.com/rodekruis/IBF-system/issues/14710) ([dde92a6](https://github.com/rodekruis/IBF-system/commit/dde92a6e72dfa34f2b4659f68abb8961cfc17141))
* change from-name email AB[#14709](https://github.com/rodekruis/IBF-system/issues/14709) ([6f05e90](https://github.com/rodekruis/IBF-system/commit/6f05e90c8b560c7925865c4aa16df86eed95a542))
* improve sorting of events in chat-section AB[#14710](https://github.com/rodekruis/IBF-system/issues/14710) ([4678483](https://github.com/rodekruis/IBF-system/commit/4678483663c939a851a67ef35a036b7230b56299))
* missing date attribute in mock endpoint call AB[#14721](https://github.com/rodekruis/IBF-system/issues/14721) ([2e7b5e2](https://github.com/rodekruis/IBF-system/commit/2e7b5e211fa0d5708454141430d46812150da718))
* only execute api-call if parameters match AB[#14744](https://github.com/rodekruis/IBF-system/issues/14744) ([8d7e50d](https://github.com/rodekruis/IBF-system/commit/8d7e50ddf87f186ebb1f5c8ae947065888522177))
* reiterate eventname AB[#14708](https://github.com/rodekruis/IBF-system/issues/14708) ([15ab37f](https://github.com/rodekruis/IBF-system/commit/15ab37f80b557839a58e7802c714aa4db7305dae))



# [0.173.0](https://github.com/rodekruis/IBF-system/compare/v0.172.1...v0.173.0) (2022-08-05)


### Bug Fixes

* switch event before api call AB[#14614](https://github.com/rodekruis/IBF-system/issues/14614) ([1e2696f](https://github.com/rodekruis/IBF-system/commit/1e2696f02fd64b7d13c2927e3f058bcee26145d2))
* use correct event on timeline click AB[#14614](https://github.com/rodekruis/IBF-system/issues/14614) ([8cfebca](https://github.com/rodekruis/IBF-system/commit/8cfebca27a819135ecbbe16a6fbac7783e4a92e2))


### Features

* replace current btn with text AB[#14642](https://github.com/rodekruis/IBF-system/issues/14642) ([9c5be2d](https://github.com/rodekruis/IBF-system/commit/9c5be2d6d4d31f3aa68f411214fc0f88f4a27420))
* split eventswitcher AB[#14542](https://github.com/rodekruis/IBF-system/issues/14542) ([6000cef](https://github.com/rodekruis/IBF-system/commit/6000cefd061843d16b15b9135a307790f372eacc))



## [0.172.1](https://github.com/rodekruis/IBF-system/compare/v0.172.0...v0.172.1) (2022-08-01)


### Bug Fixes

* correct mock data to 0-1 values AB[#14657](https://github.com/rodekruis/IBF-system/issues/14657) ([6de1272](https://github.com/rodekruis/IBF-system/commit/6de127226c3ca8b9bf87dd7ff99d681a8fad517a))



# [0.172.0](https://github.com/rodekruis/IBF-system/compare/v0.171.0...v0.172.0) (2022-08-01)


### Bug Fixes

* mention if not available AB[#14617](https://github.com/rodekruis/IBF-system/issues/14617) ([d84587d](https://github.com/rodekruis/IBF-system/commit/d84587dbeca7df6234ae68070452ebbc011c6759))


### Features

* change trigger statement to disastertype-specific AB[#14615](https://github.com/rodekruis/IBF-system/issues/14615) ([7adbd12](https://github.com/rodekruis/IBF-system/commit/7adbd12613a9b3dcddf701b3e34b82029bb7329a))
* get trigger statement by disastertype AB[#14617](https://github.com/rodekruis/IBF-system/issues/14617) ([2544580](https://github.com/rodekruis/IBF-system/commit/25445807f47462d8d3d87859c409c636bfb2b86b))



# [0.171.0](https://github.com/rodekruis/IBF-system/compare/v0.170.0...v0.171.0) (2022-08-01)


Expand Down Expand Up @@ -78,66 +132,3 @@



## [0.167.2](https://github.com/rodekruis/IBF-system/compare/v0.167.1...v0.167.2) (2022-07-08)


### Bug Fixes

* correct PHL floods eapLink AB[#14421](https://github.com/rodekruis/IBF-system/issues/14421) ([956d8ee](https://github.com/rodekruis/IBF-system/commit/956d8eec08488d2792466d55d3853742bf03227f))
* correct PHL trigger statement AB[#14421](https://github.com/rodekruis/IBF-system/issues/14421) ([ee65ccb](https://github.com/rodekruis/IBF-system/commit/ee65ccba83bb6221abed002b734ebfdf39e59d66))



## [0.167.1](https://github.com/rodekruis/IBF-system/compare/v0.167.0...v0.167.1) (2022-07-01)


### Bug Fixes

* update dam marker popup string AB[#14364](https://github.com/rodekruis/IBF-system/issues/14364) ([3c1c560](https://github.com/rodekruis/IBF-system/commit/3c1c560f9584eead21b498b2d875523edafdfb8e))



# [0.167.0](https://github.com/rodekruis/IBF-system/compare/v0.166.0...v0.167.0) (2022-07-01)


### Bug Fixes

* chat showing all municipalities AB[#14267](https://github.com/rodekruis/IBF-system/issues/14267) ([d603f5b](https://github.com/rodekruis/IBF-system/commit/d603f5b881fd1e17eab4292b376a2096124e7788))
* disable old-event scenario for typhoon AB[#14095](https://github.com/rodekruis/IBF-system/issues/14095) ([18e0844](https://github.com/rodekruis/IBF-system/commit/18e08448c3a191357adee476520d4a1a93efc626))
* number format exposed areas AB[#14186](https://github.com/rodekruis/IBF-system/issues/14186) ([450407d](https://github.com/rodekruis/IBF-system/commit/450407dc6457b34f1be58a3188d49eb8b8d1dd78))
* numberformat + aggregate calculation AB[#14211](https://github.com/rodekruis/IBF-system/issues/14211) ([f029024](https://github.com/rodekruis/IBF-system/commit/f029024ce4c85bd373353118749fb2edd0fdf4e5))
* remove empty brackets if no action-month AB[#14197](https://github.com/rodekruis/IBF-system/issues/14197) ([a9bcb2c](https://github.com/rodekruis/IBF-system/commit/a9bcb2c5cef3dfda2324751ae15ebfd59c75e54f))


### Features

* add PHL trigger statement AB[#14263](https://github.com/rodekruis/IBF-system/issues/14263) ([1fdc6d3](https://github.com/rodekruis/IBF-system/commit/1fdc6d33fc518b7f1fde69cd4806519148896343))
* change UX copy after SPD check AB[#14214](https://github.com/rodekruis/IBF-system/issues/14214) ([d83de73](https://github.com/rodekruis/IBF-system/commit/d83de7367686cd99ef75316e0e87a0de786c3a5b))
* handle 0-hours events AB[#14213](https://github.com/rodekruis/IBF-system/issues/14213) ([eb1301a](https://github.com/rodekruis/IBF-system/commit/eb1301a74186e1bf62ad2f0f7622e76807156d21))
* include no-landfall in mock scenarios AB[#14184](https://github.com/rodekruis/IBF-system/issues/14184) ([67c4221](https://github.com/rodekruis/IBF-system/commit/67c4221cc525ea69cb8b9fb6018b608dad7d0374))
* make email fit for multi-event AB[#14210](https://github.com/rodekruis/IBF-system/issues/14210) ([10ba1fe](https://github.com/rodekruis/IBF-system/commit/10ba1fedb3dbedae383691ab275e54b7f2f8120b))
* make ux copy generic for no-landfall case AB[#14185](https://github.com/rodekruis/IBF-system/issues/14185) ([4ec6107](https://github.com/rodekruis/IBF-system/commit/4ec610706936e222df36c95f53c3b6e5c205f707))
* make ux copy of live event generic for no-landfall case AB[#14194](https://github.com/rodekruis/IBF-system/issues/14194) ([b5d66d7](https://github.com/rodekruis/IBF-system/commit/b5d66d76e0a9442bab0d739eae72bac79fc7bd62))
* mention eventname + trhreshold-reached AB[#14212](https://github.com/rodekruis/IBF-system/issues/14212) ([72237a6](https://github.com/rodekruis/IBF-system/commit/72237a6b257ca0977672fe5ff172fab9d5618f91))
* no landfall track data AB[#14183](https://github.com/rodekruis/IBF-system/issues/14183) ([8bf9bb9](https://github.com/rodekruis/IBF-system/commit/8bf9bb941a6a506673b32edb194cb53c8dd3baaa))
* process no landfall events AB[#14214](https://github.com/rodekruis/IBF-system/issues/14214) ([23041e6](https://github.com/rodekruis/IBF-system/commit/23041e685a3120b4f726733a927e02906bfb75b0))
* update typhoon track AB[#14313](https://github.com/rodekruis/IBF-system/issues/14313) ([4f2b936](https://github.com/rodekruis/IBF-system/commit/4f2b93651804cc4382ff1176120cfadda3856ec8))



# [0.166.0](https://github.com/rodekruis/IBF-system/compare/v0.165.0...v0.166.0) (2022-07-01)


### Bug Fixes

* add missing popup text AB[#14360](https://github.com/rodekruis/IBF-system/issues/14360) ([d67f882](https://github.com/rodekruis/IBF-system/commit/d67f882d7abf0c5f60618c7ffa11699260b5146c))
* remove unwanted characters from xlsx AB[#14320](https://github.com/rodekruis/IBF-system/issues/14320) ([22fb60e](https://github.com/rodekruis/IBF-system/commit/22fb60e07403e52aeef93437edb287428416249d))
* sort xlsx AB[#14320](https://github.com/rodekruis/IBF-system/issues/14320) ([d9dc121](https://github.com/rodekruis/IBF-system/commit/d9dc121efdd069f45a5db37d3baa390d10ac2103))


### Features

* process new layers AB[#13978](https://github.com/rodekruis/IBF-system/issues/13978) ([2e44ff4](https://github.com/rodekruis/IBF-system/commit/2e44ff4fba613f4f33b32182c6b5dc19442f03bf))



Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@
></p>
</app-dialogue-turn>
<!-- Active event -->
<app-dialogue-turn
*ngIf="eventState?.activeEvent && eventState?.activeTrigger"
isConnected="true"
>
<ng-container *ngFor="let event of eventState?.events">
<ng-container *ngIf="eventState?.activeEvent && eventState?.activeTrigger">
<app-dialogue-turn
*ngFor="let event of eventState?.events"
[isTriggered]="event.thresholdReached"
[isNotTriggered]="!event.thresholdReached"
[isSelected]="event.eventName === eventState?.event.eventName"
isConnected="true"
>
<p *ngIf="event.activeTrigger && event.thresholdReached">
<span
[innerHTML]="
Expand Down Expand Up @@ -94,8 +97,7 @@
}
"
></p>
</ng-container>
<ng-container *ngFor="let event of eventState?.events">

<p
*ngIf="event.activeTrigger && !event.thresholdReached"
[innerHTML]="
Expand All @@ -110,20 +112,20 @@
}
"
></p>
</ng-container>

<app-event-switcher></app-event-switcher>
<app-event-switcher [event]="event"></app-event-switcher>

<p *ngIf="forecastInfo && country?.countryCodeISO3 === 'ZWE'">
{{ forecastInfo }}
</p>
<p *ngIf="forecastInfo && country?.countryCodeISO3 === 'ZWE'">
{{ forecastInfo }}
</p>

<p
class="clear-out-message"
*ngIf="!!clearOutMessage"
[innerHTML]="clearOutMessage"
></p>
</app-dialogue-turn>
<p
class="clear-out-message"
*ngIf="!!clearOutMessage"
[innerHTML]="clearOutMessage"
></p>
</app-dialogue-turn>
</ng-container>
<!-- Old event -->
<app-dialogue-turn *ngIf="eventService.isOldEvent()" isConnected="true">
<p
Expand Down Expand Up @@ -161,12 +163,13 @@
[isTriggered]="true"
>
<p
[translate]="
[innerHTML]="
'chat-component.' + disasterTypeName + '.active-event.overview'
| translate
: {
nrTriggeredAreas: activeAreas.length,
adminAreaLabelPlural: adminAreaLabelPlural,
eventName: eventState?.event.eventName,
actionIndicator: actionIndicatorLabel
}
"
Expand Down Expand Up @@ -201,12 +204,13 @@
[isStopped]="true"
>
<p
[translate]="
[innerHTML]="
'chat-component.' + disasterTypeName + '.stopped-event.overview'
| translate
: {
nrStoppedAreas: stoppedAreas.length,
adminAreaLabelPlural: adminAreaLabelPlural,
eventName: eventState?.event.eventName,
actionIndicator: actionIndicatorLabel
}
"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ export class ChatComponent implements OnInit, OnDestroy {

private onEventStateChange = (eventState: EventState) => {
this.eventState = eventState;
this.eventState?.events?.sort((a, b) =>
Number(a.firstLeadTime?.split('-')[0]) >
Number(b.firstLeadTime?.split('-')[0])
? 1
: a.startDate > b.startDate
? 1
: -1,
);
};

private onTimelineStateChange = (timelineState: TimelineState) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
'is-spoken': animate && isSpoken,
'is-warn': isWarn,
'is-stopped': isStopped,
'is-triggered': isTriggered
'is-triggered': isTriggered,
'is-not-triggered': isNotTriggered,
'is-selected': isSelected
}"
>
<div class="dialogue-turn--actor">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,29 @@
}
}

.dialogue-turn.is-not-triggered {
.dialogue-turn--content {
ion-card {
background-color: var(--ion-color-ibf-no-alert-tertiary) !important;
color: var(--ion-color-ibf-black) !important;
}
}
}

.dialogue-turn.is-triggered {
.dialogue-turn--content {
ion-card {
border: var(--ion-color-ibf-outline-red) solid 2px;
background-color: var(--ion-color-ibf-trigger-alert-tertiary) !important;
color: var(--ion-color-ibf-trigger-alert-tertiary-contrast) !important;
border: var(--ion-color-ibf-outline-red) solid 1px;
}
}

&.is-selected {
.dialogue-turn--content {
ion-card {
border: var(--ion-color-ibf-outline-red) solid 2px;
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ export class DialogueTurnComponent implements OnInit {
@Input()
isTriggered = false;

@Input()
isNotTriggered = false;

@Input()
isSelected = true;

isSelf: boolean;
isSystem: boolean;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
<div *ngIf="multipleActiveEvents()" class="containerDiv">
<div *ngFor="let event of eventState?.events">
<div>
<ion-button
class="ibf event-switch-button"
[class.triggered]="event.thresholdReached"
[class.selected]="event.eventName === selectedEventName"
shape="block"
slot="start"
[color]="getColor(event)"
size="small"
(click)="switchEvent(event)"
>
{{ event.eventName }}
</ion-button>
</div>
<div *ngIf="multipleActiveEvents()">
<div *ngIf="event.eventName === selectedEventName">
<p>
<strong>{{
'chat-component.typhoon.event-switcher.current-event-message'
| translate
}}</strong>
</p>
</div>
<div class="containerDiv">
<ion-button
*ngIf="event.eventName !== selectedEventName"
class="ibf event-switch-button"
[class.triggered]="event.thresholdReached"
[class.selected]="event.eventName === selectedEventName"
shape="block"
slot="start"
[color]="getColor(event)"
size="small"
(click)="switchEvent(event)"
>
{{
'chat-component.typhoon.event-switcher.switch-event-button-prefix'
| translate
}}{{ event.eventName }}
</ion-button>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
p {
font-size: 12px;
}

.active {
background-color: var(--ion-color-ibf-chat-self);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnDestroy, OnInit } from '@angular/core';
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
import { Subscription } from 'rxjs';
import { EventService, EventSummary } from 'src/app/services/event.service';
import { EventState } from 'src/app/types/event-state';
Expand All @@ -13,7 +13,6 @@ import { TimelineService } from '../../services/timeline.service';
styleUrls: ['./event-switcher.component.scss'],
})
export class EventSwitcherComponent implements OnInit, OnDestroy {
public events: EventSummary[] = [];
public selectedEventName: string;
public eventState: EventState;
public timelineState: TimelineState;
Expand All @@ -24,6 +23,9 @@ export class EventSwitcherComponent implements OnInit, OnDestroy {
private manualEventStateSubscription: Subscription;
private timelineStateSubscription: Subscription;

@Input()
public event: EventSummary;

constructor(
private disasterTypeService: DisasterTypeService,
public eventService: EventService,
Expand Down Expand Up @@ -87,13 +89,15 @@ export class EventSwitcherComponent implements OnInit, OnDestroy {

public switchEvent(event: EventSummary): void {
this.selectedEventName = event.eventName;

if (this.timelineState.timeStepButtons?.length) {
// Call eventService directly instead of via timelineService, to avoid cyclical dependency between event- and timeline service
this.eventService.switchEvent(event.eventName);

if (event.firstLeadTime !== this.timelineState.activeLeadTime) {
// Only do this, when leadtime actually changes (so not for typhoon case with 2 events with same leadtime)
this.timelineService.handleTimeStepButtonClick(event.firstLeadTime);
}
// Call eventService directly instead of via timelineService, to avoid cyclical dependency between event- and timeline service
this.eventService.switchEvent(event.eventName);
}
}

Expand Down
Loading

0 comments on commit 24737f9

Please sign in to comment.