@eeacms/volto-bise-policy 1.3.9 → 1.3.11
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 +21 -29
- package/package.json +1 -1
- package/src/components/Widgets/NRRWidgets.jsx +28 -0
- package/src/components/manage/Blocks/CaseStudyExplorer/CaseStudyExplorerView.jsx +2 -1
- package/src/components/manage/Blocks/CaseStudyExplorer/CaseStudyFilters.jsx +20 -8
- package/src/components/manage/Blocks/CaseStudyExplorer/FeatureDisplay.jsx +9 -26
- package/src/components/manage/Blocks/CaseStudyExplorer/FeatureDisplay.test.jsx +17 -0
- package/src/components/manage/Blocks/CaseStudyExplorer/InfoOverlay.jsx +34 -5
- package/src/components/manage/Blocks/CaseStudyExplorer/InfoOverlay.test.jsx +22 -1
- package/src/components/manage/Blocks/CaseStudyExplorer/styles.less +25 -4
- package/src/components/manage/Blocks/CaseStudyExplorer/utils.js +4 -2
- package/src/components/manage/Blocks/CaseStudyExplorer/utils.test.js +15 -6
- package/src/index.js +14 -4
- package/theme/globals/natura2000.less +54 -10
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,27 @@ 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.3.11](https://github.com/eea/volto-bise-policy/compare/1.3.10...1.3.11) - 28 October 2026
|
|
8
|
+
|
|
9
|
+
#### :house: Internal changes
|
|
10
|
+
|
|
11
|
+
- style(natura2000): add habitat section styles [laszlocseh - [`f816db5`](https://github.com/eea/volto-bise-policy/commit/f816db5c2dc08ea8cb9c24f6e6c97f91468d676d)]
|
|
12
|
+
|
|
13
|
+
### [1.3.10](https://github.com/eea/volto-bise-policy/compare/1.3.9...1.3.10) - 21 September 2026
|
|
14
|
+
|
|
15
|
+
#### :rocket: New Features
|
|
16
|
+
|
|
17
|
+
- feat(CaseStudyExplorer): add image and link icon to feature popup [laszlocseh - [`ceba7db`](https://github.com/eea/volto-bise-policy/commit/ceba7db816f00fd430edab13812aac348a3042c2)]
|
|
18
|
+
- feat: replace NRR article with legislation and biogeographical region filters [laszlocseh - [`6f6c0b4`](https://github.com/eea/volto-bise-policy/commit/6f6c0b479f046977a8ff63524f7db32ebdb1ae03)]
|
|
19
|
+
|
|
20
|
+
#### :nail_care: Enhancements
|
|
21
|
+
|
|
22
|
+
- refactor(CaseStudyExplorer): use Image component in FeatureDisplay [laszlocseh - [`19e4a0f`](https://github.com/eea/volto-bise-policy/commit/19e4a0fa357391ab96a12c676ae79c3501f0a2ba)]
|
|
23
|
+
|
|
24
|
+
#### :house: Internal changes
|
|
25
|
+
|
|
26
|
+
- style: Automated code fix [eea-jenkins - [`9df6965`](https://github.com/eea/volto-bise-policy/commit/9df696548aac424140d0db0b1f1181a19c8ba2a0)]
|
|
27
|
+
|
|
7
28
|
### [1.3.9](https://github.com/eea/volto-bise-policy/compare/1.3.8...1.3.9) - 27 August 2026
|
|
8
29
|
|
|
9
30
|
#### :bug: Bug Fixes
|
|
@@ -92,10 +113,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
92
113
|
- enable attributions for osm [Claudia Ifrim - [`de583af`](https://github.com/eea/volto-bise-policy/commit/de583af4eff7c7a3a91a9845eb372e2bfa86fec1)]
|
|
93
114
|
### [1.3.3](https://github.com/eea/volto-bise-policy/compare/1.3.2...1.3.3) - 9 July 2026
|
|
94
115
|
|
|
95
|
-
#### :house: Internal changes
|
|
96
|
-
|
|
97
|
-
- chore: [JENKINSFILE] sanitize sonarqube command [valentinab25 - [`8e2dc1a`](https://github.com/eea/volto-bise-policy/commit/8e2dc1a14f3230f197f009a76bf87587724b6e3a)]
|
|
98
|
-
|
|
99
116
|
#### :hammer_and_wrench: Others
|
|
100
117
|
|
|
101
118
|
- test: pin Chromium version 149 to work with Cypress [valentinab25 - [`5841387`](https://github.com/eea/volto-bise-policy/commit/5841387ae59380ee15af8c82a4df81c4767e1b7c)]
|
|
@@ -121,7 +138,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
121
138
|
|
|
122
139
|
#### :hammer_and_wrench: Others
|
|
123
140
|
|
|
124
|
-
- update jenkinsfile [nileshgulia1 - [`84315d2`](https://github.com/eea/volto-bise-policy/commit/84315d29e36427a50fcc1a939c9e650b69bd81f2)]
|
|
125
141
|
- fix sonarqube [nileshgulia1 - [`2da4f19`](https://github.com/eea/volto-bise-policy/commit/2da4f1921027093a95d9011ef3ff8d2977fc0dcc)]
|
|
126
142
|
- fix duplicated code [nileshgulia1 - [`91cdb7a`](https://github.com/eea/volto-bise-policy/commit/91cdb7ad2221506a15ed988e28c7e918b07bcbbf)]
|
|
127
143
|
- fix slashmenu styles on content box [nileshgulia1 - [`13765ad`](https://github.com/eea/volto-bise-policy/commit/13765ad26acc9af1f1066b164b4c58393b902c01)]
|
|
@@ -147,7 +163,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
147
163
|
|
|
148
164
|
#### :hammer_and_wrench: Others
|
|
149
165
|
|
|
150
|
-
- update jenkinsfile [nileshgulia1 - [`84315d2`](https://github.com/eea/volto-bise-policy/commit/84315d29e36427a50fcc1a939c9e650b69bd81f2)]
|
|
151
166
|
- fix sonarqube [nileshgulia1 - [`2da4f19`](https://github.com/eea/volto-bise-policy/commit/2da4f1921027093a95d9011ef3ff8d2977fc0dcc)]
|
|
152
167
|
- fix duplicated code [nileshgulia1 - [`91cdb7a`](https://github.com/eea/volto-bise-policy/commit/91cdb7ad2221506a15ed988e28c7e918b07bcbbf)]
|
|
153
168
|
- fix slashmenu styles on content box [nileshgulia1 - [`13765ad`](https://github.com/eea/volto-bise-policy/commit/13765ad26acc9af1f1066b164b4c58393b902c01)]
|
|
@@ -196,11 +211,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
196
211
|
- Remove z-index styles from header and toolbar [dobri1408 - [`4fc001e`](https://github.com/eea/volto-bise-policy/commit/4fc001e8e0336540b08b685eed42060fd9ca4190)]
|
|
197
212
|
### [1.2.39](https://github.com/eea/volto-bise-policy/compare/1.2.38...1.2.39) - 24 February 2026
|
|
198
213
|
|
|
199
|
-
#### :house: Internal changes
|
|
200
|
-
|
|
201
|
-
- chore: [JENKINSFILE] add package version in sonarqube [valentinab25 - [`4c2d75b`](https://github.com/eea/volto-bise-policy/commit/4c2d75bbf6dca47929c6613749169b40ed483985)]
|
|
202
|
-
- chore: [JENKINSFILE] use sonarqube branches [EEA Jenkins - [`f99c622`](https://github.com/eea/volto-bise-policy/commit/f99c622726cfd711704f50218a2f1fe833974ec3)]
|
|
203
|
-
|
|
204
214
|
#### :hammer_and_wrench: Others
|
|
205
215
|
|
|
206
216
|
- add eea brand colors [Dobricean Ioan Dorian - [`ba09f05`](https://github.com/eea/volto-bise-policy/commit/ba09f05dc50952cccd9e3acb8ee2938600b20f9f)]
|
|
@@ -462,7 +472,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
462
472
|
- chore: customize root theme to use volto-spotlight - refs #259794 [ana-oprea - [`347f96e`](https://github.com/eea/volto-bise-policy/commit/347f96e335139f9656abd34c308c531b05de85e7)]
|
|
463
473
|
- chore: change the theme and alias to volto-spotlight and add volto-spotlight to package.json - refs #259794 [ana-oprea - [`52732a1`](https://github.com/eea/volto-bise-policy/commit/52732a17b3247a04ffae0a3f5118e173afa98157)]
|
|
464
474
|
- chore: change theme to eea-volto-theme, change config.alias - refs #259794 [ana-oprea - [`c2d08ea`](https://github.com/eea/volto-bise-policy/commit/c2d08ea08a7f0e5f6f7d32149e60ea3f3e901923)]
|
|
465
|
-
- chore: [JENKINS] Refactor automated testing [valentinab25 - [`a3c9488`](https://github.com/eea/volto-bise-policy/commit/a3c9488c5d09ba97fe5976675524d436080a2460)]
|
|
466
475
|
- chore: husky, lint-staged use fixed versions [valentinab25 - [`fddc30f`](https://github.com/eea/volto-bise-policy/commit/fddc30f11a1d8ec290edaca2d924282f5e113bc6)]
|
|
467
476
|
- chore:volto 16 in tests, update docs, fix stylelint overrides [valentinab25 - [`005ce74`](https://github.com/eea/volto-bise-policy/commit/005ce742dbd014fde27e417059251233365766dd)]
|
|
468
477
|
|
|
@@ -472,23 +481,11 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
472
481
|
- fix tests [Claudia Ifrim - [`a8fc12f`](https://github.com/eea/volto-bise-policy/commit/a8fc12fbf962289c1aac42f4b54352bb585af735)]
|
|
473
482
|
- test: in cypress don't wait for breadcrumbs [ana-oprea - [`89e3810`](https://github.com/eea/volto-bise-policy/commit/89e38104e6f8292cdbf2b948f7fe4b7dc064bcef)]
|
|
474
483
|
- Replace norefferer with noopener for links that open in new tab [David Ichim - [`ef3781a`](https://github.com/eea/volto-bise-policy/commit/ef3781ac7368bf8f497082aaee0c63538c0760da)]
|
|
475
|
-
- test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`c1277ba`](https://github.com/eea/volto-bise-policy/commit/c1277bacf840ee9feccbfd6a2c85f0b25a9a9125)]
|
|
476
|
-
- test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`c944153`](https://github.com/eea/volto-bise-policy/commit/c944153710fd53c5d48863cf363464273e25f52e)]
|
|
477
|
-
- test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`d648d52`](https://github.com/eea/volto-bise-policy/commit/d648d525a2fc5076577fe0f75ff9782bf0d1d4e9)]
|
|
478
|
-
- test: [JENKINS] fix jest config, fail with logs on coverage [valentinab25 - [`2a7affe`](https://github.com/eea/volto-bise-policy/commit/2a7affe33d737704bdba117c4a5c8c6748ef7a47)]
|
|
479
|
-
- test: [JENKINS] fix jest config, fail with logs on coverage [valentinab25 - [`5929642`](https://github.com/eea/volto-bise-policy/commit/59296420105d0e8c1f1547aa0cd17a019e478c2b)]
|
|
480
|
-
- test: [JENKINS] fix jest config, fail with logs on coverage [valentinab25 - [`b1142f1`](https://github.com/eea/volto-bise-policy/commit/b1142f1da3667a9f56720f65bebce897a5dd8005)]
|
|
481
484
|
- test: cypress should not wait for navigation, actions, types - refs #259794 [ana-oprea - [`188637c`](https://github.com/eea/volto-bise-policy/commit/188637c78a0cae71b5ee48022507d559dfaceb3e)]
|
|
482
|
-
- test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`fa4e473`](https://github.com/eea/volto-bise-policy/commit/fa4e473018386ec3f09d7300d655c8cccdc19a0e)]
|
|
483
|
-
- test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`1d9135b`](https://github.com/eea/volto-bise-policy/commit/1d9135bb878b3c7a1b828085b99b9d27d78ce60e)]
|
|
484
485
|
- remove cypress tests as it doesn t work on bise [Dobricean Ioan Dorian - [`ba7e2de`](https://github.com/eea/volto-bise-policy/commit/ba7e2defea2dcfd01537c3abb41fa9515ff0a3e3)]
|
|
485
486
|
- add mega menu layout settings as #259794 said [dobri1408 - [`b9a3683`](https://github.com/eea/volto-bise-policy/commit/b9a3683e7d85f8c88ad8feac975c47c434f62c4a)]
|
|
486
|
-
- test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`9181908`](https://github.com/eea/volto-bise-policy/commit/9181908c7f4b51bdf83a34f8c7f25827de9b1cc6)]
|
|
487
|
-
- test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`099d796`](https://github.com/eea/volto-bise-policy/commit/099d79669471e6924bf1e0bc51a79d54379c3a1a)]
|
|
488
|
-
- test: [JENKINS] Improve cypress time [valentinab25 - [`6d5d8e2`](https://github.com/eea/volto-bise-policy/commit/6d5d8e29b04ddb92628245570055067ca3dcbb6c)]
|
|
489
487
|
- test: fix comment [valentinab25 - [`4f27d5a`](https://github.com/eea/volto-bise-policy/commit/4f27d5af2e8895c7af4f1157521ca42682b96e23)]
|
|
490
488
|
- test: EN locales, pre-commit fix, feature PRs checks Refs #257193 [valentinab25 - [`4c2fcb0`](https://github.com/eea/volto-bise-policy/commit/4c2fcb01065e1ef962317ba7be788fd1df079618)]
|
|
491
|
-
- test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`89afaa1`](https://github.com/eea/volto-bise-policy/commit/89afaa15892930452027ef8c8593fc6d193cda70)]
|
|
492
489
|
### [1.2.7](https://github.com/eea/volto-bise-policy/compare/1.2.6...1.2.7) - 9 August 2023
|
|
493
490
|
|
|
494
491
|
#### :house: Documentation changes
|
|
@@ -609,10 +606,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
609
606
|
|
|
610
607
|
- feat(package.json): add @eeacms/volto-block-toc addon to addons list [Miu Razvan - [`ba5d5e6`](https://github.com/eea/volto-bise-policy/commit/ba5d5e6931b5ec324f6aa8c6b735e17963e71db2)]
|
|
611
608
|
|
|
612
|
-
#### :house: Internal changes
|
|
613
|
-
|
|
614
|
-
- chore(Jenkinsfile): remove VOLTO variable value [Miu Razvan - [`2c64b0d`](https://github.com/eea/volto-bise-policy/commit/2c64b0d534f670a5a8300927b10c398a3dba05ae)]
|
|
615
|
-
|
|
616
609
|
#### :hammer_and_wrench: Others
|
|
617
610
|
|
|
618
611
|
- update [Miu Razvan - [`639f91a`](https://github.com/eea/volto-bise-policy/commit/639f91a3830640e0d9062b136dd8184027d288f7)]
|
|
@@ -630,7 +623,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
630
623
|
- Add missing dependencies [Miu Razvan - [`3712bf8`](https://github.com/eea/volto-bise-policy/commit/3712bf85fc537fa5448d80242fed56b26e33855b)]
|
|
631
624
|
- Prepare 1.0.0 release [Miu Razvan - [`fbb707d`](https://github.com/eea/volto-bise-policy/commit/fbb707d01afe6642a223e2fb3e88abb677de241e)]
|
|
632
625
|
- Update [Miu Razvan - [`487a390`](https://github.com/eea/volto-bise-policy/commit/487a3900f707d88a40d435d88ff6072f1eb9698f)]
|
|
633
|
-
- Fix Jenkinsfile [Miu Razvan - [`96f92cc`](https://github.com/eea/volto-bise-policy/commit/96f92cc4f14b066ced8ec1c6e48a782780f10d80)]
|
|
634
626
|
- Rename to volto-bise-policy [Miu Razvan - [`045b4aa`](https://github.com/eea/volto-bise-policy/commit/045b4aa61164c51db36db40fee1151d31829b9fa)]
|
|
635
627
|
### 0.1.0 - 7 December 2022
|
|
636
628
|
|
package/package.json
CHANGED
|
@@ -85,6 +85,34 @@ export const NRRArticleView = ({ value }) => {
|
|
|
85
85
|
);
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
+
export const NRRLegislationView = ({ value }) => {
|
|
89
|
+
const items = parseItems(value);
|
|
90
|
+
if (items.length === 0) return null;
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<InlineList
|
|
94
|
+
label="NRR Legislation"
|
|
95
|
+
secondary
|
|
96
|
+
items={items}
|
|
97
|
+
render={(item) => item.title}
|
|
98
|
+
/>
|
|
99
|
+
);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const NRRBiogeographicalRegionView = ({ value }) => {
|
|
103
|
+
const items = parseItems(value);
|
|
104
|
+
if (items.length === 0) return null;
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<InlineList
|
|
108
|
+
label="Biogeographical region"
|
|
109
|
+
secondary
|
|
110
|
+
items={items}
|
|
111
|
+
render={(item) => item.title}
|
|
112
|
+
/>
|
|
113
|
+
);
|
|
114
|
+
};
|
|
115
|
+
|
|
88
116
|
export const NRRrelatedCaseStudiesView = ({ value }) => {
|
|
89
117
|
const items = parseItems(value);
|
|
90
118
|
if (items.length === 0) return null;
|
|
@@ -21,11 +21,12 @@ export default function CaseStudyExplorerView(props) {
|
|
|
21
21
|
const hideFilters = caseStudiesIds ? true : false;
|
|
22
22
|
|
|
23
23
|
const [activeFilters, setActiveFilters] = React.useState({
|
|
24
|
+
nrr_legislation: [],
|
|
25
|
+
nrr_biogeographical_region: [],
|
|
24
26
|
measures_implemented: [],
|
|
25
27
|
typology_of_measures: [],
|
|
26
28
|
current_status: [],
|
|
27
29
|
habitat_ecosystem_type: [],
|
|
28
|
-
nrr_article: [],
|
|
29
30
|
scale_of_planning: [],
|
|
30
31
|
});
|
|
31
32
|
|
|
@@ -114,6 +114,16 @@ function CaseStudyFiltersComponent(props) {
|
|
|
114
114
|
|
|
115
115
|
return (
|
|
116
116
|
<>
|
|
117
|
+
<CaseStudyFilter
|
|
118
|
+
filterTitle="Legislation"
|
|
119
|
+
filterName="nrr_legislation"
|
|
120
|
+
{...props}
|
|
121
|
+
/>
|
|
122
|
+
<CaseStudyFilter
|
|
123
|
+
filterTitle="Biogeographical region"
|
|
124
|
+
filterName="nrr_biogeographical_region"
|
|
125
|
+
{...props}
|
|
126
|
+
/>
|
|
117
127
|
<CaseStudyFilter
|
|
118
128
|
filterTitle="Measures"
|
|
119
129
|
filterName="measures_implemented"
|
|
@@ -144,11 +154,6 @@ function CaseStudyFiltersComponent(props) {
|
|
|
144
154
|
filterName="habitat_ecosystem_type"
|
|
145
155
|
{...props}
|
|
146
156
|
/>
|
|
147
|
-
<CaseStudyFilter
|
|
148
|
-
filterTitle="NRR Article"
|
|
149
|
-
filterName="nrr_article"
|
|
150
|
-
{...props}
|
|
151
|
-
/>
|
|
152
157
|
<CaseStudyFilter
|
|
153
158
|
filterTitle="Scale of Planning"
|
|
154
159
|
filterName="scale_of_planning"
|
|
@@ -347,9 +352,16 @@ function ActiveFiltersComponent(props) {
|
|
|
347
352
|
onRemoveFilter={removeFilter}
|
|
348
353
|
/>
|
|
349
354
|
<FilterGroup
|
|
350
|
-
filterName="
|
|
351
|
-
filterLabel="
|
|
352
|
-
activeFilterCodes={activeFilters.
|
|
355
|
+
filterName="nrr_legislation"
|
|
356
|
+
filterLabel="Legislation:"
|
|
357
|
+
activeFilterCodes={activeFilters.nrr_legislation}
|
|
358
|
+
filters={filters}
|
|
359
|
+
onRemoveFilter={removeFilter}
|
|
360
|
+
/>
|
|
361
|
+
<FilterGroup
|
|
362
|
+
filterName="nrr_biogeographical_region"
|
|
363
|
+
filterLabel="Biogeographical region:"
|
|
364
|
+
activeFilterCodes={activeFilters.nrr_biogeographical_region}
|
|
353
365
|
filters={filters}
|
|
354
366
|
onRemoveFilter={removeFilter}
|
|
355
367
|
/>
|
|
@@ -1,41 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import Image from '@plone/volto/components/theme/Image/Image';
|
|
2
3
|
|
|
3
4
|
export default function FeatureDisplay({ feature }) {
|
|
4
5
|
return feature ? (
|
|
5
6
|
<div id="csepopup">
|
|
7
|
+
{feature.image ? (
|
|
8
|
+
<Image
|
|
9
|
+
className="csepopup-image"
|
|
10
|
+
src={feature.image}
|
|
11
|
+
alt={feature.title || ''}
|
|
12
|
+
/>
|
|
13
|
+
) : null}
|
|
6
14
|
<h3>
|
|
7
15
|
<strong>
|
|
8
16
|
<a target="_blank" rel="noopener noreferrer" href={feature.path}>
|
|
9
17
|
{feature.title}
|
|
18
|
+
<i class="ri-external-link-line"></i>
|
|
10
19
|
</a>
|
|
11
20
|
</strong>
|
|
12
21
|
</h3>
|
|
13
|
-
{/* <div>
|
|
14
|
-
<h4>Measures implemented</h4>
|
|
15
|
-
<ul>
|
|
16
|
-
{feature.measures_implemented.map((item, index) => {
|
|
17
|
-
return (
|
|
18
|
-
<li key={index}>
|
|
19
|
-
<a
|
|
20
|
-
target="_blank"
|
|
21
|
-
rel="noopener noreferrer"
|
|
22
|
-
href={item['path']}
|
|
23
|
-
>
|
|
24
|
-
{item['title']}
|
|
25
|
-
</a>
|
|
26
|
-
</li>
|
|
27
|
-
);
|
|
28
|
-
})}
|
|
29
|
-
</ul>
|
|
30
|
-
</div> */}
|
|
31
|
-
{/* <div>
|
|
32
|
-
<h4>typology_of_measures </h4>
|
|
33
|
-
<ul>
|
|
34
|
-
{feature.typology_of_measures.map((item, index) => {
|
|
35
|
-
return <li key={index}>{item}</li>;
|
|
36
|
-
})}
|
|
37
|
-
</ul>
|
|
38
|
-
</div> */}
|
|
39
22
|
</div>
|
|
40
23
|
) : null;
|
|
41
24
|
}
|
|
@@ -9,6 +9,7 @@ describe('FeatureDisplay Component', () => {
|
|
|
9
9
|
const feature = {
|
|
10
10
|
title: 'Sample Feature',
|
|
11
11
|
path: 'https://example.com/sample-feature',
|
|
12
|
+
image: 'https://example.com/preview.jpg',
|
|
12
13
|
measures_implemented: [
|
|
13
14
|
{ path: 'https://example.com/nwrm-1', title: 'NWRM 1' },
|
|
14
15
|
{ path: 'https://example.com/nwrm-2', title: 'NWRM 2' },
|
|
@@ -23,6 +24,22 @@ describe('FeatureDisplay Component', () => {
|
|
|
23
24
|
'href',
|
|
24
25
|
'https://example.com/sample-feature',
|
|
25
26
|
);
|
|
27
|
+
expect(getByRole('img')).toHaveAttribute(
|
|
28
|
+
'src',
|
|
29
|
+
'https://example.com/preview.jpg',
|
|
30
|
+
);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('does not render an image when the feature has none', () => {
|
|
34
|
+
const { queryByRole, getByRole } = render(
|
|
35
|
+
<FeatureDisplay feature={{ title: 'No image', path: '/no-image' }} />,
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
expect(queryByRole('img')).not.toBeInTheDocument();
|
|
39
|
+
expect(getByRole('link', { name: 'No image' })).toHaveAttribute(
|
|
40
|
+
'href',
|
|
41
|
+
'/no-image',
|
|
42
|
+
);
|
|
26
43
|
});
|
|
27
44
|
|
|
28
45
|
it('renders nothing when feature is null', () => {
|
|
@@ -14,6 +14,17 @@ function InfoOverlay({
|
|
|
14
14
|
const { map } = useMapContext();
|
|
15
15
|
const [tooltip, setTooltipRef] = React.useState();
|
|
16
16
|
const [showTooltip, setShowTooltip] = React.useState();
|
|
17
|
+
const overlayRef = React.useRef(null);
|
|
18
|
+
|
|
19
|
+
// `ol` is a fresh object literal on every render (see withOpenLayers) and
|
|
20
|
+
// `onFeatureSelect`/`hideFilters` can change identity; keep them in refs so
|
|
21
|
+
// the overlay and its map handler are created only once per mount.
|
|
22
|
+
const olRef = React.useRef(ol);
|
|
23
|
+
olRef.current = ol;
|
|
24
|
+
const onFeatureSelectRef = React.useRef(onFeatureSelect);
|
|
25
|
+
onFeatureSelectRef.current = onFeatureSelect;
|
|
26
|
+
const hideFiltersRef = React.useRef(hideFilters);
|
|
27
|
+
hideFiltersRef.current = hideFilters;
|
|
17
28
|
|
|
18
29
|
const prevLayerId = usePrevious(layerId);
|
|
19
30
|
|
|
@@ -26,12 +37,13 @@ function InfoOverlay({
|
|
|
26
37
|
React.useEffect(() => {
|
|
27
38
|
if (!(map && tooltip)) return;
|
|
28
39
|
|
|
29
|
-
const overlay = new
|
|
30
|
-
element:
|
|
40
|
+
const overlay = new olRef.current.Overlay({
|
|
41
|
+
element: tooltip,
|
|
31
42
|
positioning: 'bottom-center',
|
|
32
43
|
offset: [0, -10],
|
|
33
44
|
stopEvent: false,
|
|
34
45
|
});
|
|
46
|
+
overlayRef.current = overlay;
|
|
35
47
|
map.addOverlay(overlay);
|
|
36
48
|
|
|
37
49
|
function handler(evt) {
|
|
@@ -41,7 +53,7 @@ function InfoOverlay({
|
|
|
41
53
|
|
|
42
54
|
if (
|
|
43
55
|
features.length &&
|
|
44
|
-
!
|
|
56
|
+
!hideFiltersRef.current // && !isCluster(features)
|
|
45
57
|
) {
|
|
46
58
|
setShowTooltip(true);
|
|
47
59
|
} else {
|
|
@@ -49,7 +61,7 @@ function InfoOverlay({
|
|
|
49
61
|
if (evt.originalEvent.target.tagName === 'A') return;
|
|
50
62
|
setShowTooltip(false);
|
|
51
63
|
popupOverlay.style.display = 'none';
|
|
52
|
-
|
|
64
|
+
onFeatureSelectRef.current(null);
|
|
53
65
|
}
|
|
54
66
|
}
|
|
55
67
|
|
|
@@ -58,8 +70,25 @@ function InfoOverlay({
|
|
|
58
70
|
return () => {
|
|
59
71
|
map.un('click', handler);
|
|
60
72
|
map.removeOverlay(overlay);
|
|
73
|
+
overlayRef.current = null;
|
|
61
74
|
};
|
|
62
|
-
}, [map, tooltip
|
|
75
|
+
}, [map, tooltip]);
|
|
76
|
+
|
|
77
|
+
// Anchor the popup to the selected case study and show it above the marker.
|
|
78
|
+
// Selecting a cluster (null feature) or clicking the map clears the popup.
|
|
79
|
+
React.useEffect(() => {
|
|
80
|
+
const overlay = overlayRef.current;
|
|
81
|
+
if (!overlay) return;
|
|
82
|
+
|
|
83
|
+
const coordinates = selectedFeature?.geometry?.flatCoordinates;
|
|
84
|
+
if (coordinates) {
|
|
85
|
+
overlay.setPosition(coordinates);
|
|
86
|
+
setShowTooltip(true);
|
|
87
|
+
} else {
|
|
88
|
+
overlay.setPosition(undefined);
|
|
89
|
+
setShowTooltip(false);
|
|
90
|
+
}
|
|
91
|
+
}, [selectedFeature, tooltip]);
|
|
63
92
|
|
|
64
93
|
const [isClient, setIsClient] = React.useState(false);
|
|
65
94
|
React.useEffect(() => setIsClient(true), []);
|
|
@@ -31,6 +31,7 @@ jest.mock('ol/Overlay', () => {
|
|
|
31
31
|
const mockOl = {
|
|
32
32
|
Overlay: jest.fn((config) => ({
|
|
33
33
|
element: config.element,
|
|
34
|
+
setPosition: jest.fn(),
|
|
34
35
|
})),
|
|
35
36
|
};
|
|
36
37
|
|
|
@@ -111,7 +112,8 @@ describe('InfoOverlay', () => {
|
|
|
111
112
|
handler(evt);
|
|
112
113
|
|
|
113
114
|
expect(onFeatureSelect).toHaveBeenCalledWith(null);
|
|
114
|
-
|
|
115
|
+
const overlay = mockOl.Overlay.mock.results[0].value;
|
|
116
|
+
expect(overlay.element.style.display).toBe('none');
|
|
115
117
|
});
|
|
116
118
|
|
|
117
119
|
it('ignores click when target is a link (A tag)', () => {
|
|
@@ -135,4 +137,23 @@ describe('InfoOverlay', () => {
|
|
|
135
137
|
|
|
136
138
|
expect(onFeatureSelect).not.toHaveBeenCalled();
|
|
137
139
|
});
|
|
140
|
+
|
|
141
|
+
it('positions the overlay over the selected feature', () => {
|
|
142
|
+
render(
|
|
143
|
+
<InfoOverlay
|
|
144
|
+
{...defaultProps}
|
|
145
|
+
selectedFeature={{ geometry: { flatCoordinates: [10, 20] } }}
|
|
146
|
+
/>,
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
const overlay = mockOl.Overlay.mock.results[0].value;
|
|
150
|
+
expect(overlay.setPosition).toHaveBeenCalledWith([10, 20]);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it('clears the overlay position when no feature is selected', () => {
|
|
154
|
+
render(<InfoOverlay {...defaultProps} selectedFeature={null} />);
|
|
155
|
+
|
|
156
|
+
const overlay = mockOl.Overlay.mock.results[0].value;
|
|
157
|
+
expect(overlay.setPosition).toHaveBeenCalledWith(undefined);
|
|
158
|
+
});
|
|
138
159
|
});
|
|
@@ -35,6 +35,14 @@
|
|
|
35
35
|
opacity: 0.55;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
.ol-overlaycontainer {
|
|
39
|
+
z-index: 1 !important;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ol-viewport {
|
|
43
|
+
overflow: visible !important;
|
|
44
|
+
}
|
|
45
|
+
|
|
38
46
|
#csepopup > span {
|
|
39
47
|
display: 'block';
|
|
40
48
|
margin-bottom: '10px';
|
|
@@ -42,21 +50,30 @@
|
|
|
42
50
|
}
|
|
43
51
|
|
|
44
52
|
#csepopup {
|
|
45
|
-
|
|
46
|
-
width: 100%;
|
|
53
|
+
width: 300px;
|
|
47
54
|
// height: 100%;
|
|
48
55
|
padding: 1em;
|
|
56
|
+
background-color: #f9f9f9;
|
|
49
57
|
// border: 1px solid black;
|
|
50
|
-
// font-size: 14px;
|
|
51
58
|
// line-height: initial;
|
|
52
59
|
font-size: 1rem;
|
|
53
60
|
|
|
61
|
+
.csepopup-image {
|
|
62
|
+
display: block;
|
|
63
|
+
width: 100%;
|
|
64
|
+
max-width: 260px;
|
|
65
|
+
max-height: 160px;
|
|
66
|
+
margin-bottom: 10px;
|
|
67
|
+
object-fit: cover;
|
|
68
|
+
}
|
|
69
|
+
|
|
54
70
|
a:hover {
|
|
55
71
|
color: #289588;
|
|
56
72
|
}
|
|
57
73
|
|
|
58
74
|
h3 {
|
|
59
|
-
|
|
75
|
+
margin: 0px;
|
|
76
|
+
font-size: 1rem;
|
|
60
77
|
}
|
|
61
78
|
|
|
62
79
|
h4 {
|
|
@@ -96,6 +113,10 @@
|
|
|
96
113
|
max-height: 133px;
|
|
97
114
|
}
|
|
98
115
|
}
|
|
116
|
+
|
|
117
|
+
.ri-external-link-line {
|
|
118
|
+
margin-left: 0.25rem;
|
|
119
|
+
}
|
|
99
120
|
}
|
|
100
121
|
|
|
101
122
|
#external-popup-overlay {
|
|
@@ -104,7 +104,8 @@ export function getFeatures({ cases, ol }) {
|
|
|
104
104
|
properties,
|
|
105
105
|
'habitat_ecosystem_type',
|
|
106
106
|
),
|
|
107
|
-
|
|
107
|
+
nrr_legislation: properties.nrr_legislation,
|
|
108
|
+
nrr_biogeographical_region: properties.nrr_biogeographical_region,
|
|
108
109
|
scale_of_planning: properties.scale_of_planning,
|
|
109
110
|
description: properties.description,
|
|
110
111
|
index,
|
|
@@ -143,11 +144,12 @@ function hasWholeWord(text, needle) {
|
|
|
143
144
|
}
|
|
144
145
|
|
|
145
146
|
const FILTER_FIELDS = [
|
|
147
|
+
'nrr_legislation',
|
|
148
|
+
'nrr_biogeographical_region',
|
|
146
149
|
'measures_implemented',
|
|
147
150
|
'typology_of_measures',
|
|
148
151
|
'current_status',
|
|
149
152
|
'habitat_ecosystem_type',
|
|
150
|
-
'nrr_article',
|
|
151
153
|
'scale_of_planning',
|
|
152
154
|
];
|
|
153
155
|
|
|
@@ -96,11 +96,12 @@ describe('utils.js', () => {
|
|
|
96
96
|
},
|
|
97
97
|
];
|
|
98
98
|
const noFilters = {
|
|
99
|
+
nrr_legislation: [],
|
|
100
|
+
nrr_biogeographical_region: [],
|
|
99
101
|
measures_implemented: [],
|
|
100
102
|
typology_of_measures: [],
|
|
101
103
|
current_status: [],
|
|
102
104
|
habitat_ecosystem_type: [],
|
|
103
|
-
nrr_article: [],
|
|
104
105
|
scale_of_planning: [],
|
|
105
106
|
};
|
|
106
107
|
|
|
@@ -127,7 +128,8 @@ describe('utils.js', () => {
|
|
|
127
128
|
url: '/planned-river-case',
|
|
128
129
|
current_status: 'planned',
|
|
129
130
|
ecosystem_typology: ['River', 'Wetland'],
|
|
130
|
-
|
|
131
|
+
nrr_legislation: [{ id: 'article-1', title: 'Article 1' }],
|
|
132
|
+
nrr_biogeographical_region: [{ id: 'region-1', title: 'Alpine' }],
|
|
131
133
|
scale_of_planning: 'Regional',
|
|
132
134
|
},
|
|
133
135
|
},
|
|
@@ -139,7 +141,8 @@ describe('utils.js', () => {
|
|
|
139
141
|
url: '/future-case',
|
|
140
142
|
current_status: 'Future',
|
|
141
143
|
ecosystem_typology: ['Forest'],
|
|
142
|
-
|
|
144
|
+
nrr_legislation: ['article-2'],
|
|
145
|
+
nrr_biogeographical_region: ['region-2'],
|
|
143
146
|
scale_of_planning: 'National',
|
|
144
147
|
},
|
|
145
148
|
},
|
|
@@ -147,18 +150,23 @@ describe('utils.js', () => {
|
|
|
147
150
|
|
|
148
151
|
expect(
|
|
149
152
|
filterCases(cases, {
|
|
153
|
+
nrr_legislation: ['article-1'],
|
|
154
|
+
nrr_biogeographical_region: ['region-1'],
|
|
150
155
|
measures_implemented: [],
|
|
151
156
|
typology_of_measures: [],
|
|
152
157
|
current_status: ['planned'],
|
|
153
158
|
habitat_ecosystem_type: ['River'],
|
|
154
|
-
nrr_article: ['article-1'],
|
|
155
159
|
scale_of_planning: ['Regional'],
|
|
156
160
|
}),
|
|
157
161
|
).toHaveLength(1);
|
|
158
|
-
expect(getFilters(cases).
|
|
162
|
+
expect(getFilters(cases).nrr_legislation).toEqual({
|
|
159
163
|
'article-1': 'Article 1',
|
|
160
164
|
'article-2': 'article-2',
|
|
161
165
|
});
|
|
166
|
+
expect(getFilters(cases).nrr_biogeographical_region).toEqual({
|
|
167
|
+
'region-1': 'Alpine',
|
|
168
|
+
'region-2': 'region-2',
|
|
169
|
+
});
|
|
162
170
|
});
|
|
163
171
|
|
|
164
172
|
test('getFilters', () => {
|
|
@@ -176,7 +184,8 @@ describe('utils.js', () => {
|
|
|
176
184
|
},
|
|
177
185
|
current_status: {},
|
|
178
186
|
habitat_ecosystem_type: {},
|
|
179
|
-
|
|
187
|
+
nrr_legislation: {},
|
|
188
|
+
nrr_biogeographical_region: {},
|
|
180
189
|
scale_of_planning: {},
|
|
181
190
|
});
|
|
182
191
|
});
|
package/src/index.js
CHANGED
|
@@ -30,6 +30,8 @@ import {
|
|
|
30
30
|
NRRTypologyOfMeasuresView,
|
|
31
31
|
NRREcosystemTypologyView,
|
|
32
32
|
NRRArticleView,
|
|
33
|
+
NRRLegislationView,
|
|
34
|
+
NRRBiogeographicalRegionView,
|
|
33
35
|
NRRrelatedCaseStudiesView,
|
|
34
36
|
NRRMeasuresImplementedView,
|
|
35
37
|
NRRHabitatEcosystemTypeView,
|
|
@@ -284,14 +286,23 @@ const applyConfig = (config) => {
|
|
|
284
286
|
}
|
|
285
287
|
|
|
286
288
|
config.widgets.id.geolocation = GeolocationWidget;
|
|
289
|
+
// NRR Measure widgets
|
|
287
290
|
config.widgets.views.id.nrr_typology_of_measures = NRRTypologyOfMeasuresView;
|
|
288
291
|
config.widgets.views.id.nrr_ecosystem_typology = NRREcosystemTypologyView;
|
|
292
|
+
config.widgets.views.id.nrr_article = NRRArticleView;
|
|
293
|
+
config.widgets.views.id.related_case_studies = NRRrelatedCaseStudiesView;
|
|
294
|
+
// NRR Case study widgets
|
|
295
|
+
config.widgets.views.id.nrr_measures_implemented = NRRMeasuresImplementedView;
|
|
289
296
|
config.widgets.views.id.nrr_habitat_ecosystem_type =
|
|
290
297
|
NRRHabitatEcosystemTypeView;
|
|
291
298
|
config.widgets.views.id.nrr_scale_of_planning = NRRScaleOfPlanningView;
|
|
292
|
-
config.widgets.views.id.
|
|
299
|
+
config.widgets.views.id.nrr_legislation = NRRLegislationView;
|
|
300
|
+
config.widgets.views.id.nrr_biogeographical_region =
|
|
301
|
+
NRRBiogeographicalRegionView;
|
|
293
302
|
config.widgets.views.id.nrr_current_status = NRRCurrentStatusView;
|
|
294
|
-
|
|
303
|
+
config.widgets.id.nrr_habitat_directive = EUNISHDWidget;
|
|
304
|
+
config.widgets.views.id.nrr_habitat_directive = EUNISHDView;
|
|
305
|
+
// Marine EUNIS habitat Widgets
|
|
295
306
|
config.widgets.id.eunis_national_json = EUNISCountryCodeWidget;
|
|
296
307
|
config.widgets.views.id.eunis_national_json = EUNISCountryCodeView;
|
|
297
308
|
config.widgets.id.eunis_regional_sea_convention_value_json =
|
|
@@ -311,8 +322,7 @@ const applyConfig = (config) => {
|
|
|
311
322
|
config.widgets.views.id.eunis_msfd_relevant_classification_json =
|
|
312
323
|
EUNISMSFDView;
|
|
313
324
|
config.widgets.views.id.eunis_code = EUNISCodeView;
|
|
314
|
-
|
|
315
|
-
config.widgets.views.id.nrr_measures_implemented = NRRMeasuresImplementedView;
|
|
325
|
+
|
|
316
326
|
config.widgets.views.widget.richtext = RichTextWidget;
|
|
317
327
|
|
|
318
328
|
return config;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
.styled.protected-habitats
|
|
2
|
-
> .tabs-block.default
|
|
3
|
-
> .styled
|
|
4
|
-
> .tabs.default
|
|
5
|
-
> .ui.menu {
|
|
1
|
+
.styled.protected-habitats>.tabs-block.default>.styled>.tabs.default>.ui.menu {
|
|
6
2
|
border-bottom: 2px solid #dadada;
|
|
7
3
|
margin-bottom: 1rem;
|
|
8
4
|
border-radius: 0;
|
|
@@ -54,18 +50,19 @@
|
|
|
54
50
|
|
|
55
51
|
.is-n2k-site {
|
|
56
52
|
.eea.header .main.bar {
|
|
53
|
+
|
|
57
54
|
.ui.grid,
|
|
58
55
|
.main-menu,
|
|
59
|
-
.main-menu
|
|
60
|
-
.main-menu
|
|
56
|
+
.main-menu>ul,
|
|
57
|
+
.main-menu>ul>li {
|
|
61
58
|
height: 100%;
|
|
62
59
|
}
|
|
63
60
|
}
|
|
64
61
|
|
|
65
|
-
.eea.header .main.bar .main-menu
|
|
62
|
+
.eea.header .main.bar .main-menu>ul>li {
|
|
66
63
|
padding: 0 0.5rem !important;
|
|
67
64
|
|
|
68
|
-
>
|
|
65
|
+
>a {
|
|
69
66
|
align-self: center;
|
|
70
67
|
}
|
|
71
68
|
}
|
|
@@ -79,7 +76,7 @@
|
|
|
79
76
|
padding-bottom: 0;
|
|
80
77
|
}
|
|
81
78
|
|
|
82
|
-
.ui.accordion
|
|
79
|
+
.ui.accordion>button>a {
|
|
83
80
|
color: #fff !important;
|
|
84
81
|
}
|
|
85
82
|
}
|
|
@@ -127,6 +124,7 @@
|
|
|
127
124
|
@media only screen and (min-width: 992px) {
|
|
128
125
|
> :first-child:not(:last-child) {
|
|
129
126
|
flex: 1;
|
|
127
|
+
|
|
130
128
|
img {
|
|
131
129
|
object-fit: fill;
|
|
132
130
|
}
|
|
@@ -175,3 +173,49 @@
|
|
|
175
173
|
}
|
|
176
174
|
}
|
|
177
175
|
}
|
|
176
|
+
|
|
177
|
+
// Habitats
|
|
178
|
+
.section-habitats.section-habitats_rl,
|
|
179
|
+
.section-habitats.section-habitats_eunis2012,
|
|
180
|
+
.section-habitats.section-habitats_res4,
|
|
181
|
+
.section-habitats.section-habitat,
|
|
182
|
+
.section-habitats.section-habitats_eunis_revised {
|
|
183
|
+
h2 {
|
|
184
|
+
margin-top: 14px;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.light-gray-background {
|
|
188
|
+
background-color: #f9f9f9;
|
|
189
|
+
padding: 1em;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.column-blocks-wrapper {
|
|
193
|
+
margin-bottom: 0;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.table-of-contents .list {
|
|
197
|
+
border-left: 3px solid #bbbdbf;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.table-of-contents .list li:before {
|
|
201
|
+
content: none !important;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.table-of-contents h2 {
|
|
205
|
+
font-size: 1.25rem;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.white-background {
|
|
209
|
+
background-color: white;
|
|
210
|
+
border: 1px solid #efefef;
|
|
211
|
+
text-align: center;
|
|
212
|
+
padding: 10px 0px;
|
|
213
|
+
width: 26% !important;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.white-criteria>span {
|
|
217
|
+
background-color: white;
|
|
218
|
+
padding: 3px 5px;
|
|
219
|
+
border: 1px solid #efefef;
|
|
220
|
+
}
|
|
221
|
+
}
|