Skip to content

Commit 38570f5

Browse files
nsemetsNazar690
andauthored
Fix/accessibility (#359)
* fix(accessibility): update accessibility for some pages * fix(accessibility): added aria labels * fix(updates): clean up code * fix(routes): removed unused route * fix(accessibility): added aria labels to institutions * fix(accessibility): removed aria label for header button * fix(metadata): fixed spacing * fix(resource-metadata): fixed url --------- Co-authored-by: Nazar Semets <nazar690@gmail.com>
1 parent 2dedc73 commit 38570f5

70 files changed

Lines changed: 245 additions & 230 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/app/app.routes.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ export const routes: Routes = [
3535
canActivate: [authGuard],
3636
providers: [provideStates([ProjectsState])],
3737
},
38-
{
39-
path: 'confirm/:userId/:token',
40-
loadComponent: () => import('./features/home/home.component').then((mod) => mod.HomeComponent),
41-
data: { skipBreadcrumbs: true },
42-
},
4338
{
4439
path: 'register',
4540
canActivate: [redirectIfLoggedInGuard],

src/app/core/components/root/root.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
</div>
2727
}
2828

29-
<p-confirm-dialog styleClass="w-full md:w-6 xl:w-5" />
29+
<p-confirm-dialog id="dialog" styleClass="w-full md:w-6 xl:w-5" [header]="'common.dialogs.confirmation' | translate" />

src/app/core/components/root/root.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { TranslatePipe } from '@ngx-translate/core';
2+
13
import { ConfirmDialog } from 'primeng/confirmdialog';
24

35
import { CommonModule } from '@angular/common';
@@ -23,6 +25,7 @@ import { IS_MEDIUM, IS_WEB } from '@osf/shared/helpers';
2325
BreadcrumbComponent,
2426
RouterOutlet,
2527
SidenavComponent,
28+
TranslatePipe,
2629
],
2730
templateUrl: './root.component.html',
2831
styleUrls: ['./root.component.scss'],

src/app/features/admin-institutions/components/admin-table/admin-table.component.html

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@
3232
[showToggleAll]="false"
3333
[showClear]="false"
3434
[dropdownIcon]="'hidden'"
35+
[ariaLabel]="'common.accessibility.customizeOptions' | translate"
3536
>
3637
<ng-template let-values pTemplate="selectedItems">
3738
<div class="flex align-items-center gap-2">
38-
<i class="fa fa-table-columns text-primary font-bold"></i>
39-
<span>{{ 'adminInstitutions.institutionUsers.customize' | translate }}</span>
39+
<i class="fas fa-table-columns text-primary text-xl"></i>
40+
<span class="text-primary">{{ 'adminInstitutions.institutionUsers.customize' | translate }}</span>
4041
</div>
4142
</ng-template>
4243

@@ -49,18 +50,19 @@
4950
icon="fa fa-download text-primary text-xl"
5051
outlined
5152
styleClass="grey-border-color"
53+
[ariaLabel]="'common.buttons.download' | translate"
5254
(onClick)="downloadMenu.toggle($event)"
5355
/>
5456

