111731: Minimize all the facets when adding filter through advanced component & filter suggestions

This commit is contained in:
Alexandre Vryghem
2024-05-07 12:09:47 +02:00
parent 1f42f92344
commit e66035c896
3 changed files with 5 additions and 0 deletions

View File

@@ -97,6 +97,7 @@ export class AdvancedSearchComponent implements OnInit, OnDestroy {
applyFilter(): void { applyFilter(): void {
if (isNotEmpty(this.currentValue)) { if (isNotEmpty(this.currentValue)) {
this.searchFilterService.minimizeAll();
this.subs.push(this.searchConfigurationService.selectNewAppliedFilterParams(this.currentFilter, this.currentValue.trim(), this.currentOperator).pipe(take(1)).subscribe((params: Params) => { this.subs.push(this.searchConfigurationService.selectNewAppliedFilterParams(this.currentFilter, this.currentValue.trim(), this.currentOperator).pipe(take(1)).subscribe((params: Params) => {
void this.router.navigate([this.searchService.getSearchLink()], { void this.router.navigate([this.searchService.getSearchLink()], {
queryParams: params, queryParams: params,

View File

@@ -212,6 +212,7 @@ export class SearchFacetFilterComponent implements OnInit, OnDestroy {
*/ */
protected applyFilterValue(data: string): void { protected applyFilterValue(data: string): void {
if (data.match(new RegExp(`^.+,(equals|query|authority)$`))) { if (data.match(new RegExp(`^.+,(equals|query|authority)$`))) {
this.filterService.minimizeAll();
const valueParts = data.split(','); const valueParts = data.split(',');
this.subs.push(this.searchConfigService.selectNewAppliedFilterParams(this.filterConfig.name, valueParts.slice(0, valueParts.length - 1).join(), valueParts[valueParts.length - 1]).pipe(take(1)).subscribe((params: Params) => { this.subs.push(this.searchConfigService.selectNewAppliedFilterParams(this.filterConfig.name, valueParts.slice(0, valueParts.length - 1).join(), valueParts[valueParts.length - 1]).pipe(take(1)).subscribe((params: Params) => {
void this.router.navigate(this.getSearchLinkParts(), { void this.router.navigate(this.getSearchLinkParts(), {

View File

@@ -71,4 +71,7 @@ export class SearchFilterServiceStub {
resetPage(_filterName: string): void { resetPage(_filterName: string): void {
} }
minimizeAll(): void {
}
} }