Skip to content

Commit 83a591b

Browse files
FrancescoMolinaroAndrea Barbasso
authored andcommitted
Merged in task/ux-plus-2023_02_x/UXP-178 (pull request #20)
[UXP-178] fix accessibility Approved-by: Andrea Barbasso
2 parents 3817a5c + 1e8d676 commit 83a591b

6 files changed

Lines changed: 23 additions & 8 deletions

File tree

src/app/shared/carousel/carousel.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
</div>
2121
<div class="carousel-caption" *ngIf="item.indexableObject.metadata">
2222
<div class="carousel-caption-inner">
23-
<h3 data-test="carouselObjTitle" [class]="carouselOptions.titleStyle"
23+
<h1 data-test="carouselObjTitle" [class]="carouselOptions.titleStyle" class="h3"
2424
*ngIf="item.indexableObject.metadata[title]">
25-
{{item.indexableObject.metadata[title][0].value}}</h3>
25+
{{item.indexableObject.metadata[title][0].value}}</h1>
2626
<div data-test="carouselObjDesc" class="carousel-caption-text pr-3 pl-2" [class]="carouselOptions.captionStyle"
2727
*ngIf="item.indexableObject.metadata[description]; let descriptionObj">
2828
{{descriptionObj[0].value}}
@@ -51,7 +51,7 @@
5151
</div>
5252

5353
<div class="text-center play-pause-button">
54-
<button [disabled]="isLoading$ | async" type="button" class="btn btn-sm toggle-paused" (click)="togglePaused()">
54+
<button [disabled]="isLoading$ | async" [attr.aria-label]="'carousel.play.pause' | translate" type="button" class="btn btn-sm toggle-paused" (click)="togglePaused()">
5555
<i class="fas fa-play" *ngIf="paused"></i>
5656
<i class="fas fa-pause" *ngIf="!paused"></i>
5757
</button>

src/app/shared/explore/section-component/top-section/top-section.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div class="card-header">{{ 'explore.index.' + (topSection.titleKey ? topSection.titleKey : topSection.sortField) | translate }}</div>
55
</ng-container>
66
<ng-template #listView>
7-
<h3 class="mx-2">{{ 'explore.index.' + (topSection.titleKey ? topSection.titleKey : topSection.sortField) | translate }}</h3>
7+
<h1 class="h3 mx-2">{{ 'explore.index.' + (topSection.titleKey ? topSection.titleKey : topSection.sortField) | translate }}</h1>
88
</ng-template>
99
<div [ngClass]="{'card-body': topSection.showAsCard}">
1010
<div class="row pl-2" *ngIf="topSection.showLayoutSwitch">

src/app/social/social.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div id="a2a" [class.d-none]="!(showOnCurrentRoute$ | async)" data-a2a-scroll-show="0,60"
1+
<div [attr.aria-label]="'social.component.title' | translate" role="dialog" id="a2a" [class.d-none]="!(showOnCurrentRoute$ | async)" data-a2a-scroll-show="0,60"
22
class="a2a_kit a2a_kit_size_32 a2a_floating_style a2a_default_style" [attr.data-a2a-title]="title" [attr.data-a2a-url]="url">
33
<a *ngFor="let button of buttonList" [class]="'a2a_button_' + button" [class.a2a_counter]="showCounters && button !== 'facebook'"></a>
44
<a *ngIf="showPlusButton" class="a2a_dd" href="https://www.addtoany.com/share"></a>

src/app/social/social.component.spec.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { DOCUMENT } from '@angular/common';
44
import { ActivatedRoute } from '@angular/router';
55
import { StoreModule } from '@ngrx/store';
66
import { SocialService } from './social.service';
7+
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
8+
import { TranslateLoaderMock } from '../shared/mocks/translate-loader.mock';
79

810
describe('SocialComponent', () => {
911
let component: SocialComponent;
@@ -17,7 +19,15 @@ describe('SocialComponent', () => {
1719
beforeEach(async () => {
1820
await TestBed.configureTestingModule({
1921
declarations: [SocialComponent],
20-
imports: [StoreModule.forRoot({})],
22+
imports: [
23+
StoreModule.forRoot({}),
24+
TranslateModule.forRoot({
25+
loader: {
26+
provide: TranslateLoader,
27+
useClass: TranslateLoaderMock
28+
}
29+
})
30+
],
2131
providers: [
2232
{ provide: ActivatedRoute, useValue: activatedRouteStub },
2333
{ provide: SocialService, useValue: socialServiceStub },

src/app/social/social.module.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import { NgModule } from '@angular/core';
22
import { CommonModule } from '@angular/common';
3-
3+
import { TranslateModule } from '@ngx-translate/core';
44
import { SocialComponent } from './social.component';
55

66
@NgModule({
77
declarations: [
88
SocialComponent
99
],
1010
imports: [
11-
CommonModule
11+
CommonModule,
12+
TranslateModule
1213
],
1314
exports: [
1415
SocialComponent

src/assets/i18n/en.json5

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4357,6 +4357,8 @@
43574357

43584358
"none.listelement.badge": "Item",
43594359

4360+
"no.description.available": "No description available",
4361+
43604362
"openaire.broker.title": "OpenAIRE Broker",
43614363

43624364
"openaire.broker.topics.description": "Below you can see all the topics received from the subscriptions to OpenAIRE.",
@@ -5580,6 +5582,8 @@
55805582

55815583
"selectable-list-item-control.select": "Select item",
55825584

5585+
"social.component.title": "Social Share",
5586+
55835587
"sorting.ASC": "Ascending",
55845588

55855589
"sorting.DESC": "Descending",

0 commit comments

Comments
 (0)