Skip to content

Commit 85369aa

Browse files
authored
Merge pull request #2717 from alexandrevryghem/fix-accessibility-issues_contribute-main
Fix accessibility issues (part 2)
2 parents 5b9a98a + ca24713 commit 85369aa

66 files changed

Lines changed: 363 additions & 265 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/access-control/bulk-access/bulk-access.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<div class="container">
2+
<h1>{{ 'admin.access-control.bulk-access.title' | translate }}</h1>
23
<ds-bulk-access-browse [listId]="listId"></ds-bulk-access-browse>
34
<div class="clearfix mb-3"></div>
45
<ds-bulk-access-settings #dsBulkSettings ></ds-bulk-access-settings>

src/app/admin/admin-import-batch-page/batch-import-page.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="container">
2-
<h2 id="header">{{'admin.batch-import.page.header' | translate}}</h2>
2+
<h1 id="header">{{'admin.batch-import.page.header' | translate}}</h1>
33
<p>{{'admin.batch-import.page.help' | translate}}</p>
44
<p *ngIf="dso">
55
selected collection: <b>{{getDspaceObjectName()}}</b>&nbsp;
@@ -28,7 +28,7 @@ <h2 id="header">{{'admin.batch-import.page.header' | translate}}</h2>
2828
<small class="form-text text-muted">
2929
{{'admin.batch-import.page.toggle.help' | translate}}
3030
</small>
31-
31+
3232

3333
<ds-file-dropzone-no-uploader
3434
*ngIf="isUpload"

