@eeacms/volto-arcgis-block 0.1.367 → 0.1.368

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,8 @@ 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.368](https://github.com/eea/volto-arcgis-block/compare/0.1.367...0.1.368) - 17 June 2025
8
+
7
9
  ### [0.1.367](https://github.com/eea/volto-arcgis-block/compare/0.1.366...0.1.367) - 17 June 2025
8
10
 
9
11
  #### :house: Internal changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.367",
3
+ "version": "0.1.368",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -1087,6 +1087,15 @@ class MenuWidget extends React.Component {
1087
1087
  if (productDropdown) {
1088
1088
  let scrollPosition = productDropdown.offsetTop;
1089
1089
  if (dataset) {
1090
+ let familyDropdown = node.closest('.map-menu-family-dropdown');
1091
+ if (familyDropdown) {
1092
+ let button = familyDropdown.querySelector(
1093
+ '.ccl-expandable__button',
1094
+ );
1095
+ if (button) {
1096
+ button.setAttribute('aria-expanded', 'true');
1097
+ }
1098
+ }
1090
1099
  let datasetDropdown = node.closest('.map-menu-product-dropdown');
1091
1100
  if (datasetDropdown) {
1092
1101
  let button = datasetDropdown.querySelector(
@@ -1402,13 +1411,14 @@ class MenuWidget extends React.Component {
1402
1411
  );
1403
1412
  }
1404
1413
 
1405
- metodProcessFamily(family, familyTitle, inheritedIndex, checkProduct) {
1414
+ metodProcessFamily(family, familyTitle, inheritedIndex, checkFamily) {
1406
1415
  var dataset_def = [];
1407
1416
  var datasets = [];
1408
1417
  var index = 0;
1409
1418
  var familyId = familyTitle.replace(/\s+/g, '');
1410
- var inheritedIndexProduct = inheritedIndex + '_' + familyId;
1411
- checkProduct = 'map_product_' + inheritedIndexProduct;
1419
+ var inheritedIndexFamily = inheritedIndex + '_' + familyId;
1420
+ checkFamily = 'map_family_' + inheritedIndexFamily;
1421
+ var checkProduct = 'map_product_' + inheritedIndex;
1412
1422
  var familyTitleName = '';
1413
1423
  this.tax.tree.forEach((element) => {
1414
1424
  element.children.forEach((element) => {
@@ -1419,38 +1429,23 @@ class MenuWidget extends React.Component {
1419
1429
  });
1420
1430
  if (family && Array.isArray(family)) {
1421
1431
  for (var i in family) {
1422
- // if (this.filtersApplied) {
1423
- // dataset_def = document
1424
- // .querySelector('#' + checkProduct)
1425
- // ?.getAttribute('defcheck');
1426
- // } else if (
1427
- // product.Datasets[i] &&
1428
- // product.Datasets[i].Default_active === true
1429
- // ) {
1430
- // var idDataset = 'map_dataset_' + inheritedIndexProduct + '_' + index;
1431
- // dataset_def.push(idDataset);
1432
- // }
1433
-
1434
- // CLMS-1545
1435
- // if (!product.Datasets[i].MarkAsDownloadableNoServiceToVisualize) {
1436
1432
  if (family[i]) {
1437
1433
  datasets.push(
1438
1434
  this.metodProcessDataset(
1439
1435
  family[i],
1440
1436
  index,
1441
- inheritedIndexProduct,
1442
- checkProduct,
1437
+ inheritedIndex,
1438
+ checkFamily,
1443
1439
  ),
1444
1440
  );
1445
1441
  index++;
1446
1442
  }
1447
- // }
1448
1443
  }
1449
1444
  }
1450
1445
 
1451
1446
  // Empty vector, add the first dataset
1452
1447
  if (!dataset_def.length) {
1453
- var idDatasetB = 'map_dataset_' + inheritedIndexProduct + '_0';
1448
+ var idDatasetB = 'map_dataset_' + inheritedIndexFamily + '_0';
1454
1449
  dataset_def.push(idDatasetB);
1455
1450
  }
1456
1451
  let style = this.props.download ? { display: 'none' } : {};
@@ -1458,13 +1453,13 @@ class MenuWidget extends React.Component {
1458
1453
  return (
1459
1454
  <div
1460
1455
  className="map-menu-family-dropdown"
1461
- id={'family_' + inheritedIndexProduct}
1456
+ id={'family_' + inheritedIndexFamily}
1462
1457
  familyid={familyId}
1463
1458
  key={'a' + familyId}
1464
1459
  >
1465
1460
  <fieldset className="ccl-fieldset" key={'b' + familyId}>
1466
1461
  <div
1467
- id={'dropdown_' + inheritedIndexProduct}
1462
+ id={'dropdown_' + inheritedIndexFamily}
1468
1463
  className="ccl-expandable__button"
1469
1464
  aria-expanded="false"
1470
1465
  key={'c' + familyId}
@@ -1481,7 +1476,8 @@ class MenuWidget extends React.Component {
1481
1476
  <div className="ccl-form-group" key={'e' + familyId}>
1482
1477
  <input
1483
1478
  type="checkbox"
1484
- id={checkProduct}
1479
+ id={checkFamily}
1480
+ parentid={checkProduct}
1485
1481
  name=""
1486
1482
  value="name"
1487
1483
  className="ccl-checkbox ccl-required ccl-form-check-input"
@@ -1493,7 +1489,7 @@ class MenuWidget extends React.Component {
1493
1489
  ></input>
1494
1490
  <label
1495
1491
  className="ccl-form-check-label"
1496
- htmlFor={checkProduct}
1492
+ htmlFor={checkFamily}
1497
1493
  key={'f' + familyId}
1498
1494
  >
1499
1495
  <legend className="ccl-form-legend">
@@ -1517,7 +1513,7 @@ class MenuWidget extends React.Component {
1517
1513
  </div>
1518
1514
  <div
1519
1515
  className="ccl-form map-menu-family-container"
1520
- id={'family_container_' + inheritedIndexProduct}
1516
+ id={'family_container_' + inheritedIndexFamily}
1521
1517
  >
1522
1518
  {datasets}
1523
1519
  </div>
@@ -1875,6 +1871,27 @@ class MenuWidget extends React.Component {
1875
1871
  datasetCheck.checked = trueChecks > 0;
1876
1872
 
1877
1873
  let parentId = datasetCheck.getAttribute('parentid');
1874
+ if (parentId) {
1875
+ if (parentId.includes('map_family')) {
1876
+ this.updateCheckFamily(parentId);
1877
+ } else {
1878
+ this.updateCheckProduct(parentId);
1879
+ }
1880
+ }
1881
+ }
1882
+
1883
+ updateCheckFamily(id) {
1884
+ let familyCheck = document.querySelector('#' + id);
1885
+ if (!familyCheck) return;
1886
+
1887
+ let layerChecks = Array.from(
1888
+ document.querySelectorAll('[parentid="' + id + '"]'),
1889
+ );
1890
+
1891
+ let trueChecks = layerChecks.filter((elem) => elem.checked).length;
1892
+ familyCheck.checked = trueChecks > 0;
1893
+
1894
+ let parentId = familyCheck.getAttribute('parentid');
1878
1895
  if (parentId) {
1879
1896
  this.updateCheckProduct(parentId);
1880
1897
  }