Skip to content

Commit

Permalink
fix dismissible error alert and fix a11y
Browse files Browse the repository at this point in the history
  • Loading branch information
auumgn committed Feb 9, 2024
1 parent 6edc51f commit ec0c175
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
9 changes: 8 additions & 1 deletion ui/src/app/shared/alert/alert.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
<ngb-alert *ngIf="alert && alert.type && alert.msg" [type]="alert.type" [dismissible]="false" class="alert-success">
<div class="d-flex">
<div class="font-size-16 flex-grow-1">{{ alert.msg | localize }}</div>
<a (click)="close(alert)" (keyup)="closeOldestAlert()" tabindex="0" class="close">×</a>
<a
(click)="close(alert)"
(keyup.esc)="closeOldestAlert()"
(keyup.enter)="closeOldestAlert()"
tabindex="0"
class="close"
>×</a
>
</div>
</ngb-alert>
</div>
Expand Down
10 changes: 9 additions & 1 deletion ui/src/app/user/user-update.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,21 @@ <h1 id="jhi-ms-user-heading" class="mt-5" i18n="@@gatewayApp.msUserServiceMSUser
class="alert alert-danger alert-dismissible"
role="alert"
ng-reflect-type="danger"
(close)="validation.errors = null"
[dismissible]="false"
>
<ul class="validation-errors">
<li *ngFor="let error of validation.errors">
{{ error }}
</li>
</ul>
<a
(click)="validation.errors = null"
(keyup.esc)="validation.errors = null"
(keyup.enter)="validation.errors = null"
tabindex="0"
class="close"
>×</a
>
</ngb-alert>
</div>
<div class="form-group">
Expand Down

0 comments on commit ec0c175

Please sign in to comment.