src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ <h1 id="header" class="border-bottom pb-2">{{'admin.registries.bitstream-formats
1919
<table id="formats" class="table table-striped table-hover">
2020
<thead>
2121
<tr>
22-
<th scope="col" [attr.aria-label]="'admin.registries.bitstream-formats.select' | translate"></th>
22+
<th scope="col"><span class="sr-only">{{'admin.registries.bitstream-formats.table.selected' | translate}}</span></th>
2323
<th scope="col">{{'admin.registries.bitstream-formats.table.id' | translate}}</th>
2424
<th scope="col">{{'admin.registries.bitstream-formats.table.name' | translate}}</th>
2525
<th scope="col">{{'admin.registries.bitstream-formats.table.mimetype' | translate}}</th>
@@ -35,6 +35,7 @@ <h1 id="header" class="border-bottom pb-2">{{'admin.registries.bitstream-formats
3535
[checked]="isSelected(bitstreamFormat) | async"
3636
(change)="selectBitStreamFormat(bitstreamFormat, $event)"
3737
>
38+
<span class="sr-only">{{'admin.registries.bitstream-formats.select' | translate}}}</span>
3839
</label>
3940
</td>
4041
<td><a [routerLink]="['/admin/registries/bitstream-formats', bitstreamFormat.id, 'edit']">{{bitstreamFormat.id}}</a></td>

src/app/admin/admin-registries/metadata-registry/metadata-registry.component.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="metadata-registry row">
33
<div class="col-12">
44

5-
<h2 id="header" class="border-bottom pb-2">{{'admin.registries.metadata.head' | translate}}</h2>
5+
<h1 id="header" class="border-bottom pb-2">{{'admin.registries.metadata.head' | translate}}</h1>
66

77
<p id="description" class="pb-2">{{'admin.registries.metadata.description' | translate}}</p>
88

@@ -19,7 +19,7 @@ <h2 id="header" class="border-bottom pb-2">{{'admin.registries.metadata.head' |
1919
<table id="metadata-schemas" class="table table-striped table-hover">
2020
<thead>
2121
<tr>
22-
<th scope="col"></th>
22+
<th scope="col"><span class="sr-only">{{'admin.registries.metadata.schemas.table.selected' | translate}}</span></th>
2323
<th scope="col">{{'admin.registries.metadata.schemas.table.id' | translate}}</th>
2424
<th scope="col">{{'admin.registries.metadata.schemas.table.namespace' | translate}}</th>
2525
<th scope="col">{{'admin.registries.metadata.schemas.table.name' | translate}}</th>
@@ -34,6 +34,7 @@ <h2 id="header" class="border-bottom pb-2">{{'admin.registries.metadata.head' |
3434
[checked]="isSelected(schema) | async"
3535
(change)="selectMetadataSchema(schema, $event)"
3636
>
37+
<span class="sr-only">{{((isSelected(schema) | async) ? 'admin.registries.metadata.schemas.deselect' : 'admin.registries.metadata.schemas.select') | translate}}</span>
3738
</label>
3839
</td>
3940
<td class="selectable-row" (click)="editSchema(schema)"><a [routerLink]="[schema.prefix]">{{schema.id}}</a></td>

src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<div *ngIf="registryService.getActiveMetadataSchema() | async; then editheader; else createHeader"></div>
22

33
<ng-template #createHeader>
4-
<h4>{{messagePrefix + '.create' | translate}}</h4>
4+
<h2>{{messagePrefix + '.create' | translate}}</h2>
55
</ng-template>
66

77
<ng-template #editheader>
8-
<h4>{{messagePrefix + '.edit' | translate}}</h4>
8+
<h2>{{messagePrefix + '.edit' | translate}}</h2>
99
</ng-template>
1010

1111
<ds-form [formId]="formId"

src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<div *ngIf="registryService.getActiveMetadataField() | async; then editheader; else createHeader"></div>
22

33
<ng-template #createHeader>
4-
<h4>{{messagePrefix + '.create' | translate}}</h4>
4+
<h2>{{messagePrefix + '.create' | translate}}</h2>
55
</ng-template>
66

77
<ng-template #editheader>
8-
<h4>{{messagePrefix + '.edit' | translate}}</h4>
8+
<h2>{{messagePrefix + '.edit' | translate}}</h2>
99
</ng-template>
1010

1111
<ds-form [formId]="formId"

src/app/admin/admin-registries/metadata-schema/metadata-schema.component.html

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<div class="metadata-schema row">
33
<div class="col-12" *ngVar="(metadataSchema$ | async) as schema">
44

5-
<h2 id="header" class="border-bottom pb-2">{{'admin.registries.schema.head' | translate}}: "{{schema?.prefix}}"</h2>
5+
<h1 id="header" class="border-bottom pb-2">{{'admin.registries.schema.head' | translate}}: "{{schema?.prefix}}"</h1>
66

77
<p id="description" class="pb-2">{{'admin.registries.schema.description' | translate:{ namespace: schema?.namespace } }}</p>
88

99
<ds-metadata-field-form
1010
[metadataSchema]="schema"
1111
(submitForm)="forceUpdateFields()"></ds-metadata-field-form>
1212

13-
<h3>{{'admin.registries.schema.fields.head' | translate}}</h3>
13+
<h2>{{'admin.registries.schema.fields.head' | translate}}</h2>
1414

1515
<ng-container *ngVar="(metadataFields$ | async)?.payload as fields">
1616
<ds-pagination
@@ -24,7 +24,7 @@ <h3>{{'admin.registries.schema.fields.head' | translate}}</h3>
2424
<table id="metadata-fields" class="table table-striped table-hover">
2525
<thead>
2626
<tr>
27-
<th></th>
27+
<th><span class="sr-only">{{'admin.registries.schema.fields.table.selected' | translate}}</span></th>
2828
<th scope="col">{{'admin.registries.schema.fields.table.id' | translate}}</th>
2929
<th scope="col">{{'admin.registries.schema.fields.table.field' | translate}}</th>
3030
<th scope="col">{{'admin.registries.schema.fields.table.scopenote' | translate}}</th>
@@ -33,12 +33,11 @@ <h3>{{'admin.registries.schema.fields.head' | translate}}</h3>
3333
<tbody>
3434
<tr *ngFor="let field of fields?.page"
3535
[ngClass]="{'table-primary' : isActive(field) | async}">
36-
<td>
37-
<label class="mb-0">
38-
<input type="checkbox"
39-
[checked]="isSelected(field) | async"
40-
(change)="selectMetadataField(field, $event)">
41-
</label>
36+
<td *ngVar="(isSelected(field) | async) as selected">
37+
<input type="checkbox"
38+
[attr.aria-label]="(selected ? 'admin.registries.schema.fields.deselect' : 'admin.registries.schema.fields.select') | translate"
39+
[checked]="selected"
40+
(change)="selectMetadataField(field, $event)">
4241
</td>
4342
<td class="selectable-row" (click)="editField(field)">{{field.id}}</td>
4443
<td class="selectable-row" (click)="editField(field)">{{schema?.prefix}}.{{field.element}}{{field.qualifier ? '.' + field.qualifier : ''}}</td>

src/app/collection-page/collection-page.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<!-- Collection logo -->
1414
<ds-comcol-page-logo *ngIf="logoRD$"
1515
[logo]="(logoRD$ | async)?.payload"
16-
[alternateText]="'Collection Logo'">
16+
[alternateText]="'collection.logo' | translate">
1717
</ds-comcol-page-logo>
1818

1919
<!-- Handle -->

src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<div class="container-fluid mb-2" *ngVar="(itemTemplateRD$ | async) as itemTemplateRD">
2-
<label>{{ 'collection.edit.template.label' | translate}}</label>
2+
<span class="d-inline-block mb-2">{{ 'collection.edit.template.label' | translate}}</span>
33
<div class="button-row space-children-mr">
44
<button *ngIf="!itemTemplateRD?.payload" class="btn btn-success" (click)="addItemTemplate()">
5-
<i class="fas fa-plus"></i>
5+
<i class="fas fa-plus" aria-hidden="true"></i>
66
<span class="d-none d-sm-inline">&nbsp;{{"collection.edit.template.add-button" | translate}}</span>
77
</button>
88
<button *ngIf="itemTemplateRD?.payload" class="btn btn-danger" (click)="deleteItemTemplate()">
9-
<i class="fas fa-trash-alt"></i>
9+
<i class="fas fa-trash-alt" aria-hidden="true"></i>
1010
<span class="d-none d-sm-inline">&nbsp;{{"collection.edit.template.delete-button" | translate}}</span>
1111
</button>
1212
<button *ngIf="itemTemplateRD?.payload" class="btn btn-primary"
1313
[routerLink]="'/collections/' + (dsoRD$ | async)?.payload.uuid + '/itemtemplate'">
14-
<i class="fas fa-edit"></i>
14+
<i class="fas fa-edit" aria-hidden="true"></i>
1515
<span class="d-none d-sm-inline">&nbsp;{{"collection.edit.template.edit-button" | translate}}</span>
1616
</button>
1717
</div>

src/app/community-list-page/community-list/community-list.component.html

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<cdk-tree-node *cdkTreeNodeDef="let node; when: isShowMore" cdkTreeNodePadding
55
class="example-tree-node show-more-node">
66
<div class="btn-group">
7-
<button type="button" class="btn btn-default" cdkTreeNodeToggle>
8-
<span class="fa fa-chevron-right invisible" aria-hidden="true"></span>
9-
</button>
7+
<span aria-hidden="true" class="btn btn-default invisible" cdkTreeNodeToggle>
8+
<span class="fa fa-chevron-right"></span>
9+
</span>
1010
<div class="align-middle pt-2">
1111
<button *ngIf="!(dataSource.loading$ | async)" (click)="getNextPage(node)"
1212
class="btn btn-outline-primary btn-sm" role="button">
@@ -24,15 +24,18 @@
2424
<cdk-tree-node *cdkTreeNodeDef="let node; when: hasChild" cdkTreeNodePadding
2525
class="example-tree-node expandable-node">
2626
<div class="btn-group">
27-
<button type="button" class="btn btn-default" cdkTreeNodeToggle
28-
[title]="'toggle ' + dsoNameService.getName(node.payload)"
29-
[attr.aria-label]="'toggle ' + dsoNameService.getName(node.payload)"
27+
<button *ngIf="hasChild(null, node) | async" type="button" class="btn btn-default" cdkTreeNodeToggle
28+
[attr.aria-label]="(node.isExpanded ? 'communityList.collapse' : 'communityList.expand') | translate:{ name: dsoNameService.getName(node.payload) }"
3029
(click)="toggleExpanded(node)"
31-
[ngClass]="(hasChild(null, node)| async) ? 'visible' : 'invisible'"
32-
[attr.data-test]="(hasChild(null, node)| async) ? 'expand-button' : ''">
30+
data-test="expand-button">
3331
<span class="{{node.isExpanded ? 'fa fa-chevron-down' : 'fa fa-chevron-right'}}"
3432
aria-hidden="true"></span>
33+
<span class="sr-only">{{ (node.isExpanded ? 'communityList.collapse' : 'communityList.expand') | translate:{ name: dsoNameService.getName(node.payload) } }}</span>
3534
</button>
35+
<!--Don't render the button when non-expandable otherwise it's still accessible, instead render this placeholder-->
36+
<span *ngIf="!(hasChild(null, node) | async)" aria-hidden="true" class="btn btn-default invisible">
37+
<span class="fa fa-chevron-right"></span>
38+
</span>
3639
<div class="d-flex flex-row">
3740
<span class="align-middle pt-2 lead">
3841
<a [routerLink]="node.route" class="lead">{{ dsoNameService.getName(node.payload) }}</a>
@@ -44,10 +47,9 @@
4447
<ds-truncatable [id]="node.id">
4548
<div class="text-muted" cdkTreeNodePadding>
4649
<div class="d-flex" *ngIf="node.payload.shortDescription">
47-
<button type="button" class="btn btn-default invisible">
48-
<span class="{{node.isExpanded ? 'fa fa-chevron-down' : 'fa fa-chevron-right'}}"
49-
aria-hidden="true"></span>
50-
</button>
50+
<span aria-hidden="true" class="btn btn-default invisible">
51+
<span class="fa fa-chevron-right"></span>
52+
</span>
5153
<ds-truncatable-part [id]="node.id" [minLines]="3">
5254
<span>{{node.payload.shortDescription}}</span>
5355
</ds-truncatable-part>
@@ -56,31 +58,29 @@
5658
</ds-truncatable>
5759
<div class="d-flex" *ngIf="node===loadingNode && dataSource.loading$ | async"
5860
cdkTreeNodePadding>
59-
<button type="button" class="btn btn-default invisible">
60-
<span class="{{node.isExpanded ? 'fa fa-chevron-down' : 'fa fa-chevron-right'}}"
61-
aria-hidden="true"></span>
62-
</button>
61+
<span aria-hidden="true" class="btn btn-default invisible">
62+
<span class="fa fa-chevron-right"></span>
63+
</span>
6364
<ds-themed-loading class="ds-themed-loading"></ds-themed-loading>
6465
</div>
6566
</cdk-tree-node>
6667
<!-- This is the tree node template for leaf nodes (collections and (sub)coms without children) -->
6768
<cdk-tree-node *cdkTreeNodeDef="let node; when: !(hasChild && isShowMore)" cdkTreeNodePadding
6869
class="example-tree-node childless-node">
6970
<div class="btn-group">
70-
<button type="button" class="btn btn-default" cdkTreeNodeToggle>
71-
<span class="fa fa-chevron-right invisible" aria-hidden="true"></span>
72-
</button>
71+
<span aria-hidden="true" class="btn btn-default invisible" cdkTreeNodeToggle>
72+
<span class="fa fa-chevron-right"></span>
73+
</span>
7374
<h6 class="align-middle pt-2">
7475
<a [routerLink]="node.route" class="lead">{{ dsoNameService.getName(node.payload) }}</a>
7576
</h6>
7677
</div>
7778
<ds-truncatable [id]="node.id">
7879
<div class="text-muted" cdkTreeNodePadding>
7980
<div class="d-flex" *ngIf="node.payload.shortDescription">
80-
<button type="button" class="btn btn-default invisible">
81-
<span class="{{node.isExpanded ? 'fa fa-chevron-down' : 'fa fa-chevron-right'}}"
82-
aria-hidden="true"></span>
83-
</button>
81+
<span aria-hidden="true" class="btn btn-default invisible">
82+
<span class="fa fa-chevron-right"></span>
83+
</span>
8484
<ds-truncatable-part [id]="node.id" [minLines]="3">
8585
<span>{{node.payload.shortDescription}}</span>
8686
</ds-truncatable-part>

0 commit comments

Comments
 (0)