Skip to content

Commit 0d87a72

Browse files
authored
Merge pull request #4417 from atmire/w2p-131442_backport-4335-to-dspace-7_x
[Port dspace-7_x] Improve accessibility for screen readers
2 parents a17d58a + b6448a7 commit 0d87a72

File tree

36 files changed

+135
-92
lines changed

36 files changed

+135
-92
lines changed

cypress/e2e/header.cy.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,24 @@ describe('Header', () => {
1515
cy.visit('/');
1616

1717
// Click the language switcher (globe) in header
18-
cy.get('a[data-test="lang-switch"]').click();
18+
cy.get('button[data-test="lang-switch"]').click();
1919
// Click on the "Deusch" language in dropdown
20-
cy.get('#language-menu-list li').contains('Deutsch').click();
20+
cy.get('#language-menu-list div[role="option"]').contains('Deutsch').click();
2121

2222
// HTML "lang" attribute should switch to "de"
2323
cy.get('html').invoke('attr', 'lang').should('eq', 'de');
2424

2525
// Login menu should now be in German
26-
cy.get('a[data-test="login-menu"]').contains('Anmelden');
26+
cy.get('[data-test="login-menu"]').contains('Anmelden');
2727

2828
// Change back to English from language switcher
29-
cy.get('a[data-test="lang-switch"]').click();
30-
cy.get('#language-menu-list li').contains('English').click();
29+
cy.get('button[data-test="lang-switch"]').click();
30+
cy.get('#language-menu-list div[role="option"]').contains('English').click();
3131

3232
// HTML "lang" attribute should switch to "en"
3333
cy.get('html').invoke('attr', 'lang').should('eq', 'en');
3434

3535
// Login menu should now be in English
36-
cy.get('a[data-test="login-menu"]').contains('Log In');
36+
cy.get('[data-test="login-menu"]').contains('Log In');
3737
});
3838
});

src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-issue/journal-issue-search-result-grid-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<a *ngIf="linkType != linkTypes.None"
77
[target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'"
88
[attr.rel]="(linkType == linkTypes.ExternalLink) ? 'noopener noreferrer' : null" [routerLink]="[itemPageRoute]"
9-
class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate" role="link" tabindex="0">
9+
class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate" role="link" tabindex="-1">
1010
<div>
1111
<ds-themed-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="false">
1212
</ds-themed-thumbnail>

src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-volume/journal-volume-search-result-grid-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<a *ngIf="linkType != linkTypes.None"
77
[target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'"
88
[attr.rel]="(linkType == linkTypes.ExternalLink) ? 'noopener noreferrer' : null" [routerLink]="[itemPageRoute]"
9-
class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate" role="link" tabindex="0">
9+
class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate" role="link" tabindex="-1">
1010
<div>
1111
<ds-themed-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="false">
1212
</ds-themed-thumbnail>

src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal/journal-search-result-grid-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<a *ngIf="linkType != linkTypes.None"
77
[target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'"
88
[attr.rel]="(linkType == linkTypes.ExternalLink) ? 'noopener noreferrer' : null" [routerLink]="[itemPageRoute]"
9-
class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate" role="link" tabindex="0">
9+
class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate" role="link" tabindex="-1">
1010
<div>
1111
<ds-themed-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="false">
1212
</ds-themed-thumbnail>

src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div *ngIf="showThumbnails" class="col-3 col-md-2">
33
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'"
44
[attr.rel]="(linkType == linkTypes.ExternalLink) ? 'noopener noreferrer' : null"
5-
[routerLink]="[itemPageRoute]" class="lead item-list-title dont-break-out" role="link" tabindex="0">
5+
[routerLink]="[itemPageRoute]" class="lead item-list-title dont-break-out" role="link" tabindex="-1">
66
<ds-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="true">
77
</ds-thumbnail>
88
</a>

src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div *ngIf="showThumbnails" class="col-3 col-md-2">
33
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'"
44
[attr.rel]="(linkType == linkTypes.ExternalLink) ? 'noopener noreferrer' : null"
5-
[routerLink]="[itemPageRoute]" class="lead item-list-title dont-break-out" role="link" tabindex="0">
5+
[routerLink]="[itemPageRoute]" class="lead item-list-title dont-break-out" role="link" tabindex="-1">
66
<ds-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="true">
77
</ds-thumbnail>
88
</a>

src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="row">
22
<div *ngIf="showThumbnails" class="col-3 col-md-2">
33
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" [attr.rel]="(linkType == linkTypes.ExternalLink) ? 'noopener noreferrer' : null"
4-
[routerLink]="[itemPageRoute]" class="lead item-list-title dont-break-out" role="link" tabindex="0">
4+
[routerLink]="[itemPageRoute]" class="lead item-list-title dont-break-out" role="link" tabindex="-1">
55
<ds-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="true">
66
</ds-thumbnail>
77
</a>

src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/org-unit/org-unit-search-result-grid-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<a *ngIf="linkType != linkTypes.None"
77
[target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'"
88
[attr.rel]="(linkType == linkTypes.ExternalLink) ? 'noopener noreferrer' : null" [routerLink]="[itemPageRoute]"
9-
class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate" role="link" tabindex="0">
9+
class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate" role="link" tabindex="-1">
1010
<div>
1111
<ds-themed-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="false">
1212
</ds-themed-thumbnail>

src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/person/person-search-result-grid-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<a *ngIf="linkType != linkTypes.None"
77
[target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'"
88
[attr.rel]="(linkType == linkTypes.ExternalLink) ? 'noopener noreferrer' : null" [routerLink]="[itemPageRoute]"
9-
class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate" role="link" tabindex="0">
9+
class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate" role="link" tabindex="-1">
1010
<div>
1111
<ds-themed-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="false">
1212
</ds-themed-thumbnail>

src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/project/project-search-result-grid-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<a *ngIf="linkType != linkTypes.None"
77
[target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'"
88
[attr.rel]="(linkType == linkTypes.ExternalLink) ? 'noopener noreferrer' : null" [routerLink]="[itemPageRoute]"
9-
class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate" role="link" tabindex="0">
9+
class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate" role="link" tabindex="-1">
1010
<div>
1111
<ds-themed-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="false">
1212
</ds-themed-thumbnail>

0 commit comments

Comments
 (0)