diff --git a/packages/geo/src/lib/search/search-settings/search-settings.component.html b/packages/geo/src/lib/search/search-settings/search-settings.component.html index 9196b93717..02e24de242 100644 --- a/packages/geo/src/lib/search/search-settings/search-settings.component.html +++ b/packages/geo/src/lib/search/search-settings/search-settings.component.html @@ -13,6 +13,10 @@ +
+ +
s.available && s.getId() !== 'map' && s.showInSettings); - return textSearchSources.concat(reverseSearchSources); + const sources = textSearchSources.concat(reverseSearchSources); + this.computeSourcesCheckAllBehavior(sources); + return sources; } /** @@ -119,12 +122,12 @@ export class SearchSettingsComponent implements OnInit { } /** - * Defining the action to do for check/uncheck checkboxes + * Defining the action to do for check/uncheck checkboxes (settings) * return true if all checkbox must be checked * return false if all checkbox must be unchecked * @internal */ - computeCheckAllBehavior(setting: SearchSourceSettings) { + computeSettingCheckAllBehavior(setting: SearchSourceSettings) { if (setting.allEnabled === undefined) { if (setting.values.find(settingValue => settingValue.enabled)) { setting.allEnabled = false; @@ -136,13 +139,25 @@ export class SearchSettingsComponent implements OnInit { } } + /** + * Defining the action to do for check/uncheck checkboxes (sources) + * return true if all checkbox must be checked + * return false if all checkbox must be unchecked + * @internal + */ + computeSourcesCheckAllBehavior(sources: SearchSource[]) { + const enabledSourcesCnt = sources.filter(source => source.enabled).length; + const disabledSourcesCnt = sources.filter(source => !source.enabled).length; + this.searchSourcesAllEnabled = enabledSourcesCnt >= disabledSourcesCnt ? false : true; + } + /** * Triggered when the check all / uncheck all type is clicked, * @internal */ checkUncheckAll(event, source: SearchSource, setting: SearchSourceSettings) { event.stopPropagation(); - this.computeCheckAllBehavior(setting); + this.computeSettingCheckAllBehavior(setting); setting.values.forEach(settingValue => { settingValue.enabled = setting.allEnabled; }); @@ -150,6 +165,18 @@ export class SearchSettingsComponent implements OnInit { this.searchSourceChange.emit(source); } + /** + * Triggered when the check all / uncheck all type is clicked, + * @internal + */ + checkUncheckAllSources(event) { + event.stopPropagation(); + this.getSearchSources().map(source => { + source.enabled = this.searchSourcesAllEnabled; + this.searchSourceChange.emit(source); + }); + } + /** * Triggered when a setting is checked (radiobutton style) * @internal diff --git a/packages/geo/src/lib/search/shared/sources/ilayer.ts b/packages/geo/src/lib/search/shared/sources/ilayer.ts index 8e924ba7c7..af5cdecd87 100644 --- a/packages/geo/src/lib/search/shared/sources/ilayer.ts +++ b/packages/geo/src/lib/search/shared/sources/ilayer.ts @@ -28,7 +28,7 @@ export class ILayerSearchResultFormatter { constructor(private languageService: LanguageService) {} formatResult(data: ILayerData): ILayerData { - const allowedKey = ['title', 'abstract', 'groupTitle', 'metadataUrl']; + const allowedKey = ['title', 'abstract', 'groupTitle', 'metadataUrl', 'downloadUrl', 'urlInfo', 'name']; const property = Object.entries(data.properties) .filter(([key]) => allowedKey.indexOf(key) !== -1) diff --git a/packages/geo/src/locale/en.geo.json b/packages/geo/src/locale/en.geo.json index 1a704afef5..d00f8607ed 100644 --- a/packages/geo/src/locale/en.geo.json +++ b/packages/geo/src/locale/en.geo.json @@ -240,7 +240,10 @@ "title": "Title", "type": "Type", "url": "URL", - "metadataUrl": "Metadata" + "metadataUrl": "Metadata", + "name": "Layer name", + "urlInfo": "URL - WMS/WFS", + "downloadUrl": "Data download" }, "type": { "layer": "Layer", @@ -294,6 +297,8 @@ "tooltip": "Based on every search source, show the summary of the pointer location. Use F2 to activate/desactivate." }, "searchSources": { + "selectAll": "Select All", + "unselectAll": "Unselect All", "settings": { "results type": "Results type", "ecmax": "Maximum deviation", diff --git a/packages/geo/src/locale/fr.geo.json b/packages/geo/src/locale/fr.geo.json index 0063623627..304ae6b96e 100644 --- a/packages/geo/src/locale/fr.geo.json +++ b/packages/geo/src/locale/fr.geo.json @@ -240,7 +240,10 @@ "title": "Titre", "type": "Type", "url": "URL", - "metadataUrl": "Métadonnées" + "metadataUrl": "Métadonnées", + "name": "Nom de la couche", + "urlInfo": "Lien du service web WMS/WFS", + "downloadUrl": "Lien de téléchargement de la données" }, "type": { "layer": "Couche", @@ -294,6 +297,8 @@ "tooltip": "Afficher les coordonnées du curseur ainsi que d'autres informations sur sa position en fonction des types de résultats activées. Utiliser F2 pour activer / désactiver." }, "searchSources": { + "selectAll": "Tout sélectionner", + "unselectAll": "Tout désélectionner", "settings": { "results type": "Type de résultat", "ecmax": "Écart maximal",