@eeacms/volto-arcgis-block 0.1.59 → 0.1.60

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,18 @@ 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.60](https://github.com/eea/volto-arcgis-block/compare/0.1.59...0.1.60) - 19 September 2022
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - ESLint fix [rodriama - [`ca2e108`](https://github.com/eea/volto-arcgis-block/commit/ca2e1086b47be20dbf0858fe728de3ce6b3c91ba)]
12
+ - Update UseCasesMapViewer.jsx [Jose Asensio - [`75b72b9`](https://github.com/eea/volto-arcgis-block/commit/75b72b9018d9b8ec412d923f28e263bbc6cd803a)]
13
+ - Update UseCasesMapViewer.jsx [Jose Asensio - [`190f3a4`](https://github.com/eea/volto-arcgis-block/commit/190f3a46d7a14a647f88bfd84e40c78026e105e9)]
14
+ - Use Cases new country group EEA38 [Jose Asensio - [`d7bb1cc`](https://github.com/eea/volto-arcgis-block/commit/d7bb1cc8a97bc603d7d7be89a73bf29936968873)]
15
+ - Prettier fix [joewdavies - [`e6cb3cc`](https://github.com/eea/volto-arcgis-block/commit/e6cb3ccb53b66f01d503e6347d36ed513854a045)]
16
+ - Prettier fix [joewdavies - [`84f1e00`](https://github.com/eea/volto-arcgis-block/commit/84f1e00fd800d929c711aa7c123c53344bc45a32)]
17
+ - CLMS-1261 clear previously checked layers and expanded dropdowns when navigating from 'viewin the map viewer' [joewdavies - [`478754b`](https://github.com/eea/volto-arcgis-block/commit/478754b12a9a6c8ea005f27425639ff26592be9d)]
18
+ - CLMS-1240 Sublayer title fix in active on map [joewdavies - [`051a465`](https://github.com/eea/volto-arcgis-block/commit/051a465783b8049c8964a0cff02b3760dc7266bc)]
7
19
  ### [0.1.59](https://github.com/eea/volto-arcgis-block/compare/0.1.58...0.1.59) - 15 September 2022
8
20
 
9
21
  #### :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.59",
3
+ "version": "0.1.60",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -234,15 +234,15 @@ export const AddCartItem = ({
234
234
  ></span>
235
235
  </div>
236
236
  <Modal.Content>
237
- <p>Would you like to add this dataset to the cart?</p>
237
+ <p>Do you want to add this dataset to the cart?</p>
238
238
  {!areaData && (
239
239
  <ul>
240
240
  <li>
241
241
  <p>
242
- If you would like to download an entire dataset select
243
- &#39;Add entire dataset&#39; (Note: the download will take
244
- longer for large datasets and Europe is selected as the
245
- area of interest by default).
242
+ If you would like to download an entire dataset then
243
+ select &#39;Add entire dataset&#39; (Note: the download
244
+ will take longer for large datasets and Europe is selected
245
+ as the area of interest by default).
246
246
  </p>
247
247
  </li>
248
248
  <br />
@@ -486,6 +486,15 @@ class MenuWidget extends React.Component {
486
486
  let product = url.searchParams.get('product');
487
487
  let dataset = url.searchParams.get('dataset');
488
488
  if (product || dataset) {
489
+ // CLMS-1261 - clear any previously checked layers when navigating using 'view in the map viewer'
490
+ let expandedDropdowns = sessionStorage.getItem('expandedDropdowns');
491
+ let checkedLayers = sessionStorage.getItem('checkedLayers');
492
+ if (expandedDropdowns) {
493
+ sessionStorage.setItem('expandedDropdowns', JSON.stringify([]));
494
+ }
495
+ if (checkedLayers) {
496
+ sessionStorage.setItem('checkedLayers', JSON.stringify([]));
497
+ }
489
498
  let event = new MouseEvent('click', {
490
499
  view: window,
491
500
  bubbles: true,
@@ -1072,7 +1081,8 @@ class MenuWidget extends React.Component {
1072
1081
  let dataset = document
1073
1082
  .querySelector('[datasetid="' + group + '"]')
1074
1083
  .querySelector('input');
1075
- elem.title = dataset.title + ' - ' + elem.getAttribute('layerid');
1084
+ elem.title =
1085
+ dataset.title + ' - ' + this.getLayerTitle(this.layers[elem.id]);
1076
1086
  let groupLayers = this.getGroupLayers(group);
1077
1087
  if (groupLayers.length > 0 && groupLayers[0] in this.activeLayersJSON) {
1078
1088
  elem.hide = true;
@@ -1734,22 +1744,23 @@ class MenuWidget extends React.Component {
1734
1744
  * @param {*} id id from elem
1735
1745
  */
1736
1746
  deleteCrossEvent(elem) {
1737
- let group = this.getGroup(elem);
1738
- let groupLayers = this.getGroupLayers(group);
1739
- if (group && groupLayers.length > 1) {
1740
- groupLayers.forEach((item) => {
1741
- elem = document.getElementById(item);
1742
- // elem has to be unchecked
1743
- elem.checked = false;
1744
- this.toggleLayer(elem);
1745
- delete this.activeLayersJSON[elem.id];
1746
- });
1747
- } else {
1748
- // elem has to be unchecked
1749
- elem.checked = false;
1750
- this.toggleLayer(elem);
1751
- delete this.activeLayersJSON[elem.id];
1752
- }
1747
+ // let group = this.getGroup(elem);
1748
+ // let groupLayers = this.getGroupLayers(group);
1749
+ // if (group && groupLayers.length > 1) {
1750
+ // // are we sure we want to delete all sublayers when one is deleted?
1751
+ // groupLayers.forEach((item) => {
1752
+ // elem = document.getElementById(item);
1753
+ // // elem has to be unchecked
1754
+ // elem.checked = false;
1755
+ // this.toggleLayer(elem);
1756
+ // delete this.activeLayersJSON[elem.id];
1757
+ // });
1758
+ // } else {
1759
+ // elem has to be unchecked
1760
+ elem.checked = false;
1761
+ this.toggleLayer(elem);
1762
+ delete this.activeLayersJSON[elem.id];
1763
+ // }
1753
1764
  this.setState({});
1754
1765
  }
1755
1766
 
@@ -370,6 +370,13 @@ class UseCasesMapViewer extends React.Component {
370
370
  ),
371
371
  ].length;
372
372
  let data_eea = [
373
+ ...new Set(
374
+ data.features
375
+ .filter((a) => a.attributes.Spatial_coverage === 'EEA38')
376
+ .map((item) => item.attributes.Use_case_id),
377
+ ),
378
+ ].length;
379
+ let data_eea_uk = [
373
380
  ...new Set(
374
381
  data.features
375
382
  .filter(
@@ -392,6 +399,7 @@ class UseCasesMapViewer extends React.Component {
392
399
  (a) =>
393
400
  a.attributes.Spatial_coverage !== 'EU' &&
394
401
  a.attributes.Spatial_coverage !== 'EU 27+UK' &&
402
+ a.attributes.Spatial_coverage !== 'EEA38' &&
395
403
  a.attributes.Spatial_coverage !== 'EEA38+UK' &&
396
404
  a.attributes.Spatial_coverage !== 'GLOBAL',
397
405
  )
@@ -407,6 +415,9 @@ class UseCasesMapViewer extends React.Component {
407
415
  string += `<div>${data_eu_uk} Use cases with EU27+UK coverage</div>`;
408
416
  }
409
417
  if (data_eea > 0) {
418
+ string += `<div>${data_eea} Use cases with EEA38 coverage</div>`;
419
+ }
420
+ if (data_eea_uk > 0) {
410
421
  string += `<div>${data_eea} Use cases with EEA38+UK coverage</div>`;
411
422
  }
412
423
  if (data_global > 0) {
@@ -104,6 +104,47 @@ const config = {
104
104
  'PL',
105
105
  'UK',
106
106
  ],
107
+ EEA38: [
108
+ 'AT',
109
+ 'BE',
110
+ 'BG',
111
+ 'CH',
112
+ 'CY',
113
+ 'CZ',
114
+ 'DE',
115
+ 'DK',
116
+ 'EE',
117
+ 'EL',
118
+ 'ES',
119
+ 'FI',
120
+ 'FR',
121
+ 'HR',
122
+ 'HU',
123
+ 'IE',
124
+ 'IS',
125
+ 'IT',
126
+ 'LI',
127
+ 'LT',
128
+ 'LU',
129
+ 'LV',
130
+ 'MT',
131
+ 'NL',
132
+ 'NO',
133
+ 'PL',
134
+ 'PT',
135
+ 'RO',
136
+ 'SE',
137
+ 'SI',
138
+ 'SK',
139
+ 'TR',
140
+ //COOPERATIVES
141
+ 'AL',
142
+ 'BA',
143
+ 'XK',
144
+ 'ME',
145
+ 'MK',
146
+ 'RS',
147
+ ],
107
148
  'EEA38+UK': [
108
149
  'AT',
109
150
  'BE',