diff --git a/webapp/src/ts/app.component.ts b/webapp/src/ts/app.component.ts index c72260073df..12e193bbfd6 100644 --- a/webapp/src/ts/app.component.ts +++ b/webapp/src/ts/app.component.ts @@ -94,7 +94,7 @@ export class AppComponent implements OnInit, AfterViewInit { unreadCount = {}; hasOldNav = false; initialisationComplete = false; - trainingCardFormId = false; + trainingCardFormId = ''; constructor ( private dbSyncService:DBSyncService, @@ -446,7 +446,7 @@ export class AppComponent implements OnInit, AfterViewInit { ]) => { this.replicationStatus = replicationStatus; this.androidAppVersion = androidAppVersion; - this.currentTab = currentTab; + this.currentTab = currentTab || ''; this.selectMode = selectMode; }); @@ -462,7 +462,7 @@ export class AppComponent implements OnInit, AfterViewInit { ]) => { this.showPrivacyPolicy = showPrivacyPolicy; this.privacyPolicyAccepted = privacyPolicyAccepted; - this.trainingCardFormId = trainingCardFormId; + this.trainingCardFormId = trainingCardFormId || ''; this.displayTrainingCards(); }); } diff --git a/webapp/src/ts/effects/global.effects.ts b/webapp/src/ts/effects/global.effects.ts index 419ef7f6a76..dcc81ee9407 100644 --- a/webapp/src/ts/effects/global.effects.ts +++ b/webapp/src/ts/effects/global.effects.ts @@ -66,7 +66,7 @@ export class GlobalEffects { .toPromise(); } - private navigate(nextUrl: string, cancelCallback: () => void) { + private navigate(nextUrl: string, cancelCallback: (() => void) | null) { try { if (nextUrl) { return this.router.navigateByUrl(nextUrl); diff --git a/webapp/src/ts/modules/contacts/contacts-more-menu.component.ts b/webapp/src/ts/modules/contacts/contacts-more-menu.component.ts index c0e6313adfa..b990af41d61 100644 --- a/webapp/src/ts/modules/contacts/contacts-more-menu.component.ts +++ b/webapp/src/ts/modules/contacts/contacts-more-menu.component.ts @@ -24,7 +24,7 @@ export class ContactsMoreMenuComponent implements OnInit, OnDestroy { private hasDeletePermission = false; private isOnlineOnly = false; private loadingContent = true; - private snapshotData: Data | undefined; + private snapshotData: Data | null = null; private userSettings; selectedContactDoc; diff --git a/webapp/src/ts/modules/messages/messages.component.html b/webapp/src/ts/modules/messages/messages.component.html index a521a12f0c7..7d9a24264d4 100644 --- a/webapp/src/ts/modules/messages/messages.component.html +++ b/webapp/src/ts/modules/messages/messages.component.html @@ -1,5 +1,6 @@
+
diff --git a/webapp/src/ts/modules/reports/reports-more-menu.component.ts b/webapp/src/ts/modules/reports/reports-more-menu.component.ts index 25ad576e0e3..a320b94c9c1 100644 --- a/webapp/src/ts/modules/reports/reports-more-menu.component.ts +++ b/webapp/src/ts/modules/reports/reports-more-menu.component.ts @@ -31,7 +31,7 @@ export class ReportsMoreMenuComponent implements OnInit, OnDestroy { private hasUpdatePermission = false; private selectMode = false; private loadingContent?: boolean; - private snapshotData: Data | undefined; + private snapshotData: Data | null = null; private isOnlineOnly?: boolean; private dialogRef: MatDialogRef | undefined; private bottomSheetRef: MatBottomSheetRef | undefined; diff --git a/webapp/src/ts/reducers/global.ts b/webapp/src/ts/reducers/global.ts index c009ed6428e..f7c3889e08d 100644 --- a/webapp/src/ts/reducers/global.ts +++ b/webapp/src/ts/reducers/global.ts @@ -1,4 +1,5 @@ import { createReducer, on } from '@ngrx/store'; +import { Data } from '@angular/router'; import { Actions } from '@mm-actions/global'; import { SidebarMenu } from '@mm-components/sidebar-menu/sidebar-menu.component'; @@ -7,25 +8,25 @@ import { EnketoStatus } from '@mm-components/enketo/enketo.component'; import { VersionNumber } from '@mm-services/browser-detector.service'; export interface GlobalState { - androidAppVersion: VersionNumber | undefined; + androidAppVersion: VersionNumber | null; navigation: { - cancelCallback: null|(() => void); - preventNavigation: null|boolean; - cancelTranslationKey: null|string; - recordTelemetry: null|string; + cancelCallback: (() => void) | null; + preventNavigation: null | boolean; + cancelTranslationKey: null | string; + recordTelemetry: null | string; }; - currentTab: null|string; - snapshotData: null|Record; + currentTab: null | string; + snapshotData: Data | null; enketoStatus: EnketoStatus; facilities: Record[]; filters: Record; // Selected criteria to filter data. sidebarFilter: { isOpen?: boolean; - filterCount?: number; + filterCount?: Record; defaultFilters?: Record; }; sidebarMenu: SidebarMenu; - forms: null|Record[]; + forms: null | Record[]; lastChangedDoc: boolean; loadingContent: boolean; processingReportVerification: boolean; @@ -34,16 +35,16 @@ export interface GlobalState { privacyPolicyAccepted: boolean; showContent: boolean; showPrivacyPolicy: boolean; - title: null|string; + title: null | string; unreadCount: Record; snackbarContent: Snackbar; translationsLoaded: boolean; - userFacilityId: null|string[]; - trainingCardFormId: null|string; + userFacilityId: null | string[]; + trainingCardFormId: null | string; } const initialState: GlobalState = { - androidAppVersion: undefined, + androidAppVersion: null, navigation: { cancelCallback: null, preventNavigation: null, diff --git a/webapp/src/ts/services/browser-detector.service.ts b/webapp/src/ts/services/browser-detector.service.ts index 131f0c643f0..076b9cda220 100644 --- a/webapp/src/ts/services/browser-detector.service.ts +++ b/webapp/src/ts/services/browser-detector.service.ts @@ -1,10 +1,11 @@ import { Injectable } from '@angular/core'; import * as Bowser from 'bowser'; import { Store } from '@ngrx/store'; + import { Selectors } from '@mm-selectors/index'; + const OUTDATED_BROWSER_VERSION_MIN = '74'; const OUTDATED_BROWSER_VERSION_MAX = '90'; - type VersionSuffix = `` | `-${string}`; export type VersionNumber = 'SNAPSHOT' | `v${string}.${string}.${string}${VersionSuffix}`; @@ -13,7 +14,7 @@ export type VersionNumber = 'SNAPSHOT' | `v${string}.${string}.${string}${Versio }) export class BrowserDetectorService { private _parser?: Bowser.Parser.Parser; - private androidAppVersion: VersionNumber | undefined; + private androidAppVersion: VersionNumber | null = null; public constructor(private store: Store) { this.store.select(Selectors.getAndroidAppVersion).subscribe(androidAppVersion => {