mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Merge pull request #3918 from tdonohue/port_3385_to_8x
[Port dspace-8_x] Accessibility when selecting a search filter
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
[tabIndex]="-1"
|
||||
[routerLink]="[searchLink]"
|
||||
[queryParams]="addQueryParams$ | async"
|
||||
(click)="filterService.minimizeAll()">
|
||||
(click)="announceFilter(); filterService.minimizeAll()">
|
||||
<label class="mb-0 d-flex w-100">
|
||||
<input type="checkbox" [checked]="false" class="my-1 align-self-stretch filter-checkbox"/>
|
||||
<span class="w-100 pl-1 break-facet">
|
||||
|
@@ -12,7 +12,10 @@ import {
|
||||
Router,
|
||||
RouterLink,
|
||||
} from '@angular/router';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import {
|
||||
TranslateModule,
|
||||
TranslateService,
|
||||
} from '@ngx-translate/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
@@ -20,6 +23,7 @@ import { PaginationService } from '../../../../../../core/pagination/pagination.
|
||||
import { SearchService } from '../../../../../../core/shared/search/search.service';
|
||||
import { SearchConfigurationService } from '../../../../../../core/shared/search/search-configuration.service';
|
||||
import { SearchFilterService } from '../../../../../../core/shared/search/search-filter.service';
|
||||
import { LiveRegionService } from '../../../../../../shared/live-region/live-region.service';
|
||||
import { currentPath } from '../../../../../utils/route.utils';
|
||||
import { ShortNumberPipe } from '../../../../../utils/short-number.pipe';
|
||||
import { FacetValue } from '../../../../models/facet-value.model';
|
||||
@@ -75,6 +79,8 @@ export class SearchFacetOptionComponent implements OnInit {
|
||||
protected searchConfigService: SearchConfigurationService,
|
||||
protected router: Router,
|
||||
protected paginationService: PaginationService,
|
||||
protected liveRegionService: LiveRegionService,
|
||||
private translateService: TranslateService,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -119,4 +125,11 @@ export class SearchFacetOptionComponent implements OnInit {
|
||||
return getFacetValueForType(this.filterValue, this.filterConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* Announces to the screen reader that the page will be reloaded, which filter has been selected
|
||||
*/
|
||||
announceFilter() {
|
||||
const message = this.translateService.instant('search-facet-option.update.announcement', { filter: this.filterValue.value });
|
||||
this.liveRegionService.addMessage(message);
|
||||
}
|
||||
}
|
||||
|
@@ -6775,4 +6775,6 @@
|
||||
"register-page.registration.aria.label": "Enter your e-mail address",
|
||||
|
||||
"forgot-email.form.aria.label": "Enter your e-mail address",
|
||||
|
||||
"search-facet-option.update.announcement": "The page will be reloaded. Filter {{ filter }} is selected.",
|
||||
}
|
||||
|
@@ -10201,5 +10201,6 @@
|
||||
// "forgot-email.form.aria.label": "Enter your e-mail address",
|
||||
"forgot-email.form.aria.label": "Introduzca su dirección de correo electrónico",
|
||||
|
||||
|
||||
}
|
||||
// "search-facet-option.update.announcement": "The page will be reloaded. Filter {{ filter }} is selected.",
|
||||
"search-facet-option.update.announcement": "La página será recargada. Filtro {{ filter }} seleccionado.",
|
||||
}
|
||||
|
@@ -10258,4 +10258,7 @@
|
||||
|
||||
// "forgot-email.form.aria.label": "Enter your e-mail address",
|
||||
"forgot-email.form.aria.label": "Digite seu e-mail",
|
||||
|
||||
// "search-facet-option.update.announcement": "The page will be reloaded. Filter {{ filter }} is selected.",
|
||||
"search-facet-option.update.announcement": "A página será recarregada. O filtro {{ filter }} foi selecionado.",
|
||||
}
|
||||
|
Reference in New Issue
Block a user