From 7140beb48bde9cdc090a52206f9a686038c624ba Mon Sep 17 00:00:00 2001 From: jannisvisser Date: Mon, 16 Dec 2024 13:09:07 +0100 Subject: [PATCH] chore: automatic fixes IBF-dashboard --- .../src/app/analytics/analytics.enum.ts | 32 ++--- .../src/app/analytics/analytics.service.ts | 10 +- .../src/app/analytics/severity-level.model.ts | 1 + .../src/app/app-routing.module.ts | 2 +- .../src/app/app.component.spec.ts | 2 +- .../IBF-dashboard/src/app/app.module.ts | 8 +- .../IBF-dashboard/src/app/auth/auth.guard.ts | 4 +- .../src/app/auth/auth.service.ts | 4 +- .../about-btn/about-btn.component.ts | 2 +- .../action-result-popover.component.spec.ts | 2 +- .../activation-log-button.component.ts | 6 +- .../admin-level/admin-level.component.ts | 36 +++-- .../areas-of-focus-summary.component.ts | 27 ++-- .../src/app/components/chat/chat.component.ts | 24 ++-- .../community-notification-popup.component.ts | 10 +- .../date-button/date-button.component.ts | 8 +- .../dialogue-turn.component.spec.ts | 2 +- .../disaster-type/disaster-type.component.ts | 13 +- .../disclaimer-approximate.component.spec.ts | 3 +- .../disclaimer-toolbar.component.spec.ts | 2 +- .../disclaimer-toolbar.component.ts | 2 +- .../event-speech-bubble.component.ts | 28 ++-- .../event-switcher.component.ts | 10 +- .../export-view-popover.component.spec.ts | 2 +- .../export-view-popover.component.ts | 6 +- .../forgot-password-popover.component.spec.ts | 2 +- .../ibf-button/ibf-button.component.spec.ts | 2 +- .../ibf-guide-button.component.ts | 6 +- .../ibf-guide-popover.component.spec.ts | 10 +- ...yer-control-info-popover.component.spec.ts | 2 +- .../dynamic-point-popup.component.ts | 8 +- .../river-gauge-popup-content.component.ts | 2 +- .../login-form/login-form.component.ts | 2 +- .../app/components/logos/logos.component.ts | 2 +- .../map-controls.component.spec.ts | 2 +- .../src/app/components/map/map.component.ts | 20 +-- ...reen-orientation-popover.component.spec.ts | 2 +- .../components/timeline/timeline.component.ts | 8 +- .../timestamp/timestamp.component.spec.ts | 2 +- .../toggle-trigger-popover.component.spec.ts | 2 +- .../toggle-trigger-popover.component.ts | 4 +- .../tooltip-popover.component.spec.ts | 2 +- .../tooltip/tooltip.component.spec.ts | 2 +- .../components/tooltip/tooltip.component.ts | 2 +- .../user-state/user-state.component.ts | 8 +- .../src/app/models/country.model.ts | 21 ++- .../src/app/models/place-code.model.ts | 2 +- .../src/app/models/user/user.model.ts | 4 +- .../activation-log/activation.log.page.ts | 10 +- .../dashboard/dashboard-routing.module.ts | 6 +- .../app/pages/dashboard/dashboard.module.ts | 8 +- .../src/app/pages/dashboard/dashboard.page.ts | 4 +- .../status-report/status-report.page.ts | 34 ++--- .../app/pages/login/login-routing.module.ts | 2 +- .../src/app/pages/login/login.module.ts | 6 +- .../src/app/pipes/compact.pipe.spec.ts | 2 +- .../src/app/pipes/compact.pipe.ts | 2 +- .../src/app/services/admin-level.service.ts | 26 ++-- .../src/app/services/aggregates.service.ts | 32 ++--- .../src/app/services/api.service.ts | 34 ++--- .../app/services/auth.interceptor.service.ts | 10 +- .../src/app/services/country.service.ts | 8 +- .../src/app/services/disaster-type.service.ts | 6 +- .../src/app/services/eap-actions.service.ts | 30 ++-- .../src/app/services/event.service.ts | 28 ++-- .../services/loader.interceptor.service.ts | 2 +- .../src/app/services/loader.service.spec.ts | 2 +- .../src/app/services/map-legend.service.ts | 25 ++-- .../src/app/services/map-view.service.ts | 18 +-- .../app/services/place-code.service.spec.ts | 2 +- .../src/app/services/point-marker.service.ts | 25 ++-- .../src/app/services/timeline.service.ts | 34 ++--- .../IBF-dashboard/src/app/shared.module.ts | 90 ++++++------ .../src/app/types/admin-level.ts | 6 +- .../src/app/types/disaster-type-key.ts | 6 +- .../src/app/types/event-state.ts | 2 +- .../IBF-dashboard/src/app/types/ibf-layer.ts | 134 +++++++++--------- .../src/app/types/indicator-group.ts | 8 +- .../IBF-dashboard/src/app/types/lead-time.ts | 1 + .../IBF-dashboard/src/app/types/map-view.ts | 4 +- .../src/app/types/timeline-state.ts | 2 +- .../src/app/types/triggered-area.ts | 6 +- interfaces/IBF-dashboard/src/main.ts | 10 +- interfaces/IBF-dashboard/src/polyfills.ts | 4 +- interfaces/IBF-dashboard/src/test.ts | 1 + 85 files changed, 500 insertions(+), 493 deletions(-) diff --git a/interfaces/IBF-dashboard/src/app/analytics/analytics.enum.ts b/interfaces/IBF-dashboard/src/app/analytics/analytics.enum.ts index b82a2e71b..ab6e42774 100644 --- a/interfaces/IBF-dashboard/src/app/analytics/analytics.enum.ts +++ b/interfaces/IBF-dashboard/src/app/analytics/analytics.enum.ts @@ -1,30 +1,30 @@ export enum AnalyticsPage { - login = 'login', - dashboard = 'dashboard', activationLog = 'activation-Log', + dashboard = 'dashboard', + login = 'login', } export enum AnalyticsEvent { - watchIbfGuide = 'watch-ibf-guide', aboutTrigger = 'about-trigger', - aggregateInformation = 'aggregate-information', adminLevel = 'admin-level', - mapLayer = 'map-layer', - mapLayerInformation = 'map-layer-information', - exportView = 'export-view', - logOut = 'log-out', + aggregateInformation = 'aggregate-information', + communityNotification = 'community-notification', + damSite = 'dam', eapAction = 'eap-action', eapSubmit = 'eap-submit', - waterPoint = 'water-point', - redCrossBranch = 'red-cross-branch', + evacuationCenter = 'evacuation-center', + exportView = 'export-view', + glofasStation = 'glofas-station', healthSite = 'health-site', - damSite = 'dam', + leadTime = 'lead-time', + logOut = 'log-out', + mapLayer = 'map-layer', + mapLayerInformation = 'map-layer-information', mapMarker = 'map-marker', - glofasStation = 'glofas-station', - typhoonTrack = 'typhoon-track', mapPlaceSelect = 'map-place-select', - leadTime = 'lead-time', + redCrossBranch = 'red-cross-branch', stopTrigger = 'stop-trigger', - evacuationCenter = 'evacuation-center', - communityNotification = 'community-notification', + typhoonTrack = 'typhoon-track', + watchIbfGuide = 'watch-ibf-guide', + waterPoint = 'water-point', } diff --git a/interfaces/IBF-dashboard/src/app/analytics/analytics.service.ts b/interfaces/IBF-dashboard/src/app/analytics/analytics.service.ts index cca8b18ae..d22502b0c 100644 --- a/interfaces/IBF-dashboard/src/app/analytics/analytics.service.ts +++ b/interfaces/IBF-dashboard/src/app/analytics/analytics.service.ts @@ -4,10 +4,10 @@ import { ITelemetryItem, } from '@microsoft/applicationinsights-web'; import { SeverityLevel } from 'src/app/analytics/severity-level.model'; +import { DEBUG_LOG } from 'src/app/config'; +import { Country } from 'src/app/models/country.model'; +import { CountryService } from 'src/app/services/country.service'; import { environment } from 'src/environments/environment'; -import { DEBUG_LOG } from '../config'; -import { Country } from '../models/country.model'; -import { CountryService } from '../services/country.service'; @Injectable({ providedIn: 'root', @@ -72,7 +72,7 @@ export class AnalyticsService { logEvent( name: string, - properties?: { [key: string]: string | number | boolean }, + properties?: Record, ): void { if (this.isApplicationInsightsEnabled) { this.applicationInsights.trackEvent({ name }, properties); @@ -94,7 +94,7 @@ export class AnalyticsService { logTrace( message: string, - properties?: { [key: string]: string | number | boolean }, + properties?: Record, ) { if (this.isApplicationInsightsEnabled) { this.applicationInsights.trackTrace({ message }, properties); diff --git a/interfaces/IBF-dashboard/src/app/analytics/severity-level.model.ts b/interfaces/IBF-dashboard/src/app/analytics/severity-level.model.ts index 36eb3d79d..70fcd38f4 100644 --- a/interfaces/IBF-dashboard/src/app/analytics/severity-level.model.ts +++ b/interfaces/IBF-dashboard/src/app/analytics/severity-level.model.ts @@ -1,3 +1,4 @@ +/* eslint-disable perfectionist/sort-enums */ // Application Insights Severity Level export enum SeverityLevel { Verbose = 0, diff --git a/interfaces/IBF-dashboard/src/app/app-routing.module.ts b/interfaces/IBF-dashboard/src/app/app-routing.module.ts index e3a194c50..d950da6f5 100644 --- a/interfaces/IBF-dashboard/src/app/app-routing.module.ts +++ b/interfaces/IBF-dashboard/src/app/app-routing.module.ts @@ -1,6 +1,6 @@ import { NgModule } from '@angular/core'; import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; -import { AuthGuard } from './auth/auth.guard'; +import { AuthGuard } from 'src/app/auth/auth.guard'; const routes: Routes = [ { diff --git a/interfaces/IBF-dashboard/src/app/app.component.spec.ts b/interfaces/IBF-dashboard/src/app/app.component.spec.ts index 2bec23747..24678d848 100644 --- a/interfaces/IBF-dashboard/src/app/app.component.spec.ts +++ b/interfaces/IBF-dashboard/src/app/app.component.spec.ts @@ -2,7 +2,7 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { TestBed, waitForAsync } from '@angular/core/testing'; import { Platform } from '@ionic/angular'; import { TranslateModule } from '@ngx-translate/core'; -import { AppComponent } from './app.component'; +import { AppComponent } from 'src/app/app.component'; describe('AppComponent', () => { let platformReadySpy; diff --git a/interfaces/IBF-dashboard/src/app/app.module.ts b/interfaces/IBF-dashboard/src/app/app.module.ts index f41fe1d19..803639798 100644 --- a/interfaces/IBF-dashboard/src/app/app.module.ts +++ b/interfaces/IBF-dashboard/src/app/app.module.ts @@ -1,6 +1,6 @@ import { - HttpClient, HTTP_INTERCEPTORS, + HttpClient, provideHttpClient, withInterceptorsFromDi, } from '@angular/common/http'; @@ -11,11 +11,11 @@ import { ServiceWorkerModule } from '@angular/service-worker'; import { IonicModule, IonicRouteStrategy } from '@ionic/angular'; import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; import { TranslateHttpLoader } from '@ngx-translate/http-loader'; +import { AppComponent } from 'src/app/app.component'; +import { AppRoutingModule } from 'src/app/app-routing.module'; +import { AuthInterceptorService } from 'src/app/services/auth.interceptor.service'; import { LoaderInterceptorService } from 'src/app/services/loader.interceptor.service'; import { environment } from 'src/environments/environment'; -import { AppRoutingModule } from './app-routing.module'; -import { AppComponent } from './app.component'; -import { AuthInterceptorService } from './services/auth.interceptor.service'; export function createTranslateLoader(http: HttpClient) { return new TranslateHttpLoader(http, './assets/i18n/', '.json'); diff --git a/interfaces/IBF-dashboard/src/app/auth/auth.guard.ts b/interfaces/IBF-dashboard/src/app/auth/auth.guard.ts index f80313df5..804a07d46 100644 --- a/interfaces/IBF-dashboard/src/app/auth/auth.guard.ts +++ b/interfaces/IBF-dashboard/src/app/auth/auth.guard.ts @@ -6,7 +6,7 @@ import { UrlTree, } from '@angular/router'; import { Observable } from 'rxjs'; -import { AuthService } from './auth.service'; +import { AuthService } from 'src/app/auth/auth.service'; @Injectable({ providedIn: 'root', @@ -21,9 +21,9 @@ export class AuthGuard { next: ActivatedRouteSnapshot, state: RouterStateSnapshot, ): + | boolean | Observable | Promise - | boolean | UrlTree { const url: string = state.url; diff --git a/interfaces/IBF-dashboard/src/app/auth/auth.service.ts b/interfaces/IBF-dashboard/src/app/auth/auth.service.ts index 373ae3823..4f169e126 100644 --- a/interfaces/IBF-dashboard/src/app/auth/auth.service.ts +++ b/interfaces/IBF-dashboard/src/app/auth/auth.service.ts @@ -3,9 +3,9 @@ import { Router } from '@angular/router'; import { ToastController } from '@ionic/angular'; import { BehaviorSubject, Observable, Subscription } from 'rxjs'; import { User } from 'src/app/models/user/user.model'; +import { UserRole } from 'src/app/models/user/user-role.enum'; import { ApiService } from 'src/app/services/api.service'; import { JwtService } from 'src/app/services/jwt.service'; -import { UserRole } from '../models/user/user-role.enum'; const HTTP_STATUS_MESSAGE_MAP = { 401: 'Email and/or password unknown', @@ -95,7 +95,7 @@ export class AuthService implements OnDestroy { } private onLoginResponse = (response) => { - if (!response.user || !response.user.token) { + if (!response.user?.token) { return; } diff --git a/interfaces/IBF-dashboard/src/app/components/about-btn/about-btn.component.ts b/interfaces/IBF-dashboard/src/app/components/about-btn/about-btn.component.ts index ccc8d6fab..cec230f44 100644 --- a/interfaces/IBF-dashboard/src/app/components/about-btn/about-btn.component.ts +++ b/interfaces/IBF-dashboard/src/app/components/about-btn/about-btn.component.ts @@ -11,8 +11,8 @@ import { DisasterType, } from 'src/app/models/country.model'; import { CountryService } from 'src/app/services/country.service'; +import { DisasterTypeService } from 'src/app/services/disaster-type.service'; import { EventService } from 'src/app/services/event.service'; -import { DisasterTypeService } from '../../services/disaster-type.service'; @Component({ selector: 'app-about-btn', diff --git a/interfaces/IBF-dashboard/src/app/components/action-result-popover/action-result-popover.component.spec.ts b/interfaces/IBF-dashboard/src/app/components/action-result-popover/action-result-popover.component.spec.ts index 0d6e83a2a..13dd6ad65 100644 --- a/interfaces/IBF-dashboard/src/app/components/action-result-popover/action-result-popover.component.spec.ts +++ b/interfaces/IBF-dashboard/src/app/components/action-result-popover/action-result-popover.component.spec.ts @@ -1,7 +1,7 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { IonicModule } from '@ionic/angular'; import { TranslateModule } from '@ngx-translate/core'; -import { ActionResultPopoverComponent } from './action-result-popover.component'; +import { ActionResultPopoverComponent } from 'src/app/components/action-result-popover/action-result-popover.component'; describe('ActionResultPopoverComponent', () => { let component: ActionResultPopoverComponent; diff --git a/interfaces/IBF-dashboard/src/app/components/activation-log-button/activation-log-button.component.ts b/interfaces/IBF-dashboard/src/app/components/activation-log-button/activation-log-button.component.ts index 4374c9f31..291e7aaad 100644 --- a/interfaces/IBF-dashboard/src/app/components/activation-log-button/activation-log-button.component.ts +++ b/interfaces/IBF-dashboard/src/app/components/activation-log-button/activation-log-button.component.ts @@ -1,9 +1,9 @@ import { Component, OnDestroy } from '@angular/core'; import { Router } from '@angular/router'; import { Subscription } from 'rxjs'; -import { Country, DisasterType } from '../../models/country.model'; -import { CountryService } from '../../services/country.service'; -import { DisasterTypeService } from '../../services/disaster-type.service'; +import { Country, DisasterType } from 'src/app/models/country.model'; +import { CountryService } from 'src/app/services/country.service'; +import { DisasterTypeService } from 'src/app/services/disaster-type.service'; @Component({ selector: 'app-activation-log-button', diff --git a/interfaces/IBF-dashboard/src/app/components/admin-level/admin-level.component.ts b/interfaces/IBF-dashboard/src/app/components/admin-level/admin-level.component.ts index e8e0fd828..9e271a7a3 100644 --- a/interfaces/IBF-dashboard/src/app/components/admin-level/admin-level.component.ts +++ b/interfaces/IBF-dashboard/src/app/components/admin-level/admin-level.component.ts @@ -6,27 +6,27 @@ import { AnalyticsPage, } from 'src/app/analytics/analytics.enum'; import { AnalyticsService } from 'src/app/analytics/analytics.service'; +import { + Country, + CountryDisasterSettings, + DisasterType, +} from 'src/app/models/country.model'; +import { PlaceCode } from 'src/app/models/place-code.model'; import { AdminLevelButton, AdminLevelService, } from 'src/app/services/admin-level.service'; +import { CountryService } from 'src/app/services/country.service'; +import { DisasterTypeService } from 'src/app/services/disaster-type.service'; import { EventService } from 'src/app/services/event.service'; import { MapService } from 'src/app/services/map.service'; +import { MapViewService } from 'src/app/services/map-view.service'; +import { PlaceCodeService } from 'src/app/services/place-code.service'; import { AdminLevel, AdminLevelType } from 'src/app/types/admin-level'; +import { DisasterTypeKey } from 'src/app/types/disaster-type-key'; +import { EventState } from 'src/app/types/event-state'; import { IbfLayer, IbfLayerGroup, IbfLayerName } from 'src/app/types/ibf-layer'; -import { - Country, - CountryDisasterSettings, - DisasterType, -} from '../../models/country.model'; -import { PlaceCode } from '../../models/place-code.model'; -import { CountryService } from '../../services/country.service'; -import { DisasterTypeService } from '../../services/disaster-type.service'; -import { MapViewService } from '../../services/map-view.service'; -import { PlaceCodeService } from '../../services/place-code.service'; -import { DisasterTypeKey } from '../../types/disaster-type-key'; -import { EventState } from '../../types/event-state'; -import { MapView } from '../../types/map-view'; +import { MapView } from 'src/app/types/map-view'; @Component({ selector: 'app-admin-level', @@ -184,9 +184,7 @@ export class AdminLevelComponent implements OnInit, OnDestroy { } public useBreadcrumbs(disasterType: DisasterType): boolean { - return this.breadcrumbDisasters.includes( - disasterType?.disasterType as DisasterTypeKey, - ); + return this.breadcrumbDisasters.includes(disasterType?.disasterType); } public clickBreadcrumbButton(breadCrumb: MapView, selected: boolean) { @@ -247,19 +245,19 @@ export class AdminLevelComponent implements OnInit, OnDestroy { public showBreadcrumb(breadCrumb: MapView): boolean { if (breadCrumb === MapView.national) { return [ - MapView.national, - MapView.event, MapView.adminArea, MapView.adminArea2, MapView.adminArea3, + MapView.event, + MapView.national, ].includes(this.currentMapView); } else if (breadCrumb === MapView.event) { return ( [ - MapView.event, MapView.adminArea, MapView.adminArea2, MapView.adminArea3, + MapView.event, ].includes(this.currentMapView) && this.countryDisasterSettings?.isEventBased ); diff --git a/interfaces/IBF-dashboard/src/app/components/areas-of-focus-summary/areas-of-focus-summary.component.ts b/interfaces/IBF-dashboard/src/app/components/areas-of-focus-summary/areas-of-focus-summary.component.ts index 7db21ad32..84b6c6d09 100644 --- a/interfaces/IBF-dashboard/src/app/components/areas-of-focus-summary/areas-of-focus-summary.component.ts +++ b/interfaces/IBF-dashboard/src/app/components/areas-of-focus-summary/areas-of-focus-summary.component.ts @@ -1,24 +1,27 @@ import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core'; import { PopoverController } from '@ionic/angular'; import { Subscription } from 'rxjs'; +import { + AnalyticsEvent, + AnalyticsPage, +} from 'src/app/analytics/analytics.enum'; +import { AnalyticsService } from 'src/app/analytics/analytics.service'; +import { LayerControlInfoPopoverComponent } from 'src/app/components/layer-control-info-popover/layer-control-info-popover.component'; +import { + Country, + CountryDisasterSettings, + DisasterType, +} from 'src/app/models/country.model'; import { PlaceCode } from 'src/app/models/place-code.model'; import { ApiService } from 'src/app/services/api.service'; +import { CountryService } from 'src/app/services/country.service'; +import { DisasterTypeService } from 'src/app/services/disaster-type.service'; import { EapActionsService } from 'src/app/services/eap-actions.service'; import { EventService } from 'src/app/services/event.service'; import { PlaceCodeService } from 'src/app/services/place-code.service'; +import { AreaOfFocus } from 'src/app/types/area-of-focus'; import { EventState } from 'src/app/types/event-state'; -import { AnalyticsEvent, AnalyticsPage } from '../../analytics/analytics.enum'; -import { AnalyticsService } from '../../analytics/analytics.service'; -import { - Country, - CountryDisasterSettings, - DisasterType, -} from '../../models/country.model'; -import { CountryService } from '../../services/country.service'; -import { DisasterTypeService } from '../../services/disaster-type.service'; -import { AreaOfFocus } from '../../types/area-of-focus'; -import { TriggeredArea } from '../../types/triggered-area'; -import { LayerControlInfoPopoverComponent } from '../layer-control-info-popover/layer-control-info-popover.component'; +import { TriggeredArea } from 'src/app/types/triggered-area'; @Component({ selector: 'app-areas-of-focus-summary', diff --git a/interfaces/IBF-dashboard/src/app/components/chat/chat.component.ts b/interfaces/IBF-dashboard/src/app/components/chat/chat.component.ts index f93584ba9..14f02eb2d 100644 --- a/interfaces/IBF-dashboard/src/app/components/chat/chat.component.ts +++ b/interfaces/IBF-dashboard/src/app/components/chat/chat.component.ts @@ -8,31 +8,31 @@ import { } from 'src/app/analytics/analytics.enum'; import { AnalyticsService } from 'src/app/analytics/analytics.service'; import { AuthService } from 'src/app/auth/auth.service'; +import { ActionResultPopoverComponent } from 'src/app/components/action-result-popover/action-result-popover.component'; +import { ToggleTriggerPopoverComponent } from 'src/app/components/toggle-trigger-popover/toggle-trigger-popover.component'; import { Country, CountryDisasterSettings, DisasterType, } from 'src/app/models/country.model'; import { PlaceCode } from 'src/app/models/place-code.model'; +import { AdminLevelService } from 'src/app/services/admin-level.service'; +import { AggregatesService } from 'src/app/services/aggregates.service'; import { ApiService } from 'src/app/services/api.service'; import { CountryService } from 'src/app/services/country.service'; import { DisasterTypeService } from 'src/app/services/disaster-type.service'; import { EapActionsService } from 'src/app/services/eap-actions.service'; import { EventService, EventSummary } from 'src/app/services/event.service'; import { PlaceCodeService } from 'src/app/services/place-code.service'; +import { TimelineService } from 'src/app/services/timeline.service'; +import { AdminLevel, AdminLevelType } from 'src/app/types/admin-level'; import { EapAction } from 'src/app/types/eap-action'; import { EventState } from 'src/app/types/event-state'; +import { Indicator, NumberFormat } from 'src/app/types/indicator-group'; +import { LeadTimeTriggerKey } from 'src/app/types/lead-time'; import { TimelineState } from 'src/app/types/timeline-state'; -import { environment } from '../../../environments/environment'; -import { AdminLevelService } from '../../services/admin-level.service'; -import { AggregatesService } from '../../services/aggregates.service'; -import { TimelineService } from '../../services/timeline.service'; -import { AdminLevel, AdminLevelType } from '../../types/admin-level'; -import { Indicator, NumberFormat } from '../../types/indicator-group'; -import { LeadTimeTriggerKey } from '../../types/lead-time'; -import { TriggeredArea } from '../../types/triggered-area'; -import { ActionResultPopoverComponent } from '../action-result-popover/action-result-popover.component'; -import { ToggleTriggerPopoverComponent } from '../toggle-trigger-popover/toggle-trigger-popover.component'; +import { TriggeredArea } from 'src/app/types/triggered-area'; +import { environment } from 'src/environments/environment'; @Component({ selector: 'app-chat', @@ -435,7 +435,9 @@ export class ChatComponent implements OnInit, OnDestroy { placeCode, }); this.apiService.toggleTrigger(eventPlaceCodeId).subscribe({ - next: () => this.reloadEapAndTrigger(), + next: () => { + this.reloadEapAndTrigger(); + }, error: () => this.actionResult( this.translateService.instant( diff --git a/interfaces/IBF-dashboard/src/app/components/community-notification-popup/community-notification-popup.component.ts b/interfaces/IBF-dashboard/src/app/components/community-notification-popup/community-notification-popup.component.ts index afba31d54..cd8c2fcc1 100644 --- a/interfaces/IBF-dashboard/src/app/components/community-notification-popup/community-notification-popup.component.ts +++ b/interfaces/IBF-dashboard/src/app/components/community-notification-popup/community-notification-popup.component.ts @@ -2,11 +2,11 @@ import { Component, Input, OnInit } from '@angular/core'; import { AlertController, PopoverController } from '@ionic/angular'; import { TranslateService } from '@ngx-translate/core'; import { DateTime } from 'luxon'; -import { CommunityNotification } from '../../models/poi.model'; -import { ApiService } from '../../services/api.service'; -import { EventService } from '../../services/event.service'; -import { ActionResultPopoverComponent } from '../action-result-popover/action-result-popover.component'; -import { CommunityNotificationPhotoPopupComponent } from '../community-notification-photo-popup/community-notification-photo-popup.component'; +import { ActionResultPopoverComponent } from 'src/app/components/action-result-popover/action-result-popover.component'; +import { CommunityNotificationPhotoPopupComponent } from 'src/app/components/community-notification-photo-popup/community-notification-photo-popup.component'; +import { CommunityNotification } from 'src/app/models/poi.model'; +import { ApiService } from 'src/app/services/api.service'; +import { EventService } from 'src/app/services/event.service'; @Component({ selector: 'app-community-notification-popup', diff --git a/interfaces/IBF-dashboard/src/app/components/date-button/date-button.component.ts b/interfaces/IBF-dashboard/src/app/components/date-button/date-button.component.ts index 29fd50cff..433abc79d 100644 --- a/interfaces/IBF-dashboard/src/app/components/date-button/date-button.component.ts +++ b/interfaces/IBF-dashboard/src/app/components/date-button/date-button.component.ts @@ -2,9 +2,9 @@ import { Component, Input, OnDestroy, OnInit } from '@angular/core'; import { DateTime } from 'luxon'; import { Subscription } from 'rxjs'; import { DisasterTypeService } from 'src/app/services/disaster-type.service'; +import { TimelineService } from 'src/app/services/timeline.service'; +import { DisasterTypeKey } from 'src/app/types/disaster-type-key'; import { DateFormats, MonthFormats } from 'src/app/types/lead-time'; -import { TimelineService } from '../../services/timeline.service'; -import { DisasterTypeKey } from '../../types/disaster-type-key'; @Component({ selector: 'app-date-button', templateUrl: './date-button.component.html', @@ -15,8 +15,8 @@ export class DateButtonComponent implements OnInit, OnDestroy { @Input() active: boolean; @Input() alert: boolean; @Input() thresholdReached: boolean; - @Input() eventName: string | null; - @Input() duration: number | null; + @Input() eventName: null | string; + @Input() duration: null | number; private dateFormat = ''; private monthFormat = ''; diff --git a/interfaces/IBF-dashboard/src/app/components/dialogue-turn/dialogue-turn.component.spec.ts b/interfaces/IBF-dashboard/src/app/components/dialogue-turn/dialogue-turn.component.spec.ts index d6e321e8f..97086cb17 100644 --- a/interfaces/IBF-dashboard/src/app/components/dialogue-turn/dialogue-turn.component.spec.ts +++ b/interfaces/IBF-dashboard/src/app/components/dialogue-turn/dialogue-turn.component.spec.ts @@ -1,6 +1,6 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { DialogueTurnComponent } from './dialogue-turn.component'; +import { DialogueTurnComponent } from 'src/app/components/dialogue-turn/dialogue-turn.component'; describe('DialogueTurnComponent', () => { let component: DialogueTurnComponent; diff --git a/interfaces/IBF-dashboard/src/app/components/disaster-type/disaster-type.component.ts b/interfaces/IBF-dashboard/src/app/components/disaster-type/disaster-type.component.ts index 389a5e424..dfa283a73 100644 --- a/interfaces/IBF-dashboard/src/app/components/disaster-type/disaster-type.component.ts +++ b/interfaces/IBF-dashboard/src/app/components/disaster-type/disaster-type.component.ts @@ -1,14 +1,14 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; import { Subscription } from 'rxjs'; +import { AuthService } from 'src/app/auth/auth.service'; import { DISASTER_TYPES_SVG_MAP } from 'src/app/config'; +import { Country, DisasterType } from 'src/app/models/country.model'; +import { User } from 'src/app/models/user/user.model'; +import { CountryService } from 'src/app/services/country.service'; import { DisasterTypeService } from 'src/app/services/disaster-type.service'; import { EventService } from 'src/app/services/event.service'; +import { PlaceCodeService } from 'src/app/services/place-code.service'; import { DisasterTypeKey } from 'src/app/types/disaster-type-key'; -import { AuthService } from '../../auth/auth.service'; -import { Country, DisasterType } from '../../models/country.model'; -import { User } from '../../models/user/user.model'; -import { CountryService } from '../../services/country.service'; -import { PlaceCodeService } from '../../services/place-code.service'; @Component({ selector: 'app-disaster-type', @@ -93,8 +93,7 @@ export class DisasterTypeComponent implements OnInit, OnDestroy { const disasterType = activeDisasterType ? activeDisasterType : this.disasterTypes[0]; - this.selectedDisasterType = - disasterType.disasterType as DisasterTypeKey; + this.selectedDisasterType = disasterType.disasterType; this.disasterTypeService.setDisasterType(disasterType); } }; diff --git a/interfaces/IBF-dashboard/src/app/components/disclaimer-approximate/disclaimer-approximate.component.spec.ts b/interfaces/IBF-dashboard/src/app/components/disclaimer-approximate/disclaimer-approximate.component.spec.ts index 458792d9b..321265de0 100644 --- a/interfaces/IBF-dashboard/src/app/components/disclaimer-approximate/disclaimer-approximate.component.spec.ts +++ b/interfaces/IBF-dashboard/src/app/components/disclaimer-approximate/disclaimer-approximate.component.spec.ts @@ -1,8 +1,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { IonicModule } from '@ionic/angular'; import { TranslateModule } from '@ngx-translate/core'; - -import { DisclaimerApproximateComponent } from './disclaimer-approximate.component'; +import { DisclaimerApproximateComponent } from 'src/app/components/disclaimer-approximate/disclaimer-approximate.component'; describe('DisclaimerApproximateComponent', () => { let component: DisclaimerApproximateComponent; diff --git a/interfaces/IBF-dashboard/src/app/components/disclaimer-toolbar/disclaimer-toolbar.component.spec.ts b/interfaces/IBF-dashboard/src/app/components/disclaimer-toolbar/disclaimer-toolbar.component.spec.ts index 4dcb3d9b1..0899173a6 100644 --- a/interfaces/IBF-dashboard/src/app/components/disclaimer-toolbar/disclaimer-toolbar.component.spec.ts +++ b/interfaces/IBF-dashboard/src/app/components/disclaimer-toolbar/disclaimer-toolbar.component.spec.ts @@ -1,6 +1,6 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { IonicModule } from '@ionic/angular'; -import { DisclaimerToolbarComponent } from './disclaimer-toolbar.component'; +import { DisclaimerToolbarComponent } from 'src/app/components/disclaimer-toolbar/disclaimer-toolbar.component'; describe('DisclaimerToolbarComponent', () => { let component: DisclaimerToolbarComponent; diff --git a/interfaces/IBF-dashboard/src/app/components/disclaimer-toolbar/disclaimer-toolbar.component.ts b/interfaces/IBF-dashboard/src/app/components/disclaimer-toolbar/disclaimer-toolbar.component.ts index d402954fe..fec844380 100644 --- a/interfaces/IBF-dashboard/src/app/components/disclaimer-toolbar/disclaimer-toolbar.component.ts +++ b/interfaces/IBF-dashboard/src/app/components/disclaimer-toolbar/disclaimer-toolbar.component.ts @@ -1,5 +1,5 @@ import { Component } from '@angular/core'; -import { environment } from '../../../environments/environment'; +import { environment } from 'src/environments/environment'; @Component({ selector: 'app-disclaimer-toolbar', diff --git a/interfaces/IBF-dashboard/src/app/components/event-speech-bubble/event-speech-bubble.component.ts b/interfaces/IBF-dashboard/src/app/components/event-speech-bubble/event-speech-bubble.component.ts index 309966a5e..49fd23b89 100644 --- a/interfaces/IBF-dashboard/src/app/components/event-speech-bubble/event-speech-bubble.component.ts +++ b/interfaces/IBF-dashboard/src/app/components/event-speech-bubble/event-speech-bubble.component.ts @@ -7,16 +7,16 @@ import { } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; -import { AuthService } from '../../auth/auth.service'; -import { PlaceCode } from '../../models/place-code.model'; -import { AdminLevelService } from '../../services/admin-level.service'; -import { EventService, EventSummary } from '../../services/event.service'; -import { PlaceCodeService } from '../../services/place-code.service'; -import { TimelineService } from '../../services/timeline.service'; -import { DisasterTypeKey } from '../../types/disaster-type-key'; -import { LeadTime, LeadTimeTriggerKey } from '../../types/lead-time'; -import { TriggeredArea } from '../../types/triggered-area'; -import { NumberFormat } from '../../types/indicator-group'; +import { AuthService } from 'src/app/auth/auth.service'; +import { PlaceCode } from 'src/app/models/place-code.model'; +import { AdminLevelService } from 'src/app/services/admin-level.service'; +import { EventService, EventSummary } from 'src/app/services/event.service'; +import { PlaceCodeService } from 'src/app/services/place-code.service'; +import { TimelineService } from 'src/app/services/timeline.service'; +import { DisasterTypeKey } from 'src/app/types/disaster-type-key'; +import { NumberFormat } from 'src/app/types/indicator-group'; +import { LeadTime, LeadTimeTriggerKey } from 'src/app/types/lead-time'; +import { TriggeredArea } from 'src/app/types/triggered-area'; @Component({ selector: 'app-event-speech-bubble', @@ -77,7 +77,7 @@ export class EventSpeechBubbleComponent implements AfterViewChecked, OnDestroy { this.typhoonLandfallText = this.showTyphoonLandfallText(this.event); if (this.event) { - this.event['header'] = this.getHeader(this.event); + this.event.header = this.getHeader(this.event); } } @@ -236,11 +236,7 @@ export class EventSpeechBubbleComponent implements AfterViewChecked, OnDestroy { } public isEventWithForecastClasses(): boolean { - if ( - !this.event || - !this.event.disasterSpecificProperties || - !this.event.disasterSpecificProperties.eapAlertClass - ) { + if (!this.event?.disasterSpecificProperties?.eapAlertClass) { return false; } else return true; } diff --git a/interfaces/IBF-dashboard/src/app/components/event-switcher/event-switcher.component.ts b/interfaces/IBF-dashboard/src/app/components/event-switcher/event-switcher.component.ts index 894fb0508..94390e2e8 100644 --- a/interfaces/IBF-dashboard/src/app/components/event-switcher/event-switcher.component.ts +++ b/interfaces/IBF-dashboard/src/app/components/event-switcher/event-switcher.component.ts @@ -1,13 +1,13 @@ import { Component, Input, OnDestroy, OnInit } from '@angular/core'; import { Subscription } from 'rxjs'; +import { DisasterType } from 'src/app/models/country.model'; +import { DisasterTypeService } from 'src/app/services/disaster-type.service'; import { EventService, EventSummary } from 'src/app/services/event.service'; +import { TimelineService } from 'src/app/services/timeline.service'; +import { DisasterTypeKey } from 'src/app/types/disaster-type-key'; import { EventState } from 'src/app/types/event-state'; +import { LeadTime } from 'src/app/types/lead-time'; import { TimelineState } from 'src/app/types/timeline-state'; -import { DisasterType } from '../../models/country.model'; -import { DisasterTypeService } from '../../services/disaster-type.service'; -import { TimelineService } from '../../services/timeline.service'; -import { DisasterTypeKey } from '../../types/disaster-type-key'; -import { LeadTime } from '../../types/lead-time'; @Component({ selector: 'app-event-switcher', diff --git a/interfaces/IBF-dashboard/src/app/components/export-view-popover/export-view-popover.component.spec.ts b/interfaces/IBF-dashboard/src/app/components/export-view-popover/export-view-popover.component.spec.ts index 0d44545e8..90f4b7ce3 100644 --- a/interfaces/IBF-dashboard/src/app/components/export-view-popover/export-view-popover.component.spec.ts +++ b/interfaces/IBF-dashboard/src/app/components/export-view-popover/export-view-popover.component.spec.ts @@ -1,6 +1,6 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { IonicModule } from '@ionic/angular'; -import { ExportViewPopoverComponent } from './export-view-popover.component'; +import { ExportViewPopoverComponent } from 'src/app/components/export-view-popover/export-view-popover.component'; describe('ExportViewPopoverComponent', () => { let component: ExportViewPopoverComponent; diff --git a/interfaces/IBF-dashboard/src/app/components/export-view-popover/export-view-popover.component.ts b/interfaces/IBF-dashboard/src/app/components/export-view-popover/export-view-popover.component.ts index 7829898e7..a6f7c7208 100644 --- a/interfaces/IBF-dashboard/src/app/components/export-view-popover/export-view-popover.component.ts +++ b/interfaces/IBF-dashboard/src/app/components/export-view-popover/export-view-popover.component.ts @@ -15,13 +15,13 @@ export class ExportViewPopoverComponent { public getOperatingSystem() { let operatingSystemName = 'Unknown'; - if (navigator.appVersion.indexOf('Win') !== -1) { + if (navigator.appVersion.includes('Win')) { operatingSystemName = 'Windows'; } - if (navigator.appVersion.indexOf('Mac') !== -1) { + if (navigator.appVersion.includes('Mac')) { operatingSystemName = 'MacOS'; } - if (navigator.appVersion.indexOf('Linux') !== -1) { + if (navigator.appVersion.includes('Linux')) { operatingSystemName = 'Linux'; } return operatingSystemName; diff --git a/interfaces/IBF-dashboard/src/app/components/forgot-password-popover/forgot-password-popover.component.spec.ts b/interfaces/IBF-dashboard/src/app/components/forgot-password-popover/forgot-password-popover.component.spec.ts index a18e91d8e..e63b4ef84 100644 --- a/interfaces/IBF-dashboard/src/app/components/forgot-password-popover/forgot-password-popover.component.spec.ts +++ b/interfaces/IBF-dashboard/src/app/components/forgot-password-popover/forgot-password-popover.component.spec.ts @@ -1,7 +1,7 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { IonicModule } from '@ionic/angular'; import { TranslateModule } from '@ngx-translate/core'; -import { ForgotPasswordPopoverComponent } from './forgot-password-popover.component'; +import { ForgotPasswordPopoverComponent } from 'src/app/components/forgot-password-popover/forgot-password-popover.component'; describe('ForgotPasswordPopoverComponent', () => { let component: ForgotPasswordPopoverComponent; diff --git a/interfaces/IBF-dashboard/src/app/components/ibf-button/ibf-button.component.spec.ts b/interfaces/IBF-dashboard/src/app/components/ibf-button/ibf-button.component.spec.ts index 3a6c3e508..30a7722fb 100644 --- a/interfaces/IBF-dashboard/src/app/components/ibf-button/ibf-button.component.spec.ts +++ b/interfaces/IBF-dashboard/src/app/components/ibf-button/ibf-button.component.spec.ts @@ -1,6 +1,6 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { IonicModule } from '@ionic/angular'; -import { IbfButtonComponent } from './ibf-button.component'; +import { IbfButtonComponent } from 'src/app/components/ibf-button/ibf-button.component'; describe('IbfButtonComponent', () => { let component: IbfButtonComponent; diff --git a/interfaces/IBF-dashboard/src/app/components/ibf-guide-button/ibf-guide-button.component.ts b/interfaces/IBF-dashboard/src/app/components/ibf-guide-button/ibf-guide-button.component.ts index 83b578256..53cfcec01 100644 --- a/interfaces/IBF-dashboard/src/app/components/ibf-guide-button/ibf-guide-button.component.ts +++ b/interfaces/IBF-dashboard/src/app/components/ibf-guide-button/ibf-guide-button.component.ts @@ -6,10 +6,10 @@ import { AnalyticsPage, } from 'src/app/analytics/analytics.enum'; import { AnalyticsService } from 'src/app/analytics/analytics.service'; +import { IbfGuidePopoverComponent } from 'src/app/components/ibf-guide-popover/ibf-guide-popover.component'; +import { Country } from 'src/app/models/country.model'; +import { CountryService } from 'src/app/services/country.service'; import { EventService } from 'src/app/services/event.service'; -import { Country } from '../../models/country.model'; -import { CountryService } from '../../services/country.service'; -import { IbfGuidePopoverComponent } from '../ibf-guide-popover/ibf-guide-popover.component'; @Component({ selector: 'app-ibf-guide-button', diff --git a/interfaces/IBF-dashboard/src/app/components/ibf-guide-popover/ibf-guide-popover.component.spec.ts b/interfaces/IBF-dashboard/src/app/components/ibf-guide-popover/ibf-guide-popover.component.spec.ts index 367878280..6cc3e233c 100644 --- a/interfaces/IBF-dashboard/src/app/components/ibf-guide-popover/ibf-guide-popover.component.spec.ts +++ b/interfaces/IBF-dashboard/src/app/components/ibf-guide-popover/ibf-guide-popover.component.spec.ts @@ -1,12 +1,12 @@ -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; -import { TranslateModule } from '@ngx-translate/core'; -import { IbfGuidePopoverComponent } from './ibf-guide-popover.component'; import { provideHttpClient, withInterceptorsFromDi, } from '@angular/common/http'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { IonicModule } from '@ionic/angular'; +import { TranslateModule } from '@ngx-translate/core'; +import { IbfGuidePopoverComponent } from 'src/app/components/ibf-guide-popover/ibf-guide-popover.component'; describe('IbfGuidePopoverComponent', () => { let component: IbfGuidePopoverComponent; diff --git a/interfaces/IBF-dashboard/src/app/components/layer-control-info-popover/layer-control-info-popover.component.spec.ts b/interfaces/IBF-dashboard/src/app/components/layer-control-info-popover/layer-control-info-popover.component.spec.ts index aa590b27d..52ed9b13b 100644 --- a/interfaces/IBF-dashboard/src/app/components/layer-control-info-popover/layer-control-info-popover.component.spec.ts +++ b/interfaces/IBF-dashboard/src/app/components/layer-control-info-popover/layer-control-info-popover.component.spec.ts @@ -1,6 +1,6 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { IonicModule } from '@ionic/angular'; -import { LayerControlInfoPopoverComponent } from './layer-control-info-popover.component'; +import { LayerControlInfoPopoverComponent } from 'src/app/components/layer-control-info-popover/layer-control-info-popover.component'; describe('LayerControlInfoPopoverComponent', () => { let component: LayerControlInfoPopoverComponent; diff --git a/interfaces/IBF-dashboard/src/app/components/leaflet-popup/dynamic-point-popup/dynamic-point-popup.component.ts b/interfaces/IBF-dashboard/src/app/components/leaflet-popup/dynamic-point-popup/dynamic-point-popup.component.ts index cab16506f..9fe47d56a 100644 --- a/interfaces/IBF-dashboard/src/app/components/leaflet-popup/dynamic-point-popup/dynamic-point-popup.component.ts +++ b/interfaces/IBF-dashboard/src/app/components/leaflet-popup/dynamic-point-popup/dynamic-point-popup.component.ts @@ -1,10 +1,10 @@ import { Component, Input, OnInit } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { LatLng } from 'leaflet'; -import { EapAlertClass, EapAlertClasses } from '../../../models/country.model'; -import { RiverGauge, Station } from '../../../models/poi.model'; -import { IbfLayerName } from '../../../types/ibf-layer'; -import { LeadTime } from '../../../types/lead-time'; +import { EapAlertClass, EapAlertClasses } from 'src/app/models/country.model'; +import { RiverGauge, Station } from 'src/app/models/poi.model'; +import { IbfLayerName } from 'src/app/types/ibf-layer'; +import { LeadTime } from 'src/app/types/lead-time'; @Component({ selector: 'app-dynamic-point-popup', diff --git a/interfaces/IBF-dashboard/src/app/components/leaflet-popup/river-gauge-popup-content/river-gauge-popup-content.component.ts b/interfaces/IBF-dashboard/src/app/components/leaflet-popup/river-gauge-popup-content/river-gauge-popup-content.component.ts index 0976695e7..43f5c608d 100644 --- a/interfaces/IBF-dashboard/src/app/components/leaflet-popup/river-gauge-popup-content/river-gauge-popup-content.component.ts +++ b/interfaces/IBF-dashboard/src/app/components/leaflet-popup/river-gauge-popup-content/river-gauge-popup-content.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnInit } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; -import { RiverGauge } from '../../../models/poi.model'; +import { RiverGauge } from 'src/app/models/poi.model'; @Component({ selector: 'app-river-gauge-popup-content', diff --git a/interfaces/IBF-dashboard/src/app/components/login-form/login-form.component.ts b/interfaces/IBF-dashboard/src/app/components/login-form/login-form.component.ts index a6cfe131a..ee9e5a065 100644 --- a/interfaces/IBF-dashboard/src/app/components/login-form/login-form.component.ts +++ b/interfaces/IBF-dashboard/src/app/components/login-form/login-form.component.ts @@ -2,7 +2,7 @@ import { Component, ViewChild } from '@angular/core'; import { NgForm } from '@angular/forms'; import { PopoverController } from '@ionic/angular'; import { AuthService } from 'src/app/auth/auth.service'; -import { ForgotPasswordPopoverComponent } from '../forgot-password-popover/forgot-password-popover.component'; +import { ForgotPasswordPopoverComponent } from 'src/app/components/forgot-password-popover/forgot-password-popover.component'; @Component({ selector: 'app-login-form', templateUrl: './login-form.component.html', diff --git a/interfaces/IBF-dashboard/src/app/components/logos/logos.component.ts b/interfaces/IBF-dashboard/src/app/components/logos/logos.component.ts index 40ad5bfd7..dc249b402 100644 --- a/interfaces/IBF-dashboard/src/app/components/logos/logos.component.ts +++ b/interfaces/IBF-dashboard/src/app/components/logos/logos.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; import { Country, DisasterType } from 'src/app/models/country.model'; import { CountryService } from 'src/app/services/country.service'; -import { DisasterTypeService } from '../../services/disaster-type.service'; +import { DisasterTypeService } from 'src/app/services/disaster-type.service'; @Component({ selector: 'app-logos', diff --git a/interfaces/IBF-dashboard/src/app/components/map-controls/map-controls.component.spec.ts b/interfaces/IBF-dashboard/src/app/components/map-controls/map-controls.component.spec.ts index 6731b8cd1..1c8c1cf52 100644 --- a/interfaces/IBF-dashboard/src/app/components/map-controls/map-controls.component.spec.ts +++ b/interfaces/IBF-dashboard/src/app/components/map-controls/map-controls.component.spec.ts @@ -1,7 +1,7 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { IonicModule } from '@ionic/angular'; -import { MapControlsComponent } from './map-controls.component'; +import { MapControlsComponent } from 'src/app/components/map-controls/map-controls.component'; describe('MapControlsComponent', () => { let component: MapControlsComponent; diff --git a/interfaces/IBF-dashboard/src/app/components/map/map.component.ts b/interfaces/IBF-dashboard/src/app/components/map/map.component.ts index 20ac4bcce..f287295d1 100644 --- a/interfaces/IBF-dashboard/src/app/components/map/map.component.ts +++ b/interfaces/IBF-dashboard/src/app/components/map/map.component.ts @@ -6,16 +6,16 @@ import { Control, divIcon, DomUtil, - geoJSON, GeoJSON, + geoJSON, LatLng, LatLngBoundsLiteral, Layer, Map, MapOptions, Marker, - markerClusterGroup, MarkerClusterGroup, + markerClusterGroup, point, tileLayer, } from 'leaflet'; @@ -36,6 +36,7 @@ import { CountryDisasterSettings, DisasterType, } from 'src/app/models/country.model'; +import { PlaceCode } from 'src/app/models/place-code.model'; import { CommunityNotification, DamSite, @@ -49,13 +50,17 @@ import { Waterpoint, WaterpointInternal, } from 'src/app/models/poi.model'; +import { AdminLevelService } from 'src/app/services/admin-level.service'; import { ApiService } from 'src/app/services/api.service'; import { CountryService } from 'src/app/services/country.service'; +import { DisasterTypeService } from 'src/app/services/disaster-type.service'; import { EventService, EventSummary } from 'src/app/services/event.service'; -import { MapLegendService } from 'src/app/services/map-legend.service'; import { MapService } from 'src/app/services/map.service'; +import { MapLegendService } from 'src/app/services/map-legend.service'; import { PlaceCodeService } from 'src/app/services/place-code.service'; +import { PointMarkerService } from 'src/app/services/point-marker.service'; import { TimelineService } from 'src/app/services/timeline.service'; +import { DisasterTypeKey } from 'src/app/types/disaster-type-key'; import { EventState } from 'src/app/types/event-state'; import { IbfLayer, @@ -66,12 +71,7 @@ import { } from 'src/app/types/ibf-layer'; import { NumberFormat } from 'src/app/types/indicator-group'; import { LeadTime } from 'src/app/types/lead-time'; -import { PlaceCode } from '../../models/place-code.model'; -import { AdminLevelService } from '../../services/admin-level.service'; -import { DisasterTypeService } from '../../services/disaster-type.service'; -import { PointMarkerService } from '../../services/point-marker.service'; -import { DisasterTypeKey } from '../../types/disaster-type-key'; -import { TimelineState } from '../../types/timeline-state'; +import { TimelineState } from 'src/app/types/timeline-state'; @Component({ selector: 'app-map', @@ -388,9 +388,9 @@ export class MapComponent implements AfterViewInit, OnDestroy { private isMultiLinePointLayer(layerName: IbfLayerName): boolean { return ( [ - IbfLayerName.waterpointsInternal, IbfLayerName.healthSites, IbfLayerName.schools, + IbfLayerName.waterpointsInternal, ].includes(layerName) && this.disasterType.disasterType === DisasterTypeKey.flashFloods && this.eventState.events?.length > 0 diff --git a/interfaces/IBF-dashboard/src/app/components/screen-orientation-popover/screen-orientation-popover.component.spec.ts b/interfaces/IBF-dashboard/src/app/components/screen-orientation-popover/screen-orientation-popover.component.spec.ts index 76f473faa..85e39f503 100644 --- a/interfaces/IBF-dashboard/src/app/components/screen-orientation-popover/screen-orientation-popover.component.spec.ts +++ b/interfaces/IBF-dashboard/src/app/components/screen-orientation-popover/screen-orientation-popover.component.spec.ts @@ -1,7 +1,7 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { IonicModule } from '@ionic/angular'; import { TranslateModule } from '@ngx-translate/core'; -import { ScreenOrientationPopoverComponent } from './screen-orientation-popover.component'; +import { ScreenOrientationPopoverComponent } from 'src/app/components/screen-orientation-popover/screen-orientation-popover.component'; describe('ScreenOrientationPopoverComponent', () => { let component: ScreenOrientationPopoverComponent; diff --git a/interfaces/IBF-dashboard/src/app/components/timeline/timeline.component.ts b/interfaces/IBF-dashboard/src/app/components/timeline/timeline.component.ts index 2e3a6f893..d1a6ac0de 100644 --- a/interfaces/IBF-dashboard/src/app/components/timeline/timeline.component.ts +++ b/interfaces/IBF-dashboard/src/app/components/timeline/timeline.component.ts @@ -5,14 +5,14 @@ import { AnalyticsPage, } from 'src/app/analytics/analytics.enum'; import { AnalyticsService } from 'src/app/analytics/analytics.service'; +import { PlaceCode } from 'src/app/models/place-code.model'; +import { DisasterTypeService } from 'src/app/services/disaster-type.service'; import { EventService } from 'src/app/services/event.service'; +import { PlaceCodeService } from 'src/app/services/place-code.service'; import { TimelineService } from 'src/app/services/timeline.service'; +import { DisasterTypeKey } from 'src/app/types/disaster-type-key'; import { LeadTime } from 'src/app/types/lead-time'; import { TimelineState } from 'src/app/types/timeline-state'; -import { PlaceCode } from '../../models/place-code.model'; -import { DisasterTypeService } from '../../services/disaster-type.service'; -import { PlaceCodeService } from '../../services/place-code.service'; -import { DisasterTypeKey } from '../../types/disaster-type-key'; @Component({ selector: 'app-timeline', diff --git a/interfaces/IBF-dashboard/src/app/components/timestamp/timestamp.component.spec.ts b/interfaces/IBF-dashboard/src/app/components/timestamp/timestamp.component.spec.ts index f55ad0f36..fe54e71dd 100644 --- a/interfaces/IBF-dashboard/src/app/components/timestamp/timestamp.component.spec.ts +++ b/interfaces/IBF-dashboard/src/app/components/timestamp/timestamp.component.spec.ts @@ -1,6 +1,6 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { IonicModule } from '@ionic/angular'; -import { TimestampComponent } from './timestamp.component'; +import { TimestampComponent } from 'src/app/components/timestamp/timestamp.component'; describe('TimestampComponent', () => { let component: TimestampComponent; diff --git a/interfaces/IBF-dashboard/src/app/components/toggle-trigger-popover/toggle-trigger-popover.component.spec.ts b/interfaces/IBF-dashboard/src/app/components/toggle-trigger-popover/toggle-trigger-popover.component.spec.ts index 3d0ca7fd9..9589b2e2f 100644 --- a/interfaces/IBF-dashboard/src/app/components/toggle-trigger-popover/toggle-trigger-popover.component.spec.ts +++ b/interfaces/IBF-dashboard/src/app/components/toggle-trigger-popover/toggle-trigger-popover.component.spec.ts @@ -1,7 +1,7 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { IonicModule } from '@ionic/angular'; import { TranslateModule } from '@ngx-translate/core'; -import { ToggleTriggerPopoverComponent } from './toggle-trigger-popover.component'; +import { ToggleTriggerPopoverComponent } from 'src/app/components/toggle-trigger-popover/toggle-trigger-popover.component'; describe('ToggleTriggerPopoverComponent', () => { let component: ToggleTriggerPopoverComponent; diff --git a/interfaces/IBF-dashboard/src/app/components/toggle-trigger-popover/toggle-trigger-popover.component.ts b/interfaces/IBF-dashboard/src/app/components/toggle-trigger-popover/toggle-trigger-popover.component.ts index 0153f9746..742a2fecf 100644 --- a/interfaces/IBF-dashboard/src/app/components/toggle-trigger-popover/toggle-trigger-popover.component.ts +++ b/interfaces/IBF-dashboard/src/app/components/toggle-trigger-popover/toggle-trigger-popover.component.ts @@ -1,8 +1,8 @@ import { Component, Input } from '@angular/core'; import { PopoverController } from '@ionic/angular'; import { TranslateService } from '@ngx-translate/core'; -import { DisasterTypeKey } from '../../types/disaster-type-key'; -import { TriggeredArea } from '../../types/triggered-area'; +import { DisasterTypeKey } from 'src/app/types/disaster-type-key'; +import { TriggeredArea } from 'src/app/types/triggered-area'; @Component({ selector: 'app-toggle-trigger-popover', diff --git a/interfaces/IBF-dashboard/src/app/components/tooltip-popover/tooltip-popover.component.spec.ts b/interfaces/IBF-dashboard/src/app/components/tooltip-popover/tooltip-popover.component.spec.ts index ad171218a..f2a93c492 100644 --- a/interfaces/IBF-dashboard/src/app/components/tooltip-popover/tooltip-popover.component.spec.ts +++ b/interfaces/IBF-dashboard/src/app/components/tooltip-popover/tooltip-popover.component.spec.ts @@ -1,5 +1,5 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { TooltipPopoverComponent } from './tooltip-popover.component'; +import { TooltipPopoverComponent } from 'src/app/components/tooltip-popover/tooltip-popover.component'; describe('TooltipPopoverComponent', () => { let component: TooltipPopoverComponent; diff --git a/interfaces/IBF-dashboard/src/app/components/tooltip/tooltip.component.spec.ts b/interfaces/IBF-dashboard/src/app/components/tooltip/tooltip.component.spec.ts index 941772b5c..0656358a3 100644 --- a/interfaces/IBF-dashboard/src/app/components/tooltip/tooltip.component.spec.ts +++ b/interfaces/IBF-dashboard/src/app/components/tooltip/tooltip.component.spec.ts @@ -1,7 +1,7 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { AngularDelegate, PopoverController } from '@ionic/angular'; -import { TooltipComponent } from './tooltip.component'; +import { TooltipComponent } from 'src/app/components/tooltip/tooltip.component'; describe('TooltipComponent', () => { let component: TooltipComponent; diff --git a/interfaces/IBF-dashboard/src/app/components/tooltip/tooltip.component.ts b/interfaces/IBF-dashboard/src/app/components/tooltip/tooltip.component.ts index 5e404f8c1..b0bab2d7f 100644 --- a/interfaces/IBF-dashboard/src/app/components/tooltip/tooltip.component.ts +++ b/interfaces/IBF-dashboard/src/app/components/tooltip/tooltip.component.ts @@ -1,6 +1,6 @@ import { Component, Input } from '@angular/core'; import { PopoverController } from '@ionic/angular'; -import { TooltipPopoverComponent } from '../tooltip-popover/tooltip-popover.component'; +import { TooltipPopoverComponent } from 'src/app/components/tooltip-popover/tooltip-popover.component'; @Component({ selector: 'app-tooltip', diff --git a/interfaces/IBF-dashboard/src/app/components/user-state/user-state.component.ts b/interfaces/IBF-dashboard/src/app/components/user-state/user-state.component.ts index dbc82ed5a..46c059d60 100644 --- a/interfaces/IBF-dashboard/src/app/components/user-state/user-state.component.ts +++ b/interfaces/IBF-dashboard/src/app/components/user-state/user-state.component.ts @@ -8,14 +8,14 @@ import { } from 'src/app/analytics/analytics.enum'; import { AnalyticsService } from 'src/app/analytics/analytics.service'; import { AuthService } from 'src/app/auth/auth.service'; +import { ChangePasswordPopoverComponent } from 'src/app/components/change-password-popover/change-password-popover.component'; import { Country, DisasterType } from 'src/app/models/country.model'; +import { ApiService } from 'src/app/services/api.service'; import { CountryService } from 'src/app/services/country.service'; import { DisasterTypeService } from 'src/app/services/disaster-type.service'; import { EventService } from 'src/app/services/event.service'; import { LoaderService } from 'src/app/services/loader.service'; -import { environment } from '../../../environments/environment'; -import { ApiService } from '../../services/api.service'; -import { ChangePasswordPopoverComponent } from '../change-password-popover/change-password-popover.component'; +import { environment } from 'src/environments/environment'; @Component({ selector: 'app-user-state', @@ -26,7 +26,7 @@ export class UserStateComponent implements OnInit { @Input() public isLoggedIn: boolean; @Input() - public showCountry: boolean = true; + public showCountry = true; public environmentConfiguration = environment.configuration; diff --git a/interfaces/IBF-dashboard/src/app/models/country.model.ts b/interfaces/IBF-dashboard/src/app/models/country.model.ts index 8ce79c42a..384c77dcf 100644 --- a/interfaces/IBF-dashboard/src/app/models/country.model.ts +++ b/interfaces/IBF-dashboard/src/app/models/country.model.ts @@ -1,12 +1,12 @@ import { AdminLevel } from 'src/app/types/admin-level'; -import { DisasterTypeKey } from './../types/disaster-type-key'; -import { LeadTime, LeadTimeUnit } from './../types/lead-time'; +import { DisasterTypeKey } from 'src/app/types/disaster-type-key'; +import { LeadTime, LeadTimeUnit } from 'src/app/types/lead-time'; export class Country { countryCodeISO3: string; countryDisasterSettings: CountryDisasterSettings[]; countryName: string; adminRegionLabels: AdminRegionLabels; - countryLogos: { [disasterType: string]: string[] }; + countryLogos: Record; disasterTypes: DisasterType[]; notificationInfo: NotificationInfo; } @@ -17,26 +17,25 @@ export class CountryDisasterSettings { defaultAdminLevel: AdminLevel; activeLeadTimes: LeadTime[]; droughtForecastSeasons: DroughtForecastSeasons; - droughtAreas: { [area: string]: string[] }; + droughtAreas: Record; eapLink: string; showMonthlyEapActions: boolean; droughtEndOfMonthPipeline?: boolean; isEventBased: boolean; eapAlertClasses?: EapAlertClasses; - monthlyForecastInfo?: { - [key: string]: string[] | string; - }; + monthlyForecastInfo?: Record; enableEarlyActions?: boolean; enableStopTrigger?: boolean; } export class DroughtForecastSeasons { - [area: string]: { - [season: string]: { + [area: string]: Record< + string, + { rainMonths: number[]; actionMonths: number[]; - }; - }; + } + >; } export class NotificationInfo { diff --git a/interfaces/IBF-dashboard/src/app/models/place-code.model.ts b/interfaces/IBF-dashboard/src/app/models/place-code.model.ts index f48b86bdb..6b813cf02 100644 --- a/interfaces/IBF-dashboard/src/app/models/place-code.model.ts +++ b/interfaces/IBF-dashboard/src/app/models/place-code.model.ts @@ -1,4 +1,4 @@ -import { AdminLevel } from '../types/admin-level'; +import { AdminLevel } from 'src/app/types/admin-level'; export class PlaceCode { countryCodeISO3: string; diff --git a/interfaces/IBF-dashboard/src/app/models/user/user.model.ts b/interfaces/IBF-dashboard/src/app/models/user/user.model.ts index c01b3d3ca..483249edb 100644 --- a/interfaces/IBF-dashboard/src/app/models/user/user.model.ts +++ b/interfaces/IBF-dashboard/src/app/models/user/user.model.ts @@ -1,5 +1,5 @@ -import { UserRole } from './user-role.enum'; -import { UserStatus } from './user-status.enum'; +import { UserRole } from 'src/app/models/user/user-role.enum'; +import { UserStatus } from 'src/app/models/user/user-status.enum'; export class User { token: string; diff --git a/interfaces/IBF-dashboard/src/app/pages/dashboard/activation-log/activation.log.page.ts b/interfaces/IBF-dashboard/src/app/pages/dashboard/activation-log/activation.log.page.ts index c467071dc..9242e8c23 100644 --- a/interfaces/IBF-dashboard/src/app/pages/dashboard/activation-log/activation.log.page.ts +++ b/interfaces/IBF-dashboard/src/app/pages/dashboard/activation-log/activation.log.page.ts @@ -6,10 +6,10 @@ import { Subscription } from 'rxjs'; import { AnalyticsPage } from 'src/app/analytics/analytics.enum'; import { AnalyticsService } from 'src/app/analytics/analytics.service'; import { ApiService } from 'src/app/services/api.service'; -import { DisasterTypeService } from '../../../services/disaster-type.service'; -import { DisasterTypeKey } from '../../../types/disaster-type-key'; +import { DisasterTypeService } from 'src/app/services/disaster-type.service'; +import { DisasterTypeKey } from 'src/app/types/disaster-type-key'; -type ActivationLogRecord = { [key: string]: string | number | boolean }; +type ActivationLogRecord = Record; @Component({ selector: 'app-activation-log', @@ -23,7 +23,7 @@ export class ActivationLogPage implements OnInit, OnDestroy { public activationLogs: | { headerData: string[]; - rowsData: (string | number | boolean)[][]; + rowsData: (boolean | number | string)[][]; } | string; @@ -59,7 +59,7 @@ export class ActivationLogPage implements OnInit, OnDestroy { private jsonToCsv( items: ActivationLogRecord[], ): - | { headerData: string[]; rowsData: (string | number | boolean)[][] } + | { headerData: string[]; rowsData: (boolean | number | string)[][] } | string { if (items.length === 0) { return ''; diff --git a/interfaces/IBF-dashboard/src/app/pages/dashboard/dashboard-routing.module.ts b/interfaces/IBF-dashboard/src/app/pages/dashboard/dashboard-routing.module.ts index 2e92b0c37..28015715b 100644 --- a/interfaces/IBF-dashboard/src/app/pages/dashboard/dashboard-routing.module.ts +++ b/interfaces/IBF-dashboard/src/app/pages/dashboard/dashboard-routing.module.ts @@ -1,8 +1,8 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; -import { ActivationLogPage } from './activation-log/activation.log.page'; -import { DashboardPage } from './dashboard.page'; -import { StatusReportPage } from './status-report/status-report.page'; +import { ActivationLogPage } from 'src/app/pages/dashboard/activation-log/activation.log.page'; +import { DashboardPage } from 'src/app/pages/dashboard/dashboard.page'; +import { StatusReportPage } from 'src/app/pages/dashboard/status-report/status-report.page'; const routes: Routes = [ { diff --git a/interfaces/IBF-dashboard/src/app/pages/dashboard/dashboard.module.ts b/interfaces/IBF-dashboard/src/app/pages/dashboard/dashboard.module.ts index 209e0496a..9a6304069 100644 --- a/interfaces/IBF-dashboard/src/app/pages/dashboard/dashboard.module.ts +++ b/interfaces/IBF-dashboard/src/app/pages/dashboard/dashboard.module.ts @@ -2,11 +2,11 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { IonicModule } from '@ionic/angular'; +import { ActivationLogPage } from 'src/app/pages/dashboard/activation-log/activation.log.page'; +import { DashboardPage } from 'src/app/pages/dashboard/dashboard.page'; +import { DashboardPageRoutingModule } from 'src/app/pages/dashboard/dashboard-routing.module'; +import { StatusReportPage } from 'src/app/pages/dashboard/status-report/status-report.page'; import { SharedModule } from 'src/app/shared.module'; -import { ActivationLogPage } from './activation-log/activation.log.page'; -import { DashboardPageRoutingModule } from './dashboard-routing.module'; -import { DashboardPage } from './dashboard.page'; -import { StatusReportPage } from './status-report/status-report.page'; @NgModule({ imports: [ diff --git a/interfaces/IBF-dashboard/src/app/pages/dashboard/dashboard.page.ts b/interfaces/IBF-dashboard/src/app/pages/dashboard/dashboard.page.ts index 87f8a8bf5..97b42e2c6 100644 --- a/interfaces/IBF-dashboard/src/app/pages/dashboard/dashboard.page.ts +++ b/interfaces/IBF-dashboard/src/app/pages/dashboard/dashboard.page.ts @@ -4,10 +4,10 @@ import { DateTime } from 'luxon'; import { AnalyticsPage } from 'src/app/analytics/analytics.enum'; import { AnalyticsService } from 'src/app/analytics/analytics.service'; import { AuthService } from 'src/app/auth/auth.service'; -import { UserRole } from 'src/app/models/user/user-role.enum'; +import { ScreenOrientationPopoverComponent } from 'src/app/components/screen-orientation-popover/screen-orientation-popover.component'; import { User } from 'src/app/models/user/user.model'; +import { UserRole } from 'src/app/models/user/user-role.enum'; import { environment } from 'src/environments/environment'; -import { ScreenOrientationPopoverComponent } from '../../components/screen-orientation-popover/screen-orientation-popover.component'; @Component({ selector: 'app-dashboard', diff --git a/interfaces/IBF-dashboard/src/app/pages/dashboard/status-report/status-report.page.ts b/interfaces/IBF-dashboard/src/app/pages/dashboard/status-report/status-report.page.ts index 1bc6582e7..309617548 100644 --- a/interfaces/IBF-dashboard/src/app/pages/dashboard/status-report/status-report.page.ts +++ b/interfaces/IBF-dashboard/src/app/pages/dashboard/status-report/status-report.page.ts @@ -1,12 +1,12 @@ import { Component, OnInit } from '@angular/core'; -import { ApiService } from '../../../services/api.service'; -import { CountryService } from '../../../services/country.service'; -import { RecentDate } from '../../../types/recent-date'; -import { Country, DisasterType } from '../../../models/country.model'; -import { DISASTER_TYPES_SVG_MAP } from '../../../config'; -import { EventService, EventSummary } from '../../../services/event.service'; -import { format, parseISO } from 'date-fns'; import { TranslateService } from '@ngx-translate/core'; +import { format, parseISO } from 'date-fns'; +import { DISASTER_TYPES_SVG_MAP } from 'src/app/config'; +import { Country, DisasterType } from 'src/app/models/country.model'; +import { ApiService } from 'src/app/services/api.service'; +import { CountryService } from 'src/app/services/country.service'; +import { EventService, EventSummary } from 'src/app/services/event.service'; +import { RecentDate } from 'src/app/types/recent-date'; interface DisasterStatus { imgSrc: string; @@ -14,13 +14,9 @@ interface DisasterStatus { isStale: boolean; } -interface CountryStatus { - [key: string]: DisasterStatus; -} +type CountryStatus = Record; -interface StatusData { - [key: string]: CountryStatus; -} +type StatusData = Record; @Component({ selector: 'app-status-report', @@ -54,9 +50,9 @@ export class StatusReportPage implements OnInit { }; this.apiService .getRecentDates(country.countryCodeISO3, disasterType.disasterType) - .subscribe((date) => - this.onRecentDates(date, country.countryCodeISO3, disasterType), - ); + .subscribe((date) => { + this.onRecentDates(date, country.countryCodeISO3, disasterType); + }); } } }; @@ -80,9 +76,9 @@ export class StatusReportPage implements OnInit { this.apiService .getEventsSummary(countryCodeISO3, disasterType.disasterType) - .subscribe((events) => - this.onGetEvents(events, countryCodeISO3, disasterType), - ); + .subscribe((events) => { + this.onGetEvents(events, countryCodeISO3, disasterType); + }); }; private onGetEvents = ( diff --git a/interfaces/IBF-dashboard/src/app/pages/login/login-routing.module.ts b/interfaces/IBF-dashboard/src/app/pages/login/login-routing.module.ts index 775e38217..c275b8f21 100644 --- a/interfaces/IBF-dashboard/src/app/pages/login/login-routing.module.ts +++ b/interfaces/IBF-dashboard/src/app/pages/login/login-routing.module.ts @@ -1,6 +1,6 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; -import { LoginPage } from './login.page'; +import { LoginPage } from 'src/app/pages/login/login.page'; const routes: Routes = [ { diff --git a/interfaces/IBF-dashboard/src/app/pages/login/login.module.ts b/interfaces/IBF-dashboard/src/app/pages/login/login.module.ts index 741c1d2c0..98d9c7b16 100644 --- a/interfaces/IBF-dashboard/src/app/pages/login/login.module.ts +++ b/interfaces/IBF-dashboard/src/app/pages/login/login.module.ts @@ -2,9 +2,9 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { IonicModule } from '@ionic/angular'; -import { SharedModule } from '../../shared.module'; -import { LoginPageRoutingModule } from './login-routing.module'; -import { LoginPage } from './login.page'; +import { LoginPage } from 'src/app/pages/login/login.page'; +import { LoginPageRoutingModule } from 'src/app/pages/login/login-routing.module'; +import { SharedModule } from 'src/app/shared.module'; @NgModule({ imports: [ diff --git a/interfaces/IBF-dashboard/src/app/pipes/compact.pipe.spec.ts b/interfaces/IBF-dashboard/src/app/pipes/compact.pipe.spec.ts index df0446814..ae7941e47 100644 --- a/interfaces/IBF-dashboard/src/app/pipes/compact.pipe.spec.ts +++ b/interfaces/IBF-dashboard/src/app/pipes/compact.pipe.spec.ts @@ -1,4 +1,4 @@ -import { CompactPipe } from './compact.pipe'; +import { CompactPipe } from 'src/app/pipes/compact.pipe'; describe('CompactPipe', () => { it('create an instance', () => { diff --git a/interfaces/IBF-dashboard/src/app/pipes/compact.pipe.ts b/interfaces/IBF-dashboard/src/app/pipes/compact.pipe.ts index 29c7ad252..15b5732b7 100644 --- a/interfaces/IBF-dashboard/src/app/pipes/compact.pipe.ts +++ b/interfaces/IBF-dashboard/src/app/pipes/compact.pipe.ts @@ -1,5 +1,5 @@ import { Inject, LOCALE_ID, Pipe, PipeTransform } from '@angular/core'; -import { NumberFormat } from '../types/indicator-group'; +import { NumberFormat } from 'src/app/types/indicator-group'; @Pipe({ standalone: true, diff --git a/interfaces/IBF-dashboard/src/app/services/admin-level.service.ts b/interfaces/IBF-dashboard/src/app/services/admin-level.service.ts index f0355111b..a2e214b73 100644 --- a/interfaces/IBF-dashboard/src/app/services/admin-level.service.ts +++ b/interfaces/IBF-dashboard/src/app/services/admin-level.service.ts @@ -1,23 +1,23 @@ import { Injectable } from '@angular/core'; import { BehaviorSubject, Observable } from 'rxjs'; +import { + Country, + CountryDisasterSettings, + DisasterType, +} from 'src/app/models/country.model'; +import { PlaceCode } from 'src/app/models/place-code.model'; +import { CountryService } from 'src/app/services/country.service'; +import { DisasterTypeService } from 'src/app/services/disaster-type.service'; +import { EventService } from 'src/app/services/event.service'; +import { TimelineService } from 'src/app/services/timeline.service'; import { AdminLevel, AdminLevelLabel, AdminLevelType, } from 'src/app/types/admin-level'; -import { - Country, - CountryDisasterSettings, - DisasterType, -} from '../models/country.model'; -import { PlaceCode } from '../models/place-code.model'; -import { EventState } from '../types/event-state'; -import { IbfLayerName } from '../types/ibf-layer'; -import { TimelineState } from '../types/timeline-state'; -import { CountryService } from './country.service'; -import { DisasterTypeService } from './disaster-type.service'; -import { EventService } from './event.service'; -import { TimelineService } from './timeline.service'; +import { EventState } from 'src/app/types/event-state'; +import { IbfLayerName } from 'src/app/types/ibf-layer'; +import { TimelineState } from 'src/app/types/timeline-state'; export class AdminLevelButton { adminLevel: AdminLevel; diff --git a/interfaces/IBF-dashboard/src/app/services/aggregates.service.ts b/interfaces/IBF-dashboard/src/app/services/aggregates.service.ts index 263be599c..72e0a58df 100644 --- a/interfaces/IBF-dashboard/src/app/services/aggregates.service.ts +++ b/interfaces/IBF-dashboard/src/app/services/aggregates.service.ts @@ -1,27 +1,27 @@ import { Injectable } from '@angular/core'; import { BehaviorSubject, Observable } from 'rxjs'; +import { Country, DisasterType } from 'src/app/models/country.model'; +import { PlaceCode } from 'src/app/models/place-code.model'; +import { AdminLevelService } from 'src/app/services/admin-level.service'; import { ApiService } from 'src/app/services/api.service'; import { CountryService } from 'src/app/services/country.service'; +import { DisasterTypeService } from 'src/app/services/disaster-type.service'; +import { EapActionsService } from 'src/app/services/eap-actions.service'; +import { EventService } from 'src/app/services/event.service'; import { MapService } from 'src/app/services/map.service'; +import { PlaceCodeService } from 'src/app/services/place-code.service'; import { TimelineService } from 'src/app/services/timeline.service'; +import { AdminLevel } from 'src/app/types/admin-level'; +import { EventState } from 'src/app/types/event-state'; +import { IbfLayerName } from 'src/app/types/ibf-layer'; import { Indicator, NumberFormat } from 'src/app/types/indicator-group'; -import { Country, DisasterType } from '../models/country.model'; -import { PlaceCode } from '../models/place-code.model'; -import { AdminLevel } from '../types/admin-level'; -import { EventState } from '../types/event-state'; -import { IbfLayerName } from '../types/ibf-layer'; -import { TimelineState } from '../types/timeline-state'; -import { TriggeredArea } from '../types/triggered-area'; -import { AdminLevelService } from './admin-level.service'; -import { DisasterTypeService } from './disaster-type.service'; -import { EapActionsService } from './eap-actions.service'; -import { EventService } from './event.service'; -import { PlaceCodeService } from './place-code.service'; +import { TimelineState } from 'src/app/types/timeline-state'; +import { TriggeredArea } from 'src/app/types/triggered-area'; export enum AreaStatus { - TriggeredOrWarned = 'triggered-or-warned', NonTriggeredOrWarnd = 'non-triggered-or-warned', Stopped = 'stopped', + TriggeredOrWarned = 'triggered-or-warned', } @Injectable({ providedIn: 'root', @@ -144,9 +144,9 @@ export class AggregatesService { private onIndicatorChange = (indicators) => { this.indicators = indicators; this.mapService.removeAggregateLayers(); - this.indicators.forEach((indicator) => - this.mapService.loadAggregateLayer(indicator), - ); + this.indicators.forEach((indicator) => { + this.mapService.loadAggregateLayer(indicator); + }); this.indicatorSubject.next(this.indicators); this.loadAggregateInformation(); diff --git a/interfaces/IBF-dashboard/src/app/services/api.service.ts b/interfaces/IBF-dashboard/src/app/services/api.service.ts index dd3954a55..270564d6d 100644 --- a/interfaces/IBF-dashboard/src/app/services/api.service.ts +++ b/interfaces/IBF-dashboard/src/app/services/api.service.ts @@ -3,19 +3,19 @@ import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { map, tap } from 'rxjs/operators'; import { DEBUG_LOG } from 'src/app/config'; -import { CountryTriggers } from 'src/app/models/country-triggers.model'; import { Country, DisasterType } from 'src/app/models/country.model'; +import { CountryTriggers } from 'src/app/models/country-triggers.model'; +import { User } from 'src/app/models/user/user.model'; +import { EventSummary } from 'src/app/services/event.service'; import { JwtService } from 'src/app/services/jwt.service'; import { AdminLevel } from 'src/app/types/admin-level'; +import { Aggregate } from 'src/app/types/aggregate'; +import { DisasterTypeKey } from 'src/app/types/disaster-type-key'; +import { IbfLayerName } from 'src/app/types/ibf-layer'; import { LeadTime } from 'src/app/types/lead-time'; +import { RecentDate } from 'src/app/types/recent-date'; +import { TriggeredArea } from 'src/app/types/triggered-area'; import { environment } from 'src/environments/environment'; -import { User } from '../models/user/user.model'; -import { Aggregate } from '../types/aggregate'; -import { DisasterTypeKey } from '../types/disaster-type-key'; -import { IbfLayerName } from '../types/ibf-layer'; -import { RecentDate } from '../types/recent-date'; -import { TriggeredArea } from '../types/triggered-area'; -import { EventSummary } from './event.service'; @Injectable({ providedIn: 'root', @@ -64,13 +64,13 @@ export class ApiService { params, }) .pipe( - tap((response) => + tap((response) => { this.log( `ApiService GET: ${security} ${url}`, '\nResponse:', response, - ), - ), + ); + }), ); } @@ -85,14 +85,14 @@ export class ApiService { headers: this.createHeaders(anonymous), }) .pipe( - tap((response) => + tap((response) => { this.log( `ApiService POST: ${security} ${url}:`, body, '\nResponse:', response, - ), - ), + ); + }), ); } @@ -107,14 +107,14 @@ export class ApiService { headers: this.createHeaders(anonymous), }) .pipe( - tap((response) => + tap((response) => { this.log( `ApiService PUT: ${security} ${url}:`, body, '\nResponse:', response, - ), - ), + ); + }), ); } diff --git a/interfaces/IBF-dashboard/src/app/services/auth.interceptor.service.ts b/interfaces/IBF-dashboard/src/app/services/auth.interceptor.service.ts index 7de498faa..8fb1a2621 100644 --- a/interfaces/IBF-dashboard/src/app/services/auth.interceptor.service.ts +++ b/interfaces/IBF-dashboard/src/app/services/auth.interceptor.service.ts @@ -9,8 +9,8 @@ import { import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { tap } from 'rxjs/operators'; +import { AuthService } from 'src/app/auth/auth.service'; import { environment } from 'src/environments/environment'; -import { AuthService } from '../auth/auth.service'; @Injectable({ providedIn: 'root' }) export class AuthInterceptorService implements HttpInterceptor { @@ -22,8 +22,12 @@ export class AuthInterceptorService implements HttpInterceptor { ): Observable> { return next.handle(request).pipe( tap( - (event) => this.handleResponse(event), - (error) => this.handleError(error), + (event) => { + this.handleResponse(event); + }, + (error) => { + this.handleError(error); + }, ), ); } diff --git a/interfaces/IBF-dashboard/src/app/services/country.service.ts b/interfaces/IBF-dashboard/src/app/services/country.service.ts index f1fdc6bc4..db4e7aa6d 100644 --- a/interfaces/IBF-dashboard/src/app/services/country.service.ts +++ b/interfaces/IBF-dashboard/src/app/services/country.service.ts @@ -1,10 +1,10 @@ import { Injectable } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { BehaviorSubject, Observable } from 'rxjs'; +import { AuthService } from 'src/app/auth/auth.service'; import { Country } from 'src/app/models/country.model'; import { User } from 'src/app/models/user/user.model'; -import { AuthService } from '../auth/auth.service'; -import { ApiService } from './api.service'; +import { ApiService } from 'src/app/services/api.service'; @Injectable({ providedIn: 'root', @@ -59,7 +59,7 @@ export class CountryService { country.countryCodeISO3 === countryCodeISO3; private filterCountryByUser = (user: User) => (country) => - user.countries.indexOf(country.countryCodeISO3) >= 0; + user.countries.includes(country.countryCodeISO3); public selectCountry = (countryCodeISO3: string): void => { this.countrySubject.next( @@ -68,7 +68,7 @@ export class CountryService { }; public filterCountriesByUser(user: User): void { - if (!user || !user.countries) { + if (!user?.countries) { this.countries = []; } else { this.countries = this.countries diff --git a/interfaces/IBF-dashboard/src/app/services/disaster-type.service.ts b/interfaces/IBF-dashboard/src/app/services/disaster-type.service.ts index 56889e40d..b603f4474 100644 --- a/interfaces/IBF-dashboard/src/app/services/disaster-type.service.ts +++ b/interfaces/IBF-dashboard/src/app/services/disaster-type.service.ts @@ -4,9 +4,9 @@ import { Country, CountryDisasterSettings, DisasterType, -} from '../models/country.model'; -import { DisasterTypeKey } from '../types/disaster-type-key'; -import { CountryService } from './country.service'; +} from 'src/app/models/country.model'; +import { CountryService } from 'src/app/services/country.service'; +import { DisasterTypeKey } from 'src/app/types/disaster-type-key'; @Injectable({ providedIn: 'root', diff --git a/interfaces/IBF-dashboard/src/app/services/eap-actions.service.ts b/interfaces/IBF-dashboard/src/app/services/eap-actions.service.ts index af9fc9258..1bbf69071 100644 --- a/interfaces/IBF-dashboard/src/app/services/eap-actions.service.ts +++ b/interfaces/IBF-dashboard/src/app/services/eap-actions.service.ts @@ -1,25 +1,25 @@ import { Injectable } from '@angular/core'; import { DateTime } from 'luxon'; import { BehaviorSubject, Observable } from 'rxjs'; -import { ApiService } from 'src/app/services/api.service'; -import { CountryService } from 'src/app/services/country.service'; import { Country, CountryDisasterSettings, DisasterType, -} from '../models/country.model'; -import { PlaceCode } from '../models/place-code.model'; -import { AdminLevelType } from '../types/admin-level'; -import { EapAction } from '../types/eap-action'; -import { EventState } from '../types/event-state'; -import { LeadTime } from '../types/lead-time'; -import { TimelineState } from '../types/timeline-state'; -import { AlertLabel, TriggeredArea } from '../types/triggered-area'; -import { AdminLevelService } from './admin-level.service'; -import { DisasterTypeService } from './disaster-type.service'; -import { EventService } from './event.service'; -import { PlaceCodeService } from './place-code.service'; -import { TimelineService } from './timeline.service'; +} from 'src/app/models/country.model'; +import { PlaceCode } from 'src/app/models/place-code.model'; +import { AdminLevelService } from 'src/app/services/admin-level.service'; +import { ApiService } from 'src/app/services/api.service'; +import { CountryService } from 'src/app/services/country.service'; +import { DisasterTypeService } from 'src/app/services/disaster-type.service'; +import { EventService } from 'src/app/services/event.service'; +import { PlaceCodeService } from 'src/app/services/place-code.service'; +import { TimelineService } from 'src/app/services/timeline.service'; +import { AdminLevelType } from 'src/app/types/admin-level'; +import { EapAction } from 'src/app/types/eap-action'; +import { EventState } from 'src/app/types/event-state'; +import { LeadTime } from 'src/app/types/lead-time'; +import { TimelineState } from 'src/app/types/timeline-state'; +import { AlertLabel, TriggeredArea } from 'src/app/types/triggered-area'; @Injectable({ providedIn: 'root', diff --git a/interfaces/IBF-dashboard/src/app/services/event.service.ts b/interfaces/IBF-dashboard/src/app/services/event.service.ts index 8878f1980..50f75e62e 100644 --- a/interfaces/IBF-dashboard/src/app/services/event.service.ts +++ b/interfaces/IBF-dashboard/src/app/services/event.service.ts @@ -1,22 +1,22 @@ import { Injectable } from '@angular/core'; +import { + differenceInDays, + differenceInHours, + differenceInMonths, +} from 'date-fns'; import { DateTime } from 'luxon'; import { BehaviorSubject, Observable } from 'rxjs'; -import { ApiService } from 'src/app/services/api.service'; -import { CountryService } from 'src/app/services/country.service'; -import { LeadTimeTriggerKey, LeadTimeUnit } from 'src/app/types/lead-time'; import { Country, CountryDisasterSettings, DisasterType, -} from '../models/country.model'; -import { DisasterTypeKey } from '../types/disaster-type-key'; -import { EventState } from '../types/event-state'; -import { DisasterTypeService } from './disaster-type.service'; -import { - differenceInDays, - differenceInHours, - differenceInMonths, -} from 'date-fns'; +} from 'src/app/models/country.model'; +import { ApiService } from 'src/app/services/api.service'; +import { CountryService } from 'src/app/services/country.service'; +import { DisasterTypeService } from 'src/app/services/disaster-type.service'; +import { DisasterTypeKey } from 'src/app/types/disaster-type-key'; +import { EventState } from 'src/app/types/event-state'; +import { LeadTimeTriggerKey, LeadTimeUnit } from 'src/app/types/lead-time'; export class EventSummary { countryCodeISO3: string; @@ -179,7 +179,9 @@ export class EventService { this.country.countryCodeISO3, this.disasterType.disasterType, ) - .subscribe((date) => this.onRecentDates(date, events)); + .subscribe((date) => { + this.onRecentDates(date, events); + }); }; private onRecentDates = (date, events) => { diff --git a/interfaces/IBF-dashboard/src/app/services/loader.interceptor.service.ts b/interfaces/IBF-dashboard/src/app/services/loader.interceptor.service.ts index ce541d32f..f8f533851 100644 --- a/interfaces/IBF-dashboard/src/app/services/loader.interceptor.service.ts +++ b/interfaces/IBF-dashboard/src/app/services/loader.interceptor.service.ts @@ -8,7 +8,7 @@ import { import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { tap } from 'rxjs/operators'; -import { LoaderService } from './loader.service'; +import { LoaderService } from 'src/app/services/loader.service'; @Injectable({ providedIn: 'root', diff --git a/interfaces/IBF-dashboard/src/app/services/loader.service.spec.ts b/interfaces/IBF-dashboard/src/app/services/loader.service.spec.ts index e03eb135a..3e2a1d424 100644 --- a/interfaces/IBF-dashboard/src/app/services/loader.service.spec.ts +++ b/interfaces/IBF-dashboard/src/app/services/loader.service.spec.ts @@ -1,5 +1,5 @@ import { TestBed } from '@angular/core/testing'; -import { LoaderService } from './loader.service'; +import { LoaderService } from 'src/app/services/loader.service'; describe('LoaderService', () => { let service: LoaderService; diff --git a/interfaces/IBF-dashboard/src/app/services/map-legend.service.ts b/interfaces/IBF-dashboard/src/app/services/map-legend.service.ts index 2356a45cc..335130dc4 100644 --- a/interfaces/IBF-dashboard/src/app/services/map-legend.service.ts +++ b/interfaces/IBF-dashboard/src/app/services/map-legend.service.ts @@ -1,24 +1,24 @@ import { Injectable } from '@angular/core'; -import { Country, DisasterType } from '../models/country.model'; -import { breakKey } from '../models/map.model'; -import { EventState } from '../types/event-state'; +import { Country, DisasterType } from 'src/app/models/country.model'; +import { breakKey } from 'src/app/models/map.model'; +import { CountryService } from 'src/app/services/country.service'; +import { DisasterTypeService } from 'src/app/services/disaster-type.service'; +import { EventService } from 'src/app/services/event.service'; +import { MapService } from 'src/app/services/map.service'; +import { EventState } from 'src/app/types/event-state'; import { IbfLayer, IbfLayerLabel, IbfLayerName, wmsLegendType, -} from '../types/ibf-layer'; -import { NumberFormat } from '../types/indicator-group'; -import { CountryService } from './country.service'; -import { DisasterTypeService } from './disaster-type.service'; -import { EventService } from './event.service'; -import { MapService } from './map.service'; +} from 'src/app/types/ibf-layer'; +import { NumberFormat } from 'src/app/types/indicator-group'; enum SingleRowLegendType { fullSquare = 'full-square', fullSquareGradient = 'full-square-gradient', - outlineSquare = 'outline-square', line = 'line', + outlineSquare = 'outline-square', pin = 'pin', } @Injectable({ @@ -266,9 +266,8 @@ export class MapLegendService { private getLabel = (grades, layer, labels) => (i) => { const label = labels ? ' - ' + labels[i] : ''; if (layer.colorBreaks) { - const valueLow = layer.colorBreaks && layer.colorBreaks[i + 1]?.valueLow; - const valueHigh = - layer.colorBreaks && layer.colorBreaks[i + 1]?.valueHigh; + const valueLow = layer.colorBreaks?.[i + 1]?.valueLow; + const valueHigh = layer.colorBreaks?.[i + 1]?.valueHigh; if (valueLow === valueHigh) { return this.numberFormat(valueHigh, layer) + label + '
'; } else { diff --git a/interfaces/IBF-dashboard/src/app/services/map-view.service.ts b/interfaces/IBF-dashboard/src/app/services/map-view.service.ts index d22d71d5c..1d10fd930 100644 --- a/interfaces/IBF-dashboard/src/app/services/map-view.service.ts +++ b/interfaces/IBF-dashboard/src/app/services/map-view.service.ts @@ -4,14 +4,14 @@ import { Country, CountryDisasterSettings, DisasterType, -} from '../models/country.model'; -import { PlaceCode } from '../models/place-code.model'; -import { EventState } from '../types/event-state'; -import { MapView } from '../types/map-view'; -import { CountryService } from './country.service'; -import { DisasterTypeService } from './disaster-type.service'; -import { EventService } from './event.service'; -import { PlaceCodeService } from './place-code.service'; +} from 'src/app/models/country.model'; +import { PlaceCode } from 'src/app/models/place-code.model'; +import { CountryService } from 'src/app/services/country.service'; +import { DisasterTypeService } from 'src/app/services/disaster-type.service'; +import { EventService } from 'src/app/services/event.service'; +import { PlaceCodeService } from 'src/app/services/place-code.service'; +import { EventState } from 'src/app/types/event-state'; +import { MapView } from 'src/app/types/map-view'; @Injectable({ providedIn: 'root', @@ -83,7 +83,7 @@ export class MapViewService { return; } - if (!this.eventState || !this.eventState.event) { + if (!this.eventState?.event) { this.setBreadcrumbsMapView(MapView.national); return; } diff --git a/interfaces/IBF-dashboard/src/app/services/place-code.service.spec.ts b/interfaces/IBF-dashboard/src/app/services/place-code.service.spec.ts index 9cdaa9897..f0da7356c 100644 --- a/interfaces/IBF-dashboard/src/app/services/place-code.service.spec.ts +++ b/interfaces/IBF-dashboard/src/app/services/place-code.service.spec.ts @@ -1,5 +1,5 @@ import { TestBed } from '@angular/core/testing'; -import { PlaceCodeService } from './place-code.service'; +import { PlaceCodeService } from 'src/app/services/place-code.service'; describe('PlaceCodeService', () => { let service: PlaceCodeService; diff --git a/interfaces/IBF-dashboard/src/app/services/point-marker.service.ts b/interfaces/IBF-dashboard/src/app/services/point-marker.service.ts index 6f3eabd06..18c938cd7 100644 --- a/interfaces/IBF-dashboard/src/app/services/point-marker.service.ts +++ b/interfaces/IBF-dashboard/src/app/services/point-marker.service.ts @@ -6,6 +6,13 @@ import { } from '@angular/core'; import { divIcon, icon, IconOptions, LatLng, Marker, marker } from 'leaflet'; import { DateTime } from 'luxon'; +import { + AnalyticsEvent, + AnalyticsPage, +} from 'src/app/analytics/analytics.enum'; +import { AnalyticsService } from 'src/app/analytics/analytics.service'; +import { CommunityNotificationPopupComponent } from 'src/app/components/community-notification-popup/community-notification-popup.component'; +import { DynamicPointPopupComponent } from 'src/app/components/leaflet-popup/dynamic-point-popup/dynamic-point-popup.component'; import { LEAFLET_MARKER_ICON_OPTIONS_BASE, LEAFLET_MARKER_ICON_OPTIONS_COMMUNITY_NOTIFICATION, @@ -20,6 +27,10 @@ import { LEAFLET_MARKER_ICON_OPTIONS_WATER_POINT, LEAFLET_MARKER_ICON_OPTIONS_WATER_POINT_EXPOSED, } from 'src/app/config'; +import { + CountryDisasterSettings, + EapAlertClasses, +} from 'src/app/models/country.model'; import { CommunityNotification, DamSite, @@ -33,17 +44,9 @@ import { Waterpoint, WaterpointInternal, } from 'src/app/models/poi.model'; -import { AnalyticsEvent, AnalyticsPage } from '../analytics/analytics.enum'; -import { AnalyticsService } from '../analytics/analytics.service'; -import { CommunityNotificationPopupComponent } from '../components/community-notification-popup/community-notification-popup.component'; -import { DynamicPointPopupComponent } from '../components/leaflet-popup/dynamic-point-popup/dynamic-point-popup.component'; -import { - CountryDisasterSettings, - EapAlertClasses, -} from '../models/country.model'; -import { IbfLayerName } from '../types/ibf-layer'; -import { LeadTime } from '../types/lead-time'; -import { EventService, EventSummary } from './event.service'; +import { EventService, EventSummary } from 'src/app/services/event.service'; +import { IbfLayerName } from 'src/app/types/ibf-layer'; +import { LeadTime } from 'src/app/types/lead-time'; @Injectable({ providedIn: 'root', diff --git a/interfaces/IBF-dashboard/src/app/services/timeline.service.ts b/interfaces/IBF-dashboard/src/app/services/timeline.service.ts index d8fa86674..3a81dc829 100644 --- a/interfaces/IBF-dashboard/src/app/services/timeline.service.ts +++ b/interfaces/IBF-dashboard/src/app/services/timeline.service.ts @@ -1,26 +1,26 @@ import { Injectable } from '@angular/core'; import { DateTime } from 'luxon'; import { BehaviorSubject, Observable } from 'rxjs'; +import { + Country, + CountryDisasterSettings, + DisasterType, +} from 'src/app/models/country.model'; +import { CountryTriggers } from 'src/app/models/country-triggers.model'; import { ApiService } from 'src/app/services/api.service'; import { CountryService } from 'src/app/services/country.service'; +import { DisasterTypeService } from 'src/app/services/disaster-type.service'; +import { EventService } from 'src/app/services/event.service'; +import { PlaceCodeService } from 'src/app/services/place-code.service'; +import { DisasterTypeKey } from 'src/app/types/disaster-type-key'; +import { EventState } from 'src/app/types/event-state'; import { LeadTime, LeadTimeButtonInput, LeadTimeTriggerKey, LeadTimeUnit, } from 'src/app/types/lead-time'; -import { CountryTriggers } from '../models/country-triggers.model'; -import { - Country, - CountryDisasterSettings, - DisasterType, -} from '../models/country.model'; -import { DisasterTypeKey } from '../types/disaster-type-key'; -import { EventState } from '../types/event-state'; -import { TimelineState } from '../types/timeline-state'; -import { DisasterTypeService } from './disaster-type.service'; -import { EventService } from './event.service'; -import { PlaceCodeService } from './place-code.service'; +import { TimelineState } from 'src/app/types/timeline-state'; @Injectable({ providedIn: 'root', @@ -335,7 +335,7 @@ export class TimelineService { for (const leadTime of disasterLeadTimes) { // Push first only active lead-times .. if ( - visibleLeadTimes.map((lt) => lt.leadTime).indexOf(leadTime) === -1 && + !visibleLeadTimes.map((lt) => lt.leadTime).includes(leadTime) && this.isLeadTimeEnabled(leadTime, visibleLeadTimes) ) { if (this.hasDisabledTimeline(this.disasterType.disasterType)) { @@ -367,7 +367,7 @@ export class TimelineService { // .. and then all other lead-times if ( // skip already added leadTimes - visibleLeadTimes.map((lt) => lt.leadTime).indexOf(leadTime) === -1 && + !visibleLeadTimes.map((lt) => lt.leadTime).includes(leadTime) && // and decide for others to show or not this.filterVisibleLeadTimePerDisasterType( this.disasterType, @@ -448,13 +448,13 @@ export class TimelineService { return ( [ LeadTime.hour0, + LeadTime.hour120, + LeadTime.hour144, + LeadTime.hour168, LeadTime.hour24, LeadTime.hour48, LeadTime.hour72, LeadTime.hour96, - LeadTime.hour120, - LeadTime.hour144, - LeadTime.hour168, ].includes(leadTime) && // .. except if already one present for that day !activeLeadTimes diff --git a/interfaces/IBF-dashboard/src/app/shared.module.ts b/interfaces/IBF-dashboard/src/app/shared.module.ts index 3f3913495..59ed1ff8d 100644 --- a/interfaces/IBF-dashboard/src/app/shared.module.ts +++ b/interfaces/IBF-dashboard/src/app/shared.module.ts @@ -5,51 +5,51 @@ import { LeafletModule } from '@bluehalo/ngx-leaflet'; import { LeafletMarkerClusterModule } from '@bluehalo/ngx-leaflet-markercluster'; import { IonicModule } from '@ionic/angular'; import { TranslateModule } from '@ngx-translate/core'; -import { AnalyticsModule } from './analytics/analytics.module'; -import { AboutBtnComponent } from './components/about-btn/about-btn.component'; -import { ActionResultPopoverComponent } from './components/action-result-popover/action-result-popover.component'; -import { ActivationLogButtonComponent } from './components/activation-log-button/activation-log-button.component'; -import { AdminLevelComponent } from './components/admin-level/admin-level.component'; -import { AggregatesComponent } from './components/aggregates/aggregates.component'; -import { AreasOfFocusSummaryComponent } from './components/areas-of-focus-summary/areas-of-focus-summary.component'; -import { ChangePasswordPopoverComponent } from './components/change-password-popover/change-password-popover.component'; -import { ChatComponent } from './components/chat/chat.component'; -import { CommunityNotificationPhotoPopupComponent } from './components/community-notification-photo-popup/community-notification-photo-popup.component'; -import { CommunityNotificationPopupComponent } from './components/community-notification-popup/community-notification-popup.component'; -import { CountrySwitcherComponent } from './components/country-switcher/country-switcher.component'; -import { DateButtonComponent } from './components/date-button/date-button.component'; -import { DialogueTurnComponent } from './components/dialogue-turn/dialogue-turn.component'; -import { DisasterTypeComponent } from './components/disaster-type/disaster-type.component'; -import { DisclaimerToolbarComponent } from './components/disclaimer-toolbar/disclaimer-toolbar.component'; -import { EventSpeechBubbleComponent } from './components/event-speech-bubble/event-speech-bubble.component'; -import { EventSwitcherComponent } from './components/event-switcher/event-switcher.component'; -import { ExportViewPopoverComponent } from './components/export-view-popover/export-view-popover.component'; -import { ExportViewComponent } from './components/export-view/export-view.component'; -import { ForgotPasswordPopoverComponent } from './components/forgot-password-popover/forgot-password-popover.component'; -import { IbfButtonComponent } from './components/ibf-button/ibf-button.component'; -import { IbfGuideButtonComponent } from './components/ibf-guide-button/ibf-guide-button.component'; -import { IbfGuidePopoverComponent } from './components/ibf-guide-popover/ibf-guide-popover.component'; -import { LayerControlInfoPopoverComponent } from './components/layer-control-info-popover/layer-control-info-popover.component'; -import { DynamicPointPopupComponent } from './components/leaflet-popup/dynamic-point-popup/dynamic-point-popup.component'; -import { GlofasStationPopupContentComponent } from './components/leaflet-popup/glofas-station-popup-content/glofas-station-popup-content.component'; -import { RiverGaugePopupContentComponent } from './components/leaflet-popup/river-gauge-popup-content/river-gauge-popup-content.component'; -import { ThresholdBarComponent } from './components/leaflet-popup/threshold-bar/threshold-bar.component'; -import { TyphoonTrackpointPopupContentComponent } from './components/leaflet-popup/typhoon-trackpoint-popup-content/typhoon-trackpoint-popup-content.component'; -import { LoginFormComponent } from './components/login-form/login-form.component'; -import { LogosComponent } from './components/logos/logos.component'; -import { MapControlsComponent } from './components/map-controls/map-controls.component'; -import { MapComponent } from './components/map/map.component'; -import { MatrixComponent } from './components/matrix/matrix.component'; -import { ScreenOrientationPopoverComponent } from './components/screen-orientation-popover/screen-orientation-popover.component'; -import { TimelineComponent } from './components/timeline/timeline.component'; -import { TimestampComponent } from './components/timestamp/timestamp.component'; -import { ToggleTriggerPopoverComponent } from './components/toggle-trigger-popover/toggle-trigger-popover.component'; -import { TooltipPopoverComponent } from './components/tooltip-popover/tooltip-popover.component'; -import { TooltipComponent } from './components/tooltip/tooltip.component'; -import { UserStateComponent } from './components/user-state/user-state.component'; -import { BackendMockScenarioComponent } from './mocks/backend-mock-scenario-component/backend-mock-scenario.component'; -import { CompactPipe } from './pipes/compact.pipe'; -import { DisclaimerApproximateComponent } from './components/disclaimer-approximate/disclaimer-approximate.component'; +import { AnalyticsModule } from 'src/app/analytics/analytics.module'; +import { AboutBtnComponent } from 'src/app/components/about-btn/about-btn.component'; +import { ActionResultPopoverComponent } from 'src/app/components/action-result-popover/action-result-popover.component'; +import { ActivationLogButtonComponent } from 'src/app/components/activation-log-button/activation-log-button.component'; +import { AdminLevelComponent } from 'src/app/components/admin-level/admin-level.component'; +import { AggregatesComponent } from 'src/app/components/aggregates/aggregates.component'; +import { AreasOfFocusSummaryComponent } from 'src/app/components/areas-of-focus-summary/areas-of-focus-summary.component'; +import { ChangePasswordPopoverComponent } from 'src/app/components/change-password-popover/change-password-popover.component'; +import { ChatComponent } from 'src/app/components/chat/chat.component'; +import { CommunityNotificationPhotoPopupComponent } from 'src/app/components/community-notification-photo-popup/community-notification-photo-popup.component'; +import { CommunityNotificationPopupComponent } from 'src/app/components/community-notification-popup/community-notification-popup.component'; +import { CountrySwitcherComponent } from 'src/app/components/country-switcher/country-switcher.component'; +import { DateButtonComponent } from 'src/app/components/date-button/date-button.component'; +import { DialogueTurnComponent } from 'src/app/components/dialogue-turn/dialogue-turn.component'; +import { DisasterTypeComponent } from 'src/app/components/disaster-type/disaster-type.component'; +import { DisclaimerApproximateComponent } from 'src/app/components/disclaimer-approximate/disclaimer-approximate.component'; +import { DisclaimerToolbarComponent } from 'src/app/components/disclaimer-toolbar/disclaimer-toolbar.component'; +import { EventSpeechBubbleComponent } from 'src/app/components/event-speech-bubble/event-speech-bubble.component'; +import { EventSwitcherComponent } from 'src/app/components/event-switcher/event-switcher.component'; +import { ExportViewComponent } from 'src/app/components/export-view/export-view.component'; +import { ExportViewPopoverComponent } from 'src/app/components/export-view-popover/export-view-popover.component'; +import { ForgotPasswordPopoverComponent } from 'src/app/components/forgot-password-popover/forgot-password-popover.component'; +import { IbfButtonComponent } from 'src/app/components/ibf-button/ibf-button.component'; +import { IbfGuideButtonComponent } from 'src/app/components/ibf-guide-button/ibf-guide-button.component'; +import { IbfGuidePopoverComponent } from 'src/app/components/ibf-guide-popover/ibf-guide-popover.component'; +import { LayerControlInfoPopoverComponent } from 'src/app/components/layer-control-info-popover/layer-control-info-popover.component'; +import { DynamicPointPopupComponent } from 'src/app/components/leaflet-popup/dynamic-point-popup/dynamic-point-popup.component'; +import { GlofasStationPopupContentComponent } from 'src/app/components/leaflet-popup/glofas-station-popup-content/glofas-station-popup-content.component'; +import { RiverGaugePopupContentComponent } from 'src/app/components/leaflet-popup/river-gauge-popup-content/river-gauge-popup-content.component'; +import { ThresholdBarComponent } from 'src/app/components/leaflet-popup/threshold-bar/threshold-bar.component'; +import { TyphoonTrackpointPopupContentComponent } from 'src/app/components/leaflet-popup/typhoon-trackpoint-popup-content/typhoon-trackpoint-popup-content.component'; +import { LoginFormComponent } from 'src/app/components/login-form/login-form.component'; +import { LogosComponent } from 'src/app/components/logos/logos.component'; +import { MapComponent } from 'src/app/components/map/map.component'; +import { MapControlsComponent } from 'src/app/components/map-controls/map-controls.component'; +import { MatrixComponent } from 'src/app/components/matrix/matrix.component'; +import { ScreenOrientationPopoverComponent } from 'src/app/components/screen-orientation-popover/screen-orientation-popover.component'; +import { TimelineComponent } from 'src/app/components/timeline/timeline.component'; +import { TimestampComponent } from 'src/app/components/timestamp/timestamp.component'; +import { ToggleTriggerPopoverComponent } from 'src/app/components/toggle-trigger-popover/toggle-trigger-popover.component'; +import { TooltipComponent } from 'src/app/components/tooltip/tooltip.component'; +import { TooltipPopoverComponent } from 'src/app/components/tooltip-popover/tooltip-popover.component'; +import { UserStateComponent } from 'src/app/components/user-state/user-state.component'; +import { BackendMockScenarioComponent } from 'src/app/mocks/backend-mock-scenario-component/backend-mock-scenario.component'; +import { CompactPipe } from 'src/app/pipes/compact.pipe'; @NgModule({ imports: [ diff --git a/interfaces/IBF-dashboard/src/app/types/admin-level.ts b/interfaces/IBF-dashboard/src/app/types/admin-level.ts index 720e31e0b..2e890906e 100644 --- a/interfaces/IBF-dashboard/src/app/types/admin-level.ts +++ b/interfaces/IBF-dashboard/src/app/types/admin-level.ts @@ -6,9 +6,9 @@ export enum AdminLevel { } export enum AdminLevelType { - single = 'single', - deepest = 'deepest', - higher = 'higher', + deepest = 'deepest', // deepest of multiple admin-level + higher = 'higher', // non-deepest of multiple admin-level + single = 'single', // single admin level } export class AdminLevelLabel { diff --git a/interfaces/IBF-dashboard/src/app/types/disaster-type-key.ts b/interfaces/IBF-dashboard/src/app/types/disaster-type-key.ts index 93c5e7fb0..564b4c90f 100644 --- a/interfaces/IBF-dashboard/src/app/types/disaster-type-key.ts +++ b/interfaces/IBF-dashboard/src/app/types/disaster-type-key.ts @@ -1,9 +1,9 @@ export enum DisasterTypeKey { + dengue = 'dengue', + drought = 'drought', + flashFloods = 'flash-floods', floods = 'floods', heavyRain = 'heavy-rain', - dengue = 'dengue', malaria = 'malaria', - drought = 'drought', typhoon = 'typhoon', - flashFloods = 'flash-floods', } diff --git a/interfaces/IBF-dashboard/src/app/types/event-state.ts b/interfaces/IBF-dashboard/src/app/types/event-state.ts index 166a7a27c..16bb3dbbf 100644 --- a/interfaces/IBF-dashboard/src/app/types/event-state.ts +++ b/interfaces/IBF-dashboard/src/app/types/event-state.ts @@ -1,4 +1,4 @@ -import { EventSummary } from '../services/event.service'; +import { EventSummary } from 'src/app/services/event.service'; export class EventState { events: EventSummary[]; diff --git a/interfaces/IBF-dashboard/src/app/types/ibf-layer.ts b/interfaces/IBF-dashboard/src/app/types/ibf-layer.ts index 55b63d079..405760572 100644 --- a/interfaces/IBF-dashboard/src/app/types/ibf-layer.ts +++ b/interfaces/IBF-dashboard/src/app/types/ibf-layer.ts @@ -6,7 +6,7 @@ import { Marker, MarkerClusterGroup, } from 'leaflet'; -import { NumberFormat } from './indicator-group'; +import { NumberFormat } from 'src/app/types/indicator-group'; export class IbfLayerMetadata { name: IbfLayerName; @@ -33,7 +33,7 @@ export class IbfLayer { numberFormatMap?: NumberFormat; wms?: IbfLayerWMS; data?: GeoJSON.FeatureCollection; - leafletLayer?: Layer | LayerGroup | Marker | GeoJSON | MarkerClusterGroup; + leafletLayer?: GeoJSON | Layer | LayerGroup | Marker | MarkerClusterGroup; legendColor?: JSON | string; group?: IbfLayerGroup; dynamic?: boolean; @@ -44,8 +44,8 @@ export enum wmsLegendType { exposureLine = 'exposure-line', exposureSquare = 'exposure-square', gradient = 'gradient', - square = 'square', line = 'line', + square = 'square', } export enum IbfLayerThreshold { @@ -59,93 +59,93 @@ export enum IbfLayerType { } export enum IbfLayerName { - glofasStations = 'glofas_stations', - typhoonTrack = 'typhoon_track', - redCrossBranches = 'red_cross_branches', - redCrescentBranches = 'red_crescent_branches', - waterpoints = 'waterpoints', - floodExtent = 'flood_extent', - rainfallExtent = 'rainfall_extent', - rainfallForecast = 'rainfall_forecast', - population = 'population', adminRegions = 'adminRegions', adminRegions1 = 'adminRegions1', adminRegions2 = 'adminRegions2', adminRegions3 = 'adminRegions3', adminRegions4 = 'adminRegions4', + affectedPopulation = 'affected_population', + alertThreshold = 'alert_threshold', + communityNotifications = 'community_notifications', + covidRisk = 'covid_risk', cropland = 'cropland', + damSites = 'dams', + droughtPhaseClassification = 'drought_phase_classification', + evacuationCenters = 'evacuation_centers', + female_head_hh = 'female_head_hh', + flood_vulnerability_index = 'flood_vulnerability_index', + floodExtent = 'flood_extent', + gauges = 'gauges', + glofasStations = 'glofas_stations', grassland = 'grassland', + healthSites = 'health_sites', + hotspotGeneral = 'Hotspot_General', + hotspotHealth = 'Hotspot_Health', + hotspotNutrition = 'Hotspot_Nutrition', + hotspotWater = 'Hotspot_Water', + housesAffected = 'houses_affected', + ipcForecastLong = 'IPC_forecast_long', + ipcForecastShort = 'IPC_forecast_short', + livestockBodyCondition = 'livestock_body_condition', + malariaRisk = 'malaria_risk', + malariaSuitableTemperature = 'malaria_suitable_temperature', + motorizedTravelTimeToHealth = 'motorized_travel_time_to_health', + population = 'population', population_affected = 'population_affected', population_affected_percentage = 'population_affected_percentage', - populationTotal = 'populationTotal', - vulnerability_score = 'vulnerability_score', - flood_vulnerability_index = 'flood_vulnerability_index', - poverty_incidence = 'poverty_incidence', - female_head_hh = 'female_head_hh', - population_u8 = 'population_u8', population_over65 = 'population_over65', - wall_type = 'wall_type', - roof_type = 'roof_type', - covidRisk = 'covid_risk', - healthSites = 'health_sites', - damSites = 'dams', - alertThreshold = 'alert_threshold', + population_u5 = 'population_u5', + population_u8 = 'population_u8', + populationTotal = 'populationTotal', potentialCases = 'potential_cases', potentialCases65 = 'potential_cases_65', - potentialCasesU9 = 'potential_cases_U9', potentialCasesU5 = 'potential_cases_U5', - malariaRisk = 'malaria_risk', - vulnerableGroup = 'vulnerable_group', - vulnerableHousing = 'vulnerable_housing', + potentialCasesU9 = 'potential_cases_U9', + poverty_incidence = 'poverty_incidence', + probWithin50Km = 'prob_within_50km', + rainfall = 'rainfall', + rainfallExtent = 'rainfall_extent', + rainfallForecast = 'rainfall_forecast', + redCrescentBranches = 'red_crescent_branches', + redCrossBranches = 'red_cross_branches', + roads = 'roads', + roof_type = 'roof_type', + schools = 'schools', totalHouses = 'total_houses', - malariaSuitableTemperature = 'malaria_suitable_temperature', totalIdps = 'total_idps', - motorizedTravelTimeToHealth = 'motorized_travel_time_to_health', - walkingTravelTimeToHealth = 'walking_travel_time_to_health', travel_time_cities = 'travel_time_cities', - population_u5 = 'population_u5', - ipcForecastShort = 'IPC_forecast_short', - ipcForecastLong = 'IPC_forecast_long', - hotspotGeneral = 'Hotspot_General', - hotspotWater = 'Hotspot_Water', - hotspotHealth = 'Hotspot_Health', - hotspotNutrition = 'Hotspot_Nutrition', - windspeed = 'windspeed', - rainfall = 'rainfall', - housesAffected = 'houses_affected', - affectedPopulation = 'affected_population', - probWithin50Km = 'prob_within_50km', - droughtPhaseClassification = 'drought_phase_classification', + typhoonTrack = 'typhoon_track', vegetationCondition = 'vegetation_condition', - livestockBodyCondition = 'livestock_body_condition', - evacuationCenters = 'evacuation_centers', - communityNotifications = 'community_notifications', - schools = 'schools', + vulnerability_score = 'vulnerability_score', + vulnerableGroup = 'vulnerable_group', + vulnerableHousing = 'vulnerable_housing', + walkingTravelTimeToHealth = 'walking_travel_time_to_health', + wall_type = 'wall_type', + waterpoints = 'waterpoints', waterpointsInternal = 'waterpoints_internal', - roads = 'roads', - gauges = 'gauges', + windspeed = 'windspeed', } export enum IbfLayerLabel { - glofasStations = 'Glofas stations', - typhoonTrack = 'Typhoon track', - redCrossBranches = 'Red Cross branches', - redCrescentBranches = 'Red Crescent branches', - waterpoints = 'Waterpoints', - floodExtent = 'Flood extent', - rainfallExtent = 'Rainfall extent', - population = 'Population', - populationTotal = 'Total Population', adminRegions1 = 'Admin Level 1', adminRegions2 = 'Admin Level 2', adminRegions3 = 'Admin Level 3', adminRegions4 = 'Admin Level 4', - cropland = 'Cropland', - grassland = 'Grassland', covidRisk = 'Covid Risk', - healthSites = 'Health Sites', + cropland = 'Cropland', damSites = 'Dam Sites', evacuationCenters = 'Evacuation Centers', + floodExtent = 'Flood extent', + glofasStations = 'Glofas stations', + grassland = 'Grassland', + healthSites = 'Health Sites', + population = 'Population', + populationTotal = 'Total Population', + rainfallExtent = 'Rainfall extent', + redCrescentBranches = 'Red Crescent branches', + redCrossBranches = 'Red Cross branches', + typhoonTrack = 'Typhoon track', + waterpoints = 'Waterpoints', } export class IbfLayerWMS { @@ -161,9 +161,9 @@ export class IbfLayerWMS { } export enum IbfLayerGroup { + adminRegions = 'adminRegions', aggregates = 'aggregates', outline = 'outline', - adminRegions = 'adminRegions', point = 'point', wms = 'wms', } @@ -183,10 +183,10 @@ export class ColorBreak { } export enum LeafletPane { - overlayPane = 'overlayPane', - aggregatePane = 'ibf-aggregate', adminBoundaryPane = 'ibf-admin-boundaries', - wmsPane = 'ibf-wms', - popupPane = 'popup', + aggregatePane = 'ibf-aggregate', outline = 'outline', + overlayPane = 'overlayPane', + popupPane = 'popup', + wmsPane = 'ibf-wms', } diff --git a/interfaces/IBF-dashboard/src/app/types/indicator-group.ts b/interfaces/IBF-dashboard/src/app/types/indicator-group.ts index f2411d6fb..40abbd6c3 100644 --- a/interfaces/IBF-dashboard/src/app/types/indicator-group.ts +++ b/interfaces/IBF-dashboard/src/app/types/indicator-group.ts @@ -1,5 +1,9 @@ -import { LayerActivation } from '../models/layer-activation.enum'; -import { ColorBreaks, IbfLayerLabel, IbfLayerName } from './ibf-layer'; +import { LayerActivation } from 'src/app/models/layer-activation.enum'; +import { + ColorBreaks, + IbfLayerLabel, + IbfLayerName, +} from 'src/app/types/ibf-layer'; export class Indicator { countryDisasterTypes: JSON; diff --git a/interfaces/IBF-dashboard/src/app/types/lead-time.ts b/interfaces/IBF-dashboard/src/app/types/lead-time.ts index 265fb33a3..a36247828 100644 --- a/interfaces/IBF-dashboard/src/app/types/lead-time.ts +++ b/interfaces/IBF-dashboard/src/app/types/lead-time.ts @@ -1,3 +1,4 @@ +/* eslint-disable perfectionist/sort-enums */ /* eslint-disable @typescript-eslint/no-duplicate-enum-values */ export enum LeadTime { diff --git a/interfaces/IBF-dashboard/src/app/types/map-view.ts b/interfaces/IBF-dashboard/src/app/types/map-view.ts index 686c89c44..66447aa2e 100644 --- a/interfaces/IBF-dashboard/src/app/types/map-view.ts +++ b/interfaces/IBF-dashboard/src/app/types/map-view.ts @@ -1,7 +1,7 @@ export enum MapView { - national = 'national', - event = 'event', adminArea = 'admin-area', adminArea2 = 'admin-area2', adminArea3 = 'admin-area3', + event = 'event', + national = 'national', } diff --git a/interfaces/IBF-dashboard/src/app/types/timeline-state.ts b/interfaces/IBF-dashboard/src/app/types/timeline-state.ts index 22a6d3f7d..9cda5dc92 100644 --- a/interfaces/IBF-dashboard/src/app/types/timeline-state.ts +++ b/interfaces/IBF-dashboard/src/app/types/timeline-state.ts @@ -1,5 +1,5 @@ import { DateTime } from 'luxon'; -import { LeadTime, LeadTimeUnit } from './lead-time'; +import { LeadTime, LeadTimeUnit } from 'src/app/types/lead-time'; export class TimelineState { today: DateTime; diff --git a/interfaces/IBF-dashboard/src/app/types/triggered-area.ts b/interfaces/IBF-dashboard/src/app/types/triggered-area.ts index 0603247dd..6cd4e3032 100644 --- a/interfaces/IBF-dashboard/src/app/types/triggered-area.ts +++ b/interfaces/IBF-dashboard/src/app/types/triggered-area.ts @@ -1,5 +1,5 @@ -import { AdminLevel } from './admin-level'; -import { EapAction } from './eap-action'; +import { AdminLevel } from 'src/app/types/admin-level'; +import { EapAction } from 'src/app/types/eap-action'; export class TriggeredArea { actionsValue: number; @@ -19,7 +19,7 @@ export class TriggeredArea { } export enum AlertLabel { + alert = 'alert', // No-EAP trigger = 'trigger', // EAP trigger warning = 'warning', // EAP below-trigger - alert = 'alert', // No-EAP } diff --git a/interfaces/IBF-dashboard/src/main.ts b/interfaces/IBF-dashboard/src/main.ts index 8e6dfdcb4..3e3e8debf 100644 --- a/interfaces/IBF-dashboard/src/main.ts +++ b/interfaces/IBF-dashboard/src/main.ts @@ -1,12 +1,14 @@ import { enableProdMode } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; -import { AppModule } from './app/app.module'; -import { environment } from './environments/environment'; +import { AppModule } from 'src/app/app.module'; +import { environment } from 'src/environments/environment'; -if (['production', 'stage'].indexOf(environment.configuration) >= 0) { +if (['production', 'stage'].includes(environment.configuration)) { enableProdMode(); } platformBrowserDynamic() .bootstrapModule(AppModule) - .catch((err) => console.log(err)); + .catch((err) => { + console.log(err); + }); diff --git a/interfaces/IBF-dashboard/src/polyfills.ts b/interfaces/IBF-dashboard/src/polyfills.ts index 09c3639f0..df6f00c6a 100644 --- a/interfaces/IBF-dashboard/src/polyfills.ts +++ b/interfaces/IBF-dashboard/src/polyfills.ts @@ -42,12 +42,10 @@ * */ -import './zone-flags'; - +import 'src/zone-flags'; /*************************************************************************************************** * Zone JS is required by default for Angular itself. */ - import 'zone.js'; // Included with Angular CLI. /*************************************************************************************************** diff --git a/interfaces/IBF-dashboard/src/test.ts b/interfaces/IBF-dashboard/src/test.ts index 19fc8ba11..ff4efd206 100644 --- a/interfaces/IBF-dashboard/src/test.ts +++ b/interfaces/IBF-dashboard/src/test.ts @@ -1,6 +1,7 @@ // This file is required by karma.conf.js and loads recursively all the .spec and framework files import 'zone.js/testing'; + import { getTestBed } from '@angular/core/testing'; import { BrowserDynamicTestingModule,