Skip to content

Commit 0eb2d5c

Browse files
andreaNekiandreaNeki
authored andcommitted
Improving accessibility on the new user registration page
1 parent ee7e835 commit 0eb2d5c

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

src/app/register-email-form/register-email-form.component.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@ <h1>{{MESSAGE_PREFIX + '.header'|translate}}</h1>
1414
<label class="font-weight-bold"
1515
for="email">{{MESSAGE_PREFIX + '.email' | translate}}</label>
1616
<input [className]="(email.invalid) && (email.dirty || email.touched) ? 'form-control is-invalid' :'form-control'"
17-
type="text" id="email" formControlName="email"/>
17+
type="text" id="email" formControlName="email"
18+
[attr.aria-label]="'register-email.aria.label'|translate"
19+
aria-describedby="email-errors-required email-error-not-valid"
20+
[attr.aria-invalid]="form.get('email')?.invalid"/>
1821
<div *ngIf="email.invalid && (email.dirty || email.touched)"
1922
class="invalid-feedback show-feedback">
20-
<span *ngIf="email.errors && email.errors.required">
23+
<span *ngIf="email.errors && email.errors.required" id="email-errors-required">
2124
{{ MESSAGE_PREFIX + '.email.error.required' | translate }}
2225
</span>
23-
<span *ngIf="email.errors && ((email.errors.pattern && this.typeRequest === TYPE_REQUEST_REGISTER) || email.errors.email)">
26+
<span *ngIf="email.errors && ((email.errors.pattern && this.typeRequest === TYPE_REQUEST_REGISTER) || email.errors.email)" id="email-error-not-valid">
2427
{{ MESSAGE_PREFIX + '.email.error.not-email-form' | translate }}
2528
<ng-container *ngIf="validMailDomains.length > 0">
2629
{{ MESSAGE_PREFIX + '.email.error.not-valid-domain' | translate: { domains: validMailDomains.join(', ') } }}

src/assets/i18n/en.json5

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6739,4 +6739,6 @@
67396739
"item.page.cc.license.disclaimer": "Except where otherwised noted, this item's license is described as",
67406740

67416741
"browse.search-form.placeholder": "Search the repository",
6742+
6743+
"register-email.aria.label": "Enter your e-mail address",
67426744
}

src/assets/i18n/es.json5

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8152,5 +8152,8 @@
81528152
//"browse.search-form.placeholder": "Search the repository",
81538153
"browse.search-form.placeholder": "Buscar en el repositorio",
81548154

8155+
// "register-email.aria.label": "Enter your e-mail address",
8156+
"register-email.aria.label": "Introduzca su dirección de correo electrónico",
8157+
81558158

81568159
}

src/assets/i18n/pt-BR.json5

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10249,4 +10249,7 @@
1024910249

1025010250
//"browse.search-form.placeholder": "Search the repository",
1025110251
"browse.search-form.placeholder": "Buscar no repositório",
10252+
10253+
// "register-email.aria.label": "Enter your e-mail address",
10254+
"register-email.aria.label": "Digite seu e-mail",
1025210255
}

0 commit comments

Comments
 (0)