From 6fb68c45a9066f6c0411a16a7df1551273becde1 Mon Sep 17 00:00:00 2001 From: Binabh Date: Fri, 26 Jun 2026 17:01:08 +0545 Subject: [PATCH] fix: use max features in view tooltip instead of placeholder and update related tests --- .../components/TOC/fragments/settings/Display.jsx | 5 +++-- .../TOC/fragments/settings/__tests__/Display-test.jsx | 1 + .../editor/AdvancedSettings/CommonAdvancedSettings.jsx | 10 ++++------ .../__tests__/CommonAdvancedSettings-test.js | 1 + web/client/translations/data.de-DE.json | 2 +- web/client/translations/data.en-US.json | 2 +- web/client/translations/data.es-ES.json | 2 +- web/client/translations/data.fr-FR.json | 2 +- web/client/translations/data.it-IT.json | 2 +- 9 files changed, 14 insertions(+), 13 deletions(-) diff --git a/web/client/components/TOC/fragments/settings/Display.jsx b/web/client/components/TOC/fragments/settings/Display.jsx index 909b8fecc9..aebcb58c89 100644 --- a/web/client/components/TOC/fragments/settings/Display.jsx +++ b/web/client/components/TOC/fragments/settings/Display.jsx @@ -223,13 +223,14 @@ export default class extends React.Component { {this.props.element.type === "flatgeobuf" && - + +  } /> + diff --git a/web/client/components/TOC/fragments/settings/__tests__/Display-test.jsx b/web/client/components/TOC/fragments/settings/__tests__/Display-test.jsx index 1a52684385..a5b01a88fa 100644 --- a/web/client/components/TOC/fragments/settings/__tests__/Display-test.jsx +++ b/web/client/components/TOC/fragments/settings/__tests__/Display-test.jsx @@ -74,6 +74,7 @@ describe('test Layer Properties Display module component', () => { const maxFeaturesInView = document.querySelector('[data-qa="display-max-features-in-view"]'); expect(maxFeaturesInView).toBeTruthy(); expect(maxFeaturesInView.value).toBe('7'); + expect(document.querySelector('.mapstore-info-popover')).toBeTruthy(); ReactTestUtils.Simulate.change(maxFeaturesInView, { target: { value: '15' } }); expect(spyOn.calls[0].arguments).toEqual([ 'maxFeaturesInView', 15 ]); ReactTestUtils.Simulate.change(maxFeaturesInView, { target: { value: '' } }); diff --git a/web/client/components/catalog/editor/AdvancedSettings/CommonAdvancedSettings.jsx b/web/client/components/catalog/editor/AdvancedSettings/CommonAdvancedSettings.jsx index 614d692ff3..3c153dc895 100644 --- a/web/client/components/catalog/editor/AdvancedSettings/CommonAdvancedSettings.jsx +++ b/web/client/components/catalog/editor/AdvancedSettings/CommonAdvancedSettings.jsx @@ -11,9 +11,6 @@ import { FormGroup, Checkbox, ControlLabel, FormControl } from "react-bootstrap" import Message from "../../../I18N/Message"; import InfoPopover from '../../../widgets/widget/InfoPopover'; -import localizedProps from '../../../misc/enhancers/localizedProps'; - -const LocalizedFormControl = localizedProps('placeholder')(FormControl); const parseMaxFeaturesInView = (event) => { const maxFeaturesInView = Number(event?.target?.value); @@ -65,13 +62,14 @@ export default ({ } {!isNil(service.type) && service.type === "flatgeobuf" && - - +  } /> + + onChangeServiceProperty("layerOptions", { ...service.layerOptions, diff --git a/web/client/components/catalog/editor/AdvancedSettings/__tests__/CommonAdvancedSettings-test.js b/web/client/components/catalog/editor/AdvancedSettings/__tests__/CommonAdvancedSettings-test.js index beb46ee0d6..a52a6c3b45 100644 --- a/web/client/components/catalog/editor/AdvancedSettings/__tests__/CommonAdvancedSettings-test.js +++ b/web/client/components/catalog/editor/AdvancedSettings/__tests__/CommonAdvancedSettings-test.js @@ -117,6 +117,7 @@ describe('Test common advanced settings', () => { const maxFeaturesInView = document.querySelector("[data-qa='catalog-max-features-in-view']"); expect(maxFeaturesInView).toBeTruthy(); expect(maxFeaturesInView.value).toBe('7'); + expect(document.querySelector('.mapstore-info-popover')).toBeTruthy(); TestUtils.Simulate.change(maxFeaturesInView, { "target": { "value": '15' }}); expect(spyOn.calls[0].arguments).toEqual([ 'layerOptions', diff --git a/web/client/translations/data.de-DE.json b/web/client/translations/data.de-DE.json index 0aa7da745c..4cbd2ad6f7 100644 --- a/web/client/translations/data.de-DE.json +++ b/web/client/translations/data.de-DE.json @@ -136,7 +136,7 @@ "heightOffset": "Höhenversatz (m)", "wmsLayerTileSize": "Kachelgröße (WMS)", "maxFeaturesInView": "Maximale Anzahl von Features in der Ansicht", - "maxFeaturesInViewPlaceholder": "Wenn der Wert undefiniert ist, funktioniert die aktuelle Funktionalität wie gewohnt (d. h. alle Features laden)", + "maxFeaturesInViewTooltip": "Wenn der Wert undefiniert ist, funktioniert die aktuelle Funktionalität wie gewohnt (d. h. alle Features laden)", "serverType": "Servertyp", "formatError": "Es war nicht möglich, Format und Informationsblattformat vom konfigurierten Dienst abzurufen. Wahrscheinlich verwenden Sie einen No-Vendor-Dienst und dieser wird nicht unterstützt (z. B. GeoNetwork).", "serverTypeOption": { diff --git a/web/client/translations/data.en-US.json b/web/client/translations/data.en-US.json index 9f9f9a3ee1..2a26d570ed 100644 --- a/web/client/translations/data.en-US.json +++ b/web/client/translations/data.en-US.json @@ -136,7 +136,7 @@ "heightOffset": "Height offset (m)", "wmsLayerTileSize": "Tile size (WMS)", "maxFeaturesInView": "Max features in view", - "maxFeaturesInViewPlaceholder": "When the value is undefined current functionality works as usual(i.e. load all features)", + "maxFeaturesInViewTooltip": "When the value is undefined current functionality works as usual (i.e. load all features)", "serverType": "Server Type", "formatError": "It was not possible to fetch format and information sheet format from the service configured. Probably you are using a No Vendor service and this is not supported (e.g. GeoNetwork)", "serverTypeOption": { diff --git a/web/client/translations/data.es-ES.json b/web/client/translations/data.es-ES.json index 6312e4d644..fbf5dc1166 100644 --- a/web/client/translations/data.es-ES.json +++ b/web/client/translations/data.es-ES.json @@ -133,7 +133,7 @@ "heightOffset": "Desplazamiento de altura (m)", "wmsLayerTileSize": "Tamaño del mosaico (WMS)", "maxFeaturesInView": "Número máximo de entidades en la vista", - "maxFeaturesInViewPlaceholder": "Cuando el valor es indefinido, la funcionalidad actual funciona como de costumbre (es decir, cargar todas las entidades)", + "maxFeaturesInViewTooltip": "Cuando el valor es indefinido, la funcionalidad actual funciona como de costumbre (es decir, cargar todas las entidades)", "serverType": "Tipo de servidor", "formatError": "No fue posible recuperar el formato y el formato de la hoja de información del servicio configurado. Probablemente esté utilizando un servicio sin proveedor y no es compatible (por ejemplo, GeoNetwork)", "serverTypeOption": { diff --git a/web/client/translations/data.fr-FR.json b/web/client/translations/data.fr-FR.json index 5c0cea0fae..fabffa74a1 100644 --- a/web/client/translations/data.fr-FR.json +++ b/web/client/translations/data.fr-FR.json @@ -136,7 +136,7 @@ "heightOffset": "Décalage en hauteur (m)", "wmsLayerTileSize": "Taille de la tuile (WMS)", "maxFeaturesInView": "Nombre maximal d'entités dans la vue", - "maxFeaturesInViewPlaceholder": "Lorsque la valeur est indéfinie, la fonctionnalité actuelle fonctionne comme d'habitude (c'est-à-dire charger toutes les entités)", + "maxFeaturesInViewTooltip": "Lorsque la valeur est indéfinie, la fonctionnalité actuelle fonctionne comme d'habitude (c'est-à-dire charger toutes les entités)", "serverType": "Type de serveur", "formatError": "Il n'a pas été possible de récupérer le format et le format de la fiche d'information à partir du service configuré. Vous utilisez probablement un service No Vendor et celui-ci n'est pas pris en charge (par exemple GeoNetwork)", "serverTypeOption": { diff --git a/web/client/translations/data.it-IT.json b/web/client/translations/data.it-IT.json index f2b355a9b0..c2284b9540 100644 --- a/web/client/translations/data.it-IT.json +++ b/web/client/translations/data.it-IT.json @@ -136,7 +136,7 @@ "heightOffset": "Spostamento in altezza (m)", "wmsLayerTileSize": "Dimensione tile (WMS)", "maxFeaturesInView": "Numero massimo di feature in vista", - "maxFeaturesInViewPlaceholder": "Quando il valore è indefinito, la funzionalità attuale funziona come di consueto (cioè carica tutte le feature)", + "maxFeaturesInViewTooltip": "Quando il valore è indefinito, la funzionalità attuale funziona come di consueto (cioè carica tutte le feature)", "serverType": "Tipo di Server", "formatError": "Non è stato possibile recuperare le informazioni sui formati dal servizio configurato. Probabilmente stai usando un servizio \"No Vendor\" e questo non è supportato (es. GeoNetwork)", "serverTypeOption": {