@eeacms/volto-arcgis-block 0.1.359 → 0.1.361

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 CHANGED
@@ -4,6 +4,13 @@ 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.361](https://github.com/eea/volto-arcgis-block/compare/0.1.360...0.1.361) - 20 May 2025
8
+
9
+ ### [0.1.360](https://github.com/eea/volto-arcgis-block/compare/0.1.359...0.1.360) - 19 May 2025
10
+
11
+ #### :hammer_and_wrench: Others
12
+
13
+ - CLMS-287785 (bug): all bookmark data updated on order shift [Unai Bolivar - [`ebc49f7`](https://github.com/eea/volto-arcgis-block/commit/ebc49f73a4bae9bd29d0ee1c4706b0e1ce42c5c8)]
7
14
  ### [0.1.359](https://github.com/eea/volto-arcgis-block/compare/0.1.358...0.1.359) - 16 May 2025
8
15
 
9
16
  ### [0.1.358](https://github.com/eea/volto-arcgis-block/compare/0.1.357...0.1.358) - 14 May 2025
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.359",
3
+ "version": "0.1.361",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -27,6 +27,7 @@ class BookmarkWidget extends React.Component {
27
27
  this.menuClass =
28
28
  'esri-icon-bookmark esri-widget--button esri-widget esri-interactive';
29
29
  this.sessionBookmarks = [];
30
+ this.sessionBookmarkIndexLinkUid = [];
30
31
  this.sessionBookmarkLayers = [];
31
32
  this.sessionBookmarkOpacity = [];
32
33
  this.sessionBookmarkVisible = [];
@@ -200,6 +201,7 @@ class BookmarkWidget extends React.Component {
200
201
  }
201
202
  });
202
203
  this.sessionBookmarks.push(e.added[0]);
204
+ this.sessionBookmarkIndexLinkUid.push(e.added[0].uid);
203
205
  this.sessionBookmarkLayers.push(check);
204
206
  this.sessionBookmarkOpacity.push(opacity);
205
207
  this.sessionBookmarkVisible.push(visible);
@@ -237,55 +239,92 @@ class BookmarkWidget extends React.Component {
237
239
  this.sessionBookmarkLayers.splice(index, 1);
238
240
  this.sessionBookmarkOpacity.splice(index, 1);
239
241
  this.sessionBookmarkVisible.splice(index, 1);
240
- this.sessionBookmarkHotspot.splice(index, 1);
242
+ if (
243
+ this.sessionBookmarkHotspot &&
244
+ Array.isArray(this.sessionBookmarkHotspot)
245
+ ) {
246
+ this.sessionBookmarkHotspot.splice(index, 1);
247
+ }
241
248
  shouldUpdate = true;
242
249
  break;
243
250
  }
244
251
  }
245
- } else {
246
- let newSessionBookmark = [];
252
+ } else if (e.moved) {
253
+ let newSessionBookmarks = [];
254
+ let newSessionBookmarkIndexLinkUid = [];
247
255
  let newSessionBookmarkLayers = [];
248
256
  let newSessionBookmarkOpacity = [];
249
257
  let newSessionBookmarkVisible = [];
250
258
  let newSessionBookmarkHotspot = [];
251
- for (let i = 0; i < this.Bookmarks.bookmarks.items.length; i++) {
252
- for (let j = 0; j < this.sessionBookmarks.length; j++) {
253
- if (
254
- this.Bookmarks.bookmarks.items[i] === this.sessionBookmarks[j]
255
- ) {
256
- newSessionBookmark.push(this.sessionBookmarks[j]);
257
- newSessionBookmarkLayers.push(this.sessionBookmarkLayers[j]);
258
- newSessionBookmarkOpacity.push(
259
- this.sessionBookmarkOpacity[j],
260
- );
261
- newSessionBookmarkVisible.push(
262
- this.sessionBookmarkVisible[j],
263
- );
264
- newSessionBookmarkHotspot.push(
265
- this.sessionBookmarkHotspot[j],
266
- );
267
- }
268
- }
269
- }
270
- if (
271
- newSessionBookmark.length !== this.sessionBookmarks.length ||
272
- newSessionBookmarkLayers.length !==
273
- this.sessionBookmarkLayers.length ||
274
- newSessionBookmarkOpacity.length !==
275
- this.sessionBookmarkOpacity.length ||
276
- newSessionBookmarkVisible.length !==
277
- this.sessionBookmarkVisible.length ||
278
- newSessionBookmarkHotspot.length !==
279
- this.sessionBookmarkHotspot.length
280
- ) {
281
- this.sessionBookmarks = newSessionBookmark;
282
- this.sessionBookmarkLayers = newSessionBookmarkLayers;
283
- this.sessionBookmarkOpacity = newSessionBookmarkOpacity;
284
- this.sessionBookmarkVisible = newSessionBookmarkVisible;
285
- this.sessionBookmarkHotspot = newSessionBookmarkHotspot;
286
- shouldUpdate = true;
287
- }
259
+ e.moved.forEach((bookmark) => {
260
+ let index = this.sessionBookmarkIndexLinkUid.indexOf(
261
+ bookmark.uid,
262
+ );
263
+ newSessionBookmarks.push(bookmark);
264
+ newSessionBookmarkIndexLinkUid.push(bookmark.uid);
265
+ newSessionBookmarkLayers.push(this.sessionBookmarkLayers[index]);
266
+ newSessionBookmarkOpacity.push(
267
+ this.sessionBookmarkOpacity[index],
268
+ );
269
+ newSessionBookmarkVisible.push(
270
+ this.sessionBookmarkVisible[index],
271
+ );
272
+ newSessionBookmarkHotspot.push(
273
+ this.sessionBookmarkHotspot[index],
274
+ );
275
+ });
276
+ this.sessionBookmarks = newSessionBookmarks;
277
+ this.sessionBookmarkIndexLinkUid = newSessionBookmarkIndexLinkUid;
278
+ this.sessionBookmarkLayers = newSessionBookmarkLayers;
279
+ this.sessionBookmarkOpacity = newSessionBookmarkOpacity;
280
+ this.sessionBookmarkVisible = newSessionBookmarkVisible;
281
+ this.sessionBookmarkHotspot = newSessionBookmarkHotspot;
282
+ shouldUpdate = true;
288
283
  }
