From 0045ff65bce53cca1c13d576c6e34866ed60de58 Mon Sep 17 00:00:00 2001 From: aziz Date: Tue, 20 Dec 2022 15:33:22 +0100 Subject: [PATCH 1/7] fix(search-results): hide empty result during typing --- .../search-results-tool/search-results-tool.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.html b/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.html index 6c5020e0f1..17bf4c3763 100644 --- a/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.html +++ b/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.html @@ -7,7 +7,7 @@

{{ 'igo.integration.searchResultsTool.noResults' | translate }} Date: Wed, 21 Dec 2022 20:23:53 +0100 Subject: [PATCH 2/7] change if condition to show search result component, until the request ended --- .../search-results-tool.component.html | 4 ++-- .../search-results-tool.component.ts | 14 +++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.html b/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.html index 17bf4c3763..257e5e412a 100644 --- a/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.html +++ b/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.html @@ -1,4 +1,4 @@ -
+

{{ 'igo.integration.searchResultsTool.noResults' | translate }}

{{ 'igo.integration.searchResultsTool.doSearch' | translate }}

@@ -7,7 +7,7 @@

{{ 'igo.integration.searchResultsTool.noResults' | translate }} Date: Wed, 21 Dec 2022 20:31:13 +0100 Subject: [PATCH 3/7] resolve lint error --- .../search/search-results-tool/search-results-tool.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.ts b/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.ts index 3d2216f2ec..a84b5e3254 100644 --- a/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.ts +++ b/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.ts @@ -155,7 +155,7 @@ export class SearchResultsToolComponent implements OnInit, OnDestroy { public toolState: ToolState, private directionState: DirectionState, configService: ConfigService - ) { + ) { this.hasFeatureEmphasisOnSelection = configService.getConfig( 'hasFeatureEmphasisOnSelection' ); From 2de1d88fdd10e2a3b576183a7a75c138c0414976 Mon Sep 17 00:00:00 2001 From: Philippe Lafreniere Date: Thu, 5 Jan 2023 15:23:50 -0500 Subject: [PATCH 4/7] fix no results display when term is empty --- packages/geo/src/lib/search/search-bar/search-bar.component.ts | 2 +- .../search-results-tool/search-results-tool.component.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/geo/src/lib/search/search-bar/search-bar.component.ts b/packages/geo/src/lib/search/search-bar/search-bar.component.ts index 942d0afdc9..ac09251070 100644 --- a/packages/geo/src/lib/search/search-bar/search-bar.component.ts +++ b/packages/geo/src/lib/search/search-bar/search-bar.component.ts @@ -244,7 +244,7 @@ export class SearchBarComponent implements OnInit, OnDestroy { this.stream$$ = this.stream$ .pipe( - debounce((term: string) => (term === '' ? EMPTY : timer(this.debounce))) + debounce(() => timer(this.debounce)) ) .subscribe((term: string) => this.onSetTerm(term)); diff --git a/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.html b/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.html index 257e5e412a..c5b27d4560 100644 --- a/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.html +++ b/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.html @@ -1,4 +1,4 @@ -
+

{{ 'igo.integration.searchResultsTool.noResults' | translate }}

{{ 'igo.integration.searchResultsTool.doSearch' | translate }}

From b5cc2b7f473d329e4e6a6b277c508ed231162f0e Mon Sep 17 00:00:00 2001 From: aziz Date: Thu, 5 Jan 2023 21:48:31 +0100 Subject: [PATCH 5/7] uncommit toggleTopPanel function --- .../search-results-tool.component.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.ts b/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.ts index a84b5e3254..2bb12a1323 100644 --- a/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.ts +++ b/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.ts @@ -525,15 +525,11 @@ export class SearchResultsToolComponent implements OnInit, OnDestroy { } } - toggleTopPanel(event?: MouseEvent) { - if(event && ((event.target as any)?.className !== 'igo-panel-title')) { - return; + toggleTopPanel() { + if (this.topPanelState === 'expanded') { + this.topPanelState = 'collapsed'; } else { - if (this.topPanelState === 'expanded') { - this.topPanelState = 'collapsed'; - } else { - this.topPanelState = 'expanded'; - } + this.topPanelState = 'expanded'; } } From 06464bb22ca37a8e950ee53c1fe468f87059f79f Mon Sep 17 00:00:00 2001 From: aziz Date: Thu, 5 Jan 2023 22:00:00 +0100 Subject: [PATCH 6/7] solve lint error --- packages/geo/src/lib/search/search-bar/search-bar.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/geo/src/lib/search/search-bar/search-bar.component.ts b/packages/geo/src/lib/search/search-bar/search-bar.component.ts index ac09251070..1554486f33 100644 --- a/packages/geo/src/lib/search/search-bar/search-bar.component.ts +++ b/packages/geo/src/lib/search/search-bar/search-bar.component.ts @@ -13,7 +13,7 @@ import { FloatLabelType, MatFormFieldAppearance } from '@angular/material/form-field'; -import { BehaviorSubject, Subscription, EMPTY, timer } from 'rxjs'; +import { BehaviorSubject, Subscription, timer } from 'rxjs'; import { debounce, distinctUntilChanged } from 'rxjs/operators'; import { LanguageService } from '@igo2/core'; From d4b034ba126e676b72ea3aad6f039d216f7bb9f0 Mon Sep 17 00:00:00 2001 From: Philippe Lafreniere Date: Fri, 6 Jan 2023 08:42:19 -0500 Subject: [PATCH 7/7] fix request delay on first debounce --- .../search-results-tool/search-results-tool.component.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.ts b/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.ts index 2bb12a1323..8a23db1806 100644 --- a/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.ts +++ b/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.ts @@ -164,8 +164,11 @@ export class SearchResultsToolComponent implements OnInit, OnDestroy { ngOnInit() { this.searchTerm$$ = this.searchState.searchTerm$.subscribe( (searchTerm: string) => { - if (searchTerm !== undefined && searchTerm !== null) { + if (searchTerm !== undefined && searchTerm !== null && searchTerm !== '') { this.term = searchTerm; + this.debouncedEmpty$.next(false); + } else if (searchTerm === '') { + this.debouncedEmpty$.next(true); } } );