5557
@if (reportsLink()) {
5658
<a
5759
pButton
5860
[href]="reportsLink()"
59-
class="p-button p-button-outlined p-button-sm p-06 font-bold grey-border-color child-button-0-padding no-underline"
61+
icon="fas fa-chart-pie text-xl"
62+
class="p-button p-button-outlined font-bold grey-border-color no-underline"
6063
target="_blank"
61-
>
62-
<i class="fa fa-chart-pie text-xl"></i>
63-
</a>
64+
[attr.aria-label]="'common.buttons.reportsLink' | translate"
65+
></a>
6466
}
6567
</div>
6668
</div>
@@ -112,7 +114,7 @@
112114
<a
113115
[href]="getLinkUrl(rowData[col.field])"
114116
[target]="getLinkTarget(rowData[col.field], col)"
115-
class="text-primary no-underline hover:underline"
117+
class="font-bold no-underline hover:underline"
116118
>
117119
@if (col.dateFormat) {
118120
{{ getCellValue(rowData[col.field]) | date: col.dateFormat }}
@@ -135,6 +137,7 @@
135137
[icon]="col.iconClass"
136138
variant="text"
137139
severity="info"
140+
[ariaLabel]="'common.accessibility.tooltipBtn' | translate"
138141
(onClick)="onIconClick(rowData, col)"
139142
/>
140143
}
@@ -158,14 +161,21 @@
158161
@if (isNextPreviousPagination()) {
159162
<div class="flex column-gap-2 w-full justify-content-center pt-2">
160163
@if (firstLink() && prevLink()) {
161-
<p-button icon="fas fa-angles-left" severity="contrast" text (click)="switchPage(firstLink())" />
164+
<p-button
165+
icon="fas fa-angles-left"
166+
severity="contrast"
167+
text
168+
[ariaLabel]="'common.accessibility.goToFirstPage' | translate"
169+
(onClick)="switchPage(firstLink())"
170+
/>
162171
}
163172

164173
<p-button
165174
icon="fas fa-angle-left"
166175
severity="contrast"
167176
text
168177
[disabled]="!prevLink()"
178+
[ariaLabel]="'common.accessibility.goToPreviousPage' | translate"
169179
(onClick)="switchPage(prevLink())"
170180
/>
171181

@@ -174,6 +184,7 @@
174184
severity="contrast"
175185
text
176186
[disabled]="!nextLink()"
187+
[ariaLabel]="'common.accessibility.goToNextPage' | translate"
177188
(onClick)="switchPage(nextLink())"
178189
/>
179190
</div>

src/app/features/admin-institutions/mappers/institution-preprint-to-table-data.mapper.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
import { extractPathAfterDomain } from '@osf/features/admin-institutions/helpers';
21
import { ResourceModel } from '@shared/models';
32

3+
import { extractPathAfterDomain } from '../helpers';
44
import { TableCellData, TableCellLink } from '../models';
55

66
export function mapPreprintResourceToTableData(preprint: ResourceModel): TableCellData {
77
return {
8-
title: {
9-
text: preprint.title,
10-
url: preprint.absoluteUrl,
11-
target: '_blank',
12-
} as TableCellLink,
8+
title: preprint.title,
139
link: {
1410
text: preprint.absoluteUrl.split('/').pop() || preprint.absoluteUrl,
1511
url: preprint.absoluteUrl,

src/app/features/admin-institutions/mappers/institution-project-to-table-data.mapper.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
import { extractPathAfterDomain } from '@osf/features/admin-institutions/helpers';
2-
import { TableCellData, TableCellLink } from '@osf/features/admin-institutions/models';
31
import { ResourceModel } from '@shared/models';
42

3+
import { extractPathAfterDomain } from '../helpers';
4+
import { TableCellData, TableCellLink } from '../models';
5+
56
export function mapProjectResourceToTableCellData(project: ResourceModel): TableCellData {
67
return {
7-
title: {
8-
url: project.absoluteUrl,
9-
text: project.title,
10-
} as TableCellLink,
8+
title: project.title,
119
link: {
1210
url: project.absoluteUrl,
1311
text: project.absoluteUrl.split('/').pop() || project.absoluteUrl,

src/app/features/admin-institutions/mappers/institution-registration-to-table-data.mapper.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ import { TableCellData, TableCellLink } from '../models';
55

66
export function mapRegistrationResourceToTableData(registration: ResourceModel): TableCellData {
77
return {
8-
title: {
9-
text: registration.title,
10-
url: registration.absoluteUrl,
11-
target: '_blank',
12-
} as TableCellLink,
8+
title: registration.title,
139
link: {
1410
text: registration.absoluteUrl.split('/').pop() || registration.absoluteUrl,
1511
url: registration.absoluteUrl,

src/app/features/admin-institutions/mappers/institution-user-to-table-data.mapper.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
import { InstitutionUser, TableCellData } from '@osf/features/admin-institutions/models';
1+
import { InstitutionUser, TableCellData } from '../models';
22

33
import { environment } from 'src/environments/environment';
44

55
export function mapUserToTableCellData(user: InstitutionUser): TableCellData {
66
return {
77
id: user.id,
8-
userName: user.userName
9-
? {
10-
text: user.userName,
11-
url: `${environment.webUrl}/${user.userId}`,
12-
target: '_blank',
13-
}
14-
: '-',
8+
userName: user.userName || '-',
159
department: user.department || '-',
1610
userLink: {
1711
text: user.userId,

src/app/features/admin-institutions/pages/institutions-preprints/institutions-preprints.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ <h3 class="title">
1818
<div slot="otherFilters">
1919
<p-button
2020
styleClass="grey-border-color"
21-
icon="fa fa-filter text-primary text-xl"
21+
icon="fas fa-filter text-primary text-xl"
2222
[label]="'adminInstitutions.common.filters' | translate"
2323
outlined
2424
(onClick)="filtersVisible.set(!filtersVisible())"

src/app/features/admin-institutions/pages/institutions-projects/institutions-projects.component.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
[reportsLink]="institution()!.linkToExternalReportsArchive"
1212
>
1313
<div slot="amount" class="flex items-center">
14-
<h3 class="title">{{ resourcesCount() }} {{ 'adminInstitutions.projects.totalProjects' | translate }}</h3>
14+
<p class="text-primary font-bold">
15+
{{ resourcesCount() }} {{ 'adminInstitutions.projects.totalProjects' | translate }}
16+
</p>
1517
</div>
1618

1719
<div slot="otherFilters">
1820
<p-button
1921
styleClass="grey-border-color"
20-
icon="fa fa-filter text-primary text-xl"
22+
icon="fas fa-filter text-primary text-xl"
2123
[label]="'adminInstitutions.common.filters' | translate"
2224
outlined
2325
(onClick)="filtersVisible.set(!filtersVisible())"

0 commit comments

Comments
 (0)