Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: breadcrumbs #1458

Merged
merged 83 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
1bc7971
WIP breadcrumb button l&f
arsforza Sep 18, 2023
e5c1c8b
refactor: create MapView service AB#23655
arsforza Sep 21, 2023
d305b5c
fix: lint
arsforza Sep 21, 2023
a32a174
feat: load districts in national view AB#23762
jannisvisser Sep 22, 2023
2cb1de9
fix: revert unused change AB#23762
jannisvisser Sep 22, 2023
ffbd9be
fix: move code to new service AB#23762
jannisvisser Sep 25, 2023
7f5c3b3
Merge branch 'master' of https://github.com/rodekruis/IBF-system into…
jannisvisser Sep 25, 2023
4899a6e
fix: event areas in separate entity AB#23762
jannisvisser Sep 25, 2023
314dba7
Merge branch 'feat.load-event-areas-national-view' of https://github.…
arsforza Sep 25, 2023
f0ac543
fix: test
jannisvisser Sep 25, 2023
c7d59f3
Merge branch 'feat.breadcrumbs' of https://github.com/rodekruis/IBF-s…
arsforza Sep 25, 2023
7eaddc3
feat: add breadcrumbs to adminLevel AB#23652
arsforza Sep 28, 2023
58d7af5
fix: translation + prettier AB#23653
arsforza Sep 28, 2023
47545af
feat: show also non-triggered TAs mock AB#23763
jannisvisser Sep 29, 2023
72b2914
Merge branch 'master' of https://github.com/rodekruis/IBF-system into…
jannisvisser Oct 2, 2023
6d95180
fix: add changedetector AB#23895
jannisvisser Oct 2, 2023
332b1f5
refactor: small AB#23895
jannisvisser Oct 2, 2023
e13f709
lint
jannisvisser Oct 2, 2023
0650e1c
fix: clear placecode on admin area switch AB#23925
arsforza Oct 2, 2023
dad34db
fix: change too long btn texts
jannisvisser Oct 2, 2023
dd53286
fix: rm closing X btn AB#23901
jannisvisser Oct 2, 2023
74d9447
fix: ibf-button
jannisvisser Oct 2, 2023
3a53e4a
feat: make single-admin work AB#23901
jannisvisser Oct 2, 2023
eb5c50f
feat: enable breadcrumbs for floods AB#23921
jannisvisser Oct 2, 2023
8230ede
style: move and resize breadcrumbs AB#23653
arsforza Oct 2, 2023
ad4ab1b
style: update font size of layers menu AB#23653
arsforza Oct 2, 2023
92d7a62
feat: zoom in and out 1 level AB#23927
jannisvisser Oct 2, 2023
e988faa
feat: zoom in and out to deeper levels AB#23927
jannisvisser Oct 6, 2023
a2b744a
Merge branch 'feat.breadcrumbs' of https://github.com/rodekruis/IBF-s…
jannisvisser Oct 6, 2023
3adcbe8
fix: revert as this now works different AB#23925
jannisvisser Oct 6, 2023
600baaf
fix: aggregate values on deeper levels AB#23931
jannisvisser Oct 6, 2023
0bca20c
fix: bug AB#23927
jannisvisser Oct 6, 2023
bff6ff4
feat: show N/A for action summary on deeper levels AB#23923
jannisvisser Oct 6, 2023
e2ed372
feat: multiple admin-area breadcrumbs AB#23922
jannisvisser Oct 6, 2023
8633df3
fix: set hovering behaviour above other logic AB#24040
jannisvisser Oct 6, 2023
8b45320
fix: also apply parentPlaceCode filter on aggregates endpoint AB#24040
jannisvisser Oct 6, 2023
e6557e1
fix: mock alert_threshold to 1 if triggered + rm unused levels AB#23921
jannisvisser Oct 9, 2023
27508d6
Merge pull request #1469 from rodekruis/feat.breadcrumbs-non-event
jannisvisser Oct 9, 2023
e4774aa
fix: explanatory comments AB#24042
jannisvisser Oct 9, 2023
c9bb22b
WIP handle mapview in aggregates header AB#23761
arsforza Oct 9, 2023
d107179
fix: include warning areas in counter AB#24056
jannisvisser Oct 9, 2023
963547f
feat: add isEventBased AB#24055
arsforza Oct 9, 2023
08c0ccd
feat: process isEventBased AB#24055
jannisvisser Oct 9, 2023
50573e4
fix: navy outline on hover on warned area AB#24058
jannisvisser Oct 9, 2023
3818e83
feat: show all event-areas if non-triggered AB#24061
jannisvisser Oct 9, 2023
a695160
lint
jannisvisser Oct 9, 2023
ab7f530
fix: header hovering behaviour AB#24057
jannisvisser Oct 9, 2023
b0e58b7
fix: also fix middle column headers for multi-admin AB#23933
jannisvisser Oct 9, 2023
8d7a0d6
feat: use isEventBased AB#24055
arsforza Oct 9, 2023
c321492
lint
jannisvisser Oct 9, 2023
7e99cf4
Merge branch 'feat.breadcrumbs' of https://github.com/rodekruis/IBF-s…
arsforza Oct 9, 2023
d5bb073
Merge branch 'feat.breadcrumbs' of https://github.com/rodekruis/IBF-s…
arsforza Oct 9, 2023
cf01e78
feat: show diffent no-actions text AB#24048
jannisvisser Oct 9, 2023
cf34fd0
Merge branch 'feat.breadcrumbs' of https://github.com/rodekruis/IBF-s…
jannisvisser Oct 9, 2023
b0c36bf
fix: 1 event area AB#24074
jannisvisser Oct 9, 2023
0bccd9d
fix: add exposedPrefix manually stopped AB#24074
jannisvisser Oct 9, 2023
75e12f4
fix: hide stop trigger btn on deeper levels AB#24074
jannisvisser Oct 9, 2023
b9759df
feat: add translations AB#24059
arsforza Oct 12, 2023
509e8f1
fix: prettier
arsforza Oct 12, 2023
9ec9445
fix: move UG203701 to parent 21UGA003004 AB#23934
arsforza Oct 12, 2023
ac1bc3b
fix: update UGA floods mock data AB#23934
arsforza Oct 12, 2023
1f9256c
fix: translations AB#24059
jannisvisser Oct 13, 2023
34a4a77
fix: replace subscription with function AB#24055
arsforza Oct 13, 2023
5b17736
fix: replace missed disaster settings AB#24055
arsforza Oct 13, 2023
2be55c3
fix: update alert_threshold AB#23934
arsforza Oct 13, 2023
7f249de
fix: make stopped areas work on deeper levels AB#24076
jannisvisser Oct 13, 2023
9a84cfb
Merge branch 'feat.breadcrumbs' of https://github.com/rodekruis/IBF-s…
jannisvisser Oct 13, 2023
b95a03a
lint
jannisvisser Oct 13, 2023
73fc00d
fix: pass country/disasterType as arguments to method AB#24055
jannisvisser Oct 13, 2023
bb77ac2
fix: ZWE mock AB#24043
jannisvisser Oct 13, 2023
9020587
fix: show 'drought' instead of eventName fof ZWE drought AB#24043
jannisvisser Oct 13, 2023
0758fca
fix: all = back AB#24139
jannisvisser Oct 13, 2023
df958c0
fix: rm popup + back on area click AB#24138
arsforza Oct 13, 2023
ad14126
fix: show which area selected in warning event + related border chang…
jannisvisser Oct 13, 2023
f237f77
Merge branch 'feat.breadcrumbs' of https://github.com/rodekruis/IBF-s…
arsforza Oct 13, 2023
5d23bdb
Merge branch 'feat.breadcrumbs' of https://github.com/rodekruis/IBF-s…
jannisvisser Oct 13, 2023
58091a6
lint
jannisvisser Oct 13, 2023
330a0e5
fix: adjust breadcrumbs border AB#24141
arsforza Oct 13, 2023
38fd1bb
fix: improve zooming AB#24144
jannisvisser Oct 13, 2023
5b14182
fix: update populatio_affected AB#23934
arsforza Oct 13, 2023
7b2ee9b
fix: prevent undefined AB#24074
arsforza Oct 16, 2023
3cb7c9a
fix: exclude ZWE from 3-month rule AB#24043
jannisvisser Oct 16, 2023
366572a
Merge branch 'feat.breadcrumbs' of https://github.com/rodekruis/IBF-s…
jannisvisser Oct 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions interfaces/IBF-dashboard/src/app/auth/auth.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ export class AuthGuard implements CanActivate {
| UrlTree {
const url: string = state.url;

return this.checkLogin(url, next);
return this.checkLogin(url);
}

checkLogin(url: string, route: ActivatedRouteSnapshot): boolean {
checkLogin(url: string): boolean {
if (this.authService.isLoggedIn()) {
console.log('route: ', route);
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import {
AnalyticsPage,
} from 'src/app/analytics/analytics.enum';
import { AnalyticsService } from 'src/app/analytics/analytics.service';
import { Country, DisasterType } from 'src/app/models/country.model';
import {
Country,
CountryDisasterSettings,
DisasterType,
} from 'src/app/models/country.model';
import { CountryService } from 'src/app/services/country.service';
import { EventService } from 'src/app/services/event.service';
import { DisasterTypeService } from '../../services/disaster-type.service';
Expand All @@ -23,6 +27,7 @@ export class AboutBtnComponent implements OnDestroy {
private countrySubscription: Subscription;
private disasterType: DisasterType;
private disasterTypeSubscription: Subscription;
private countryDisasterSettings: CountryDisasterSettings;

constructor(
private countryService: CountryService,
Expand Down Expand Up @@ -50,6 +55,10 @@ export class AboutBtnComponent implements OnDestroy {

private onDisasterTypeChange = (disasterType: DisasterType) => {
this.disasterType = disasterType;
this.countryDisasterSettings = this.disasterTypeService.getCountryDisasterTypeSettings(
this.country,
this.disasterType,
);
};

public btnAction() {
Expand All @@ -60,11 +69,7 @@ export class AboutBtnComponent implements OnDestroy {
});

if (this.country && this.disasterType) {
window.open(
this.country.countryDisasterSettings.find(
(s) => s.disasterType === this.disasterType.disasterType,
).eapLink,
);
window.open(this.countryDisasterSettings?.eapLink);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,54 +1,118 @@
<div class="ion-padding-top ibf-admin-level-buttons">
<ion-button
*ngIf="getAdminLevelLabel(adminLevel.adminLevel1)"
size="small"
class="ibf-admin-level-button"
fill="solid"
[color]="
isAdminLevelActive(adminLevel.adminLevel1) ? 'ibf-primary' : 'ibf-white'
"
[disabled]="isAdminLevelDisabled(adminLevel.adminLevel1)"
(click)="clickAdminLevelButton(adminLevel.adminLevel1)"
>
{{ getAdminLevelLabel(adminLevel.adminLevel1) }}
</ion-button>
<ion-button
*ngIf="getAdminLevelLabel(adminLevel.adminLevel2)"
size="small"
class="ibf-admin-level-button"
fill="solid"
[color]="
isAdminLevelActive(adminLevel.adminLevel2) ? 'ibf-primary' : 'ibf-white'
"
[disabled]="isAdminLevelDisabled(adminLevel.adminLevel2)"
(click)="clickAdminLevelButton(adminLevel.adminLevel2)"
>
{{ getAdminLevelLabel(adminLevel.adminLevel2) }}
</ion-button>
<ion-button
*ngIf="getAdminLevelLabel(adminLevel.adminLevel3)"
size="small"
class="ibf-admin-level-button"
fill="solid"
[color]="
isAdminLevelActive(adminLevel.adminLevel3) ? 'ibf-primary' : 'ibf-white'
"
[disabled]="isAdminLevelDisabled(adminLevel.adminLevel3)"
(click)="clickAdminLevelButton(adminLevel.adminLevel3)"
>
{{ getAdminLevelLabel(adminLevel.adminLevel3) }}
</ion-button>
<ion-button
*ngIf="getAdminLevelLabel(adminLevel.adminLevel4)"
size="small"
class="ibf-admin-level-button"
fill="solid"
[color]="
isAdminLevelActive(adminLevel.adminLevel4) ? 'ibf-primary' : 'ibf-white'
"
[disabled]="isAdminLevelDisabled(adminLevel.adminLevel4)"
(click)="clickAdminLevelButton(adminLevel.adminLevel4)"
>
{{ getAdminLevelLabel(adminLevel.adminLevel4) }}
</ion-button>
</div>
<ng-container
*ngIf="useBreadcrumbs(disasterType); then breadcrumbs; else tabs"
></ng-container>
<ng-template #breadcrumbs>
<div class="ion-margin-start breadcrumbs-container">
<ion-button
*ngIf="showBreadcrumb(mapViewEnum.national)"
class="breadcrumb"
[ngClass]="
currentMapView === mapViewEnum.national
? 'breadcrumb-alone'
: 'breadcrumb-start'
"
[class.selected]="currentMapView === mapViewEnum.national"
(click)="
clickBreadcrumbButton(
mapViewEnum.national,
currentMapView === mapViewEnum.national
)
"
>
{{ 'breadcrumbs.national-view' | translate }}
</ion-button>
<ion-button
*ngIf="showBreadcrumb(mapViewEnum.event)"
class="breadcrumb"
[ngClass]="
currentMapView === mapViewEnum.event
? 'breadcrumb-end'
: 'breadcrumb-middle'
"
[class.selected]="currentMapView === mapViewEnum.event"
(click)="
clickBreadcrumbButton(
mapViewEnum.event,
currentMapView === mapViewEnum.event
)
"
>
{{ eventState?.event?.eventName }}
</ion-button>
<ion-button
*ngIf="showBreadcrumb(mapViewEnum.adminArea)"
class="breadcrumb"
[ngClass]="
currentMapView === mapViewEnum.adminArea
? 'breadcrumb-end'
: 'breadcrumb-middle'
"
[class.selected]="currentMapView === mapViewEnum.adminArea"
(click)="
clickBreadcrumbButton(
mapViewEnum.adminArea,
currentMapView === mapViewEnum.adminArea
)
"
[innerHtml]="
currentMapView === mapViewEnum.adminArea
? placeCode?.placeCodeName
: currentMapView === mapViewEnum.adminArea2
? placeCode?.placeCodeParent?.placeCodeName
: placeCode?.placeCodeParent?.placeCodeParent?.placeCodeName
"
>
</ion-button>
<ion-button
*ngIf="showBreadcrumb(mapViewEnum.adminArea2)"
class="breadcrumb"
[ngClass]="
currentMapView === mapViewEnum.adminArea2
? 'breadcrumb-end'
: 'breadcrumb-middle'
"
[class.selected]="currentMapView === mapViewEnum.adminArea2"
(click)="
clickBreadcrumbButton(
mapViewEnum.adminArea2,
currentMapView === mapViewEnum.adminArea2
)
"
[innerHtml]="
currentMapView === mapViewEnum.adminArea2
? placeCode?.placeCodeName
: placeCode?.placeCodeParent?.placeCodeName
"
>
</ion-button>
<ion-button
*ngIf="showBreadcrumb(mapViewEnum.adminArea3)"
class="breadcrumb breadcrumb-end"
[class.selected]="currentMapView === mapViewEnum.adminArea3"
(click)="
clickBreadcrumbButton(
mapViewEnum.adminArea3,
currentMapView === mapViewEnum.adminArea3
)
"
>
{{ placeCode?.placeCodeName }}
</ion-button>
</div>
</ng-template>
<ng-template #tabs>
<div class="ion-margin-start breadcrumbs-container">
<ion-button
*ngFor="let button of adminLevelButtons | async"
size="small"
fill="solid"
class="breadcrumb"
[ngClass]="button.buttonTypeClass"
[class.selected]="isAdminLevelActive(button.adminLevel, button.disabled)"
[disabled]="button.disabled"
(click)="clickAdminLevelButton(button.adminLevel)"
>
{{ button.label }}
</ion-button>
</div>
</ng-template>
Original file line number Diff line number Diff line change
@@ -1,17 +1,41 @@
.ibf-admin-level-buttons {
margin-left: 5px;
.ibf-admin-level-button {
margin-left: 0px;
margin-right: 0px;
text-transform: uppercase;
height: 16px;
font-size: 7px;
font-weight: 700;
.breadcrumbs-container {
margin-top: 20px;
}

.breadcrumb {
height: var(--breadcrumb-height);
font-size: 12px;

margin: 0;
--box-shadow: none;

--background: var(--ion-color-ibf-white);
--border-color: var(--ion-color-ibf-no-alert-primary);
--border-width: 2px;
--border-style: solid;
--color: var(--ion-color-ibf-no-alert-primary);

&.selected {
--background: var(--ion-color-ibf-no-alert-primary);

--color: var(--ion-color-ibf-white);
}
}

ion-button {
border: 1px solid var(--ion-color-ibf-primary);
.breadcrumb-start {
--border-width: 2px 0px 2px 2px;
--border-radius: var(--breadcrumb-radius) 0 0 var(--breadcrumb-radius);
}

.breadcrumb-middle {
--border-radius: 0;
--box-shadow: none;
--border-width: 2px 0px 2px 2px;
}

.breadcrumb-end {
--border-radius: 0 var(--breadcrumb-radius) var(--breadcrumb-radius) 0;
}

.breadcrumb-alone {
--border-radius: var(--breadcrumb-radius);
}
Loading
Loading