@eeacms/volto-arcgis-block 0.1.117 → 0.1.119

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.119](https://github.com/eea/volto-arcgis-block/compare/0.1.118...0.1.119) - 22 March 2023
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - CLMS-1886 (bug):Works well on custom map [Urkorue - [`81a9d1d`](https://github.com/eea/volto-arcgis-block/commit/81a9d1d5beccbfa71b3a2b8bf19f66996aba3c16)]
12
+ - CLMS-1886 (bug):Opacities work well with filtered layers [Urkorue - [`97ba87b`](https://github.com/eea/volto-arcgis-block/commit/97ba87bd861bc802bd5a062c5bb196cc01debd27)]
13
+ ### [0.1.118](https://github.com/eea/volto-arcgis-block/compare/0.1.117...0.1.118) - 22 March 2023
14
+
15
+ #### :hammer_and_wrench: Others
16
+
17
+ - CLMS-1969 [Amanda Rodriguez - [`fbab554`](https://github.com/eea/volto-arcgis-block/commit/fbab55460cb65c7c2099e09334415cf50763b209)]
18
+ - CLMS-1967 [Amanda Rodriguez - [`ccacbb3`](https://github.com/eea/volto-arcgis-block/commit/ccacbb3e68e3e5895bd2cab23c8159ae2594e809)]
19
+ - CLMS-1966 [Amanda Rodriguez - [`15fe77d`](https://github.com/eea/volto-arcgis-block/commit/15fe77d2fa6cb490144370165f655d3d485a036c)]
20
+ - CLMS-1965 [Amanda Rodriguez - [`4d1a829`](https://github.com/eea/volto-arcgis-block/commit/4d1a829cf6fafc838ad2c0079282c954e5323251)]
7
21
  ### [0.1.117](https://github.com/eea/volto-arcgis-block/compare/0.1.116...0.1.117) - 21 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.117",
3
+ "version": "0.1.119",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -293,7 +293,7 @@ class AreaWidget extends React.Component {
293
293
  popup.innerHTML =
294
294
  '<div class="drawRectanglePopup-content">' +
295
295
  '<span class="drawRectanglePopup-icon"><span class="esri-icon-cursor-marquee"></span></span>' +
296
- '<div class="drawRectanglePopup-text">Select an area of interest to download a dataset</div>' +
296
+ '<div class="drawRectanglePopup-text">Select or draw an area of interest in the map to continue</div>' +
297
297
  '</div>';
298
298
  this.props.download && this.props.view.ui.add(popup, 'top-right');
299
299
  }
@@ -447,7 +447,8 @@ class AreaWidget extends React.Component {
447
447
  <span className="esri-icon-cursor-marquee"></span>
448
448
  </span>
449
449
  <div className="drawRectanglePopup-text">
450
- Select an area of interest to download a dataset
450
+ Select or draw an area of interest in the map to
451
+ continue
451
452
  </div>
452
453
  </>
453
454
  )}
@@ -457,8 +458,8 @@ class AreaWidget extends React.Component {
457
458
  <FontAwesomeIcon icon={['fas', 'download']} />
458
459
  </span>
459
460
  <div className="drawRectanglePopup-text">
460
- Click on the download icon of the "Menu of products" to
461
- download the dataset
461
+ Click on the download icon on “Products and datasets” to
462
+ add to cart
462
463
  </div>
463
464
  </>
464
465
  )}
@@ -58,6 +58,16 @@ export const AddCartItem = ({
58
58
  let data = checkCartData(cartData, area, dataset);
59
59
  addCartItem(data).then(() => {
60
60
  showMessageTimer('Added to cart', 'success', 'Success');
61
+ if (dataset.IsTimeSeries) {
62
+ let id = dataset.DatasetId;
63
+ let datasetElem = document.querySelector('[datasetid="' + id + '"]');
64
+ let datasetInput = document.querySelector(
65
+ '#active_' +
66
+ datasetElem.querySelector('.map-menu-layer input:checked').id,
67
+ );
68
+ datasetInput.removeAttribute('time-start');
69
+ datasetInput.removeAttribute('time-end');
70
+ }
61
71
  });
62
72
  };
63
73
 
@@ -91,11 +101,16 @@ export const AddCartItem = ({
91
101
  return data;
92
102
  };
93
103
 
94
- const downloadCancel = (mapViewer) => {
95
- mapViewer.view.popup.close();
96
- mapViewer.view.graphics.removeAll();
97
- props.updateArea('');
98
- document.querySelector('.drawRectanglePopup-block').style.display = 'block';
104
+ const openCalendar = (dataset) => {
105
+ document.getElementById('active_label').click();
106
+ if (!document.querySelector('.timeslider-container')) {
107
+ let layerId = document.querySelector(
108
+ '[datasetid="' + dataset.DatasetId + '"] .map-menu-layer input:checked',
109
+ ).id;
110
+ document
111
+ .querySelector("[layer-id='" + layerId + "'] .active-layer-time")
112
+ .click();
113
+ }
99
114
  };
100
115
 
101
116
  const showMessageTimer = (msg, type, title) => {
@@ -170,13 +185,15 @@ export const AddCartItem = ({
170
185
  >
171
186
  Add to cart
172
187
  </button>
173
- <button
174
- id="map_download_cancel"
175
- className="ccl-button ccl-button--default"
176
- onClick={() => downloadCancel(mapViewer)}
177
- >
178
- Cancel
179
- </button>
188
+ {dataset.IsTimeSeries && (
189
+ <button
190
+ id="map_download_cancel"
191
+ className="ccl-button ccl-button--default"
192
+ onClick={() => openCalendar(dataset)}
193
+ >
194
+ Open calendar
195
+ </button>
196
+ )}
180
197
  </div>
181
198
  ) : isLoggedIn ? ( // If isLoggedIn == true and user clicks download
182
199
  <Popup
@@ -1917,6 +1934,7 @@ class MenuWidget extends React.Component {
1917
1934
  }}
1918
1935
  tabIndex="0"
1919
1936
  role="button"
1937
+ data-download={fromDownload ? true : false}
1920
1938
  >
1921
1939
  <Popup
1922
1940
  trigger={<FontAwesomeIcon icon={this.timeLayers[elem.id]} />}
@@ -2201,10 +2219,30 @@ class MenuWidget extends React.Component {
2201
2219
  document
2202
2220
  .querySelector('#map_remove_layers')
2203
2221
  .classList.remove('locked');
2204
- if (this.props.download)
2222
+ if (this.props.download) {
2205
2223
  document
2206
2224
  .querySelector('#download_label')
2207
2225
  .classList.remove('locked');
2226
+ if (
2227
+ document.querySelector(
2228
+ '.active-layer[layer-id="' +
2229
+ elem.id +
2230
+ '"] .map-menu-icon.active-layer-time',
2231
+ ).dataset.download === 'true'
2232
+ ) {
2233
+ document.getElementById('download_label').click();
2234
+ }
2235
+ } else {
2236
+ if (
2237
+ document.querySelector(
2238
+ '.active-layer[layer-id="' +
2239
+ elem.id +
2240
+ '"] .map-menu-icon.active-layer-time',
2241
+ ).dataset.download === 'true'
2242
+ ) {
2243
+ document.getElementById('products_label').click();
2244
+ }
2245
+ }
2208
2246
  if (
2209
2247
  document.contains(document.querySelector('.timeslider-container'))
2210
2248
  )
@@ -2312,8 +2350,16 @@ class MenuWidget extends React.Component {
2312
2350
  // ).dataset.opacity = value;
2313
2351
  // });
2314
2352
  // } else {
2315
- this.layers[layer].opacity = value / 100;
2316
- this.saveOpacity(layer, value / 100);
2353
+ if (this.layers['lcc_filter'] && layer.includes('all_lcc')) {
2354
+ this.layers['lcc_filter'].opacity = value / 100;
2355
+ this.saveOpacity(this.layers['lcc_filter'], value / 100);
2356
+ } else if (this.layers['lc_filter'] && layer.includes('all_present')) {
2357
+ this.layers['lc_filter'].opacity = value / 100;
2358
+ this.saveOpacity(this.layers['lc_filter'], value / 100);
2359
+ } else {
2360
+ this.layers[layer].opacity = value / 100;
2361
+ this.saveOpacity(this.layer, value / 100);
2362
+ }
2317
2363
  document.querySelector(
2318
2364
  '.active-layer[layer-id="' + layer + '"] .active-layer-opacity',
2319
2365
  ).dataset.opacity = value;
@@ -2381,9 +2427,24 @@ class MenuWidget extends React.Component {
2381
2427
  if (this.visibleLayers[elem.id][1] === 'eye') {
2382
2428
  this.layers[elem.id].visible = false;
2383
2429
  this.visibleLayers[elem.id] = ['fas', 'eye-slash'];
2430
+ if (this.layers['lcc_filter'] && elem.id.includes('all_lcc')) {
2431
+ this.map.remove(this.layers['lcc_filter']);
2432
+ this.layers['lcc_filter'].visible = false;
2433
+ } else if (this.layers['lc_filter'] && elem.id.includes('all_present')) {
2434
+ this.map.remove(this.layers['lc_filter']);
2435
+ this.layers['lc_filter'].visible = false;
2436
+ }
2384
2437
  } else {
2385
- this.map.add(this.layers[elem.id]);
2386
- this.layers[elem.id].visible = true;
2438
+ if (this.layers['lcc_filter'] && elem.id.includes('all_lcc')) {
2439
+ this.map.add(this.layers['lcc_filter']);
2440
+ this.layers['lcc_filter'].visible = true;
2441
+ } else if (this.layers['lc_filter'] && elem.id.includes('all_present')) {
2442
+ this.map.add(this.layers['lc_filter']);
2443
+ this.layers['lc_filter'].visible = true;
2444
+ } else {
2445
+ this.map.add(this.layers[elem.id]);
2446
+ this.layers[elem.id].visible = true;
2447
+ }
2387
2448
  this.visibleLayers[elem.id] = ['fas', 'eye'];
2388
2449
  }
2389
2450
 
@@ -269,6 +269,13 @@ class TimesliderWidget extends React.Component {
269
269
  .querySelector('#timeslider_close')
270
270
  .addEventListener('click', () => {
271
271
  this.props.time.elem.querySelector('.active-layer-time').click();
272
+ if (this.props.fromDownload) {
273
+ if (this.props.download) {
274
+ document.getElementById('download_label').click();
275
+ } else {
276
+ document.getElementById('products_label').click();
277
+ }
278
+ }
272
279
  });
273
280
 
274
281
  this.props.view