diff --git a/docs/arlas-wui-builder-configuration.md b/docs/arlas-wui-builder-configuration.md index 4374f33c..55a88856 100644 --- a/docs/arlas-wui-builder-configuration.md +++ b/docs/arlas-wui-builder-configuration.md @@ -22,7 +22,7 @@ All supported environment variables are listed below. Instead of overriding some properties of the settings file, it is possible to start the `arlas-wui-builder` container with a given settings file. -#### File +#### File The `arlas-wui-builder` container can start with a mounted settings file thanks to docker volume mapping. For instance, if the current directory of the host contains a `settings.yaml` file, the container can be started as follow: @@ -62,6 +62,8 @@ If you don't mount a `settings.yaml` file to the container, nor serve it with `A | ARLAS_EXPORT_HISTOGRAMS_NB_BUCKETS | histogram.export_nb_buckets | 1000 | The export to csv feature will download `histogram.export_nb_buckets` buckets for histograms. | | ARLAS_USE_TIME_FILTER | use_time_filter | false | If true, the analytics and map previews will fetch only the last 7 days of the chosen-collection data. | | ARLAS_BASEMAPS | basemaps | [] | List of basemaps that the users can embark within their dashbaords. View the [`basemap` structure](#)| +| ARLAS_ENABLE_H3 | enable_h3 | false | If true, allows the user to configure cluster layers agregated by h3 cell | + ## ARLAS-wui-builder assets ARLAS-wui-builder comes with several assets: @@ -153,7 +155,7 @@ In order to make it available in the builder, please follow these instructions : "tiles": ["pmtiles://https://PATH-TO-PMTILES.pmtiles/{z}/{x}/{y}"] } } - + } ``` diff --git a/package-lock.json b/package-lock.json index 9f821169..7c213006 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6127,9 +6127,9 @@ } }, "node_modules/arlas-d3": { - "version": "11.2.2", - "resolved": "https://registry.npmjs.org/arlas-d3/-/arlas-d3-11.2.2.tgz", - "integrity": "sha512-Q9lo1L4tqzkp5dyujzUtMYpB8QVPlDG47Y7yyKYFcrSzT7rxHz8ZuMadIN9T+JsFOgMomtxAgTLXlnmIbpZUtA==", + "version": "11.2.3", + "resolved": "https://registry.npmjs.org/arlas-d3/-/arlas-d3-11.2.3.tgz", + "integrity": "sha512-A5Hyjy1ensxDors5lTBDNqi9/gAhSgVvoFJk4rRPu535N5ON5+MArFeLuMRZa0TNKJ6G8LVCVlCTjuN5VKkqtg==", "dependencies": { "@types/d3-array": "^3.0.3", "@types/d3-axis": "^3.0.1", @@ -26079,9 +26079,9 @@ } }, "arlas-d3": { - "version": "11.2.2", - "resolved": "https://registry.npmjs.org/arlas-d3/-/arlas-d3-11.2.2.tgz", - "integrity": "sha512-Q9lo1L4tqzkp5dyujzUtMYpB8QVPlDG47Y7yyKYFcrSzT7rxHz8ZuMadIN9T+JsFOgMomtxAgTLXlnmIbpZUtA==", + "version": "11.2.3", + "resolved": "https://registry.npmjs.org/arlas-d3/-/arlas-d3-11.2.3.tgz", + "integrity": "sha512-A5Hyjy1ensxDors5lTBDNqi9/gAhSgVvoFJk4rRPu535N5ON5+MArFeLuMRZa0TNKJ6G8LVCVlCTjuN5VKkqtg==", "requires": { "@types/d3-array": "^3.0.3", "@types/d3-axis": "^3.0.1", diff --git a/scripts/start.sh b/scripts/start.sh index 3404358d..e9eb4a18 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -497,6 +497,17 @@ fi envsubst '$ARLAS_USE_TIME_FILTER' < /usr/share/nginx/html/settings.yaml > /usr/share/nginx/html/settings.yaml.tmp mv /usr/share/nginx/html/settings.yaml.tmp /usr/share/nginx/html/settings.yaml +# Enable h3 agregations +if [ -z "${ARLAS_ENABLE_H3}" ]; then + ARLAS_ENABLE_H3=false + export ARLAS_ENABLE_H3 + echo "H3 agregations are not allowed" +else + echo ${ARLAS_ENABLE_H3} "is used for 'enable_h3' in settings.yaml file" +fi +envsubst '$ARLAS_ENABLE_H3' < /usr/share/nginx/html/settings.yaml > /usr/share/nginx/html/settings.yaml.tmp +mv /usr/share/nginx/html/settings.yaml.tmp /usr/share/nginx/html/settings.yaml + # Set App base path if [ -z "${ARLAS_BUILDER_APP_PATH}" ]; then ARLAS_BUILDER_APP_PATH="" diff --git a/src/app/modules/analytics-config/components/edit-histogram-label/edit-histogram-label.component.ts b/src/app/modules/analytics-config/components/edit-histogram-label/edit-histogram-label.component.ts index 234b4401..18026fbf 100644 --- a/src/app/modules/analytics-config/components/edit-histogram-label/edit-histogram-label.component.ts +++ b/src/app/modules/analytics-config/components/edit-histogram-label/edit-histogram-label.component.ts @@ -194,8 +194,8 @@ export class EditHistogramLabelComponent implements OnInit, OnDestroy { private disableXUnitField() { this.xAxisConfig.displayUnitControl.next(false); this.xAxisConfig.unitControl.disable(); - this.xAxisConfig.hint.next('Managed by arlas'); - this.xAxisConfig.infoMessage.next(marker('Filled by Arlas')); + this.xAxisConfig.hint.next(marker('Managed by ARLAS')); + this.xAxisConfig.infoMessage.next(marker('Filled by ARLAS')); } private enableXUnitField() { diff --git a/src/app/modules/analytics-config/services/donut-form-builder/donut-form-builder.service.ts b/src/app/modules/analytics-config/services/donut-form-builder/donut-form-builder.service.ts index 61108c1d..7d790f3f 100644 --- a/src/app/modules/analytics-config/services/donut-form-builder/donut-form-builder.service.ts +++ b/src/app/modules/analytics-config/services/donut-form-builder/donut-form-builder.service.ts @@ -137,7 +137,7 @@ export class DonutConfigForm extends WidgetConfigFormGroup { if (result !== undefined) { globalKeysToColortrl.clear(); result.forEach((kc: KeywordColor) => { - /** after closing the dialog, save the [keyword, color] list in the Arlas color service */ + /** after closing the dialog, save the [keyword, color] list in the ARLAS color service */ (this.colorService.colorGenerator as ArlasColorGeneratorLoader).updateKeywordColor(kc.keyword, kc.color); this.addToColorManualValuesCtrl(kc); }); diff --git a/src/app/modules/analytics-config/services/powerbar-form-builder/powerbar-form-builder.service.ts b/src/app/modules/analytics-config/services/powerbar-form-builder/powerbar-form-builder.service.ts index 6a5357a5..e619c77a 100644 --- a/src/app/modules/analytics-config/services/powerbar-form-builder/powerbar-form-builder.service.ts +++ b/src/app/modules/analytics-config/services/powerbar-form-builder/powerbar-form-builder.service.ts @@ -246,7 +246,7 @@ export class PowerbarConfigForm extends WidgetConfigFormGroup { .afterClosed().subscribe((result: Array) => { if (result !== undefined) { result.forEach((kc: KeywordColor) => { - /** after closing the dialog, save the [keyword, color] list in the Arlas color service */ + /** after closing the dialog, save the [keyword, color] list in the ARLAS color service */ (colorService.colorGenerator as ArlasColorGeneratorLoader).updateKeywordColor(kc.keyword, kc.color); addToColorManualValuesCtrl(kc, this.globalKeysToColortrl.controls); }); diff --git a/src/app/modules/analytics-config/services/resultlist-form-builder/resultlist-form-builder.service.ts b/src/app/modules/analytics-config/services/resultlist-form-builder/resultlist-form-builder.service.ts index 2b3c602c..8437961b 100644 --- a/src/app/modules/analytics-config/services/resultlist-form-builder/resultlist-form-builder.service.ts +++ b/src/app/modules/analytics-config/services/resultlist-form-builder/resultlist-form-builder.service.ts @@ -501,7 +501,7 @@ export class ResultlistColumnFormGroup extends CollectionConfigFormGroup { .afterClosed().subscribe((result: Array) => { if (result !== undefined) { result.forEach((kc: KeywordColor) => { - /** after closing the dialog, save the [keyword, color] list in the Arlas color service */ + /** after closing the dialog, save the [keyword, color] list in the ARLAS color service */ (colorService.colorGenerator as ArlasColorGeneratorLoader).updateKeywordColor(kc.keyword, kc.color); this.addToColorManualValuesCtrl(kc); }); diff --git a/src/app/modules/map-config/components/preview/preview.component.ts b/src/app/modules/map-config/components/preview/preview.component.ts index 80d7a324..6d585172 100644 --- a/src/app/modules/map-config/components/preview/preview.component.ts +++ b/src/app/modules/map-config/components/preview/preview.component.ts @@ -56,7 +56,7 @@ export class PreviewComponent implements AfterViewInit, OnDestroy { public mapRedrawSources; public mapLegendUpdater; public mapVisibilityUpdater; - public mainMapContributor; + public mainMapContributor: MapContributor; public constructor( protected mainFormService: MainFormService, diff --git a/src/app/modules/map-config/services/map-import/map-import.service.ts b/src/app/modules/map-config/services/map-import/map-import.service.ts index 6d8cdd3b..4e93b69e 100644 --- a/src/app/modules/map-config/services/map-import/map-import.service.ts +++ b/src/app/modules/map-config/services/map-import/map-import.service.ts @@ -17,7 +17,7 @@ * under the License. */ import { Injectable } from '@angular/core'; -import { FormArray, FormControl, FormGroup } from '@angular/forms'; +import { FormArray } from '@angular/forms'; import { KeywordColor, OTHER_KEYWORD } from '@map-config/components/dialog-color-table/models'; import { LAYER_MODE } from '@map-config/components/edit-layer/models'; import { NORMALIZED, VISIBILITY } from '@services/main-form-manager/config-map-export-helper'; diff --git a/src/app/modules/map-config/services/map-layer-form-builder/map-layer-form-builder.service.ts b/src/app/modules/map-config/services/map-layer-form-builder/map-layer-form-builder.service.ts index 697b5cc7..9bc5d664 100644 --- a/src/app/modules/map-config/services/map-layer-form-builder/map-layer-form-builder.service.ts +++ b/src/app/modules/map-config/services/map-layer-form-builder/map-layer-form-builder.service.ts @@ -50,6 +50,7 @@ import { } from './models'; import { ButtonToggleFormControl } from '@shared-models/config-form'; import { toNumericOptionsObs } from '../../../../services/collection-service/tools'; +import { ArlasSettingsService } from 'arlas-wui-toolkit'; export const PRECISION_TOLERATED_DIFFERENCE = 3; @@ -1428,8 +1429,10 @@ export class MapLayerTypeClusterFormGroup extends MapLayerAllTypesFormGroup { public constructor( collection: string, collectionFields: Observable>, - propertySelectorFormBuilder: PropertySelectorFormBuilderService + propertySelectorFormBuilder: PropertySelectorFormBuilderService, + settingsService: ArlasSettingsService ) { + super( collection, collectionFields, @@ -1475,7 +1478,9 @@ export class MapLayerTypeClusterFormGroup extends MapLayerAllTypesFormGroup { false, [ { label: marker('Tile Grid'), value: ClusterAggType.tile }, - { label: marker('GeohashGrid'), value: ClusterAggType.geohash } + { label: marker('Geohash Grid'), value: ClusterAggType.geohash }, + { label: marker('Geohex Grid'), value: ClusterAggType.h3, + enabled: !!settingsService.settings && settingsService.settings['enable_h3'] } ]), granularity: new SelectFormControl( '', @@ -1600,7 +1605,8 @@ export class MapLayerFormBuilderService { private defaultValuesService: DefaultValuesService, private propertySelectorFormBuilder: PropertySelectorFormBuilderService, private mainFormService: MainFormService, - private collectionService: CollectionService + private collectionService: CollectionService, + private settigsService: ArlasSettingsService ) { } public buildLayer(collection: string, edit?: boolean) { @@ -1677,7 +1683,8 @@ export class MapLayerFormBuilderService { const clusterFormGroup = new MapLayerTypeClusterFormGroup( collection, collectionFields, - this.propertySelectorFormBuilder); + this.propertySelectorFormBuilder, + this.settigsService); this.defaultValuesService.setDefaultValueRecursively('map.layer', clusterFormGroup); return clusterFormGroup; diff --git a/src/app/services/startup/builderconfig.schema.json b/src/app/services/startup/builderconfig.schema.json index b6ef8e73..cef6cedc 100644 --- a/src/app/services/startup/builderconfig.schema.json +++ b/src/app/services/startup/builderconfig.schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-06/schema#", - "title": "Arlas WUI application Configuration", + "title": "ARLAS WUI application Configuration", "description": "The Configuration of an arlas web application", "type": "object", "$id": "arlasconfig.schema.json", diff --git a/src/app/shared/components/config-form-control/config-form-control.component.html b/src/app/shared/components/config-form-control/config-form-control.component.html index cded00ee..e4b37960 100644 --- a/src/app/shared/components/config-form-control/config-form-control.component.html +++ b/src/app/shared/components/config-form-control/config-form-control.component.html @@ -45,7 +45,7 @@ {{ typedControl.label | translate}} @@ -86,7 +86,7 @@ @@ -132,7 +132,7 @@ {{ typedControl.label | translate}}