@eeacms/volto-marine-policy 2.0.35 → 2.0.36
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 +13 -0
- package/package.json +1 -1
- package/src/components/Blocks/DemoSitesExplorer/DemoSitesExplorerView.js +15 -10
- package/src/components/Blocks/DemoSitesExplorer/DemoSitesFilters.jsx +2 -2
- package/src/components/Blocks/DemoSitesExplorer/DemoSitesMap.jsx +56 -42
- package/src/components/Blocks/DemoSitesExplorer/images/icon-point-light.png +0 -0
- package/src/components/Blocks/DemoSitesExplorer/images/icon-point.png +0 -0
- package/src/components/Blocks/DemoSitesExplorer/images/icon-region-light.png +0 -0
- package/src/components/Blocks/DemoSitesExplorer/images/icon-region.png +0 -0
- package/src/components/Blocks/DemoSitesExplorer/schema.jsx +14 -6
- package/src/components/Blocks/DemoSitesExplorer/utils.js +20 -17
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,19 @@ 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.36](https://github.com/eea/volto-marine-policy/compare/2.0.35...2.0.36) - 10 November 2025
|
|
8
|
+
|
|
9
|
+
#### :rocket: New Features
|
|
10
|
+
|
|
11
|
+
- feat: new variation for Demo sites explorer [laszlocseh - [`58799b2`](https://github.com/eea/volto-marine-policy/commit/58799b23a8c0ff0f34ff2aeee8991113baaaa3d9)]
|
|
12
|
+
|
|
13
|
+
#### :house: Internal changes
|
|
14
|
+
|
|
15
|
+
- style: Automated code fix [eea-jenkins - [`db0e43a`](https://github.com/eea/volto-marine-policy/commit/db0e43a4def21dddc41640173ff963ad97b6d32a)]
|
|
16
|
+
|
|
17
|
+
#### :hammer_and_wrench: Others
|
|
18
|
+
|
|
19
|
+
- fix demo sites map [laszlocseh - [`b4e676a`](https://github.com/eea/volto-marine-policy/commit/b4e676a445bcee52dc74b36662c36e149c74c841)]
|
|
7
20
|
### [2.0.35](https://github.com/eea/volto-marine-policy/compare/2.0.34...2.0.35) - 3 November 2025
|
|
8
21
|
|
|
9
22
|
#### :rocket: New Features
|
package/package.json
CHANGED
|
@@ -19,8 +19,7 @@ export default function DemoSitesExplorerView(props) {
|
|
|
19
19
|
: '/marine/@@demo-sites-map.arcgis.json';
|
|
20
20
|
let cases = useCases(addAppURL(cases_url));
|
|
21
21
|
const [selectedCase, onSelectedCase] = React.useState(null);
|
|
22
|
-
const {
|
|
23
|
-
// console.log('enableMarineMO', enableMarineMO);
|
|
22
|
+
const { mapVariation } = props.data;
|
|
24
23
|
const { properties } = props;
|
|
25
24
|
// if the map is rendered on the indicator page we hide the Target and
|
|
26
25
|
// the Indicator filters, and hide the chart on the right side
|
|
@@ -39,7 +38,10 @@ export default function DemoSitesExplorerView(props) {
|
|
|
39
38
|
const [filters, setFilters] = React.useState([]);
|
|
40
39
|
const [map, setMap] = React.useState();
|
|
41
40
|
const [highlightedIndex, setHighlightedIndex] = React.useState(-1);
|
|
42
|
-
const columnsLength =
|
|
41
|
+
const columnsLength =
|
|
42
|
+
hideFilters || ['blueParks', 'blueParksObj1'].includes(mapVariation)
|
|
43
|
+
? 12
|
|
44
|
+
: 8;
|
|
43
45
|
|
|
44
46
|
React.useEffect(() => {
|
|
45
47
|
const _filters = getFilters(activeItems, indicatorOnly);
|
|
@@ -60,11 +62,11 @@ export default function DemoSitesExplorerView(props) {
|
|
|
60
62
|
cases,
|
|
61
63
|
activeFilters,
|
|
62
64
|
indicatorOnly,
|
|
63
|
-
|
|
65
|
+
mapVariation,
|
|
64
66
|
);
|
|
65
67
|
|
|
66
68
|
setActiveItems(activeItems);
|
|
67
|
-
}, [activeFilters, cases, indicatorOnly,
|
|
69
|
+
}, [activeFilters, cases, indicatorOnly, mapVariation]);
|
|
68
70
|
|
|
69
71
|
if (__SERVER__) return '';
|
|
70
72
|
|
|
@@ -86,7 +88,7 @@ export default function DemoSitesExplorerView(props) {
|
|
|
86
88
|
hideFilters={hideFilters}
|
|
87
89
|
setActiveFilters={setActiveFilters}
|
|
88
90
|
highlightedIndex={highlightedIndex}
|
|
89
|
-
|
|
91
|
+
mapVariation={mapVariation}
|
|
90
92
|
/>
|
|
91
93
|
</Grid.Row>
|
|
92
94
|
<Grid.Row>
|
|
@@ -108,10 +110,13 @@ export default function DemoSitesExplorerView(props) {
|
|
|
108
110
|
setMap={setMap}
|
|
109
111
|
highlightedIndex={highlightedIndex}
|
|
110
112
|
setHighlightedIndex={setHighlightedIndex}
|
|
111
|
-
|
|
113
|
+
mapVariation={mapVariation}
|
|
112
114
|
/>
|
|
113
115
|
</Grid.Column>
|
|
114
|
-
{!(
|
|
116
|
+
{!(
|
|
117
|
+
hideFilters ||
|
|
118
|
+
['blueParks', 'blueParksObj1'].includes(mapVariation)
|
|
119
|
+
) ? (
|
|
115
120
|
<Grid.Column
|
|
116
121
|
mobile={4}
|
|
117
122
|
tablet={4}
|
|
@@ -142,7 +147,7 @@ export default function DemoSitesExplorerView(props) {
|
|
|
142
147
|
<div className="circle">
|
|
143
148
|
{/* <div className="dot-demosite"></div> */}
|
|
144
149
|
<img
|
|
145
|
-
src="/marine/europe-seas/eu-mission-restore-our-oceans-and-water/icon-point.png/@@images/image/small"
|
|
150
|
+
src="/marine/europe-seas/eu-mission-restore-our-oceans-and-water/icon-point-light.png/@@images/image/small"
|
|
146
151
|
alt=""
|
|
147
152
|
/>
|
|
148
153
|
</div>
|
|
@@ -152,7 +157,7 @@ export default function DemoSitesExplorerView(props) {
|
|
|
152
157
|
<div className="circle">
|
|
153
158
|
{/* <div className="dot-region"></div> */}
|
|
154
159
|
<img
|
|
155
|
-
src="/marine/europe-seas/eu-mission-restore-our-oceans-and-water/icon-region.png/@@images/image/small"
|
|
160
|
+
src="/marine/europe-seas/eu-mission-restore-our-oceans-and-water/icon-region-light.png/@@images/image/small"
|
|
156
161
|
alt=""
|
|
157
162
|
/>
|
|
158
163
|
</div>
|
|
@@ -165,7 +165,7 @@ export function DemoSitesFilters(props) {
|
|
|
165
165
|
hideFilters,
|
|
166
166
|
setActiveFilters,
|
|
167
167
|
highlightedIndex,
|
|
168
|
-
|
|
168
|
+
mapVariation,
|
|
169
169
|
} = props;
|
|
170
170
|
|
|
171
171
|
React.useEffect(() => {
|
|
@@ -180,7 +180,7 @@ export function DemoSitesFilters(props) {
|
|
|
180
180
|
});
|
|
181
181
|
}, []);
|
|
182
182
|
|
|
183
|
-
return !
|
|
183
|
+
return !['blueParks', 'blueParksObj1'].includes(mapVariation) ? (
|
|
184
184
|
<>
|
|
185
185
|
{!hideFilters ? (
|
|
186
186
|
<DemoSitesFilter
|
|
@@ -42,7 +42,7 @@ function DemoSitesMap(props) {
|
|
|
42
42
|
setMap,
|
|
43
43
|
highlightedIndex,
|
|
44
44
|
setHighlightedIndex,
|
|
45
|
-
|
|
45
|
+
mapVariation,
|
|
46
46
|
ol,
|
|
47
47
|
} = props;
|
|
48
48
|
const features = getFeatures({ cases: items, ol });
|
|
@@ -135,8 +135,8 @@ function DemoSitesMap(props) {
|
|
|
135
135
|
}, [map, selectedCase, resetMapButtonClass, setResetMapButtonClass, ol]);
|
|
136
136
|
|
|
137
137
|
const clusterStyle = React.useMemo(
|
|
138
|
-
() => selectedClusterStyle({ selectedCase, ol,
|
|
139
|
-
[selectedCase, ol,
|
|
138
|
+
() => selectedClusterStyle({ selectedCase, ol, mapVariation }),
|
|
139
|
+
[selectedCase, ol, mapVariation],
|
|
140
140
|
);
|
|
141
141
|
|
|
142
142
|
const MapWithSelection = React.useMemo(() => Map, []);
|
|
@@ -196,7 +196,9 @@ function DemoSitesMap(props) {
|
|
|
196
196
|
// selectedCase={selectedCase}
|
|
197
197
|
/>
|
|
198
198
|
<Layer.Tile source={tileWMSSources[0]} zIndex={0} />
|
|
199
|
-
{
|
|
199
|
+
{['blueParks', 'blueParksObj1'].includes(mapVariation) && (
|
|
200
|
+
<Layer.Tile source={arcgisSource} zIndex={0} />
|
|
201
|
+
)}
|
|
200
202
|
<Layer.Vector
|
|
201
203
|
style={clusterStyle}
|
|
202
204
|
source={clusterSource}
|
|
@@ -209,7 +211,7 @@ function DemoSitesMap(props) {
|
|
|
209
211
|
) : null;
|
|
210
212
|
}
|
|
211
213
|
|
|
212
|
-
const selectedClusterStyle = ({ selectedFeature, ol,
|
|
214
|
+
const selectedClusterStyle = ({ selectedFeature, ol, mapVariation }) => {
|
|
213
215
|
function _clusterStyle(feature, selectedFeature) {
|
|
214
216
|
const size = feature.get('features').length;
|
|
215
217
|
let clusterStyle = styleCache[size];
|
|
@@ -235,52 +237,64 @@ const selectedClusterStyle = ({ selectedFeature, ol, enableMarineMO }) => {
|
|
|
235
237
|
});
|
|
236
238
|
styleCache[size] = clusterStyle;
|
|
237
239
|
}
|
|
238
|
-
//
|
|
239
|
-
if (
|
|
240
|
-
|
|
240
|
+
// use condition size === 1 to enable clusterization
|
|
241
|
+
if (true) {
|
|
242
|
+
let iconType = '-light';
|
|
243
|
+
let iconSize = 'icon';
|
|
244
|
+
|
|
245
|
+
if ('blueParks' === mapVariation) {
|
|
241
246
|
return new ol.style.Style({
|
|
242
247
|
image: new ol.style.Icon({
|
|
243
248
|
anchor: [0.5, 1],
|
|
244
|
-
// size: [52, 52],
|
|
245
|
-
// offset: [52, 0],
|
|
246
|
-
// opacity: 1,
|
|
247
249
|
scale: 0.8,
|
|
248
250
|
src: '/marine/europe-seas/eu-mission-restore-our-oceans-and-water/icon-point.png/@@images/image/tiny',
|
|
249
251
|
}),
|
|
250
252
|
});
|
|
251
|
-
} else {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
// let color = '#0179cf';
|
|
255
|
-
// let width = feature.values_.features[0].values_['width'];
|
|
256
|
-
// let radius = feature.values_.features[0].values_['radius'];
|
|
257
|
-
|
|
258
|
-
// return new ol.style.Style({
|
|
259
|
-
// image: new ol.style.Circle({
|
|
260
|
-
// radius: radius,
|
|
261
|
-
// fill: new ol.style.Fill({
|
|
262
|
-
// color: '#fff',
|
|
263
|
-
// }),
|
|
264
|
-
// stroke: new ol.style.Stroke({
|
|
265
|
-
// color: color,
|
|
266
|
-
// width: width,
|
|
267
|
-
// }),
|
|
268
|
-
// }),
|
|
269
|
-
// });
|
|
270
|
-
let iconUrl =
|
|
271
|
-
feature.values_.features[0].values_['type_is_region'] ===
|
|
272
|
-
'Associated region'
|
|
273
|
-
? '/marine/europe-seas/eu-mission-restore-our-oceans-and-water/icon-region.png/@@images/image/icon'
|
|
274
|
-
: '/marine/europe-seas/eu-mission-restore-our-oceans-and-water/icon-point.png/@@images/image/icon';
|
|
253
|
+
} else if ('blueParksObj1' === mapVariation) {
|
|
254
|
+
iconType = '-light';
|
|
255
|
+
iconSize = 'tiny';
|
|
275
256
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
257
|
+
if (
|
|
258
|
+
['BioProtect', 'BLUE CONNECT', 'BLUE4ALL', 'EFFECTIVE'].includes(
|
|
259
|
+
feature.values_.features[0].values_['project'],
|
|
260
|
+
)
|
|
261
|
+
) {
|
|
262
|
+
iconType = '';
|
|
263
|
+
iconSize = 'tiny';
|
|
264
|
+
}
|
|
283
265
|
}
|
|
266
|
+
// let color = feature.values_.features[0].values_['color'];
|
|
267
|
+
// type_is_region
|
|
268
|
+
// let color = '#0179cf';
|
|
269
|
+
// let width = feature.values_.features[0].values_['width'];
|
|
270
|
+
// let radius = feature.values_.features[0].values_['radius'];
|
|
271
|
+
|
|
272
|
+
// return new ol.style.Style({
|
|
273
|
+
// image: new ol.style.Circle({
|
|
274
|
+
// radius: radius,
|
|
275
|
+
// fill: new ol.style.Fill({
|
|
276
|
+
// color: '#fff',
|
|
277
|
+
// }),
|
|
278
|
+
// stroke: new ol.style.Stroke({
|
|
279
|
+
// color: color,
|
|
280
|
+
// width: width,
|
|
281
|
+
// }),
|
|
282
|
+
// }),
|
|
283
|
+
// });
|
|
284
|
+
|
|
285
|
+
let iconUrl =
|
|
286
|
+
feature.values_.features[0].values_['type_is_region'] ===
|
|
287
|
+
'Associated region'
|
|
288
|
+
? `/marine/europe-seas/eu-mission-restore-our-oceans-and-water/icon-region${iconType}.png/@@images/image/${iconSize}`
|
|
289
|
+
: `/marine/europe-seas/eu-mission-restore-our-oceans-and-water/icon-point${iconType}.png/@@images/image/${iconSize}`;
|
|
290
|
+
|
|
291
|
+
return new ol.style.Style({
|
|
292
|
+
image: new ol.style.Icon({
|
|
293
|
+
anchor: [0.5, 1],
|
|
294
|
+
scale: 0.8,
|
|
295
|
+
src: iconUrl,
|
|
296
|
+
}),
|
|
297
|
+
});
|
|
284
298
|
} else {
|
|
285
299
|
return clusterStyle;
|
|
286
300
|
}
|
|
Binary file
|
|
Binary file
|
|
@@ -4,20 +4,28 @@ const DemoSitesExplorerSchema = {
|
|
|
4
4
|
{
|
|
5
5
|
id: 'default',
|
|
6
6
|
title: 'Default',
|
|
7
|
-
fields: ['
|
|
7
|
+
fields: ['mapVariation'],
|
|
8
8
|
},
|
|
9
9
|
],
|
|
10
10
|
|
|
11
11
|
properties: {
|
|
12
|
-
|
|
13
|
-
title: '
|
|
12
|
+
mapVariation: {
|
|
13
|
+
title: 'Choose the type of map',
|
|
14
14
|
description:
|
|
15
15
|
'If enabled, the Marine Protected Areas layer will be displayed on the map, without the filters and the chart on the right side',
|
|
16
|
-
type: 'boolean',
|
|
17
|
-
|
|
16
|
+
// type: 'boolean',
|
|
17
|
+
choices: [
|
|
18
|
+
['standard', 'Standard map with filters and chart'],
|
|
19
|
+
['blueParks', 'Marine protected areas map with Blue Parks projects'],
|
|
20
|
+
[
|
|
21
|
+
'blueParksObj1',
|
|
22
|
+
'Marine protected areas map with Objective 1 and Blue Parks projects',
|
|
23
|
+
],
|
|
24
|
+
],
|
|
25
|
+
default: 'standard',
|
|
18
26
|
},
|
|
19
27
|
},
|
|
20
|
-
required: ['
|
|
28
|
+
required: ['mapVariation'],
|
|
21
29
|
};
|
|
22
30
|
|
|
23
31
|
export default DemoSitesExplorerSchema;
|
|
@@ -144,12 +144,7 @@ export function getFeatures({ cases, ol }) {
|
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
export function filterCases(
|
|
148
|
-
cases,
|
|
149
|
-
activeFilters,
|
|
150
|
-
indicatorOnly,
|
|
151
|
-
enableMarineMO,
|
|
152
|
-
) {
|
|
147
|
+
export function filterCases(cases, activeFilters, indicatorOnly, mapVariation) {
|
|
153
148
|
const data = cases.filter((_case) => {
|
|
154
149
|
let flag_objective = false;
|
|
155
150
|
let flag_target = false;
|
|
@@ -163,21 +158,20 @@ export function filterCases(
|
|
|
163
158
|
return item['title'].toString();
|
|
164
159
|
});
|
|
165
160
|
if (indicators?.includes(indicatorOnly)) flag_indicatorOnly = true;
|
|
166
|
-
} else if (enableMarineMO) {
|
|
167
|
-
let indicators = _case.properties.indicators?.map((item) => {
|
|
168
|
-
return item['title'].toString();
|
|
169
|
-
});
|
|
170
|
-
if (
|
|
171
|
-
indicators?.includes('Marine protected areas') ||
|
|
172
|
-
indicators?.includes('Marine strictly protected areas')
|
|
173
|
-
)
|
|
174
|
-
flag_indicatorOnly = true;
|
|
175
161
|
} else {
|
|
176
162
|
flag_indicatorOnly = true;
|
|
177
163
|
}
|
|
178
164
|
|
|
179
165
|
// debugger;
|
|
180
|
-
if (
|
|
166
|
+
if ('blueParksObj1' === mapVariation) {
|
|
167
|
+
let objective = _case.properties.objective;
|
|
168
|
+
if (
|
|
169
|
+
objective.includes(
|
|
170
|
+
'Objective 1: Protect and restore marine and freshwater ecosystems and biodiversity',
|
|
171
|
+
)
|
|
172
|
+
)
|
|
173
|
+
flag_objective = true;
|
|
174
|
+
} else if (!activeFilters.objective_filter.length) {
|
|
181
175
|
flag_objective = true;
|
|
182
176
|
} else {
|
|
183
177
|
let objective = _case.properties.objective;
|
|
@@ -209,7 +203,16 @@ export function filterCases(
|
|
|
209
203
|
});
|
|
210
204
|
}
|
|
211
205
|
|
|
212
|
-
|
|
206
|
+
// BioProtect, BLUE CONNECT, BLUE4ALL, EFFECTIVE
|
|
207
|
+
if (['blueParks'].includes(mapVariation)) {
|
|
208
|
+
let project = _case.properties.project;
|
|
209
|
+
if (
|
|
210
|
+
['BioProtect', 'BLUE CONNECT', 'BLUE4ALL', 'EFFECTIVE'].includes(
|
|
211
|
+
project,
|
|
212
|
+
)
|
|
213
|
+
)
|
|
214
|
+
flag_project = true;
|
|
215
|
+
} else if (!activeFilters.project_filter.length) {
|
|
213
216
|
flag_project = true;
|
|
214
217
|
} else {
|
|
215
218
|
let project = _case.properties.project;
|