@eeacms/volto-arcgis-block 0.1.139 → 0.1.140

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,7 +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.139](https://github.com/eea/volto-arcgis-block/compare/0.1.138...0.1.139) - 9 May 2023
7
+ ### [0.1.140](https://github.com/eea/volto-arcgis-block/compare/0.1.139...0.1.140) - 11 May 2023
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - CLMS-1953 (lint): Sets only one span with text. Can handle layers with no legends [ujbolivar - [`4335250`](https://github.com/eea/volto-arcgis-block/commit/433525063af14ac1e48d9a5bb646127769efb5e2)]
12
+ - CLMS-1953 (lint): Ran linting scripts [ujbolivar - [`b73661d`](https://github.com/eea/volto-arcgis-block/commit/b73661d000cda6629be6dd0b110d5acb96c1e1bf)]
13
+ - CLMS-1953 (chore): cleaned up and took out unecessary functions [ujbolivar - [`60cd5f8`](https://github.com/eea/volto-arcgis-block/commit/60cd5f87f7737bfda0ae801b3acf7627bfe2c182)]
14
+ ### [0.1.139](https://github.com/eea/volto-arcgis-block/compare/0.1.138...0.1.139) - 10 May 2023
8
15
 
9
16
  #### :hammer_and_wrench: Others
10
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.139",
3
+ "version": "0.1.140",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -34,7 +34,11 @@ class LegendWidget extends React.Component {
34
34
 
35
35
  // If img src returns a broken link
36
36
  if (!(img.complete && img.naturalHeight !== 0)) {
37
- img.style.display = 'none';
37
+ if (img.style) {
38
+ img.style.display = 'none';
39
+ }
40
+
41
+ if (element.parentNode.querySelector('span')) return;
38
42
 
39
43
  let span = document.createElement('span');
40
44
  span.innerHTML = 'No legend available';
@@ -648,25 +648,6 @@ class MenuWidget extends React.Component {
648
648
  }, 1000);
649
649
  }
650
650
 
651
- setLegendOpacity = () => {
652
- const collection = document.getElementsByClassName('esri-legend__symbol');
653
-
654
- Array.prototype.forEach.call(collection, function (element) {
655
- let img = {};
656
-
657
- if (element.hasChildNodes()) {
658
- img = element.childNodes[0];
659
- } else {
660
- img = element;
661
- }
662
- // Set Legend opacity back to 1;
663
- img.setAttribute(
664
- 'style',
665
- 'opacity:1; -moz-opacity:1; filter:alpha(opacity=100)',
666
- );
667
- });
668
- };
669
-
670
651
  /**
671
652
  * This method is executed after the render method is executed
672
653
  */
@@ -2701,7 +2682,6 @@ class MenuWidget extends React.Component {
2701
2682
  '.active-layer[layer-id="' + layer + '"] .active-layer-opacity',
2702
2683
  ).dataset.opacity = value;
2703
2684
  // }
2704
- this.setLegendOpacity();
2705
2685
  }
2706
2686
 
2707
2687
  /**