@eeacms/volto-arcgis-block 0.1.121 → 0.1.123

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,20 @@ 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.123](https://github.com/eea/volto-arcgis-block/compare/0.1.122...0.1.123) - 24 March 2023
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - CLMS-1975-1634 (fix): finished implementing these tickets and ran linting scripts [ujbolivar - [`fe41bc0`](https://github.com/eea/volto-arcgis-block/commit/fe41bc0e1e44beb350a340a18625e34c61d41437)]
12
+ - CLMS-1975-1634 (FIX): Changes for CLMS-1975 and CLMS-1634 completed [ujbolivar - [`4d13b79`](https://github.com/eea/volto-arcgis-block/commit/4d13b7965e9691fe1d66d2cc25b51a1c05f0d0e1)]
13
+ - CLMS-1975 [Amanda Rodriguez - [`182755c`](https://github.com/eea/volto-arcgis-block/commit/182755c7edb0348c505d1906d803c64fc4e18eb6)]
14
+ ### [0.1.122](https://github.com/eea/volto-arcgis-block/compare/0.1.121...0.1.122) - 23 March 2023
15
+
16
+ #### :hammer_and_wrench: Others
17
+
18
+ - CLMS-1765-and-CLMS-1975 (chore): Commented a completed task and ran linting scripts [ujbolivar - [`894352f`](https://github.com/eea/volto-arcgis-block/commit/894352f3e25d9a1bc8143092c9683d348651222f)]
19
+ - CLMS-1756 and CLMS-1975 (lint): Ran linting scripts [ujbolivar - [`e5fb127`](https://github.com/eea/volto-arcgis-block/commit/e5fb127413d91ee36457c2530f61fa01488a2de8)]
20
+ - CLMS-1765 AND CLMS-1975 (fix): Corrected issues with datasets loading. Pushing latest team changes [ujbolivar - [`473fcc9`](https://github.com/eea/volto-arcgis-block/commit/473fcc9de87c6137b5e877c4bc8684e79df4a205)]
7
21
  ### [0.1.121](https://github.com/eea/volto-arcgis-block/compare/0.1.120...0.1.121) - 23 March 2023
8
22
 
9
23
  #### :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.121",
3
+ "version": "0.1.123",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -366,10 +366,10 @@ class MenuWidget extends React.Component {
366
366
  node.style.display = zoom > 6 ? 'none' : 'block';
367
367
  }
368
368
  }
369
- if (dropDownActive.includes('dropdown_2_0')) {
369
+ if (dropDownActive.includes('dropdown_2_1')) {
370
370
  let checks = document
371
- .getElementById('dropdown_2_0')
372
- .nextSibling.querySelectorAll('[parentid="map_product_2_0"]');
371
+ .getElementById('dropdown_2_1')
372
+ .nextSibling.querySelectorAll('[parentid="map_product_2_1"]');
373
373
  let checksList = Array.prototype.slice.call(checks);
374
374
  if (checksList && checksList !== null) {
375
375
  checksList.forEach((check) => {
@@ -417,9 +417,17 @@ class MenuWidget extends React.Component {
417
417
  );
418
418
  }
419
419
 
420
+ waitForDataFill = async () => {
421
+ while (this.compCfg.length === 0) {
422
+ await new Promise((resolve) => setTimeout(resolve, 100)); // wait for 100ms
423
+ }
424
+ return this.compCfg;
425
+ };
426
+
420
427
  // get custom TMS layer JSON
421
428
  getTMSLayersJSON() {
422
429
  let promises = []; // download JSON file calls
430
+ this.waitForDataFill();
423
431
  this.compCfg.forEach((component) => {
424
432
  component.Products.forEach((product) => {
425
433
  product.Datasets.forEach((dataset) => {
@@ -818,12 +826,10 @@ class MenuWidget extends React.Component {
818
826
  for (var i in component.Products) {
819
827
  // CLMS-1544
820
828
  // dont show the product if all of its datasets has the auxiliary service as its ViewService URL
829
+ //CLMS-1756
830
+ //don´t show the product if MarkAsDownloadableNoServiceToVisualize is true
821
831
  const isAuxiliary = (dataset) =>
822
- dataset.ViewService.toLowerCase() ===
823
- 'https://trial.discomap.eea.europa.eu/arcgis/services/clms/worldcountries/mapserver/wmsserver' ||
824
- dataset.ViewService.toLowerCase() ===
825
- 'https://trial.discomap.eea.europa.eu/arcgis/services/clms/worldcountries/mapserver/wmsserver?';
826
-
832
+ dataset.MarkAsDownloadableNoServiceToVisualize;
827
833
  if (!component.Products[i].Datasets.every(isAuxiliary)) {
828
834
  products.push(
829
835
  this.metodProcessProduct(
@@ -900,12 +906,7 @@ class MenuWidget extends React.Component {
900
906
  }
901
907
 
902
908
  // CLMS-1545
903
- if (
904
- product.Datasets[i].ViewService.toLowerCase() !==
905
- 'https://trial.discomap.eea.europa.eu/arcgis/services/clms/worldcountries/mapserver/wmsserver' &&
906
- product.Datasets[i].ViewService.toLowerCase() !==
907
- 'https://trial.discomap.eea.europa.eu/arcgis/services/clms/worldcountries/mapserver/wmsserver?'
908
- ) {
909
+ if (!product.Datasets[i].MarkAsDownloadableNoServiceToVisualize) {
909
910
  datasets.push(
910
911
  this.metodProcessDataset(
911
912
  product.Datasets[i],
@@ -1901,7 +1902,7 @@ class MenuWidget extends React.Component {
1901
1902
  * Method to show Active Layers of the map
1902
1903
  * @param {*} elem From the click event
1903
1904
  */
1904
- addActiveLayer(elem, order, fromDownload) {
1905
+ addActiveLayer(elem, order, fromDownload, hideCalendar) {
1905
1906
  return (
1906
1907
  <div
1907
1908
  className="active-layer"
@@ -1992,7 +1993,12 @@ class MenuWidget extends React.Component {
1992
1993
  />
1993
1994
  </span>
1994
1995
  {this.timeLayers[elem.id][1] === 'stop' &&
1995
- this.renderTimeslider(elem, this.layers[elem.id], fromDownload)}
1996
+ this.renderTimeslider(
1997
+ elem,
1998
+ this.layers[elem.id],
1999
+ fromDownload,
2000
+ hideCalendar,
2001
+ )}
1996
2002
  </div>
1997
2003
  </div>
1998
2004
  );
@@ -2128,7 +2134,7 @@ class MenuWidget extends React.Component {
2128
2134
  * @param {*} id id from elem
2129
2135
  */
2130
2136
 
2131
- showTimeSlider(elem, fromDownload) {
2137
+ showTimeSlider(elem, fromDownload, hideCalendar) {
2132
2138
  if (
2133
2139
  sessionStorage.key('timeSliderTag') &&
2134
2140
  sessionStorage.getItem('timeSliderTag') === 'true'
@@ -2168,6 +2174,7 @@ class MenuWidget extends React.Component {
2168
2174
  elem,
2169
2175
  order,
2170
2176
  fromDownload,
2177
+ hideCalendar,
2171
2178
  );
2172
2179
  } else {
2173
2180
  if (
@@ -2741,7 +2748,7 @@ class MenuWidget extends React.Component {
2741
2748
  }
2742
2749
  }
2743
2750
 
2744
- renderTimeslider(elem, layer, fromDownload) {
2751
+ renderTimeslider(elem, layer, fromDownload, hideCalendar) {
2745
2752
  if (this.props.view && layer) {
2746
2753
  let activeLayer = document.querySelector('#active_' + elem.id);
2747
2754
  let time = { elem: activeLayer };
@@ -2765,6 +2772,7 @@ class MenuWidget extends React.Component {
2765
2772
  logged={isLoggedIn}
2766
2773
  fromDownload={fromDownload}
2767
2774
  area={this.props.area}
2775
+ hideCalendar={hideCalendar}
2768
2776
  />,
2769
2777
  document.querySelector('.esri-ui-bottom-right'),
2770
2778
  );
@@ -2785,7 +2793,7 @@ class MenuWidget extends React.Component {
2785
2793
  .querySelector('[datasetid="' + id + '"] input')
2786
2794
  .getAttribute('defcheck');
2787
2795
  setTimeout(() => {
2788
- this.showTimeSlider(document.getElementById(layerId), false);
2796
+ this.showTimeSlider(document.getElementById(layerId), true, true);
2789
2797
  }, 100);
2790
2798
  }
2791
2799
  }
@@ -26,7 +26,8 @@ class TimesliderWidget extends React.Component {
26
26
  timeSelectedValuesC: [], //To compare time slider stored values with new selected values
27
27
  showDatePanel: false,
28
28
  lockDatePanel: true,
29
- showCalendar: this.props.fromDownload ? true : false,
29
+ showCalendar:
30
+ this.props.fromDownload && !this.props.hideCalendar ? true : false,
30
31
  dateStart: this.props.time.start ? new Date(this.props.time.start) : null,
31
32
  dateEnd: this.props.time.end ? new Date(this.props.time.end) : null,
32
33
  periodicity: null,