@eeacms/volto-arcgis-block 0.1.355 → 0.1.357
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/Jenkinsfile +1 -1
- package/package.json +1 -1
- package/src/components/MapViewer/MenuWidget.jsx +28 -3
- package/src/components/MapViewer/SwipeWidget.jsx +104 -58
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
+
### [0.1.357](https://github.com/eea/volto-arcgis-block/compare/0.1.356...0.1.357) - 12 May 2025
|
|
8
|
+
|
|
9
|
+
#### :hammer_and_wrench: Others
|
|
10
|
+
|
|
11
|
+
- Merge pull request #945 from eea/CLMS-285178-ISOLATED-SWIPE-WIDGET-FIX [Unai Bolivar - [`617b4c4`](https://github.com/eea/volto-arcgis-block/commit/617b4c43ad4363267c4df34c72e64314ee42afb4)]
|
|
12
|
+
- CLMS-285178 (bug): Separated swipe from other tickets and can push now going [Unai Bolivar - [`84efe24`](https://github.com/eea/volto-arcgis-block/commit/84efe24d964b79f54ddf17f69e389a3f57e3f867)]
|
|
13
|
+
- CLMS-285178 (bug): Separated swipe from other tickets and can push [Unai Bolivar - [`3e94fd6`](https://github.com/eea/volto-arcgis-block/commit/3e94fd6d2f92817d6b0220155a7e8a0ed5d8dfdb)]
|
|
14
|
+
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`fdd39ce`](https://github.com/eea/volto-arcgis-block/commit/fdd39ce6c0d848b33f3b6d033e4b35e9bd4f2002)]
|
|
15
|
+
### [0.1.356](https://github.com/eea/volto-arcgis-block/compare/0.1.355...0.1.356) - 6 May 2025
|
|
16
|
+
|
|
17
|
+
#### :hammer_and_wrench: Others
|
|
18
|
+
|
|
19
|
+
- Merge pull request #944 from eea/develop [Unai Bolivar - [`a034911`](https://github.com/eea/volto-arcgis-block/commit/a0349111d5f09be64b57acccc6a14cc5617f279a)]
|
|
7
20
|
### [0.1.355](https://github.com/eea/volto-arcgis-block/compare/0.1.354...0.1.355) - 5 May 2025
|
|
8
21
|
|
|
9
22
|
### [0.1.354](https://github.com/eea/volto-arcgis-block/compare/0.1.353...0.1.354) - 24 April 2025
|
package/Jenkinsfile
CHANGED
|
@@ -4,7 +4,7 @@ pipeline {
|
|
|
4
4
|
environment {
|
|
5
5
|
GIT_NAME = "volto-arcgis-block"
|
|
6
6
|
NAMESPACE = "@eeacms"
|
|
7
|
-
SONARQUBE_TAGS = "volto.eea.europa.eu,clms.land.copernicus.eu,water.europa.eu-freshwater,clmsdemo.devel6cph.eea.europa.eu,land.copernicus.eu"
|
|
7
|
+
SONARQUBE_TAGS = "volto.eea.europa.eu,clms.land.copernicus.eu,water.europa.eu-freshwater,clmsdemo.devel6cph.eea.europa.eu,land.copernicus.eu,ask.copernicus.eu"
|
|
8
8
|
DEPENDENCIES = ""
|
|
9
9
|
BACKEND_PROFILES = "eea.kitkat:testing"
|
|
10
10
|
BACKEND_ADDONS = "clms.addon,clms.types,clms.downloadtool,clms.statstool"
|
package/package.json
CHANGED
|
@@ -1457,8 +1457,8 @@ class MenuWidget extends React.Component {
|
|
|
1457
1457
|
return (
|
|
1458
1458
|
<div
|
|
1459
1459
|
className="map-menu-family-dropdown"
|
|
1460
|
-
id={'
|
|
1461
|
-
|
|
1460
|
+
id={'family_' + inheritedIndexProduct}
|
|
1461
|
+
familyid={familyId}
|
|
1462
1462
|
key={'a' + familyId}
|
|
1463
1463
|
>
|
|
1464
1464
|
<fieldset className="ccl-fieldset" key={'b' + familyId}>
|
|
@@ -3213,7 +3213,7 @@ class MenuWidget extends React.Component {
|
|
|
3213
3213
|
let datasetContainer = selectedDataset.closest(
|
|
3214
3214
|
'.map-menu-dataset-dropdown',
|
|
3215
3215
|
);
|
|
3216
|
-
let datasetContainerId = datasetContainer
|
|
3216
|
+
let datasetContainerId = datasetContainer?.getAttribute('datasetid');
|
|
3217
3217
|
this.compCfg.forEach((component) => {
|
|
3218
3218
|
component.Products.forEach((product) => {
|
|
3219
3219
|
product.Datasets.forEach((dataset) => {
|
|
@@ -5191,6 +5191,7 @@ class MenuWidget extends React.Component {
|
|
|
5191
5191
|
let productFilter;
|
|
5192
5192
|
let familyFilter;
|
|
5193
5193
|
let result = false;
|
|
5194
|
+
let familiesResult = [];
|
|
5194
5195
|
if (document.querySelector('#menu-searchtext')) {
|
|
5195
5196
|
searchText = document
|
|
5196
5197
|
.querySelector('#menu-searchtext')
|
|
@@ -5270,6 +5271,12 @@ class MenuWidget extends React.Component {
|
|
|
5270
5271
|
if (dataset.Default_active) {
|
|
5271
5272
|
defaultActive = 'map_' + datasetElem.id;
|
|
5272
5273
|
}
|
|
5274
|
+
if (
|
|
5275
|
+
dataset.FamilyTitle &&
|
|
5276
|
+
!familiesResult.includes(dataset.FamilyTitle)
|
|
5277
|
+
) {
|
|
5278
|
+
familiesResult.push(dataset.FamilyTitle);
|
|
5279
|
+
}
|
|
5273
5280
|
} else if (
|
|
5274
5281
|
datasetChecked ||
|
|
5275
5282
|
(dataset?.DatasetTitle?.toUpperCase().includes(searchText) &&
|
|
@@ -5301,6 +5308,12 @@ class MenuWidget extends React.Component {
|
|
|
5301
5308
|
if (dataset.Default_active) {
|
|
5302
5309
|
defaultActive = 'map_' + datasetElem.id;
|
|
5303
5310
|
}
|
|
5311
|
+
if (
|
|
5312
|
+
dataset.FamilyTitle &&
|
|
5313
|
+
!familiesResult.includes(dataset.FamilyTitle)
|
|
5314
|
+
) {
|
|
5315
|
+
familiesResult.push(dataset.FamilyTitle);
|
|
5316
|
+
}
|
|
5304
5317
|
} else {
|
|
5305
5318
|
datasetElem.setAttribute('style', 'display: none;');
|
|
5306
5319
|
}
|
|
@@ -5325,6 +5338,18 @@ class MenuWidget extends React.Component {
|
|
|
5325
5338
|
componentElem.setAttribute('style', 'display: none;');
|
|
5326
5339
|
}
|
|
5327
5340
|
}
|
|
5341
|
+
let familiesElements = document.querySelectorAll(
|
|
5342
|
+
'.map-menu-family-dropdown',
|
|
5343
|
+
);
|
|
5344
|
+
for (let index = 0; index < familiesElements.length; index++) {
|
|
5345
|
+
if (
|
|
5346
|
+
familiesResult.includes(familiesElements[index].attributes[2].value)
|
|
5347
|
+
) {
|
|
5348
|
+
familiesElements[index].setAttribute('style', 'display: block;');
|
|
5349
|
+
} else {
|
|
5350
|
+
familiesElements[index].setAttribute('style', 'display: none;');
|
|
5351
|
+
}
|
|
5352
|
+
}
|
|
5328
5353
|
let myServiceResult = false;
|
|
5329
5354
|
this.state.wmsUserServiceLayers.forEach((element) => {
|
|
5330
5355
|
let node = document.getElementById('my-service-' + element.LayerId);
|
|
@@ -25,8 +25,11 @@ class SwipeWidget extends React.Component {
|
|
|
25
25
|
this.dpiMax = 1200;
|
|
26
26
|
this.scaleMax = 600000000;
|
|
27
27
|
this.map = this.props.map;
|
|
28
|
-
|
|
28
|
+
// layers = this.props.layers;
|
|
29
29
|
this.hasSwipe = false;
|
|
30
|
+
this.prevActiveLayers = this.props.mapViewer.activeLayers
|
|
31
|
+
? this.props.mapViewer.activeLayers
|
|
32
|
+
: [];
|
|
30
33
|
}
|
|
31
34
|
|
|
32
35
|
loader() {
|
|
@@ -103,6 +106,27 @@ class SwipeWidget extends React.Component {
|
|
|
103
106
|
});
|
|
104
107
|
}
|
|
105
108
|
|
|
109
|
+
componentDidUpdate(prevProps, prevState) {
|
|
110
|
+
const curr = this.props.mapViewer.activeLayers || [];
|
|
111
|
+
const prev = this.prevActiveLayers || [];
|
|
112
|
+
const changed =
|
|
113
|
+
curr.length !== prev.length || curr.some((layer, i) => layer !== prev[i]);
|
|
114
|
+
if (this.state.showMapMenu && changed) {
|
|
115
|
+
if (curr.length === 0) {
|
|
116
|
+
sessionStorage.setItem('checkedLayers', JSON.stringify([]));
|
|
117
|
+
this.map.layers.removeAll();
|
|
118
|
+
this.props.view.ui.remove(this.swipe);
|
|
119
|
+
this.hasSwipe = false;
|
|
120
|
+
this.resetSwipeWidgetToDefault();
|
|
121
|
+
// this.openMenu(this);
|
|
122
|
+
} else if (this.hasSwipe) {
|
|
123
|
+
this.loadOptions();
|
|
124
|
+
this.renderApplySwipeButton();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
this.prevActiveLayers = curr;
|
|
128
|
+
}
|
|
129
|
+
|
|
106
130
|
getLayerTitle(layer) {
|
|
107
131
|
let title;
|
|
108
132
|
if (layer.url && layer.url.toLowerCase().includes('wmts')) {
|
|
@@ -119,6 +143,7 @@ class SwipeWidget extends React.Component {
|
|
|
119
143
|
return title;
|
|
120
144
|
}
|
|
121
145
|
loadOptions() {
|
|
146
|
+
const layers = this.props.layers;
|
|
122
147
|
var selectLeadingLayer = document.getElementById('select-leading-layer');
|
|
123
148
|
if (selectLeadingLayer) {
|
|
124
149
|
this.removeOptions(selectLeadingLayer);
|
|
@@ -143,9 +168,9 @@ class SwipeWidget extends React.Component {
|
|
|
143
168
|
this.map.layers.items.length > 0
|
|
144
169
|
) {
|
|
145
170
|
cl = [];
|
|
146
|
-
// Find the layer ID in
|
|
171
|
+
// Find the layer ID in layers that corresponds to each map.layers item
|
|
147
172
|
for (const mapLayer of this.map.layers.items) {
|
|
148
|
-
for (const [layerKey, layerObj] of Object.entries(
|
|
173
|
+
for (const [layerKey, layerObj] of Object.entries(layers)) {
|
|
149
174
|
if (layerObj.id === mapLayer.id) {
|
|
150
175
|
cl.push(layerKey);
|
|
151
176
|
break;
|
|
@@ -162,32 +187,32 @@ class SwipeWidget extends React.Component {
|
|
|
162
187
|
// Process the layers
|
|
163
188
|
if (cl && cl.length > 0) {
|
|
164
189
|
cl.forEach((layer) => {
|
|
165
|
-
if (
|
|
166
|
-
let layerId =
|
|
167
|
-
if (
|
|
190
|
+
if (layers[layer]) {
|
|
191
|
+
let layerId = layers[layer].id;
|
|
192
|
+
if (layers['lcc_filter']) {
|
|
168
193
|
if (
|
|
169
194
|
layer === 'all_lcc_a_pol_1_4_1_0' ||
|
|
170
195
|
layer === 'all_lcc_b_pol_1_4_1_1'
|
|
171
196
|
) {
|
|
172
|
-
layerId =
|
|
197
|
+
layerId = layers['lcc_filter'].id;
|
|
173
198
|
}
|
|
174
199
|
}
|
|
175
|
-
if (
|
|
200
|
+
if (layers['lc_filter']) {
|
|
176
201
|
if (
|
|
177
202
|
layer === 'all_present_lc_a_pol_1_4_0_0' ||
|
|
178
203
|
layer === 'all_present_lc_b_pol_1_4_0_1'
|
|
179
204
|
) {
|
|
180
|
-
layerId =
|
|
205
|
+
layerId = layers['lc_filter'].id;
|
|
181
206
|
}
|
|
182
207
|
}
|
|
183
|
-
if (
|
|
208
|
+
if (layers['klc_filter']) {
|
|
184
209
|
if (layer === 'cop_klc_1_4_2_0') {
|
|
185
|
-
layerId =
|
|
210
|
+
layerId = layers['klc_filter'].id;
|
|
186
211
|
}
|
|
187
212
|
}
|
|
188
|
-
if (
|
|
213
|
+
if (layers['pa_filter']) {
|
|
189
214
|
if (layer === 'protected_areas_1_4_3_0') {
|
|
190
|
-
layerId =
|
|
215
|
+
layerId = layers['pa_filter'].id;
|
|
191
216
|
}
|
|
192
217
|
}
|
|
193
218
|
if (selectLeadingLayer) {
|
|
@@ -198,7 +223,7 @@ class SwipeWidget extends React.Component {
|
|
|
198
223
|
) {
|
|
199
224
|
selectLeadingLayer.options.add(
|
|
200
225
|
new Option(
|
|
201
|
-
this.getLayerTitle(
|
|
226
|
+
this.getLayerTitle(layers[layer]),
|
|
202
227
|
layerId,
|
|
203
228
|
true,
|
|
204
229
|
true,
|
|
@@ -206,11 +231,7 @@ class SwipeWidget extends React.Component {
|
|
|
206
231
|
);
|
|
207
232
|
} else {
|
|
208
233
|
selectLeadingLayer.options.add(
|
|
209
|
-
new Option(
|
|
210
|
-
this.getLayerTitle(this.layers[layer]),
|
|
211
|
-
layerId,
|
|
212
|
-
false,
|
|
213
|
-
),
|
|
234
|
+
new Option(this.getLayerTitle(layers[layer]), layerId, false),
|
|
214
235
|
);
|
|
215
236
|
}
|
|
216
237
|
}
|
|
@@ -222,7 +243,7 @@ class SwipeWidget extends React.Component {
|
|
|
222
243
|
) {
|
|
223
244
|
selectTrailingLayer.options.add(
|
|
224
245
|
new Option(
|
|
225
|
-
this.getLayerTitle(
|
|
246
|
+
this.getLayerTitle(layers[layer]),
|
|
226
247
|
layerId,
|
|
227
248
|
true,
|
|
228
249
|
true,
|
|
@@ -230,11 +251,7 @@ class SwipeWidget extends React.Component {
|
|
|
230
251
|
);
|
|
231
252
|
} else {
|
|
232
253
|
selectTrailingLayer.options.add(
|
|
233
|
-
new Option(
|
|
234
|
-
this.getLayerTitle(this.layers[layer]),
|
|
235
|
-
layerId,
|
|
236
|
-
false,
|
|
237
|
-
),
|
|
254
|
+
new Option(this.getLayerTitle(layers[layer]), layerId, false),
|
|
238
255
|
);
|
|
239
256
|
}
|
|
240
257
|
}
|
|
@@ -242,6 +259,33 @@ class SwipeWidget extends React.Component {
|
|
|
242
259
|
});
|
|
243
260
|
}
|
|
244
261
|
}
|
|
262
|
+
resetSwipeWidgetToDefault() {
|
|
263
|
+
// Remove all swipe layers
|
|
264
|
+
if (this.swipe) {
|
|
265
|
+
this.swipe.leadingLayers.removeAll();
|
|
266
|
+
this.swipe.trailingLayers.removeAll();
|
|
267
|
+
this.hasSwipe = false;
|
|
268
|
+
}
|
|
269
|
+
// Reset dropdowns to default
|
|
270
|
+
const selectLeadingLayer = document.getElementById('select-leading-layer');
|
|
271
|
+
if (selectLeadingLayer) {
|
|
272
|
+
this.removeOptions(selectLeadingLayer);
|
|
273
|
+
selectLeadingLayer.options.add(
|
|
274
|
+
new Option('Select a leading layer', 'default', false, false),
|
|
275
|
+
);
|
|
276
|
+
selectLeadingLayer.options[0].disabled = true;
|
|
277
|
+
}
|
|
278
|
+
const selectTrailingLayer = document.getElementById(
|
|
279
|
+
'select-trailing-layer',
|
|
280
|
+
);
|
|
281
|
+
if (selectTrailingLayer) {
|
|
282
|
+
this.removeOptions(selectTrailingLayer);
|
|
283
|
+
selectTrailingLayer.options.add(
|
|
284
|
+
new Option('Select a trailing layer', 'default', false, false),
|
|
285
|
+
);
|
|
286
|
+
selectTrailingLayer.options[0].disabled = true;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
245
289
|
removeOptions(selectElement) {
|
|
246
290
|
if (selectElement.options.length > 0) {
|
|
247
291
|
var i,
|
|
@@ -252,6 +296,7 @@ class SwipeWidget extends React.Component {
|
|
|
252
296
|
}
|
|
253
297
|
}
|
|
254
298
|
renderApplySwipeButton() {
|
|
299
|
+
const layers = this.props.layers;
|
|
255
300
|
this.props.view.ui.remove(this.swipe);
|
|
256
301
|
this.props.view.ui.add(this.swipe);
|
|
257
302
|
this.hasSwipe = true;
|
|
@@ -268,44 +313,44 @@ class SwipeWidget extends React.Component {
|
|
|
268
313
|
let cl = JSON.parse(sessionStorage.getItem('checkedLayers'));
|
|
269
314
|
if (cl) {
|
|
270
315
|
cl.forEach((layer) => {
|
|
271
|
-
if (
|
|
272
|
-
this.swipe.leadingLayers.add(
|
|
316
|
+
if (layers[layer].id === selectedLeadingLayer) {
|
|
317
|
+
this.swipe.leadingLayers.add(layers[layer]);
|
|
273
318
|
}
|
|
274
|
-
if (
|
|
275
|
-
this.swipe.trailingLayers.add(
|
|
319
|
+
if (layers[layer].id === selectedTrailingLayer) {
|
|
320
|
+
this.swipe.trailingLayers.add(layers[layer]);
|
|
276
321
|
}
|
|
277
322
|
});
|
|
278
323
|
}
|
|
279
|
-
if (
|
|
280
|
-
if (
|
|
281
|
-
this.swipe.leadingLayers.add(
|
|
324
|
+
if (layers['lcc_filter']) {
|
|
325
|
+
if (layers['lcc_filter'].id === selectedLeadingLayer) {
|
|
326
|
+
this.swipe.leadingLayers.add(layers['lcc_filter']);
|
|
282
327
|
}
|
|
283
|
-
if (
|
|
284
|
-
this.swipe.trailingLayers.add(
|
|
328
|
+
if (layers['lcc_filter'].id === selectedTrailingLayer) {
|
|
329
|
+
this.swipe.trailingLayers.add(layers['lcc_filter']);
|
|
285
330
|
}
|
|
286
331
|
}
|
|
287
|
-
if (
|
|
288
|
-
if (
|
|
289
|
-
this.swipe.leadingLayers.add(
|
|
332
|
+
if (layers['lc_filter']) {
|
|
333
|
+
if (layers['lc_filter'].id === selectedLeadingLayer) {
|
|
334
|
+
this.swipe.leadingLayers.add(layers['lc_filter']);
|
|
290
335
|
}
|
|
291
|
-
if (
|
|
292
|
-
this.swipe.trailingLayers.add(
|
|
336
|
+
if (layers['lc_filter'].id === selectedTrailingLayer) {
|
|
337
|
+
this.swipe.trailingLayers.add(layers['lc_filter']);
|
|
293
338
|
}
|
|
294
339
|
}
|
|
295
|
-
if (
|
|
296
|
-
if (
|
|
297
|
-
this.swipe.leadingLayers.add(
|
|
340
|
+
if (layers['klc_filter']) {
|
|
341
|
+
if (layers['klc_filter'].id === selectedLeadingLayer) {
|
|
342
|
+
this.swipe.leadingLayers.add(layers['klc_filter']);
|
|
298
343
|
}
|
|
299
|
-
if (
|
|
300
|
-
this.swipe.trailingLayers.add(
|
|
344
|
+
if (layers['klc_filter'].id === selectedTrailingLayer) {
|
|
345
|
+
this.swipe.trailingLayers.add(layers['klc_filter']);
|
|
301
346
|
}
|
|
302
347
|
}
|
|
303
|
-
if (
|
|
304
|
-
if (
|
|
305
|
-
this.swipe.leadingLayers.add(
|
|
348
|
+
if (layers['pa_filter']) {
|
|
349
|
+
if (layers['pa_filter'].id === selectedLeadingLayer) {
|
|
350
|
+
this.swipe.leadingLayers.add(layers['pa_filter']);
|
|
306
351
|
}
|
|
307
|
-
if (
|
|
308
|
-
this.swipe.trailingLayers.add(
|
|
352
|
+
if (layers['pa_filter'].id === selectedTrailingLayer) {
|
|
353
|
+
this.swipe.trailingLayers.add(layers['pa_filter']);
|
|
309
354
|
}
|
|
310
355
|
}
|
|
311
356
|
this.map.layers.removeAll();
|
|
@@ -318,23 +363,24 @@ class SwipeWidget extends React.Component {
|
|
|
318
363
|
}
|
|
319
364
|
|
|
320
365
|
loadVisibleLayers() {
|
|
366
|
+
const layers = this.props.layers;
|
|
321
367
|
let cl = JSON.parse(sessionStorage.getItem('checkedLayers'));
|
|
322
368
|
if (cl) {
|
|
323
369
|
cl.forEach((layer) => {
|
|
324
|
-
this.map.layers.add(
|
|
370
|
+
this.map.layers.add(layers[layer]);
|
|
325
371
|
});
|
|
326
372
|
}
|
|
327
|
-
if (
|
|
328
|
-
this.map.layers.add(
|
|
373
|
+
if (layers['lcc_filter']) {
|
|
374
|
+
this.map.layers.add(layers['lcc_filter']);
|
|
329
375
|
}
|
|
330
|
-
if (
|
|
331
|
-
this.map.layers.add(
|
|
376
|
+
if (layers['lc_filter']) {
|
|
377
|
+
this.map.layers.add(layers['lc_filter']);
|
|
332
378
|
}
|
|
333
|
-
if (
|
|
334
|
-
this.map.layers.add(
|
|
379
|
+
if (layers['klc_filter']) {
|
|
380
|
+
this.map.layers.add(layers['klc_filter']);
|
|
335
381
|
}
|
|
336
|
-
if (
|
|
337
|
-
this.map.layers.add(
|
|
382
|
+
if (layers['pa_filter']) {
|
|
383
|
+
this.map.layers.add(layers['pa_filter']);
|
|
338
384
|
}
|
|
339
385
|
}
|
|
340
386
|
/**
|