From 54f16adca886dd9afc04fe768c51eeb80ca8a007 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 6 Oct 2023 10:17:44 +0200 Subject: [PATCH] Add accessibility role to notification div --- client/src/app/app.component.html | 6 ++++-- client/src/app/app.component.ts | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/client/src/app/app.component.html b/client/src/app/app.component.html index 7d43cf74e..e14e5a8c1 100644 --- a/client/src/app/app.component.html +++ b/client/src/app/app.component.html @@ -53,12 +53,14 @@
-
+

{{ message.summary }}

{{ message.detail }}

- +
diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index 42842987d..e598be56f 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts @@ -160,17 +160,33 @@ export class AppComponent implements OnInit, AfterViewInit { this.screenService.isBroadcastMessageDisplayed = false } + // --------------------------------------------------------------------------- + getNotificationIcon (message: { severity: 'success' | 'error' | 'info' }): GlobalIconName { switch (message.severity) { case 'error': return 'cross' + case 'success': return 'tick' + case 'info': return 'help' } } + getNotificationRole (message: { severity: 'success' | 'error' | 'info' }) { + switch (message.severity) { + case 'error': + return 'alert' + + default: + return 'status' + } + } + + // --------------------------------------------------------------------------- + private initRouteEvents () { const eventsObs = this.router.events