@eeacms/volto-arcgis-block 0.1.328 → 0.1.330

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,14 @@ 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.330](https://github.com/eea/volto-arcgis-block/compare/0.1.329...0.1.330) - 16 January 2025
8
+
9
+ ### [0.1.329](https://github.com/eea/volto-arcgis-block/compare/0.1.328...0.1.329) - 14 January 2025
10
+
11
+ #### :hammer_and_wrench: Others
12
+
13
+ - Merge pull request #881 from eea/develop [Unai Bolivar - [`c2bef1e`](https://github.com/eea/volto-arcgis-block/commit/c2bef1e50a2c6a1058ce542b888dca0118f4d61b)]
14
+ - CLMS-270893 (bug): Fixed scroll positioning of checked dataset in dataviewer when coming from dataset catalogue result [Unai Bolivar - [`8a2cf7f`](https://github.com/eea/volto-arcgis-block/commit/8a2cf7f3184b81c653d3ba420921d481bc5619fa)]
7
15
  ### [0.1.328](https://github.com/eea/volto-arcgis-block/compare/0.1.327...0.1.328) - 9 January 2025
8
16
 
9
17
  ### [0.1.327](https://github.com/eea/volto-arcgis-block/compare/0.1.326...0.1.327) - 8 January 2025
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.328",
3
+ "version": "0.1.330",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -743,11 +743,11 @@ class MenuWidget extends React.Component {
743
743
  // and ensure that the component is rendered again
744
744
  this.setState({ showMapMenu: true });
745
745
  }
746
- if (this.loadFirst && this.container.current) {
747
- this.checkUrl();
748
- this.loadFirst = false;
749
- this.zoomTooltips();
750
- }
746
+ // if (this.loadFirst && this.container.current) {
747
+ this.checkUrl();
748
+ // this.loadFirst = false;
749
+ this.zoomTooltips();
750
+ // }
751
751
 
752
752
  let authToken = this.getAuthToken();
753
753
  let timeSliderTag = sessionStorage.getItem('timeSliderTag');
@@ -1060,7 +1060,11 @@ class MenuWidget extends React.Component {
1060
1060
  scrollPosition = mapMenu.offsetTop;
1061
1061
  }
1062
1062
  }
1063
- document.querySelector('.panels').scrollTop = scrollPosition;
1063
+ setTimeout(() => {
1064
+ document.querySelector(
1065
+ 'div#paneles.panels',
1066
+ ).scrollTop = scrollPosition;
1067
+ }, 1000);
1064
1068
  }
1065
1069
  }
1066
1070
  }
