Skip to content

Commit fa73e48

Browse files
authored
fix: use max features in view tooltip instead of placeholder and update related tests (#12552)
1 parent a8ef3fb commit fa73e48

9 files changed

Lines changed: 14 additions & 13 deletions

File tree

web/client/components/TOC/fragments/settings/Display.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,14 @@ export default class extends React.Component {
223223
{this.props.element.type === "flatgeobuf" && <Row>
224224
<Col xs={12}>
225225
<FormGroup>
226-
<ControlLabel><Message msgId="layerProperties.maxFeaturesInView" /></ControlLabel>
226+
<ControlLabel>
227+
<Message msgId="layerProperties.maxFeaturesInView" />&nbsp;<InfoPopover text={<Message msgId="layerProperties.maxFeaturesInViewTooltip" />} />
228+
</ControlLabel>
227229
<IntlNumberFormControl
228230
data-qa="display-max-features-in-view"
229231
type="number"
230232
min={1}
231233
step={1}
232-
placeholder="layerProperties.maxFeaturesInViewPlaceholder"
233234
value={this.props.element.maxFeaturesInView === undefined ? '' : this.props.element.maxFeaturesInView}
234235
onChange={this.onMaxFeaturesInViewChange}/>
235236
</FormGroup>

web/client/components/TOC/fragments/settings/__tests__/Display-test.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ describe('test Layer Properties Display module component', () => {
7474
const maxFeaturesInView = document.querySelector('[data-qa="display-max-features-in-view"]');
7575
expect(maxFeaturesInView).toBeTruthy();
7676
expect(maxFeaturesInView.value).toBe('7');
77+
expect(document.querySelector('.mapstore-info-popover')).toBeTruthy();
7778
ReactTestUtils.Simulate.change(maxFeaturesInView, { target: { value: '15' } });
7879
expect(spyOn.calls[0].arguments).toEqual([ 'maxFeaturesInView', 15 ]);
7980
ReactTestUtils.Simulate.change(maxFeaturesInView, { target: { value: '' } });

web/client/components/catalog/editor/AdvancedSettings/CommonAdvancedSettings.jsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ import { FormGroup, Checkbox, ControlLabel, FormControl } from "react-bootstrap"
1111

1212
import Message from "../../../I18N/Message";
1313
import InfoPopover from '../../../widgets/widget/InfoPopover';
14-
import localizedProps from '../../../misc/enhancers/localizedProps';
15-
16-
const LocalizedFormControl = localizedProps('placeholder')(FormControl);
1714

1815
const parseMaxFeaturesInView = (event) => {
1916
const maxFeaturesInView = Number(event?.target?.value);
@@ -65,13 +62,14 @@ export default ({
6562
</FormGroup>}
6663
{!isNil(service.type) && service.type === "flatgeobuf" &&
6764
<FormGroup className="form-group" controlId="maxFeaturesInView" key="maxFeaturesInView">
68-
<ControlLabel><Message msgId="layerProperties.maxFeaturesInView" /></ControlLabel>
69-
<LocalizedFormControl
65+
<ControlLabel>
66+
<Message msgId="layerProperties.maxFeaturesInView" />&nbsp;<InfoPopover text={<Message msgId="layerProperties.maxFeaturesInViewTooltip" />} />
67+
</ControlLabel>
68+
<FormControl
7069
data-qa="catalog-max-features-in-view"
7170
type="number"
7271
min={1}
7372
step={1}
74-
placeholder="layerProperties.maxFeaturesInViewPlaceholder"
7573
value={service.layerOptions?.maxFeaturesInView === undefined ? '' : service.layerOptions?.maxFeaturesInView}
7674
onChange={(e) => onChangeServiceProperty("layerOptions", {
7775
...service.layerOptions,

web/client/components/catalog/editor/AdvancedSettings/__tests__/CommonAdvancedSettings-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ describe('Test common advanced settings', () => {
117117
const maxFeaturesInView = document.querySelector("[data-qa='catalog-max-features-in-view']");
118118
expect(maxFeaturesInView).toBeTruthy();
119119
expect(maxFeaturesInView.value).toBe('7');
120+
expect(document.querySelector('.mapstore-info-popover')).toBeTruthy();
120121
TestUtils.Simulate.change(maxFeaturesInView, { "target": { "value": '15' }});
121122
expect(spyOn.calls[0].arguments).toEqual([
122123
'layerOptions',

web/client/translations/data.de-DE.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
"heightOffset": "Höhenversatz (m)",
137137
"wmsLayerTileSize": "Kachelgröße (WMS)",
138138
"maxFeaturesInView": "Maximale Anzahl von Features in der Ansicht",
139-
"maxFeaturesInViewPlaceholder": "Wenn der Wert undefiniert ist, funktioniert die aktuelle Funktionalität wie gewohnt (d. h. alle Features laden)",
139+
"maxFeaturesInViewTooltip": "Wenn der Wert undefiniert ist, funktioniert die aktuelle Funktionalität wie gewohnt (d. h. alle Features laden)",
140140
"serverType": "Servertyp",
141141
"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).",
142142
"serverTypeOption": {

web/client/translations/data.en-US.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
"heightOffset": "Height offset (m)",
137137
"wmsLayerTileSize": "Tile size (WMS)",
138138
"maxFeaturesInView": "Max features in view",
139-
"maxFeaturesInViewPlaceholder": "When the value is undefined current functionality works as usual(i.e. load all features)",
139+
"maxFeaturesInViewTooltip": "When the value is undefined current functionality works as usual (i.e. load all features)",
140140
"serverType": "Server Type",
141141
"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)",
142142
"serverTypeOption": {

web/client/translations/data.es-ES.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
"heightOffset": "Desplazamiento de altura (m)",
134134
"wmsLayerTileSize": "Tamaño del mosaico (WMS)",
135135
"maxFeaturesInView": "Número máximo de entidades en la vista",
136-
"maxFeaturesInViewPlaceholder": "Cuando el valor es indefinido, la funcionalidad actual funciona como de costumbre (es decir, cargar todas las entidades)",
136+
"maxFeaturesInViewTooltip": "Cuando el valor es indefinido, la funcionalidad actual funciona como de costumbre (es decir, cargar todas las entidades)",
137137
"serverType": "Tipo de servidor",
138138
"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)",
139139
"serverTypeOption": {

web/client/translations/data.fr-FR.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
"heightOffset": "Décalage en hauteur (m)",
137137
"wmsLayerTileSize": "Taille de la tuile (WMS)",
138138
"maxFeaturesInView": "Nombre maximal d'entités dans la vue",
139-
"maxFeaturesInViewPlaceholder": "Lorsque la valeur est indéfinie, la fonctionnalité actuelle fonctionne comme d'habitude (c'est-à-dire charger toutes les entités)",
139+
"maxFeaturesInViewTooltip": "Lorsque la valeur est indéfinie, la fonctionnalité actuelle fonctionne comme d'habitude (c'est-à-dire charger toutes les entités)",
140140
"serverType": "Type de serveur",
141141
"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)",
142142
"serverTypeOption": {

web/client/translations/data.it-IT.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
"heightOffset": "Spostamento in altezza (m)",
137137
"wmsLayerTileSize": "Dimensione tile (WMS)",
138138
"maxFeaturesInView": "Numero massimo di feature in vista",
139-
"maxFeaturesInViewPlaceholder": "Quando il valore è indefinito, la funzionalità attuale funziona come di consueto (cioè carica tutte le feature)",
139+
"maxFeaturesInViewTooltip": "Quando il valore è indefinito, la funzionalità attuale funziona come di consueto (cioè carica tutte le feature)",
140140
"serverType": "Tipo di Server",
141141
"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)",
142142
"serverTypeOption": {

0 commit comments

Comments
 (0)