From fa82a023c0af561a1a25f6f6634c4db98d23dcd6 Mon Sep 17 00:00:00 2001 From: Erik Tiekstra Date: Wed, 15 Dec 2021 08:44:43 +0100 Subject: [PATCH] Added possible fix for toLowerCase() errors in PROD --- .../src/app/components/toast-list/toast/toast.component.ts | 3 ++- .../components/reports-list/reports-list.component.html | 2 +- .../src/app/shared/utils/capitalize-words.util.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/mina-sidor-fa/src/app/components/toast-list/toast/toast.component.ts b/apps/mina-sidor-fa/src/app/components/toast-list/toast/toast.component.ts index 36ee04e..16e7c2b 100644 --- a/apps/mina-sidor-fa/src/app/components/toast-list/toast/toast.component.ts +++ b/apps/mina-sidor-fa/src/app/components/toast-list/toast/toast.component.ts @@ -27,7 +27,8 @@ export class ToastComponent implements AfterViewInit { } get className(): string { - return `toast toast--${this.error.severity.toLowerCase()}`; + const severity = this.error.severity || ErrorSeverity.HIGH; + return `toast toast--${severity.toLowerCase()}`; } emitCloseEvent(): void { diff --git a/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/deltagare-card/components/deltagare-tab-reports/components/reports-list/reports-list.component.html b/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/deltagare-card/components/deltagare-tab-reports/components/reports-list/reports-list.component.html index effb6a3..230b09d 100644 --- a/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/deltagare-card/components/deltagare-tab-reports/components/reports-list/reports-list.component.html +++ b/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/deltagare-card/components/deltagare-tab-reports/components/reports-list/reports-list.component.html @@ -53,7 +53,7 @@ [afActive]="activeReportMotivation" (afOnPrimaryClick)="closeMotivationDialog()" (afOnInactive)="closeMotivationDialog()" - [afHeading]="'Motivering till beslut: ' + activeReportMotivation.type + ' ' + activeReportMotivation.status.toLowerCase()" + [afHeading]="'Motivering till beslut: ' + activeReportMotivation.type + ' ' + activeReportMotivation.status?.toLowerCase()" afHeadingLevel="h2" afPrimaryButtonText="Stäng" > diff --git a/apps/mina-sidor-fa/src/app/shared/utils/capitalize-words.util.ts b/apps/mina-sidor-fa/src/app/shared/utils/capitalize-words.util.ts index c47ddde..66ea472 100644 --- a/apps/mina-sidor-fa/src/app/shared/utils/capitalize-words.util.ts +++ b/apps/mina-sidor-fa/src/app/shared/utils/capitalize-words.util.ts @@ -1,4 +1,4 @@ -export function capitalizeWords(words: string): string { +export function capitalizeWords(words: string = ''): string { return words .split(' ') .map(word => `${word.charAt(0).toUpperCase()}${word.slice(1).toLowerCase()}`)