@@ -4217,93 +4221,91 @@ class MenuWidget extends React.Component {
4217
4221
  // if (document.getElementById('select-family')) {
4218
4222
  // familyFilter = document.getElementById('select-family').text;
4219
4223
  // }
4224
+ let checkedLayers = JSON.parse(sessionStorage.getItem('checkedLayers'));
4220
4225
  for (let index = 0; index < this.compCfg.length; index++) {
4221
4226
  let componentFound = false;
4222
- if (
4223
- this.compCfg[index].ComponentPosition.toString() === componentFilter ||
4224
- componentFilter === 'default'
4225
- ) {
4226
- for (let j = 0; j < this.compCfg[index].Products.length; j++) {
4227
- const product = this.compCfg[index].Products[j];
4228
- let productFound = false;
4227
+ let componentChecked = false;
4228
+ let componentElem = document.querySelector('#component_' + index);
4229
+ for (let j = 0; j < this.compCfg[index].Products.length; j++) {
4230
+ const product = this.compCfg[index].Products[j];
4231
+ let productFound = false;
4232
+ let productChecked = false;
4233
+ let productElem = document.querySelector(
4234
+ '[productid="' + product.ProductId + '"]',
4235
+ );
4236
+ for (let k = 0; k < product.Datasets.length; k++) {
4237
+ const dataset = product.Datasets[k];
4238
+ let datasetChecked = false;
4239
+ let datasetElem = document.querySelector(
4240
+ '[datasetid="' + dataset.DatasetId + '"]',
4241
+ );
4242
+ for (let l = 0; l < checkedLayers.length; l++) {
4243
+ if (
4244
+ dataset.DatasetTitle ===
4245
+ this.layers[checkedLayers[l]].DatasetTitle
4246
+ ) {
4247
+ componentChecked = true;
4248
+ productChecked = true;
4249
+ datasetChecked = true;
4250
+ }
4251
+ }
4229
4252
  if (
4230
- product.ProductId === productFilter ||
4253
+ searchText === '' &&
4254
+ componentFilter === 'default' &&
4231
4255
  productFilter === 'default'
4232
4256
  ) {
4233
- for (let k = 0; k < product.Datasets.length; k++) {
4234
- const dataset = product.Datasets[k];
4235
-
4236
- if (
4237
- searchText === '' &&
4238
- componentFilter === 'default' &&
4239
- productFilter === 'default'
4240
- ) {
4241
- componentFound = true;
4242
- productFound = true;
4243
- result = true;
4244
- let componentElem = document.querySelector(
4245
- '#component_' + index,
4246
- );
4247
- componentElem
4248
- .querySelector('.ccl-expandable__button')
4249
- .setAttribute('aria-expanded', 'false');
4250
-
4251
- let productElem = document.querySelector(
4252
- '[productid="' + product.ProductId + '"]',
4253
- );
4254
- productElem
4255
- .querySelector('.ccl-expandable__button')
4256
- .setAttribute('aria-expanded', 'false');
4257
- let datasetElem = document.querySelector(
4258
- '[datasetid="' + dataset.DatasetId + '"]',
4259
- );
4260
- datasetElem.removeAttribute('style');
4261
- productElem.removeAttribute('style');
4262
- componentElem.removeAttribute('style');
4263
- } else if (
4264
- dataset?.DatasetTitle?.toUpperCase().includes(searchText)
4265
- ) {
4266
- componentFound = true;
4267
- productFound = true;
4268
- result = true;
4269
- let componentElem = document.querySelector(
4270
- '#component_' + index,
4271
- );
4272
- componentElem
4273
- .querySelector('.ccl-expandable__button')
4274
- .setAttribute('aria-expanded', 'true');
4275
-
4276
- let productElem = document.querySelector(
4277
- '[productid="' + product.ProductId + '"]',
4278
- );
4279
- productElem
4280
- .querySelector('.ccl-expandable__button')
4281
- .setAttribute('aria-expanded', 'true');
4282
- let datasetElem = document.querySelector(
4283
- '[datasetid="' + dataset.DatasetId + '"]',
4284
- );
4285
- datasetElem.removeAttribute('style');
4286
- productElem.removeAttribute('style');
4287
- componentElem.removeAttribute('style');
4288
- } else {
4289
- let datasetElem = document.querySelector(
4290
- '[datasetid="' + dataset.DatasetId + '"]',
4291
- );
4292
- datasetElem.setAttribute('style', 'display: none;');
4293
- }
4294
- }
4295
- }
4296
- if (!productFound) {
4297
- let productElem = document.querySelector(
4298
- '[productid="' + product.ProductId + '"]',
4299
- );
4300
- productElem.setAttribute('style', 'display: none;');
4257
+ componentFound = true;
4258
+ productFound = true;
4259
+ result = true;
4260
+ componentElem
4261
+ .querySelector('.ccl-expandable__button')
4262
+ .setAttribute('aria-expanded', 'false');
4263
+ productElem
4264
+ .querySelector('.ccl-expandable__button')
4265
+ .setAttribute('aria-expanded', 'false');
4266
+ datasetElem.removeAttribute('style');
4267
+ productElem.removeAttribute('style');
4268
+ componentElem.removeAttribute('style');
4269
+ } else if (
4270
+ datasetChecked ||
4271
+ (dataset?.DatasetTitle?.toUpperCase().includes(searchText) &&
4272
+ (product.ProductId === productFilter ||
4273
+ productFilter === 'default') &&
4274
+ (this.compCfg[index].ComponentPosition.toString() ===
4275
+ componentFilter ||
4276
+ componentFilter === 'default'))
4277
+ ) {
4278
+ componentFound = true;
4279
+ productFound = true;
4280
+ result = true;
4281
+ componentElem
4282
+ .querySelector('.ccl-expandable__button')
4283
+ .setAttribute('aria-expanded', 'true');
4284
+ productElem
4285
+ .querySelector('.ccl-expandable__button')
4286
+ .setAttribute('aria-expanded', 'true');
4287
+ datasetElem.removeAttribute('style');
4288
+ productElem.removeAttribute('style');
4289
+ componentElem.removeAttribute('style');
4290
+ } else {
4291
+ datasetElem.setAttribute('style', 'display: none;');
4301
4292
  }
4302
4293
  }
4303
- this.compCfg[index].Products.forEach((product) => {});
4294
+ if (productChecked) {
4295
+ productElem
4296
+ .querySelector('.ccl-expandable__button')
4297
+ .setAttribute('aria-expanded', 'true');
4298
+ }
4299
+ if (!productFound && !productChecked) {
4300
+ productElem.setAttribute('style', 'display: none;');
4301
+ }
4302
+ }
4303
+ if (componentChecked) {
4304
+ componentElem
4305
+ .querySelector('.ccl-expandable__button')
4306
+ .setAttribute('aria-expanded', 'true');
4304
4307
  }
4305
- if (!componentFound) {
4306
- let componentElem = document.querySelector('#component_' + index);
4308
+ if (!componentFound && !componentChecked) {
4307
4309
  componentElem.setAttribute('style', 'display: none;');
4308
4310
  }
4309
4311
  }