284
+ // } else {
285
+ // let newSessionBookmark = [];
286
+ // let newSessionBookmarkLayers = [];
287
+ // let newSessionBookmarkOpacity = [];
288
+ // let newSessionBookmarkVisible = [];
289
+ // let newSessionBookmarkHotspot = [];
290
+ // for (let i = 0; i < this.Bookmarks.bookmarks.items.length; i++) {
291
+ // for (let j = 0; j < this.sessionBookmarks.length; j++) {
292
+ // if (
293
+ // this.Bookmarks.bookmarks.items[i] === this.sessionBookmarks[j]
294
+ // ) {
295
+ // newSessionBookmark.push(this.sessionBookmarks[j]);
296
+ // newSessionBookmarkLayers.push(this.sessionBookmarkLayers[j]);
297
+ // newSessionBookmarkOpacity.push(
298
+ // this.sessionBookmarkOpacity[j],
299
+ // );
300
+ // newSessionBookmarkVisible.push(
301
+ // this.sessionBookmarkVisible[j],
302
+ // );
303
+ // newSessionBookmarkHotspot.push(
304
+ // this.sessionBookmarkHotspot[j],
305
+ // );
306
+ // }
307
+ // }
308
+ // }
309
+ // }
310
+ // if (
311
+ // newSessionBookmark.length !== this.sessionBookmarks.length ||
312
+ // newSessionBookmarkLayers.length !==
313
+ // this.sessionBookmarkLayers.length ||
314
+ // newSessionBookmarkOpacity.length !==
315
+ // this.sessionBookmarkOpacity.length ||
316
+ // newSessionBookmarkVisible.length !==
317
+ // this.sessionBookmarkVisible.length ||
318
+ // newSessionBookmarkHotspot.length !==
319
+ // this.sessionBookmarkHotspot.length
320
+ // ) {
321
+ // this.sessionBookmarks = newSessionBookmark;
322
+ // this.sessionBookmarkLayers = newSessionBookmarkLayers;
323
+ // this.sessionBookmarkOpacity = newSessionBookmarkOpacity;
324
+ // this.sessionBookmarkVisible = newSessionBookmarkVisible;
325
+ // this.sessionBookmarkHotspot = newSessionBookmarkHotspot;
326
+ // shouldUpdate = true;
327
+ // }
289
328
  if (shouldUpdate && this.userID != null) {
290
329
  localStorage.setItem(
291
330
  BOOKMARK_SESSION_KEY + '_' + this.userID,
@@ -431,6 +470,13 @@ class BookmarkWidget extends React.Component {
431
470
  );
432
471
  }
433
472
  }
473
+ if (
474
+ !Array.isArray(selectLayers) ||
475
+ !Array.isArray(selectOpacity) ||
476
+ !Array.isArray(selectVisible)
477
+ ) {
478
+ return;
479
+ }
434
480
  let layerOpacities = {};
435
481
  const layerKeys = {
436
482
  lcc_filter: 'all_lcc',
@@ -336,7 +336,9 @@ class MapViewer extends React.Component {
336
336
  this.location.search.includes('dataset=')))
337
337
  ) {
338
338
  let toc_panel_scrolls = sessionStorage.getItem('toc_panel_scrolls');
339
- sessionStorage.clear();
339
+ if (!sessionStorage.getItem('TMSLayerObj')) {
340
+ sessionStorage.clear();
341
+ }
340
342
  sessionStorage.setItem('toc_panel_scrolls', toc_panel_scrolls);
341
343
  }
342
344
  // if (
@@ -4505,8 +4505,7 @@ class MenuWidget extends React.Component {
4505
4505
  let dataset = url.searchParams.get('dataset');
4506
4506
  if (
4507
4507
  this.state.wmsUserServiceLayers.length > 0 &&
4508
- prevState.wmsUserServiceLayers.length === 0 &&
4509
- !(product || dataset)
4508
+ prevState.wmsUserServiceLayers.length === 0
4510
4509
  ) {
4511
4510
  // Close other tabs and open "My Services" tab
4512
4511
  let dropdownsMapMenu = document.querySelectorAll('.map-menu-dropdown');
@@ -4515,13 +4514,16 @@ class MenuWidget extends React.Component {
4515
4514
  let dropdownId = 'dropdown_' + i;
4516
4515
  // let myServicesId = 'component_' + i;
4517
4516
  // let mapMenuServiceDropdownId = 'product_' + i + '_' + j;
4518
- dropdownsMapMenu.forEach((dropdown) => {
4519
- if (dropdown.id !== dropdownId) {
4520
- dropdown
4521
- .querySelector('.ccl-expandable__button')
4522
- .setAttribute('aria-expanded', 'false');
4523
- }
4524
- });
4517
+ if (!(product || dataset)) {
4518
+ dropdownsMapMenu.forEach((dropdown) => {
4519
+ if (dropdown.id !== dropdownId) {
4520
+ dropdown
4521
+ .querySelector('.ccl-expandable__button')
4522
+ .setAttribute('aria-expanded', 'false');
4523
+ }
4524
+ });
4525
+ }
4526
+
4525
4527
  document.getElementById(dropdownId).setAttribute('aria-expanded', 'true');
4526
4528
  }
4527
4529