Merge branch 'dspace-7_x' into task/dspace-7_x/CST-15595

# Conflicts:
#	src/assets/i18n/en.json5
This commit is contained in:
Andrea Barbasso
2025-01-31 15:09:03 +01:00
6 changed files with 26 additions and 3 deletions

View File

@@ -1,7 +1,8 @@
<a *ngIf="isVisible | async" class="d-flex flex-row"
[tabIndex]="-1"
[routerLink]="[searchLink]"
[queryParams]="addQueryParams" queryParamsHandling="merge">
[queryParams]="addQueryParams" queryParamsHandling="merge"
(click)="announceFilter()">
<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">

View File

@@ -19,6 +19,7 @@ import { PaginationComponentOptions } from '../../../../../pagination/pagination
import { PaginationService } from '../../../../../../core/pagination/pagination.service';
import { PaginationServiceStub } from '../../../../../testing/pagination-service.stub';
import { ShortNumberPipe } from '../../../../../utils/short-number.pipe';
import { UUIDService } from '../../../../../../core/shared/uuid.service';
describe('SearchFacetOptionComponent', () => {
let comp: SearchFacetOptionComponent;
@@ -113,7 +114,8 @@ describe('SearchFacetOptionComponent', () => {
}
/* eslint-enable no-empty, @typescript-eslint/no-empty-function */
}
}
},
{ provide: UUIDService, useClass: UUIDService },
],
schemas: [NO_ERRORS_SCHEMA]
}).overrideComponent(SearchFacetOptionComponent, {

View File

@@ -2,10 +2,12 @@ import { combineLatest as observableCombineLatest, Observable, Subscription } fr
import { map } from 'rxjs/operators';
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
import { FacetValue } from '../../../../models/facet-value.model';
import { SearchFilterConfig } from '../../../../models/search-filter-config.model';
import { SearchService } from '../../../../../../core/shared/search/search.service';
import { SearchFilterService } from '../../../../../../core/shared/search/search-filter.service';
import { LiveRegionService } from '../../../../../../shared/live-region/live-region.service';
import { SearchConfigurationService } from '../../../../../../core/shared/search/search-configuration.service';
import { hasValue } from '../../../../../empty.util';
import { currentPath } from '../../../../../utils/route.utils';
@@ -67,7 +69,9 @@ export class SearchFacetOptionComponent implements OnInit, OnDestroy {
protected filterService: SearchFilterService,
protected searchConfigService: SearchConfigurationService,
protected router: Router,
protected paginationService: PaginationService
protected paginationService: PaginationService,
protected liveRegionService: LiveRegionService,
private translateService: TranslateService,
) {
}
@@ -129,4 +133,12 @@ export class SearchFacetOptionComponent implements OnInit, OnDestroy {
this.sub.unsubscribe();
}
}
/**
* 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);
}
}

View File

@@ -5402,6 +5402,8 @@
"forgot-email.form.aria.label": "Enter your e-mail address",
"search-facet-option.update.announcement": "The page will be reloaded. Filter {{ filter }} is selected.",
"live-region.ordering.instructions": "Press spacebar to reorder {{ itemName }}.",
"live-region.ordering.status": "{{ itemName }}, grabbed. Current position in list: {{ index }} of {{ length }}. Press up and down arrow keys to change position, SpaceBar to drop, Escape to cancel.",

View File

@@ -7839,4 +7839,7 @@
// "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.",
}

View File

@@ -7866,4 +7866,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.",
}