@eeacms/volto-marine-policy 2.0.34 → 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 CHANGED
@@ -4,11 +4,34 @@ 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.34](https://github.com/eea/volto-marine-policy/compare/2.0.33...2.0.34) - 29 October 2025
7
+ ### [2.0.36](https://github.com/eea/volto-marine-policy/compare/2.0.35...2.0.36) - 10 November 2025
8
8
 
9
- #### :bug: Bug Fixes
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)]
20
+ ### [2.0.35](https://github.com/eea/volto-marine-policy/compare/2.0.34...2.0.35) - 3 November 2025
10
21
 
11
- - fix: fix demo sites explorer base layer [laszlocseh - [`567da96`](https://github.com/eea/volto-marine-policy/commit/567da96a3ca7dd017467de768d4068919eb813a8)]
22
+ #### :rocket: New Features
23
+
24
+ - feat: new icons for Demo site explorer [laszlocseh - [`cbde97c`](https://github.com/eea/volto-marine-policy/commit/cbde97c9ff6ff209d9e3f0d4dbbf2d4338730f18)]
25
+
26
+ #### :house: Internal changes
27
+
28
+ - style: Automated code fix [eea-jenkins - [`2246072`](https://github.com/eea/volto-marine-policy/commit/22460723524bce84c7f48ed2bb8cd38e7ec78ecc)]
29
+ - style: Automated code fix [eea-jenkins - [`ac39190`](https://github.com/eea/volto-marine-policy/commit/ac39190f1c45b3f08d64222f188ae21bc924ef12)]
30
+
31
+ #### :hammer_and_wrench: Others
32
+
33
+ - fix eslint [laszlocseh - [`55aaaae`](https://github.com/eea/volto-marine-policy/commit/55aaaaeb97d54a49f8ee0acaf8b6bd8987ef1d47)]
34
+ ### [2.0.34](https://github.com/eea/volto-marine-policy/compare/2.0.33...2.0.34) - 29 October 2025
12
35
 
13
36
  ### [2.0.33](https://github.com/eea/volto-marine-policy/compare/2.0.32...2.0.33) - 22 October 2025
14
37
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-marine-policy",
3
- "version": "2.0.34",
3
+ "version": "2.0.36",
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",
@@ -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 { enableMarineMO } = props.data;
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 = hideFilters || enableMarineMO ? 12 : 8;
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
- enableMarineMO,
65
+ mapVariation,
64
66
  );
65
67
 
66
68
  setActiveItems(activeItems);
67
- }, [activeFilters, cases, indicatorOnly, enableMarineMO]);
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
- enableMarineMO={enableMarineMO}
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
- enableMarineMO={enableMarineMO}
113
+ mapVariation={mapVariation}
112
114
  />
113
115
  </Grid.Column>
114
- {!(hideFilters || enableMarineMO) ? (
116
+ {!(
117
+ hideFilters ||
118
+ ['blueParks', 'blueParksObj1'].includes(mapVariation)
119
+ ) ? (
115
120
  <Grid.Column
116
121
  mobile={4}
117
122
  tablet={4}
@@ -140,13 +145,21 @@ export default function DemoSitesExplorerView(props) {
140
145
  {/* <div className="legend-row legend-subtitle">Legend</div> */}
141
146
  <div className="legend-row">
142
147
  <div className="circle">
143
- <div className="dot-demosite"></div>
148
+ {/* <div className="dot-demosite"></div> */}
149
+ <img
150
+ src="/marine/europe-seas/eu-mission-restore-our-oceans-and-water/icon-point-light.png/@@images/image/small"
151
+ alt=""
152
+ />
144
153
  </div>
145
154
  <div>Demo site</div>
146
155
  </div>
147
156
  <div className="legend-row">
148
157
  <div className="circle">
149
- <div className="dot-region"></div>
158
+ {/* <div className="dot-region"></div> */}
159
+ <img
160
+ src="/marine/europe-seas/eu-mission-restore-our-oceans-and-water/icon-region-light.png/@@images/image/small"
161
+ alt=""
162
+ />
150
163
  </div>
151
164
  <div>Associated region</div>
152
165
  </div>
@@ -165,7 +165,7 @@ export function DemoSitesFilters(props) {
165
165
  hideFilters,
166
166
  setActiveFilters,
167
167
  highlightedIndex,
168
- enableMarineMO,
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 !enableMarineMO ? (
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
- enableMarineMO,
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, enableMarineMO }),
139
- [selectedCase, ol, enableMarineMO],
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
- {enableMarineMO && <Layer.Tile source={arcgisSource} zIndex={0} />}
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, enableMarineMO }) => {
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,40 +237,64 @@ const selectedClusterStyle = ({ selectedFeature, ol, enableMarineMO }) => {
235
237
  });
236
238
  styleCache[size] = clusterStyle;
237
239
  }
238
- // set size === 1 to enable clusterization
239
- if (size) {
240
- if (enableMarineMO) {
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
- // let color = feature.values_.features[0].values_['color'];
253
- let color = '#0179cf';
254
- let width = feature.values_.features[0].values_['width'];
255
- let radius = feature.values_.features[0].values_['radius'];
256
- // console.log(color)
257
- // let color = '#0083E0'; // #0083E0 #50B0A4
253
+ } else if ('blueParksObj1' === mapVariation) {
254
+ iconType = '-light';
255
+ iconSize = 'tiny';
258
256
 
259
- return new ol.style.Style({
260
- image: new ol.style.Circle({
261
- radius: radius,
262
- fill: new ol.style.Fill({
263
- color: '#fff',
264
- }),
265
- stroke: new ol.style.Stroke({
266
- color: color,
267
- width: width,
268
- }),
269
- }),
270
- });
257
+ if (
258
+ ['BioProtect', 'BLUE CONNECT', 'BLUE4ALL', 'EFFECTIVE'].includes(
259
+ feature.values_.features[0].values_['project'],
260
+ )
261
+ ) {
262
+ iconType = '';
263
+ iconSize = 'tiny';
264
+ }
271
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
+ });
272
298
  } else {
273
299
  return clusterStyle;
274
300
  }
@@ -4,20 +4,28 @@ const DemoSitesExplorerSchema = {
4
4
  {
5
5
  id: 'default',
6
6
  title: 'Default',
7
- fields: ['enableMarineMO'],
7
+ fields: ['mapVariation'],
8
8
  },
9
9
  ],
10
10
 
11
11
  properties: {
12
- enableMarineMO: {
13
- title: 'Enable Marine Protected Areas layer',
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
- default: false,
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: ['enableMarineMO'],
28
+ required: ['mapVariation'],
21
29
  };
22
30
 
23
31
  export default DemoSitesExplorerSchema;
@@ -433,12 +433,11 @@
433
433
 
434
434
  .circle {
435
435
  position: relative;
436
- width: 22px;
436
+ width: 30px;
437
437
  min-width: 22px;
438
438
  height: 22px;
439
439
  border-radius: 50%;
440
- // background-color: #007265;
441
- background-color: #0179cf;
440
+ // background-color: #0179cf;
442
441
  gap: 0.5em;
443
442
  }
444
443
 
@@ -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 (!activeFilters.objective_filter.length) {
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
- if (!activeFilters.project_filter.length) {
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;