@eeacms/volto-n2k 1.1.9 → 1.1.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 CHANGED
@@ -4,11 +4,29 @@ 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.1.9](https://github.com/eea/volto-n2k/compare/1.1.8...1.1.9) - 23 October 2025
7
+ ### [1.1.11](https://github.com/eea/volto-n2k/compare/1.1.10...1.1.11) - 26 January 2026
8
8
 
9
- #### :rocket: New Features
9
+ #### :bug: Bug Fixes
10
10
 
11
- - feat(dependencies): remove volto-spotlight [Miu Razvan - [`2f3e6a1`](https://github.com/eea/volto-n2k/commit/2f3e6a111a2e38073d96398611f745c15e4a0ff7)]
11
+ - fix: z-index sidebar [Nilesh - [`8eeeb8c`](https://github.com/eea/volto-n2k/commit/8eeeb8c7f75ccfabdab9545f6a429ffc2ba1e65f)]
12
+
13
+ ### [1.1.10](https://github.com/eea/volto-n2k/compare/1.1.9...1.1.10) - 2 December 2025
14
+
15
+ #### :house: Internal changes
16
+
17
+ - style: Automated code fix [eea-jenkins - [`1990f52`](https://github.com/eea/volto-n2k/commit/1990f520b0223fbaecd5ce4a38f55e8a28beb3eb)]
18
+ - style: Automated code fix [eea-jenkins - [`6bb329d`](https://github.com/eea/volto-n2k/commit/6bb329d70a488f9f4e2673dcc1bceab99a8ff4b7)]
19
+ - style: Automated code fix [eea-jenkins - [`f49ce89`](https://github.com/eea/volto-n2k/commit/f49ce89ad1c659f469d7667f1693b65dce29c55c)]
20
+
21
+ #### :hammer_and_wrench: Others
22
+
23
+ - fix habitat priority [Miu Razvan - [`e69d33e`](https://github.com/eea/volto-n2k/commit/e69d33e9f086e6a7b0005868a0ebda958fdf727d)]
24
+ - fix pipeline [vladcalin-edw - [`9f318d5`](https://github.com/eea/volto-n2k/commit/9f318d5f66073d59e03b14d7d72c2d2cf1e58045)]
25
+ - added sort by code_2000 [vladcalin-edw - [`c641c97`](https://github.com/eea/volto-n2k/commit/c641c9729c10c9bc268568f4a2e2c4d3615cc0c4)]
26
+ - added priority to habitats banner [vladcalin-edw - [`c53b0a4`](https://github.com/eea/volto-n2k/commit/c53b0a49232968045473df72a111afe47bcb916f)]
27
+ - added conditional priority [vladcalin-edw - [`83c0c0a`](https://github.com/eea/volto-n2k/commit/83c0c0aff46b53fc7dd44d0aa802e2bb26599999)]
28
+ - fix no priority count [vladcalin-edw - [`af22479`](https://github.com/eea/volto-n2k/commit/af224793069a6d3acf84905478ee8af6fb799563)]
29
+ ### [1.1.9](https://github.com/eea/volto-n2k/compare/1.1.8...1.1.9) - 23 October 2025
12
30
 
13
31
  ### [1.1.8](https://github.com/eea/volto-n2k/compare/1.1.7...1.1.8) - 1 October 2025
14
32
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-n2k",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
4
4
  "description": "volto-n2k: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -53,6 +53,20 @@ const ViewComponent = (props) => {
53
53
  } = habitat;
54
54
  const { attribution_copyright = [] } = habitat_pictures;
55
55
 
56
+ const priorityLabel = useMemo(() => {
57
+ const priority = habitat_prioriy[0];
58
+
59
+ if (priority === 0) {
60
+ return 'Conditional priority';
61
+ }
62
+ if (priority === null) {
63
+ return 'Without priority';
64
+ }
65
+ if (priority === 1) {
66
+ return 'With priority';
67
+ }
68
+ }, [habitat_prioriy]);
69
+
56
70
  const pictures = useMemo(
57
71
  () => habitat_pictures?.['WebURL'] || [],
58
72
  [habitat_pictures],
@@ -99,11 +113,9 @@ const ViewComponent = (props) => {
99
113
  <p className="info">
100
114
  Habitats Directive Annex I code&nbsp;&nbsp;&nbsp;{code_2000[0]}
101
115
  </p>
102
- {habitat_prioriy[0] && (
103
- <p className="info" style={{ marginTop: '1rem' }}>
104
- Priority habitat type
105
- </p>
106
- )}
116
+ <p className="info" style={{ marginTop: '1rem' }}>
117
+ {priorityLabel}
118
+ </p>
107
119
  </div>
108
120
  {pictures_length > 0 && (
109
121
  <div className={cx('carousel one-slide')}>
@@ -16,6 +16,7 @@ const View = (props) => {
16
16
  { text: 'Name', value: 'scientific_name', key: 'scientific_name' },
17
17
  { text: 'Coverage', value: 'coverage_ha', key: 'coverage_ha' },
18
18
  { text: 'Sites', value: 'number_sites', key: 'number_sites' },
19
+ { text: 'Code', value: 'code_2000', key: 'code_2000' },
19
20
  ];
20
21
 
21
22
  return (
@@ -99,22 +99,8 @@ const View = (props) => {
99
99
  if (key !== 'getTitle') {
100
100
  newFilters[filter][key] =
101
101
  filteredHabitats.filter((habitats) => {
102
- return !!habitats.filter((habitat) => {
103
- if (
104
- filtersLabels[filter][key] ===
105
- filtersLabels.habitat_prioriy.wp
106
- ) {
107
- return habitat[filter] === 1;
108
- }
109
- if (
110
- filtersLabels[filter][key] ===
111
- filtersLabels.habitat_prioriy.np
112
- ) {
113
- return habitat[filter] === null;
114
- }
115
-
116
- return habitat[filter] === filtersLabels[filter][key];
117
- }).length;
102
+ return !!habitats.filter((habitat) => habitat[filter] === key)
103
+ .length;
118
104
  }).length || 'none';
119
105
  }
120
106
  }
@@ -16,6 +16,10 @@ const getCurrentPageLength = (pagination, arr) => {
16
16
  return pagination.itemsPerPage;
17
17
  };
18
18
 
19
+ function getPriorityString(priority) {
20
+ return filtersLabels.habitat_prioriy[priority] || '';
21
+ }
22
+
19
23
  const View = (props) => {
20
24
  const {
21
25
  provider_data = {},
@@ -24,7 +28,7 @@ const View = (props) => {
24
28
  const dataReady = React.useRef(false);
25
29
  const [activeHabitatsGroup, setActiveHabitatsGroup] = React.useState('All');
26
30
  const [filters, setFilters] = React.useState({});
27
- const [habitats, spetHabitats] = React.useState([]);
31
+ const [habitats, setHabitats] = React.useState([]);
28
32
  const [filteredHabitats, setFilteredHabitats] = React.useState([]);
29
33
  const [pagination, setPagination] = React.useState({
30
34
  activePage: 1,
@@ -56,36 +60,13 @@ const View = (props) => {
56
60
 
57
61
  const filteredHabitats = habitats.filter((items, index) => {
58
62
  let itemsHaveFilter = true;
59
-
60
63
  Object.keys(activeFilters).forEach((filter) => {
61
64
  let habitatHasFilter = false;
62
-
63
- activeFilters[filter].forEach((key) => {
64
- if (filter in filtersLabels) {
65
- if (
66
- filtersLabels[filter][key] === filtersLabels.habitat_prioriy.wp
67
- ) {
68
- habitatHasFilter = items[0][filter] === 1;
69
- return;
70
- }
71
- if (
72
- filtersLabels[filter][key] === filtersLabels.habitat_prioriy.np
73
- ) {
74
- habitatHasFilter = items[0][filter] === null;
75
- return;
76
- }
77
-
78
- if (filtersLabels[filter][key] === items[0][filter]) {
79
- habitatHasFilter = true;
80
- return;
81
- }
65
+ items.forEach((item) => {
66
+ if (activeFilters[filter].includes(item[filter])) {
67
+ habitatHasFilter = true;
82
68
  }
83
69
  });
84
-
85
- if (activeFilters[filter].includes(items[0][filter])) {
86
- habitatHasFilter = true;
87
- }
88
-
89
70
  if (!habitatHasFilter) {
90
71
  itemsHaveFilter = false;
91
72
  }
@@ -115,10 +96,16 @@ const View = (props) => {
115
96
  if (!newHabitats[habitatsIndex[habitat.code_2000]]) {
116
97
  newHabitats[habitatsIndex[habitat.code_2000]] = [];
117
98
  }
118
- newHabitats[habitatsIndex[habitat.code_2000]].push(habitat);
99
+ newHabitats[habitatsIndex[habitat.code_2000]].push({
100
+ ...habitat,
101
+ habitat_prioriy:
102
+ habitat.habitat_prioriy !== null
103
+ ? habitat.habitat_prioriy.toString()
104
+ : '-1',
105
+ });
119
106
  });
120
107
  }
121
- spetHabitats(getSortedHabitats(newHabitats.filter((habitats) => habitats)));
108
+ setHabitats(getSortedHabitats(newHabitats.filter((habitats) => habitats)));
122
109
  /* eslint-disable-next-line */
123
110
  }, [JSON.stringify(provider_data)]);
124
111
 
@@ -161,6 +148,7 @@ const View = (props) => {
161
148
  k + (pagination.activePage - 1) * pagination.itemsPerPage,
162
149
  ).map((index) => {
163
150
  const habitatsData = filteredHabitats[index][0];
151
+ const priority = getPriorityString(habitatsData.habitat_prioriy);
164
152
 
165
153
  return (
166
154
  <Grid
@@ -211,9 +199,7 @@ const View = (props) => {
211
199
  style={{ fontSize: '1.2rem' }}
212
200
  key={`habitat-${index}-${habitat.code_2000}`}
213
201
  >
214
- {habitat.habitat_prioriy
215
- ? `Priority habitat type; `
216
- : ''}
202
+ {priority ? `${priority}; ` : ''}
217
203
  Cover: {habitat.coverage_ha.toFixed(2)} ha (
218
204
  {(habitat.coverage_ha / 100).toFixed(2)} km²)
219
205
  {habitat.caves > 0
@@ -14,7 +14,9 @@ div#view .site-habitats-list .habitats-list .ui.container > * {
14
14
  justify-content: space-between;
15
15
 
16
16
  .active-filters {
17
+ display: flex;
17
18
  margin-top: 0;
19
+ gap: 0.5rem;
18
20
 
19
21
  .ui.label.active-filter {
20
22
  display: inline-flex;
@@ -22,6 +24,7 @@ div#view .site-habitats-list .habitats-list .ui.container > * {
22
24
  align-items: center;
23
25
  border: 1px solid #c5c5c5;
24
26
  border-radius: 18px;
27
+ background-color: #fff;
25
28
  color: #000;
26
29
  font-weight: 400;
27
30
 
@@ -93,7 +96,7 @@ div#view .site-habitats-list .habitats-list .ui.container > * {
93
96
  background-color: #fff !important;
94
97
 
95
98
  &.right.visible {
96
- z-index: 800;
99
+ z-index: 2000;
97
100
  box-shadow: 0px 0px 13px -5px #000000;
98
101
  }
99
102
 
@@ -1,7 +1,8 @@
1
1
  export const filtersLabels = {
2
2
  habitat_prioriy: {
3
- wp: 'With priority',
4
- np: 'Without priority',
3
+ 1: 'With priority',
4
+ 0: 'Conditional priority',
5
+ '-1': 'Without priority',
5
6
  getTitle: () => 'Habitat priority',
6
7
  },
7
8
  };
@@ -14,7 +14,9 @@ div#view .site-species-list .species-list .ui.container > * {
14
14
  justify-content: space-between;
15
15
 
16
16
  .active-filters {
17
+ display: flex;
17
18
  margin-top: 0;
19
+ gap: 0.5rem;
18
20
 
19
21
  .ui.label.active-filter {
20
22
  display: inline-flex;
@@ -22,6 +24,7 @@ div#view .site-species-list .species-list .ui.container > * {
22
24
  align-items: center;
23
25
  border: 1px solid #c5c5c5;
24
26
  border-radius: 18px;
27
+ background-color: #fff;
25
28
  color: #000;
26
29
  font-weight: 400;
27
30