Skip to content

Commit

Permalink
111731: Minimize all the facets when adding filter through advanced c…
Browse files Browse the repository at this point in the history
…omponent & filter suggestions
  • Loading branch information
alexandrevryghem committed May 7, 2024
1 parent 1f42f92 commit e66035c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export class AdvancedSearchComponent implements OnInit, OnDestroy {

applyFilter(): void {
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) => {
void this.router.navigate([this.searchService.getSearchLink()], {
queryParams: params,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ export class SearchFacetFilterComponent implements OnInit, OnDestroy {
*/
protected applyFilterValue(data: string): void {
if (data.match(new RegExp(`^.+,(equals|query|authority)$`))) {
this.filterService.minimizeAll();
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) => {
void this.router.navigate(this.getSearchLinkParts(), {
Expand Down
3 changes: 3 additions & 0 deletions src/app/shared/testing/search-filter-service.stub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,7 @@ export class SearchFilterServiceStub {
resetPage(_filterName: string): void {
}

minimizeAll(): void {
}

}

0 comments on commit e66035c

Please sign in to comment.