@eeacms/volto-arcgis-block 0.1.115 → 0.1.117

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,17 @@ 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.117](https://github.com/eea/volto-arcgis-block/compare/0.1.116...0.1.117) - 21 March 2023
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - CLMS-1634 (fix): final details to make sure legend and watch functions works on general and custom mapviewers without errors [ujbolivar - [`2470714`](https://github.com/eea/volto-arcgis-block/commit/2470714f39a272c79a30625c546948ce772395fa)]
12
+ ### [0.1.116](https://github.com/eea/volto-arcgis-block/compare/0.1.115...0.1.116) - 21 March 2023
13
+
14
+ #### :hammer_and_wrench: Others
15
+
16
+ - CLMS-1634 (fix): Ran linting scripts [ujbolivar - [`87a909c`](https://github.com/eea/volto-arcgis-block/commit/87a909cf4d1fa77b0abe6d818de9bddb199a9e63)]
17
+ - CLMS-1634 (bug): fixed the watch zoom for legend function from breaking the map. [ujbolivar - [`a14cf06`](https://github.com/eea/volto-arcgis-block/commit/a14cf06543735b20b85f4ba27c18f75521aa47e4)]
7
18
  ### [0.1.115](https://github.com/eea/volto-arcgis-block/compare/0.1.114...0.1.115) - 20 March 2023
8
19
 
9
20
  #### :hammer_and_wrench: Others
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.115",
3
+ "version": "0.1.117",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -38,6 +38,7 @@ class HotspotWidget extends React.Component {
38
38
  this.layerModelInit = this.layerModelInit.bind(this);
39
39
  this.handleApplyFilter = this.handleApplyFilter.bind(this);
40
40
  //this.getLayerParameters();
41
+ this.selectedArea = null;
41
42
  }
42
43
 
43
44
  loader() {
@@ -207,7 +208,7 @@ class HotspotWidget extends React.Component {
207
208
 
208
209
  openMenu() {
209
210
  if (this.state.showMapMenu) {
210
- this.getKLCNames(this.dataJSONNames, this.dataJSONNames[0].node.klc_name);
211
+ this.getKLCNames(this.dataJSONNames, this.selectedArea);
211
212
  this.props.mapViewer.setActiveWidget();
212
213
  this.container.current.querySelector('.right-panel').style.display =
213
214
  'none';
@@ -223,10 +224,7 @@ class HotspotWidget extends React.Component {
223
224
  } else {
224
225
  this.getLayerParameters();
225
226
  if (this.getLayerParameters.length !== 0)
226
- this.getKLCNames(
227
- this.dataJSONNames,
228
- this.dataJSONNames[0].node.klc_name,
229
- );
227
+ this.getKLCNames(this.dataJSONNames, this.selectedArea);
230
228
  this.props.mapViewer.setActiveWidget(this);
231
229
  this.container.current.querySelector('.right-panel').style.display =
232
230
  'flex';
@@ -253,7 +251,10 @@ class HotspotWidget extends React.Component {
253
251
  })
254
252
  .then((data) => {
255
253
  this.dataJSONNames = data.nodes;
256
- this.getKLCNames(data.nodes, data.nodes[0].node.klc_name);
254
+ if (this.selectedArea == null) {
255
+ this.selectedArea = data.nodes[0].node.klc_name;
256
+ }
257
+ this.getKLCNames(data.nodes, this.selectedArea);
257
258
  })
258
259
  .catch(function (error) {
259
260
  /* console.log('error while getting data'); */
@@ -326,6 +327,7 @@ class HotspotWidget extends React.Component {
326
327
  var selectBoxLcTime;
327
328
  var selectBoxHighlightsLcc;
328
329
  var selectBoxLccTime;
330
+ this.selectedArea = selectedOption;
329
331
 
330
332
  selectBox = document.getElementById('select-klc-area');
331
333
  selectBoxHighlightsLcc = document.getElementById(
@@ -334,7 +336,6 @@ class HotspotWidget extends React.Component {
334
336
  selectBoxLccTime = document.getElementById('select-klc-lccTime');
335
337
  selectBoxHighlightsLc = document.getElementById('select-klc-highlights-lc');
336
338
  selectBoxLcTime = document.getElementById('select-klc-lcTime');
337
-
338
339
  for (let i = 0; i < data.length; i++) {
339
340
  var option = data[i].node.klc_name;
340
341
  if (option === selectedOption) {
@@ -332,20 +332,43 @@ class MenuWidget extends React.Component {
332
332
 
333
333
  // add zoomend listener to map to show/hide zoom in message
334
334
  this.view.watch('stationary', (isStationary) => {
335
+ let dropDownActive = sessionStorage.getItem('expandedDropdowns');
336
+ let node;
335
337
  if (isStationary) {
336
- let node = document.getElementById('snow-and-ice-zoom-message');
337
- let nodes = document.querySelectorAll('.zoom-in-message-dataset');
338
338
  let zoom = this.view.get('zoom');
339
- if (node !== null) {
340
- node.style.display = zoom > 6 ? 'none' : 'block';
339
+ if (this.props.download) {
340
+ node = document.querySelector('.zoom-in-message-dataset');
341
+ if (node && node !== null) {
342
+ node.style.display = zoom > 6 ? 'none' : 'block';
343
+ }
341
344
  }
342
- if (nodes !== null) {
343
- nodes.forEach((node) => {
344
- let isChecked = node.parentElement.offsetParent.offsetParent.querySelector(
345
- 'input',
346
- ).checked;
347
- if (isChecked) node.style.display = zoom > 6 ? 'none' : 'block';
348
- });
345
+ if (!this.props.download && dropDownActive) {
346
+ if (dropDownActive.includes('dropdown_2')) {
347
+ node = document.getElementById('snow-and-ice-zoom-message');
348
+ if (node && node !== null) {
349
+ node.style.display = zoom > 6 ? 'none' : 'block';
350
+ }
351
+ }
352
+ if (dropDownActive.includes('dropdown_2_0')) {
353
+ let checks = document
354
+ .getElementById('dropdown_2_0')
355
+ .nextSibling.querySelectorAll('[parentid="map_product_2_0"]');
356
+ let checksList = Array.prototype.slice.call(checks);
357
+ if (checksList && checksList !== null) {
358
+ checksList.forEach((check) => {
359
+ if (check !== null) {
360
+ if (check.checked) {
361
+ let node = Array.prototype.slice.call(
362
+ check.nextSibling.getElementsByClassName(
363
+ 'zoom-in-message-dataset',
364
+ ),
365
+ )[0];
366
+ node.style.display = zoom > 6 ? 'none' : 'block';
367
+ }
368
+ }
369
+ });
370
+ }
371
+ }
349
372
  }
350
373
  }
351
374
  });