Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix dismissible error alert and fix a11y #1116

Merged
merged 2 commits into from
Feb 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/src/app/error/error-alert.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ngb-alert *ngIf="alert && alert.type && alert.msg" [type]="alert.type" [dismissible]="false">
<div class="d-flex">
<p i18n="@@error.subtitle" class="font-size-16 font-weight-bold mr-auto mb-2">Sorry, an error has occurred</p>
<a (click)="close(alert)" (keyup)="closeOldestAlert()" tabindex="0">
<a (click)="close(alert)" (keyup.esc)="closeOldestAlert()" (keyup.enter)="closeOldestAlert()" tabindex="0">
<svg width="12" height="12" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M16 1.61143L14.3886 0L8 6.38857L1.61143 0L0 1.61143L6.38857 8L0 14.3886L1.61143 16L8 9.61143L14.3886 16L16 14.3886L9.61143 8L16 1.61143Z"
Expand Down
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
Loading