@eeacms/volto-arcgis-block 0.1.107 → 0.1.109

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,21 @@ 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.109](https://github.com/eea/volto-arcgis-block/compare/0.1.108...0.1.109) - 28 February 2023
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - CLMS 1581 & CLMS 1771 pushing both tickets [ujbolivar - [`dd1a580`](https://github.com/eea/volto-arcgis-block/commit/dd1a580d32faff6754121dd49415030920543c72)]
12
+ - CLMS-1771 FIX: Area widget opened by default if user is logged in and downloadTag exists [ujbolivar - [`f629491`](https://github.com/eea/volto-arcgis-block/commit/f629491531dec0dd09234b41184413b3d2e54768)]
13
+ - CLMS-1581 FIX: Hotspot widget stays open after applying filters, and unchecking one hotspotlayer even though another hotspot layer is still checked [ujbolivar - [`e5b18d6`](https://github.com/eea/volto-arcgis-block/commit/e5b18d6477e6bc0dcc7f048835d7ce97483bc9d4)]
14
+ ### [0.1.108](https://github.com/eea/volto-arcgis-block/compare/0.1.107...0.1.108) - 27 February 2023
15
+
16
+ #### :hammer_and_wrench: Others
17
+
18
+ - Delete comment [Amanda Rodriguez - [`873a594`](https://github.com/eea/volto-arcgis-block/commit/873a594332908ee6d39dfbbc2239a06455a9ebc6)]
19
+ - CLMS-1831 [Amanda Rodriguez - [`0df846a`](https://github.com/eea/volto-arcgis-block/commit/0df846a7fce73e2d6b395b26677175702cc49b36)]
20
+ - CLMS-1843 [Amanda Rodriguez - [`839a331`](https://github.com/eea/volto-arcgis-block/commit/839a331049cf47d396300c2825eef6666e159609)]
21
+ - Time slider bug fix [Amanda Rodriguez - [`d383ee3`](https://github.com/eea/volto-arcgis-block/commit/d383ee38625ee2a528e07babf65340717aab9034)]
7
22
  ### [0.1.107](https://github.com/eea/volto-arcgis-block/compare/0.1.106...0.1.107) - 23 February 2023
8
23
 
9
24
  #### :hammer_and_wrench: Others
@@ -422,13 +437,10 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
422
437
  #### :hammer_and_wrench: Others
423
438
 
424
439
  - Merge pull request #148 from eea/develop [KCarpinteroBM - [`24266fb`](https://github.com/eea/volto-arcgis-block/commit/24266fb3a0c1662d22ae0529dc1d5a25c711cf97)]
425
- - Revert "[JENKINS] Use eeacms/plone-backend and Volto alpha version- Refs #151967" [Mikel Larreategi - [`f751f69`](https://github.com/eea/volto-arcgis-block/commit/f751f69f652f0340ae55af6a4dab89d6bdc80906)]
426
440
  - Revert "Revert "Mapviewer menu and map viewer options persistence"" [Mikel Larreategi - [`ad6e440`](https://github.com/eea/volto-arcgis-block/commit/ad6e440cdc160cffb1e86e1b26e501dbe648476c)]
427
441
  - Revert "code coverage removal" [Mikel Larreategi - [`376f2d1`](https://github.com/eea/volto-arcgis-block/commit/376f2d1cd6e4e5110b3b63d5114af1bcfebe094b)]
428
442
  - Revert "Update cypress.json" [Mikel Larreategi - [`43d01a0`](https://github.com/eea/volto-arcgis-block/commit/43d01a0a95a58ef5215c6cbf18223ca30a11b9cc)]
429
443
  - Revert "Update cypress.json" [Mikel Larreategi - [`054c4ae`](https://github.com/eea/volto-arcgis-block/commit/054c4ae1767e1f26e6ec7e96a0e26a9711f29f04)]
430
- - Revert "revert [JENKINS] Use eeacms/plone-backend and Volto alpha version- Refs #151967" [Mikel Larreategi - [`64ab56e`](https://github.com/eea/volto-arcgis-block/commit/64ab56e0f1f8dddc26f26039509a028e34653e64)]
431
- - revert [JENKINS] Use eeacms/plone-backend and Volto alpha version- Refs #151967 [Mikel Larreategi - [`85ee194`](https://github.com/eea/volto-arcgis-block/commit/85ee1941e029df2b7dc910bf75231c75ffeca8c2)]
432
444
  - Update cypress.json [KCarpinteroBM - [`be285ff`](https://github.com/eea/volto-arcgis-block/commit/be285fff0c53e06a0180d5318cce81195eabcf80)]
433
445
  - Update cypress.json [KCarpinteroBM - [`a7f2118`](https://github.com/eea/volto-arcgis-block/commit/a7f2118acb7b048b4cef85aa9663c2244a1c9ca0)]
434
446
  - linting fix [KCarpinteroBM - [`27e969a`](https://github.com/eea/volto-arcgis-block/commit/27e969a7a411fd4646e0e742ce846efc0d79703e)]
@@ -488,7 +500,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
488
500
  - UX improvements [rodriama - [`151dc4b`](https://github.com/eea/volto-arcgis-block/commit/151dc4b02d0a73fdd66de9d594620ac0fa5f1dbf)]
489
501
  - deleted failing tests [KCarpinteroBM - [`ddaa9e6`](https://github.com/eea/volto-arcgis-block/commit/ddaa9e6f06db6960a4c214d3be2420c48b26715d)]
490
502
  - cleaning unnecessary files [KCarpinteroBM - [`2c02199`](https://github.com/eea/volto-arcgis-block/commit/2c021990912beb02b603a1de89aecd62e0063769)]
491
- - Reverting to Automated release 0.1.39 [KCarpinteroBM - [`fb9f317`](https://github.com/eea/volto-arcgis-block/commit/fb9f3176ccdea18fceb329eaac13ced0566ee648)]
492
503
  - commands added [KCarpinteroBM - [`049e60b`](https://github.com/eea/volto-arcgis-block/commit/049e60b7d124d1c05abd0b2775b510795f4ed59f)]
493
504
  - Mapviewer testing implementation [KCarpinteroBM - [`0103002`](https://github.com/eea/volto-arcgis-block/commit/0103002869eea108e16e3b5ff2e77a725dcc7c4b)]
494
505
  ### [0.1.39](https://github.com/eea/volto-arcgis-block/compare/0.1.38...0.1.39) - 24 March 2022
@@ -508,7 +519,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
508
519
  - ESLint fix [rodriama - [`75dae9b`](https://github.com/eea/volto-arcgis-block/commit/75dae9b5bba18ab6d9624f6c99714b4bd2179003)]
509
520
  - Remove section title [rodriama - [`ece860e`](https://github.com/eea/volto-arcgis-block/commit/ece860eae3519c7e611abac16e8d53c9a9408b34)]
510
521
  - Es-Lint [manuelmartinezbilbomatica - [`39d8d11`](https://github.com/eea/volto-arcgis-block/commit/39d8d11b9096fd603df8510c119d2e12817415d6)]
511
- - Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`bf9f683`](https://github.com/eea/volto-arcgis-block/commit/bf9f683dd35a9edb4cfd9111affcb8f8edbeae89)]
512
522
  - FEAT: Parser Time implemented [manuelmartinezbilbomatica - [`689c99e`](https://github.com/eea/volto-arcgis-block/commit/689c99e55221fee6c7c7fafc4ab95ae7a646d3dd)]
513
523
  ### [0.1.38](https://github.com/eea/volto-arcgis-block/compare/0.1.37...0.1.38) - 18 March 2022
514
524
 
@@ -603,7 +613,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
603
613
  - ESLint fix [rodriama - [`5fd3772`](https://github.com/eea/volto-arcgis-block/commit/5fd3772f197a3a380067962a5638dbf901a4624e)]
604
614
  - Pixel info [rodriama - [`1ccef39`](https://github.com/eea/volto-arcgis-block/commit/1ccef39a9adcc3ee94655c77a5a166b613600a08)]
605
615
  - NUTS bug fix [rodriama - [`37fe7f3`](https://github.com/eea/volto-arcgis-block/commit/37fe7f3fad2c005e3b7c234b3b0564d5df92fa8c)]
606
- - Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`ea5af8b`](https://github.com/eea/volto-arcgis-block/commit/ea5af8b02a5f2ee25b9b0be67cf3792bbbe84ed7)]
607
616
  ### [0.1.23](https://github.com/eea/volto-arcgis-block/compare/0.1.22...0.1.23) - 17 December 2021
608
617
 
609
618
  #### :hammer_and_wrench: Others
@@ -848,7 +857,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
848
857
  - Trying to delay ArcGIS modules load [gonzalezsd - [`ff16985`](https://github.com/eea/volto-arcgis-block/commit/ff169858e42d30bfcacc423ffc27762bb9ef05a4)]
849
858
  - Run bootstrap to fix files [valentinab25 - [`236893f`](https://github.com/eea/volto-arcgis-block/commit/236893f03314eb638b7667f81b1f91491a98ee17)]
850
859
  - fix git_name [valentinab25 - [`c7806c3`](https://github.com/eea/volto-arcgis-block/commit/c7806c312964425dc23e5d4c6973de8b81ddaeac)]
851
- - Add Sonarqube tag using frontend addons list [EEA Jenkins - [`e3afb51`](https://github.com/eea/volto-arcgis-block/commit/e3afb515dda459ee03e2b5d4b56465d2d4ad1503)]
852
860
  - Trying to change imports [gonzalezsd - [`d83d7e2`](https://github.com/eea/volto-arcgis-block/commit/d83d7e2f68da4b2a284735847f93c0763a7e13b6)]
853
861
  - default design [bipoza - [`88fbe0b`](https://github.com/eea/volto-arcgis-block/commit/88fbe0b2bc73e732e2993324a567f53902e85506)]
854
862
  - cleanup of unused code [bipoza - [`b167677`](https://github.com/eea/volto-arcgis-block/commit/b1676771f637f056cad50cb0bc186f2ea79e8517)]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.107",
3
+ "version": "0.1.109",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -288,15 +288,14 @@ class AreaWidget extends React.Component {
288
288
  ? this.container !== null && this.props.view.ui.add(this.container)
289
289
  : this.props.view.ui.add(this.container.current, 'top-right');
290
290
 
291
- var z = document.createElement('div'); // is a node
292
- z.className = 'drawRectanglePopup-block';
293
- z.innerHTML =
291
+ var popup = document.createElement('div');
292
+ popup.className = 'drawRectanglePopup-block';
293
+ popup.innerHTML =
294
294
  '<div class="drawRectanglePopup-content">' +
295
295
  '<span class="drawRectanglePopup-icon"><span class="esri-icon-cursor-marquee"></span></span>' +
296
296
  '<div class="drawRectanglePopup-text">Select an area of interest to download a dataset</div>' +
297
297
  '</div>';
298
-
299
- this.props.download && this.props.view.ui.add(z, 'top-right');
298
+ this.props.download && this.props.view.ui.add(popup, 'top-right');
300
299
  }
301
300
 
302
301
  /**
@@ -167,6 +167,8 @@ class HotspotWidget extends React.Component {
167
167
  this.props.map.add(this.esriLayer_lc);
168
168
  this.props.selectedLayers['lc_filter'] = this.esriLayer_lc;
169
169
  this.props.selectedLayers['lc_filter'].visible = true;
170
+ //set sessionStorage value to keep the widget open
171
+ sessionStorage.setItem('hotspotFilterApplied', 'true');
170
172
  }
171
173
  }
172
174
  }
@@ -484,10 +486,6 @@ class HotspotWidget extends React.Component {
484
486
  );
485
487
  }
486
488
 
487
- /**
488
- * This method is executed before the render method is executed
489
- */
490
-
491
489
  /**
492
490
  * This method is executed after the rener method is executed
493
491
  */
@@ -78,9 +78,7 @@ export const AddCartItem = ({
78
78
  if (hasTimeStart) {
79
79
  let datasetInput = document.querySelector(
80
80
  '#active_' +
81
- datasetElem
82
- .querySelector('.map-dataset-checkbox input')
83
- .getAttribute('defcheck'),
81
+ datasetElem.querySelector('.map-menu-layer input:checked').id,
84
82
  );
85
83
  let time = {
86
84
  start: parseInt(datasetInput.getAttribute('time-start')),
@@ -117,9 +115,7 @@ export const AddCartItem = ({
117
115
  let datasetElem = document.querySelector('[datasetid="' + id + '"]');
118
116
  let datasetActive = document.querySelector(
119
117
  '#active_' +
120
- datasetElem
121
- .querySelector('.map-dataset-checkbox input')
122
- .getAttribute('defcheck'),
118
+ datasetElem.querySelector('.map-menu-layer input:checked').id,
123
119
  );
124
120
  return datasetActive ? datasetActive.hasAttribute('time-start') : false;
125
121
  };
@@ -128,6 +124,12 @@ export const AddCartItem = ({
128
124
  dataset = cartData[0].Products[0].Datasets[0];
129
125
  }
130
126
 
127
+ const setDownloadTag = (val) => {
128
+ if (!sessionStorage.key('downloadButtonClicked'))
129
+ sessionStorage.setItem('downloadButtonClicked', 'true');
130
+ else sessionStorage.setItem('downloadButtonClicked', val);
131
+ };
132
+
131
133
  return (
132
134
  <>
133
135
  {download ? (
@@ -136,22 +138,26 @@ export const AddCartItem = ({
136
138
  id="map_download_add"
137
139
  className="ccl-button ccl-button-green"
138
140
  onClick={(e) => {
139
- if (dataset.IsTimeSeries && !checkTimeData(dataset)) {
140
- document.getElementById('active_label').click();
141
- if (!document.querySelector('.timeslider-container')) {
142
- let layerId = document
143
- .querySelector(
144
- '[datasetid="' + dataset.DatasetId + '"] input',
145
- )
146
- .getAttribute('defcheck');
147
- document
148
- .querySelector(
149
- "[layer-id='" + layerId + "'] .active-layer-time",
150
- )
151
- .click(e);
141
+ if (!document.querySelector('.map-menu-layer input:checked')) {
142
+ document.getElementById('products_label').click();
143
+ } else {
144
+ if (dataset.IsTimeSeries && !checkTimeData(dataset)) {
145
+ document.getElementById('active_label').click();
146
+ if (!document.querySelector('.timeslider-container')) {
147
+ let layerId = document.querySelector(
148
+ '[datasetid="' +
149
+ dataset.DatasetId +
150
+ '"] .map-menu-layer input:checked',
151
+ ).id;
152
+ document
153
+ .querySelector(
154
+ "[layer-id='" + layerId + "'] .active-layer-time",
155
+ )
156
+ .click(e);
157
+ }
158
+ } else if (areaData) {
159
+ checkArea(e);
152
160
  }
153
- } else if (areaData) {
154
- checkArea(e);
155
161
  }
156
162
  }}
157
163
  >
@@ -177,11 +183,11 @@ export const AddCartItem = ({
177
183
  if (dataset.IsTimeSeries && !checkTimeData(dataset)) {
178
184
  document.getElementById('active_label').click();
179
185
  if (!document.querySelector('.timeslider-container')) {
180
- let layerId = document
181
- .querySelector(
182
- '[datasetid="' + dataset.DatasetId + '"] input',
183
- )
184
- .getAttribute('defcheck');
186
+ let layerId = document.querySelector(
187
+ '[datasetid="' +
188
+ dataset.DatasetId +
189
+ '"] .map-menu-layer input:checked',
190
+ ).id;
185
191
  document
186
192
  .querySelector(
187
193
  "[layer-id='" + layerId + "'] .active-layer-time",
@@ -205,11 +211,11 @@ export const AddCartItem = ({
205
211
  if (dataset.IsTimeSeries && !checkTimeData(dataset)) {
206
212
  document.getElementById('active_label').click();
207
213
  if (!document.querySelector('.timeslider-container')) {
208
- let layerId = document
209
- .querySelector(
210
- '[datasetid="' + dataset.DatasetId + '"] input',
211
- )
212
- .getAttribute('defcheck');
214
+ let layerId = document.querySelector(
215
+ '[datasetid="' +
216
+ dataset.DatasetId +
217
+ '"] .map-menu-layer input:checked',
218
+ ).id;
213
219
  document
214
220
  .querySelector(
215
221
  "[layer-id='" + layerId + "'] .active-layer-time",
@@ -249,6 +255,7 @@ export const AddCartItem = ({
249
255
  <span
250
256
  className={'map-menu-icon map-menu-icon-login'}
251
257
  onClick={() => {
258
+ setDownloadTag(true);
252
259
  document.querySelector('.header-login-link').click();
253
260
  }}
254
261
  onKeyDown={() => {
@@ -463,12 +470,13 @@ class MenuWidget extends React.Component {
463
470
  }
464
471
 
465
472
  let authToken = this.getAuthToken();
466
- let timeSliderTag = this.getTimeSliderTag();
473
+ let timeSliderTag = sessionStorage.getItem('timeSliderTag');
474
+ let downloadTag = sessionStorage.getItem('downloadButtonClicked');
467
475
  let checkedLayers = JSON.parse(sessionStorage.getItem('checkedLayers'));
468
476
 
469
477
  // "Active on map" section and the time slider opened by default if user is logged in and timeSliderTag is true
470
-
471
- if (checkedLayers) {
478
+ if (checkedLayers && !this.props.download) {
479
+ // "Active on map" section and the time slider opened by default if user is logged in and timeSliderTag is true
472
480
  if (authToken && timeSliderTag) {
473
481
  for (let i = 0; i < checkedLayers.length; i++) {
474
482
  let layerid = checkedLayers[i];
@@ -495,6 +503,30 @@ class MenuWidget extends React.Component {
495
503
  }
496
504
  }
497
505
  }
506
+ // "Area widget" opened by default if user is logged in and downloadTag is true
507
+ else if (authToken && downloadTag) {
508
+ for (let i = 0; i < checkedLayers.length; i++) {
509
+ let layerid = checkedLayers[i];
510
+ if (
511
+ layerid &&
512
+ !this.layers[layerid].isTimeSeries &&
513
+ !this.container.current
514
+ .querySelector('.esri-widget')
515
+ .classList.contains('esri-icon-drag-horizontal')
516
+ ) {
517
+ //open area widget
518
+ let event = new MouseEvent('click', {
519
+ view: window,
520
+ bubbles: true,
521
+ cancelable: false,
522
+ });
523
+ document
524
+ .querySelector('.map-menu-icon-login.logged')
525
+ .dispatchEvent(event);
526
+ break;
527
+ }
528
+ }
529
+ }
498
530
  }
499
531
  // CLMS-1389
500
532
  // "Active on map" section and the time slider opened by default if download and timeseries == true
@@ -575,14 +607,6 @@ class MenuWidget extends React.Component {
575
607
  return tokenResult;
576
608
  }
577
609
 
578
- getTimeSliderTag() {
579
- let tagResult = true;
580
- if (!sessionStorage.key('timeSliderTag')) {
581
- tagResult = false;
582
- }
583
- return tagResult;
584
- }
585
-
586
610
  /**
587
611
  * Close opacity panel if user clicks outside
588
612
  */
@@ -928,7 +952,7 @@ class MenuWidget extends React.Component {
928
952
  */
929
953
  updateCheckProduct(productid) {
930
954
  let datasetChecks = Array.from(
931
- document.querySelectorAll('[parentid=' + productid + ']'),
955
+ document.querySelectorAll('[parentid="' + productid + '"]'),
932
956
  );
933
957
  let productCheck = document.querySelector('#' + productid);
934
958
  let trueCheck = datasetChecks.filter((elem) => elem.checked).length;
@@ -1180,7 +1204,7 @@ class MenuWidget extends React.Component {
1180
1204
  updateCheckDataset(id) {
1181
1205
  let datasetCheck = document.querySelector('#' + id);
1182
1206
  let layerChecks = Array.from(
1183
- document.querySelectorAll('[parentid=' + id + ']'),
1207
+ document.querySelectorAll('[parentid="' + id + '"]'),
1184
1208
  );
1185
1209
 
1186
1210
  let trueChecks = layerChecks.filter((elem) => elem.checked).length;
@@ -1460,6 +1484,8 @@ class MenuWidget extends React.Component {
1460
1484
  this.map.reorder(nuts, this.map.layers.items.length + 1);
1461
1485
  }
1462
1486
  } else {
1487
+ sessionStorage.removeItem('downloadButtonClicked');
1488
+ sessionStorage.removeItem('timeSliderTag');
1463
1489
  this.deleteCheckedLayer(elem.id);
1464
1490
  this.deleteFilteredLayer();
1465
1491
  this.layers[elem.id].opacity = 1;
@@ -1472,7 +1498,6 @@ class MenuWidget extends React.Component {
1472
1498
  delete this.timeLayers[elem.id];
1473
1499
  }
1474
1500
  this.updateCheckDataset(parentId);
1475
- //!this.props.download && this.toggleHotspotWidget();
1476
1501
  this.toggleHotspotWidget();
1477
1502
  this.layersReorder();
1478
1503
  this.checkInfoWidget();
@@ -1499,17 +1524,24 @@ class MenuWidget extends React.Component {
1499
1524
  if (this.props.download) {
1500
1525
  checkedLayers = Object.keys(this.activeLayersJSON);
1501
1526
  }
1502
- checkedLayers.forEach((key) => {
1503
- // if key includes all_present_lc_a_pol or all_lcc_a_pol and if the activeWidget is not the hotspot widget, click on the hotspot button, else close the active widget and set the hotspot container to display to none
1504
- if (
1505
- key.includes('all_present_lc_a_pol') ||
1506
- key.includes('all_lcc_a_pol')
1507
- ) {
1508
- if (!this.props.mapViewer.activeWidget) {
1509
- hotspotButton.click();
1527
+ if (
1528
+ checkedLayers.length === 0 &&
1529
+ sessionStorage.getItem('hotspotFilterApplied')
1530
+ ) {
1531
+ sessionStorage.removeItem('hotspotFilterApplied');
1532
+ }
1533
+ if (checkedLayers) {
1534
+ checkedLayers.forEach((key) => {
1535
+ if (
1536
+ key.includes('all_present_lc_a_pol') ||
1537
+ key.includes('all_lcc_a_pol')
1538
+ ) {
1539
+ if (!this.props.mapViewer.activeWidget) {
1540
+ hotspotButton.click();
1541
+ }
1510
1542
  }
1511
- }
1512
- });
1543
+ });
1544
+ }
1513
1545
  }
1514
1546
  /**
1515
1547
  * Hide or show a legend image in the legend widget for a WMTS or a TMS layer
@@ -2058,6 +2090,9 @@ class MenuWidget extends React.Component {
2058
2090
  ReactDOM.unmountComponentAtNode(
2059
2091
  document.querySelector('.esri-ui-bottom-right'),
2060
2092
  );
2093
+ if (document.querySelector('.drawRectanglePopup-block'))
2094
+ document.querySelector('.drawRectanglePopup-block').style.display =
2095
+ 'block';
2061
2096
  } else {
2062
2097
  if (this.visibleLayers[layerId][1] === 'eye-slash') {
2063
2098
  this.layers[layerId].visible = true;
@@ -2085,11 +2120,13 @@ class MenuWidget extends React.Component {
2085
2120
  layers.push(layer);
2086
2121
  }
2087
2122
  });
2088
- if (layers.length === 0 && document.querySelector('.info-container')) {
2089
- this.props.mapViewer.closeActiveWidget();
2090
- document.querySelector('.info-container').style.display = 'none';
2091
- } else if (layers.length > 0) {
2092
- document.querySelector('.info-container').style.display = 'flex';
2123
+ if (!sessionStorage.getItem('hotspotFilterApplied')) {
2124
+ if (layers.length === 0 && document.querySelector('.info-container')) {
2125
+ this.props.mapViewer.closeActiveWidget();
2126
+ document.querySelector('.info-container').style.display = 'none';
2127
+ } else if (layers.length > 0) {
2128
+ document.querySelector('.info-container').style.display = 'flex';
2129
+ }
2093
2130
  }
2094
2131
  this.renderHotspot();
2095
2132
  /**/
@@ -2484,7 +2521,14 @@ class MenuWidget extends React.Component {
2484
2521
  hotspotLayers.length === 0 &&
2485
2522
  document.querySelector('.hotspot-container')
2486
2523
  ) {
2487
- this.props.mapViewer.closeActiveWidget();
2524
+ if (
2525
+ this.props.mapViewer.activeWidget &&
2526
+ this.props.mapViewer.activeWidget.container.current.classList.contains(
2527
+ 'hotspot-container',
2528
+ )
2529
+ ) {
2530
+ this.props.mapViewer.closeActiveWidget();
2531
+ }
2488
2532
  document.querySelector('.hotspot-container').style.display = 'none';
2489
2533
  } else if (this.props.view && hotspotLayers.length > 0) {
2490
2534
  document.querySelector('.hotspot-container').style.display = 'flex';
@@ -2516,19 +2560,18 @@ class MenuWidget extends React.Component {
2516
2560
  time.start = parseInt(activeLayer.getAttribute('time-start'));
2517
2561
  time.end = parseInt(activeLayer.getAttribute('time-end'));
2518
2562
  }
2519
- let isLoggedIn = document
2520
- .querySelector('[defcheck=' + elem.id + ']')
2521
- .parentElement.querySelector('.map-menu-icon-login')
2522
- .classList.contains('logged');
2563
+ let isLoggedIn = document.querySelector('.map-menu-icon-login.logged');
2523
2564
  ReactDOM.render(
2524
2565
  <TimesliderWidget
2525
2566
  view={this.props.view}
2526
2567
  map={this.map}
2568
+ mapViewer={this.props.mapViewer}
2527
2569
  layer={layer}
2528
2570
  download={this.props.download}
2529
2571
  time={time}
2530
2572
  logged={isLoggedIn}
2531
2573
  fromDownload={fromDownload}
2574
+ area={this.props.area}
2532
2575
  />,
2533
2576
  document.querySelector('.esri-ui-bottom-right'),
2534
2577
  );
@@ -24,7 +24,7 @@ class TimesliderWidget extends React.Component {
24
24
  timeSelectedValuesC: [], //To compare time slider stored values with new selected values
25
25
  showDatePanel: false,
26
26
  lockDatePanel: true,
27
- showCalendar: false,
27
+ showCalendar: this.props.fromDownload ? true : false,
28
28
  dateStart: this.props.time.start ? new Date(this.props.time.start) : null,
29
29
  dateEnd: this.props.time.end ? new Date(this.props.time.end) : null,
30
30
  periodicity: null,
@@ -43,6 +43,13 @@ class TimesliderWidget extends React.Component {
43
43
  this.layerName = this.layer.activeLayer.id; //WMTS
44
44
  }
45
45
  this.drag = {};
46
+ if (
47
+ this.props.fromDownload &&
48
+ document.querySelector('.drawRectanglePopup-block')
49
+ ) {
50
+ document.querySelector('.drawRectanglePopup-block').style.display =
51
+ 'none';
52
+ }
46
53
  }
47
54
 
48
55
  loader() {
@@ -244,8 +251,6 @@ class TimesliderWidget extends React.Component {
244
251
  }
245
252
  this.setState({
246
253
  lockDatePanel: false,
247
- showCalendar:
248
- this.props.fromDownload || this.props.download ? true : false,
249
254
  });
250
255
  }
251
256
  },
@@ -297,6 +302,7 @@ class TimesliderWidget extends React.Component {
297
302
 
298
303
  this.getCapabilities(this.layer.url, serviceType).then((xml) => {
299
304
  let times = {};
305
+ let periodicity;
300
306
  if (this.layer.type === 'wms') {
301
307
  times = this.parseTimeWMS(xml);
302
308
  } else if (this.layer.type === 'wmts') {
@@ -326,6 +332,8 @@ class TimesliderWidget extends React.Component {
326
332
  unit: 'minutes',
327
333
  },
328
334
  };
335
+
336
+ periodicity = times[this.layerName].period;
329
337
  } else if (times[this.layerName].hasOwnProperty('array')) {
330
338
  // Dates array
331
339
  this.TimesliderWidget.fullTimeExtent = new TimeExtent({
@@ -350,19 +358,20 @@ class TimesliderWidget extends React.Component {
350
358
  timeDict[time[i]] = times[this.layerName].array[i];
351
359
  }
352
360
  }
353
- }
354
361
 
355
- let periodicity = Math.floor(
356
- (Date.parse(times[this.layerName].array[1]) -
357
- Date.parse(times[this.layerName].array[0])) /
358
- 86400000,
359
- );
360
- if (periodicity === 0) {
361
- periodicity =
362
- (new Date(times[this.layerName].array[1]).getHours() -
363
- new Date(times[this.layerName].array[0]).getHours()) /
364
- 24;
362
+ periodicity = Math.floor(
363
+ (Date.parse(times[this.layerName].array[1]) -
364
+ Date.parse(times[this.layerName].array[0])) /
365
+ 86400000,
366
+ );
367
+ if (periodicity === 0) {
368
+ periodicity =
369
+ (new Date(times[this.layerName].array[1]).getHours() -
370
+ new Date(times[this.layerName].array[0]).getHours()) /
371
+ 24;
372
+ }
365
373
  }
374
+
366
375
  this.setState({ periodicity: periodicity });
367
376
 
368
377
  this.TimesliderWidget.watch('timeExtent', (timeExtent) => {
@@ -415,17 +424,17 @@ class TimesliderWidget extends React.Component {
415
424
 
416
425
  getPeriodicity() {
417
426
  let period = this.state.periodicity;
418
- if (period === 1 / 24) {
427
+ if (period === 1 / 24 || period === 'PT1H') {
419
428
  return 'hourly';
420
- } else if (period === 1) {
429
+ } else if (period === 1 || period === 'P1D') {
421
430
  return 'daily';
422
- } else if (period === 7) {
431
+ } else if (period === 7 || period === 'P7D' || period === 'P1W') {
423
432
  return 'weekly';
424
- } else if (period === 10) {
433
+ } else if (period === 10 || period === 'P10D') {
425
434
  return '10-daily';
426
- } else if (period >= 28 && period <= 31) {
435
+ } else if ((period >= 28 && period <= 31) || period === 'P1M') {
427
436
  return 'monthly';
428
- } else if (period === 365 || period === 366) {
437
+ } else if (period === 365 || period === 366 || period === 'P1Y') {
429
438
  return 'yearly';
430
439
  } else {
431
440
  return 'not regular';
@@ -471,8 +480,19 @@ class TimesliderWidget extends React.Component {
471
480
  showCalendar() {
472
481
  if (this.state.showCalendar) {
473
482
  this.setState({ showCalendar: false });
483
+ if (
484
+ document.querySelector('.drawRectanglePopup-block') &&
485
+ !this.props.area
486
+ ) {
487
+ document.querySelector('.drawRectanglePopup-block').style.display =
488
+ 'block';
489
+ }
474
490
  } else {
475
491
  this.setState({ showCalendar: true });
492
+ if (document.querySelector('.drawRectanglePopup-block')) {
493
+ document.querySelector('.drawRectanglePopup-block').style.display =
494
+ 'none';
495
+ }
476
496
  }
477
497
  }
478
498
 
@@ -488,8 +508,27 @@ class TimesliderWidget extends React.Component {
488
508
  this.setState({
489
509
  dateStart: start,
490
510
  dateEnd: end,
491
- showCalendar: false,
492
511
  });
512
+ this.showCalendar();
513
+ if (this.props.download) {
514
+ if (this.props.fromDownload) {
515
+ this.props.time.elem.querySelector('.active-layer-time').click();
516
+ document.getElementById('download_label').click();
517
+ }
518
+ } else {
519
+ if (this.props.fromDownload) {
520
+ this.props.time.elem.querySelector('.active-layer-time').click();
521
+ document.getElementById('products_label').click();
522
+ if (
523
+ !this.props.mapViewer.activeWidget ||
524
+ !this.props.mapViewer.activeWidget.container.current.classList.contains(
525
+ 'area-container',
526
+ )
527
+ ) {
528
+ document.getElementById('map_area_button').click();
529
+ }
530
+ }
531
+ }
493
532
  }
494
533
 
495
534
  handleInputChange(e) {
@@ -513,7 +552,7 @@ class TimesliderWidget extends React.Component {
513
552
  let inputEnd;
514
553
  let timeStart;
515
554
  let timeEnd;
516
- if (this.state.showCalendar) {
555
+ if (!this.state.lockDatePanel && this.state.showCalendar) {
517
556
  inputStart = this.formatDate(
518
557
  this.state.inputStart
519
558
  ? this.state.inputStart
@@ -573,7 +612,7 @@ class TimesliderWidget extends React.Component {
573
612
  )}
574
613
  </div>
575
614
  )}
576
- {this.state.showCalendar && (
615
+ {!this.state.lockDatePanel && this.state.showCalendar && (
577
616
  <div className="timeslider-calendar-container">
578
617
  <div className="timeslider-calendar-header">
579
618
  <b>Select temporal interval to download</b>
@@ -582,12 +621,8 @@ class TimesliderWidget extends React.Component {
582
621
  id="timeslider_calendar_close"
583
622
  role="button"
584
623
  tabIndex="0"
585
- onClick={() => {
586
- this.setState({ showCalendar: false });
587
- }}
588
- onKeyDown={() => {
589
- this.setState({ showCalendar: false });
590
- }}
624
+ onClick={() => this.showCalendar()}
625
+ onKeyDown={() => this.showCalendar()}
591
626
  ></div>
592
627
  </div>
593
628
  <div className="timeslider-calendar-panel">