Added possible fix for toLowerCase() errors in PROD
This commit is contained in:
@@ -27,7 +27,8 @@ export class ToastComponent implements AfterViewInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get className(): string {
|
get className(): string {
|
||||||
return `toast toast--${this.error.severity.toLowerCase()}`;
|
const severity = this.error.severity || ErrorSeverity.HIGH;
|
||||||
|
return `toast toast--${severity.toLowerCase()}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
emitCloseEvent(): void {
|
emitCloseEvent(): void {
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
[afActive]="activeReportMotivation"
|
[afActive]="activeReportMotivation"
|
||||||
(afOnPrimaryClick)="closeMotivationDialog()"
|
(afOnPrimaryClick)="closeMotivationDialog()"
|
||||||
(afOnInactive)="closeMotivationDialog()"
|
(afOnInactive)="closeMotivationDialog()"
|
||||||
[afHeading]="'Motivering till beslut: ' + activeReportMotivation.type + ' ' + activeReportMotivation.status.toLowerCase()"
|
[afHeading]="'Motivering till beslut: ' + activeReportMotivation.type + ' ' + activeReportMotivation.status?.toLowerCase()"
|
||||||
afHeadingLevel="h2"
|
afHeadingLevel="h2"
|
||||||
afPrimaryButtonText="Stäng"
|
afPrimaryButtonText="Stäng"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export function capitalizeWords(words: string): string {
|
export function capitalizeWords(words: string = ''): string {
|
||||||
return words
|
return words
|
||||||
.split(' ')
|
.split(' ')
|
||||||
.map(word => `${word.charAt(0).toUpperCase()}${word.slice(1).toLowerCase()}`)
|
.map(word => `${word.charAt(0).toUpperCase()}${word.slice(1).toLowerCase()}`)
|
||||||
|
|||||||
Reference in New Issue
Block a user