@eeacms/volto-bise-policy 1.2.29 → 1.2.30

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,6 +4,16 @@ 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
+ ### [1.2.30](https://github.com/eea/volto-bise-policy/compare/1.2.29...1.2.30) - 7 November 2025
8
+
9
+ #### :rocket: New Features
10
+
11
+ - feat: update EUNIS marine habitat widgets [laszlocseh - [`702fe69`](https://github.com/eea/volto-bise-policy/commit/702fe69ff8d69c6bd7c130bb12fd57f346b534fd)]
12
+
13
+ #### :house: Internal changes
14
+
15
+ - style: Automated code fix [eea-jenkins - [`e880e27`](https://github.com/eea/volto-bise-policy/commit/e880e27804d16e394b3d5fc9ced17168a68157bf)]
16
+
7
17
  ### [1.2.29](https://github.com/eea/volto-bise-policy/compare/1.2.28...1.2.29) - 5 November 2025
8
18
 
9
19
  #### :rocket: New Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-bise-policy",
3
- "version": "1.2.29",
3
+ "version": "1.2.30",
4
4
  "description": "@eeacms/volto-bise-policy: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -251,6 +251,22 @@ export const EUNISMSFDView = ({ value }) => {
251
251
  );
252
252
  };
253
253
 
254
+ export const EUNISCodeView = ({ value }) => {
255
+ if (!value) return value;
256
+
257
+ return (
258
+ <span>
259
+ <a
260
+ href={`/habitats_eunis_revised/EUNISrev_${value}`}
261
+ target="_blank"
262
+ rel="noopener"
263
+ >
264
+ {value}
265
+ </a>
266
+ </span>
267
+ );
268
+ };
269
+
254
270
  export const EUNISHDView = ({ value }) => {
255
271
  let parsedValue = value;
256
272
 
@@ -279,7 +295,62 @@ export const EUNISHDView = ({ value }) => {
279
295
  <a href={item.link}>{item.value}</a>
280
296
  </>
281
297
  ) : (
282
- `${item.relation}${item.value}`
298
+ <>
299
+ <span>{item.relation}</span>
300
+ <a
301
+ href={`/habitats/ANNEX1_${item.value}`}
302
+ target="_blank"
303
+ rel="noopener"
304
+ >
305
+ {item.value}
306
+ </a>
307
+ </>
308
+ )}
309
+ </div>
310
+ </div>
311
+ ))}
312
+ </div>
313
+ );
314
+ };
315
+
316
+ export const EUNISEuropeanRedListView = ({ value }) => {
317
+ let parsedValue = value;
318
+
319
+ if (typeof value === 'string') {
320
+ try {
321
+ parsedValue = JSON.parse(value);
322
+ } catch (e) {
323
+ return null;
324
+ }
325
+ }
326
+
327
+ const items = Array.isArray(parsedValue)
328
+ ? parsedValue
329
+ : parsedValue?.value || [];
330
+
331
+ if (!items || items.length === 0) return null;
332
+
333
+ return (
334
+ <div className="eunis-widget-view">
335
+ {items.map((item) => (
336
+ <div key={item['@id']} className="msfd-item">
337
+ <div>
338
+ {item.link ? (
339
+ <>
340
+ <span>{item.relation}</span>
341
+ <a href={item.link}>{item.value}</a>
342
+ </>
343
+ ) : (
344
+ <>
345
+ <span>{item.relation}</span>
346
+ <a
347
+ href={`/habitats_rl/REDLIST_${item.value.split(' - ')[1]}`}
348
+ target="_blank"
349
+ rel="noopener"
350
+ >
351
+ {item.value}
352
+ </a>
353
+ </>
283
354
  )}
284
355
  </div>
285
356
  </div>
@@ -315,7 +386,15 @@ export const EUNISLinksToFinerEUNISHabitatsView = ({ value }) => {
315
386
  <a href={item.link}>{item.value}</a>
316
387
  </>
317
388
  ) : (
318
- `${item.value}`
389
+ <>
390
+ <a
391
+ href={`/habitats_eunis_revised/EUNISrev_${item.value}`}
392
+ target="_blank"
393
+ rel="noopener"
394
+ >
395
+ {item.value}
396
+ </a>
397
+ </>
319
398
  )}
320
399
  </div>
321
400
  </div>
@@ -360,7 +439,6 @@ export const EUNISCountryCodeView = ({ value }) => {
360
439
  ));
361
440
  };
362
441
 
363
- export const EUNISEuropeanRedListView = EUNISHDView;
364
442
  export const EUNISRegionalSeaConventionValueView = EUNISMSFDView;
365
443
 
366
444
  const msfdSchema = {
@@ -397,7 +475,7 @@ const hdSchema = {
397
475
  {
398
476
  id: 'default',
399
477
  title: 'default',
400
- fields: ['relation', 'value', 'link'],
478
+ fields: ['relation', 'value'],
401
479
  },
402
480
  ],
403
481
  properties: {
@@ -429,7 +507,7 @@ const europeanRedlistSchema = {
429
507
  {
430
508
  id: 'default',
431
509
  title: 'default',
432
- fields: ['relation', 'value', 'link'],
510
+ fields: ['relation', 'value'],
433
511
  },
434
512
  ],
435
513
  properties: {
@@ -462,7 +540,7 @@ const linksToFinerEUNISHabitatsSchema = {
462
540
  {
463
541
  id: 'default',
464
542
  title: 'default',
465
- fields: ['value', 'link'],
543
+ fields: ['value'],
466
544
  },
467
545
  ],
468
546
  properties: {
package/src/index.js CHANGED
@@ -11,6 +11,7 @@ import biseWhiteLogo from '@eeacms/volto-bise-policy/../theme/assets/images/Head
11
11
  import ecLogo from '@eeacms/volto-bise-policy/../theme/assets/logos/logo-ec.svg';
12
12
 
13
13
  import {
14
+ EUNISCodeView,
14
15
  EUNISMSFDWidget,
15
16
  EUNISMSFDView,
16
17
  EUNISHDWidget,
@@ -254,6 +255,7 @@ const applyConfig = (config) => {
254
255
  config.widgets.id.eunis_msfd_relevant_classification_json = EUNISMSFDWidget;
255
256
  config.widgets.views.id.eunis_msfd_relevant_classification_json =
256
257
  EUNISMSFDView;
258
+ config.widgets.views.id.eunis_code = EUNISCodeView;
257
259
 
258
260
  return config;
259
261
  };