From 484b8468332df96a7838b0a8e5f09c2f77dae9f0 Mon Sep 17 00:00:00 2001 From: aziz Date: Fri, 24 Mar 2023 15:11:58 +0100 Subject: [PATCH 1/4] feat(integration): Make the save search result option configurable --- .../search-results-tool/search-results-tool.component.html | 2 +- .../search-results-tool/search-results-tool.component.ts | 4 ++++ 2 files changed, 5 insertions(+), 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 3b9e7837d7..1449b1cc8f 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 @@ -32,7 +32,7 @@

{{ 'igo.integration.searchResultsTool.noResults' | translate }} - + Date: Fri, 24 Mar 2023 15:22:50 -0400 Subject: [PATCH 2/4] typo --- .../search/search-results/save-feature-dialog.component.html | 2 +- .../search/search-results/save-feature-dialog.component.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/geo/src/lib/search/search-results/save-feature-dialog.component.html b/packages/geo/src/lib/search/search-results/save-feature-dialog.component.html index dade16b92c..52f50204af 100644 --- a/packages/geo/src/lib/search/search-results/save-feature-dialog.component.html +++ b/packages/geo/src/lib/search/search-results/save-feature-dialog.component.html @@ -19,7 +19,7 @@

{{'igo.geo.layer.saveFeatureInLayer' [matAutocomplete]="auto" formControlName="layerName"> - +

{{layer.title}}

diff --git a/packages/geo/src/lib/search/search-results/save-feature-dialog.component.ts b/packages/geo/src/lib/search/search-results/save-feature-dialog.component.ts index f46462ebf7..60bc965f79 100644 --- a/packages/geo/src/lib/search/search-results/save-feature-dialog.component.ts +++ b/packages/geo/src/lib/search/search-results/save-feature-dialog.component.ts @@ -17,7 +17,7 @@ export class SaveFeatureDialogComponent implements OnInit { public form: UntypedFormGroup; feature: SearchResult; layers: Layer[] = []; - filteredLayers: Observable; + filteredLayers$: Observable; constructor( private formBuilder: UntypedFormBuilder, @@ -35,7 +35,7 @@ export class SaveFeatureDialogComponent implements OnInit { ngOnInit() { this.feature = this.data.feature; this.layers = this.data.layers; - this.filteredLayers = this.form.controls['layerName'].valueChanges.pipe( + this.filteredLayers$ = this.form.controls['layerName'].valueChanges.pipe( startWith(''), map(val => this.filter(val)) ); From 5792ed35ad3f0ee22a2f0cf50a7cacd4d404d0d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-=C3=89tienne=20Lord?= Date: Mon, 27 Mar 2023 09:27:34 -0400 Subject: [PATCH 3/4] fix undefined properties --- .../lib/feature/shared/strategies/search.ts | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/packages/geo/src/lib/feature/shared/strategies/search.ts b/packages/geo/src/lib/feature/shared/strategies/search.ts index 22625092ae..8b71251913 100644 --- a/packages/geo/src/lib/feature/shared/strategies/search.ts +++ b/packages/geo/src/lib/feature/shared/strategies/search.ts @@ -118,22 +118,24 @@ export class FeatureStoreSearchIndexStrategy extends EntityStoreStrategy { return Object.assign({}, {field: sf2.name, tokenize: "full"}, sf2.searchIndex); }); } else { - // THIS METHOD COMPUTE COLUMN DISTINCT VALUE TO FILTER WHICH COLUMN TO INDEX BASED ON A RATIO or discard float columns - const columns = Object.keys(featuresProperties[0]); - const columnsToIndex = []; - columnsToNotIndex = columns.map((column) => { - const distinctValues = [...new Set(featuresProperties.map(item => item[column]))]; - // identify column to not index based on a ratio distinctValues/nb of features OR discart exclusive float column (ex: lat, long) - if ( - (distinctValues.length / featuresProperties.length) * 100 <= ratio || - distinctValues.every(n => Number(n) === n && n % 1 !== 0)) { - columnsToNotIndex.push(column); - } else { - columnsToIndex.push(column); - } - }).filter(f => f); - const keysToIndex = columnsToIndex.filter(f => f!== 'igoSearchID'); - contentToIndex = keysToIndex.map(key => {return {field: key,tokenize: "full"};}); + if (featuresProperties.length) { + // THIS METHOD COMPUTE COLUMN DISTINCT VALUE TO FILTER WHICH COLUMN TO INDEX BASED ON A RATIO or discard float columns + const columns = Object.keys(featuresProperties[0]); + const columnsToIndex = []; + columnsToNotIndex = columns.map((column) => { + const distinctValues = [...new Set(featuresProperties.map(item => item[column]))]; + // identify column to not index based on a ratio distinctValues/nb of features OR discart exclusive float column (ex: lat, long) + if ( + (distinctValues.length / featuresProperties.length) * 100 <= ratio || + distinctValues.every(n => Number(n) === n && n % 1 !== 0)) { + columnsToNotIndex.push(column); + } else { + columnsToIndex.push(column); + } + }).filter(f => f); + const keysToIndex = columnsToIndex.filter(f => f !== 'igoSearchID'); + contentToIndex = keysToIndex.map(key => { return { field: key, tokenize: "full" }; }); + } } store.index.forEach((value, key) => { const propertiesToIndex = JSON.parse(JSON.stringify(value.properties)); From ba13d9090f0a4d204ea38f34315ad8488c79e209 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-=C3=89tienne=20Lord?= Date: Mon, 27 Mar 2023 09:27:58 -0400 Subject: [PATCH 4/4] fix style refactor --- .../search-results-add-button.component.ts | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/packages/geo/src/lib/search/search-results/search-results-add-button.component.ts b/packages/geo/src/lib/search/search-results/search-results-add-button.component.ts index dcc7bdf128..b3f131e9a0 100644 --- a/packages/geo/src/lib/search/search-results/search-results-add-button.component.ts +++ b/packages/geo/src/lib/search/search-results/search-results-add-button.component.ts @@ -32,7 +32,6 @@ import OlOverlay from 'ol/Overlay'; import { VectorSourceEvent as OlVectorSourceEvent } from 'ol/source/Vector'; import { default as OlGeometry } from 'ol/geom/Geometry'; import { QueryableDataSourceOptions } from '../../query'; -import { createOverlayDefaultStyle } from '../../style/shared/overlay/overlay-style.utils'; @Component({ @@ -334,12 +333,18 @@ export class SearchResultAddButtonComponent implements OnInit, OnDestroy{ id: 'igo-search-layer' + ++layerCounterID, title: layerTitle, source: dataSource, - style: createOverlayDefaultStyle({ - text: '', - strokeWidth: 1, - fillColor: 'rgba(255,255,255,0.4)', - strokeColor: 'rgba(143,7,7,1)' - }), + igoStyle: { + editable: false, + igoStyleObject: { + fill: { color: 'rgba(255,255,255,0.4)' }, + stroke: { color: 'rgba(143,7,7,1)', width: 1 }, + circle: { + fill: { color: 'rgba(255,255,255,0.4)', }, + stroke: { color: 'rgba(143,7,7,1)', width: 1 }, + radius: 5, + } + } + }, showInLayerList: true, exportable: true, workspace: {