Skip to content

Commit

Permalink
Merge pull request #766 from eea/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ujbolivar committed May 21, 2024
2 parents aa830d6 + ba987e8 commit 42cd44a
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

### [0.1.280](https://github.com/eea/volto-arcgis-block/compare/0.1.279...0.1.280) - 21 May 2024

#### :hammer_and_wrench: Others

- CLMS-3294 (bug): bookmarked hotspots and hotspot filters work correctly [Unai Bolivar - [`211ecc8`](https://github.com/eea/volto-arcgis-block/commit/211ecc8b3fb1b1f98248cac6ea730247440b9e22)]
- CLMS-3294 (bug): filter works on unfiltered hotspots after bookmarking. Bug remains where different bookmarks containing different filtered hotspots must be double clicked in order to summon the correct filter, and unfiltered hotspot doesn't show after saving filtered hotspots [Unai Bolivar - [`a91b089`](https://github.com/eea/volto-arcgis-block/commit/a91b0892391a710c7507cd1de99f972ea3e98dc0)]
### [0.1.279](https://github.com/eea/volto-arcgis-block/compare/0.1.278...0.1.279) - 10 May 2024

#### :hammer_and_wrench: Others
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-arcgis-block",
"version": "0.1.279",
"version": "0.1.280",
"description": "volto-arcgis-block: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: CodeSyntax",
Expand Down
24 changes: 20 additions & 4 deletions src/components/MapViewer/HotspotWidget.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,11 @@ class HotspotWidget extends React.Component {
typeLegend,
);
filterLayer.sublayers.items[0].title = title;
if (bookmarkHotspotFilter !== null) {
if (
bookmarkHotspotFilter !== null &&
bookmarkHotspotFilter.filteredLayers &&
bookmarkHotspotFilter.filteredLayers['lcc_filter'] !== undefined
) {
filterLayer.customLayerParameters['CQL_FILTER'] =
bookmarkHotspotFilter.filteredLayers['lcc_filter'];
} else {
Expand Down Expand Up @@ -337,7 +341,11 @@ class HotspotWidget extends React.Component {
typeLegend,
);
filterLayer.sublayers.items[0].title = title;
if (bookmarkHotspotFilter !== null) {
if (
bookmarkHotspotFilter !== null &&
bookmarkHotspotFilter.filteredLayers &&
bookmarkHotspotFilter.filteredLayers['lc_filter'] !== undefined
) {
filterLayer.customLayerParameters['CQL_FILTER'] =
bookmarkHotspotFilter.filteredLayers['lc_filter'];
} else {
Expand All @@ -352,7 +360,11 @@ class HotspotWidget extends React.Component {
}
if (type === 'klc') {
title = 'Key Landscapes for Conservation borders in selected Hot Spots';
if (bookmarkHotspotFilter !== null) {
if (
bookmarkHotspotFilter !== null &&
bookmarkHotspotFilter.filteredLayers &&
bookmarkHotspotFilter.filteredLayers['klc_filter'] !== undefined
) {
this.esriLayer_klc.customLayerParameters['CQL_FILTER'] =
bookmarkHotspotFilter.filteredLayers['klc_filter'];
} else {
Expand All @@ -365,7 +377,11 @@ class HotspotWidget extends React.Component {
if (type === 'pa') {
title =
'Protected Areas in Key Landscapes for Conservation borders in selected Hot Spots';
if (bookmarkHotspotFilter !== null) {
if (
bookmarkHotspotFilter !== null &&
bookmarkHotspotFilter.filteredLayers &&
bookmarkHotspotFilter.filteredLayers['pa_filter'] !== undefined
) {
this.esriLayer_pa.customLayerParameters['CQL_FILTER'] =
bookmarkHotspotFilter.filteredLayers['pa_filter'];
} else {
Expand Down
2 changes: 0 additions & 2 deletions src/components/MapViewer/InfoWidget.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,6 @@ class InfoWidget extends React.Component {
render() {
let noData = true;
if (this.state.pixelInfo) {
/* debugger */
noData = this.infoData[this.state.layerIndex].data.data
? this.infoData[this.state.layerIndex].data.data.values.map((a) => {
return a[
Expand All @@ -960,7 +959,6 @@ class InfoWidget extends React.Component {
}).length === 0
: true;
} else if (this.state.popup) {
/* debugger */
noData = this.infoData[this.state.layerIndex].data.length === 0 && true;
}
return (
Expand Down
23 changes: 21 additions & 2 deletions src/components/MapViewer/MenuWidget.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1916,7 +1916,6 @@ class MenuWidget extends React.Component {
this.layers[key].visible = true;
}
} else {
//debugger
this.layers[key].visible = false;
}
} else if (layerTitle.includes('vector')) {
Expand All @@ -1929,7 +1928,6 @@ class MenuWidget extends React.Component {
this.layers[key].visible = true;
}
} else {
//debugger
this.layers[key].visible = false;
}
}
Expand Down Expand Up @@ -1972,7 +1970,28 @@ class MenuWidget extends React.Component {
(elem.id.includes('all_lcc') || elem.id.includes('all_present')) &&
(this.layers['lc_filter'] || this.layers['lcc_filter'])
) {
let bookmarkHotspotFilter = localStorage.getItem(
'bookmarkHotspotFilter',
);
if (
this.props.bookmarkData &&
this.props.bookmarkData.active === true
) {
if (
bookmarkHotspotFilter?.filteredLayers?.hasOwnProperty('lc_filter')
) {
this.layers['lc_filter'].visible = true;
this.map.add(this.layers['lc_filter']);
} else if (
bookmarkHotspotFilter?.filteredLayers?.hasOwnProperty('lcc_filter')
) {
this.layers['lcc_filter'].visible = true;
this.map.add(this.layers['lcc_filter']);
} else {
this.layers[elem.id].visible = true;
this.map.add(this.layers[elem.id]);
}
} else if (
elem.id.includes('cop_klc') &&
this.layers['klc_filter'] !== undefined
) {
Expand Down

0 comments on commit 42cd44a

Please sign in to comment.