@eeacms/volto-marine-policy 2.0.25 → 2.0.26
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 +12 -0
- package/package.json +2 -2
- package/src/components/Blocks/DemoSitesExplorer/DemoSitesFilters.jsx +5 -5
- package/src/components/Blocks/DemoSitesExplorer/FeatureDisplay.jsx +5 -5
- package/src/components/Blocks/DemoSitesExplorer/InfoOverlay.jsx +14 -20
- package/src/components/Blocks/DemoSitesExplorer/ObjectivesChart.jsx +1 -0
- package/src/components/Blocks/DemoSitesExplorer/utils.js +2 -2
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
|
+
### [2.0.26](https://github.com/eea/volto-marine-policy/compare/2.0.25...2.0.26) - 29 August 2025
|
|
8
|
+
|
|
9
|
+
#### :rocket: Dependency updates
|
|
10
|
+
|
|
11
|
+
- Release @eeacms/volto-searchlib@2.1.10 [EEA Jenkins - [`17445e9`](https://github.com/eea/volto-marine-policy/commit/17445e91fa8ff3c66ebabdbc6f3e474f643f6d03)]
|
|
12
|
+
|
|
13
|
+
#### :hammer_and_wrench: Others
|
|
14
|
+
|
|
15
|
+
- Demo Sites Explorer show indicators link in popup [laszlocseh - [`5214931`](https://github.com/eea/volto-marine-policy/commit/52149317e361ce8bd9b4e0adc9c17ec61b35ecc1)]
|
|
16
|
+
- Fix map popup [narcis2005 - [`dd99fd7`](https://github.com/eea/volto-marine-policy/commit/dd99fd7b3ff6327730690b6a5da262905e626593)]
|
|
17
|
+
- lint ignore line [Claudia Ifrim - [`5de8369`](https://github.com/eea/volto-marine-policy/commit/5de8369f3470ef3bb592fc851a44c90489771f84)]
|
|
18
|
+
- ol fix [Claudia Ifrim - [`8eacd1f`](https://github.com/eea/volto-marine-policy/commit/8eacd1f3121e593d645eaaa0e1b22fc84fe73ced)]
|
|
7
19
|
### [2.0.25](https://github.com/eea/volto-marine-policy/compare/2.0.24...2.0.25) - 27 August 2025
|
|
8
20
|
|
|
9
21
|
#### :hammer_and_wrench: Others
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eeacms/volto-marine-policy",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.26",
|
|
4
4
|
"description": "@eeacms/volto-marine-policy: Volto add-on",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "European Environment Agency: IDM2 A-Team",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@eeacms/volto-globalsearch": "2.1.2",
|
|
41
41
|
"@eeacms/volto-metadata-block": "*",
|
|
42
42
|
"@eeacms/volto-openlayers-map": "1.0.1",
|
|
43
|
-
"@eeacms/volto-searchlib": "2.1.
|
|
43
|
+
"@eeacms/volto-searchlib": "2.1.10",
|
|
44
44
|
"@eeacms/volto-tabs-block": "*",
|
|
45
45
|
"@eeacms/volto-workflow-progress": "*",
|
|
46
46
|
"@plone-collective/volto-authomatic": "2.0.1",
|
|
@@ -326,7 +326,7 @@ export function ActiveFilters(props) {
|
|
|
326
326
|
{activeFilters.objective_filter.map((filterCode) => {
|
|
327
327
|
const filterLabel = filters.objective_filter[filterCode];
|
|
328
328
|
return (
|
|
329
|
-
<div className="ui basic label filter-value">
|
|
329
|
+
<div key={filterCode} className="ui basic label filter-value">
|
|
330
330
|
<span>{filterLabel}</span>
|
|
331
331
|
<i
|
|
332
332
|
tabIndex="0"
|
|
@@ -352,7 +352,7 @@ export function ActiveFilters(props) {
|
|
|
352
352
|
{activeFilters.target_filter.map((filterCode) => {
|
|
353
353
|
const filterLabel = filters.target_filter[filterCode];
|
|
354
354
|
return (
|
|
355
|
-
<div className="ui basic label filter-value">
|
|
355
|
+
<div key={filterCode} className="ui basic label filter-value">
|
|
356
356
|
<span>{filterLabel}</span>
|
|
357
357
|
<i
|
|
358
358
|
tabIndex="0"
|
|
@@ -377,7 +377,7 @@ export function ActiveFilters(props) {
|
|
|
377
377
|
{activeFilters.indicator_filter.map((filterCode) => {
|
|
378
378
|
const filterLabel = filters.indicator_filter[filterCode];
|
|
379
379
|
return (
|
|
380
|
-
<div className="ui basic label filter-value">
|
|
380
|
+
<div key={filterCode} className="ui basic label filter-value">
|
|
381
381
|
<span>{filterLabel}</span>
|
|
382
382
|
<i
|
|
383
383
|
tabIndex="0"
|
|
@@ -402,7 +402,7 @@ export function ActiveFilters(props) {
|
|
|
402
402
|
{activeFilters.project_filter.map((filterCode) => {
|
|
403
403
|
const filterLabel = filters.project_filter[filterCode];
|
|
404
404
|
return (
|
|
405
|
-
<div className="ui basic label filter-value">
|
|
405
|
+
<div key={filterCode} className="ui basic label filter-value">
|
|
406
406
|
<span>{filterLabel}</span>
|
|
407
407
|
<i
|
|
408
408
|
tabIndex="0"
|
|
@@ -427,7 +427,7 @@ export function ActiveFilters(props) {
|
|
|
427
427
|
{activeFilters.country_filter.map((filterCode) => {
|
|
428
428
|
const filterLabel = filters.country_filter[filterCode];
|
|
429
429
|
return (
|
|
430
|
-
<div className="ui basic label filter-value">
|
|
430
|
+
<div key={filterCode} className="ui basic label filter-value">
|
|
431
431
|
<span>{filterLabel}</span>
|
|
432
432
|
<i
|
|
433
433
|
tabIndex="0"
|
|
@@ -102,13 +102,13 @@ export default function FeatureDisplay({ feature }) {
|
|
|
102
102
|
{feature.indicators.map((item, index) => {
|
|
103
103
|
return (
|
|
104
104
|
<li key={index}>
|
|
105
|
-
<
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
<a
|
|
106
|
+
target="_blank"
|
|
107
|
+
rel="noopener noreferrer"
|
|
108
|
+
href={item['path']}
|
|
109
109
|
>
|
|
110
110
|
{item['title']}
|
|
111
|
-
</
|
|
111
|
+
</a>
|
|
112
112
|
</li>
|
|
113
113
|
);
|
|
114
114
|
})}
|
|
@@ -4,18 +4,12 @@ import { withOpenLayers } from '@eeacms/volto-openlayers-map';
|
|
|
4
4
|
import FeatureDisplay from './FeatureDisplay';
|
|
5
5
|
import { usePrevious } from '@plone/volto/helpers/Utils/usePrevious';
|
|
6
6
|
|
|
7
|
-
function InfoOverlay({
|
|
8
|
-
selectedFeature,
|
|
9
|
-
onFeatureSelect,
|
|
10
|
-
layerId,
|
|
11
|
-
// hideFilters,
|
|
12
|
-
ol,
|
|
13
|
-
}) {
|
|
7
|
+
function InfoOverlay({ selectedFeature, onFeatureSelect, layerId, ol }) {
|
|
14
8
|
const { map } = useMapContext();
|
|
15
|
-
const [tooltip, setTooltipRef] = React.useState();
|
|
16
|
-
const
|
|
17
|
-
|
|
9
|
+
const [tooltip, setTooltipRef] = React.useState(null);
|
|
10
|
+
const overlayRef = React.useRef();
|
|
18
11
|
const prevLayerId = usePrevious(layerId);
|
|
12
|
+
const [showTooltip, setShowTooltip] = React.useState(false);
|
|
19
13
|
|
|
20
14
|
React.useEffect(() => {
|
|
21
15
|
if (prevLayerId && layerId !== prevLayerId) {
|
|
@@ -24,10 +18,10 @@ function InfoOverlay({
|
|
|
24
18
|
}, [layerId, prevLayerId]);
|
|
25
19
|
|
|
26
20
|
React.useEffect(() => {
|
|
27
|
-
if (!(map && tooltip)) return;
|
|
21
|
+
if (!(map && tooltip && ol.Overlay)) return;
|
|
28
22
|
|
|
29
|
-
|
|
30
|
-
element:
|
|
23
|
+
overlayRef.current = new ol.Overlay({
|
|
24
|
+
element: tooltip,
|
|
31
25
|
positioning: 'bottom-left',
|
|
32
26
|
offset: [0, 0],
|
|
33
27
|
stopEvent: false,
|
|
@@ -36,7 +30,7 @@ function InfoOverlay({
|
|
|
36
30
|
// duration: 250,
|
|
37
31
|
// },
|
|
38
32
|
});
|
|
39
|
-
map.addOverlay(
|
|
33
|
+
map.addOverlay(overlayRef.current);
|
|
40
34
|
|
|
41
35
|
function handler(evt) {
|
|
42
36
|
const { pixel, target } = evt;
|
|
@@ -45,15 +39,13 @@ function InfoOverlay({
|
|
|
45
39
|
|
|
46
40
|
if (features.length) {
|
|
47
41
|
const coordinate = evt.coordinate;
|
|
48
|
-
|
|
42
|
+
overlayRef.current.setPosition(coordinate);
|
|
49
43
|
setShowTooltip(true);
|
|
50
44
|
} else {
|
|
51
|
-
// const coordinate = evt.coordinate
|
|
52
|
-
// overlay.setPosition(coordinate);
|
|
53
45
|
// handle a click in an overlay popup
|
|
54
46
|
if (evt.originalEvent.target.tagName === 'A') return;
|
|
47
|
+
overlayRef.current.setPosition(undefined);
|
|
55
48
|
setShowTooltip(false);
|
|
56
|
-
// popupOverlay.style.display = 'none';
|
|
57
49
|
onFeatureSelect(null);
|
|
58
50
|
}
|
|
59
51
|
}
|
|
@@ -62,9 +54,11 @@ function InfoOverlay({
|
|
|
62
54
|
|
|
63
55
|
return () => {
|
|
64
56
|
map.un('click', handler);
|
|
65
|
-
|
|
57
|
+
if (overlayRef.current) {
|
|
58
|
+
map.removeOverlay(overlayRef.current);
|
|
59
|
+
}
|
|
66
60
|
};
|
|
67
|
-
}, [map, tooltip, onFeatureSelect, ol]);
|
|
61
|
+
}, [map, tooltip, onFeatureSelect, ol.Overlay]);
|
|
68
62
|
|
|
69
63
|
const [isClient, setIsClient] = React.useState(false);
|
|
70
64
|
React.useEffect(() => setIsClient(true), []);
|
|
@@ -88,7 +88,7 @@ export function zoomMapToFeatures({ map, features, ol, threshold = 500 }) {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
export function getFeatures({ cases, ol }) {
|
|
91
|
-
const Feature = ol.Feature;
|
|
91
|
+
const Feature = ol.Feature; // eslint-disable-line no-unused-vars
|
|
92
92
|
const colors = {
|
|
93
93
|
'Objective 1: Protect and restore marine and freshwater ecosystems and biodiversity':
|
|
94
94
|
'#007b6c',
|
|
@@ -113,7 +113,7 @@ export function getFeatures({ cases, ol }) {
|
|
|
113
113
|
const {
|
|
114
114
|
geometry: { coordinates },
|
|
115
115
|
} = c;
|
|
116
|
-
const point = new Feature(
|
|
116
|
+
const point = new ol.ol.Feature(
|
|
117
117
|
new ol.geom.Point(ol.proj.fromLonLat(coordinates)),
|
|
118
118
|
);
|
|
119
119
|
point.setId(index);
|