@eeacms/volto-marine-policy 2.0.12 → 2.0.14

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,15 +4,39 @@ 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.12](https://github.com/eea/volto-marine-policy/compare/2.0.11...2.0.12) - 13 May 2025
7
+ ### [2.0.14](https://github.com/eea/volto-marine-policy/compare/2.0.13...2.0.14) - 15 May 2025
8
+
9
+ #### :rocket: Dependency updates
10
+
11
+ - Release @eeacms/volto-globalsearch@2.1.2 [EEA Jenkins - [`4781112`](https://github.com/eea/volto-marine-policy/commit/47811128d3fd2711efaafe426d32e28d87296222)]
12
+ - Release @eeacms/volto-globalsearch@2.1.1 [EEA Jenkins - [`91c4b2b`](https://github.com/eea/volto-marine-policy/commit/91c4b2ba5b743911f6898d2ad74230f3b87154b3)]
8
13
 
9
14
  #### :house: Internal changes
10
15
 
11
- - style: Automated code fix [eea-jenkins - [`185d777`](https://github.com/eea/volto-marine-policy/commit/185d7773fbd2b4c2571ad07bf851e61088e534e2)]
16
+ - style: Automated code fix [eea-jenkins - [`ebda5f4`](https://github.com/eea/volto-marine-policy/commit/ebda5f4f834a8851ccaabb27b1a75caa13a5989c)]
17
+ - style: Automated code fix [eea-jenkins - [`f3118b8`](https://github.com/eea/volto-marine-policy/commit/f3118b86f9324b186eacbf9f5cfcf716d72213f0)]
12
18
 
13
19
  #### :hammer_and_wrench: Others
14
20
 
15
- - small style update demo sites map [laszlocseh - [`2770217`](https://github.com/eea/volto-marine-policy/commit/27702172e17d865924770c7593753ac0bca61ba2)]
21
+ - update jest-addon.config.js [laszlocseh - [`f63cc32`](https://github.com/eea/volto-marine-policy/commit/f63cc327fdc89ed930f03ae4c16baaf80a8e6fc0)]
22
+ - fix eslint [laszlocseh - [`4490f3f`](https://github.com/eea/volto-marine-policy/commit/4490f3f48a8256713760bc5193588cad9cb1ce6b)]
23
+ - remove console.log [laszlocseh - [`c2adb4a`](https://github.com/eea/volto-marine-policy/commit/c2adb4afc1c98315b36e55e94011212eec6b3927)]
24
+ - make filters auto update based on selection [laszlocseh - [`1a11f9a`](https://github.com/eea/volto-marine-policy/commit/1a11f9a2a0f65a2b03778c306052086068c5c323)]
25
+ ### [2.0.13](https://github.com/eea/volto-marine-policy/compare/2.0.12...2.0.13) - 13 May 2025
26
+
27
+ #### :house: Internal changes
28
+
29
+ - style: Automated code fix [eea-jenkins - [`990f696`](https://github.com/eea/volto-marine-policy/commit/990f696c407f5ce8066cc60387ed5fbda329ce50)]
30
+
31
+ #### :hammer_and_wrench: Others
32
+
33
+ - small style update demo sites map [laszlocseh - [`f14495a`](https://github.com/eea/volto-marine-policy/commit/f14495af7eb80b2b259f46057e7d1a6ed0bb44d5)]
34
+ ### [2.0.12](https://github.com/eea/volto-marine-policy/compare/2.0.11...2.0.12) - 13 May 2025
35
+
36
+ #### :house: Internal changes
37
+
38
+ - style: Automated code fix [eea-jenkins - [`185d777`](https://github.com/eea/volto-marine-policy/commit/185d7773fbd2b4c2571ad07bf851e61088e534e2)]
39
+
16
40
  ### [2.0.11](https://github.com/eea/volto-marine-policy/compare/2.0.10...2.0.11) - 12 May 2025
17
41
 
18
42
  #### :house: Internal changes
@@ -41,10 +41,10 @@ module.exports = {
41
41
  },
42
42
  coverageThreshold: {
43
43
  global: {
44
- branches: 3,
45
- functions: 3,
46
- lines: 3,
47
- statements: 3,
44
+ branches: 2,
45
+ functions: 2,
46
+ lines: 2,
47
+ statements: 2,
48
48
  },
49
49
  },
50
50
  ...(process.env.JEST_USE_SETUP === 'ON' && {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-marine-policy",
3
- "version": "2.0.12",
3
+ "version": "2.0.14",
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",
@@ -34,7 +34,7 @@
34
34
  "@eeacms/volto-eea-design-system": "*",
35
35
  "@eeacms/volto-eea-website-theme": "*",
36
36
  "@eeacms/volto-embed": "*",
37
- "@eeacms/volto-globalsearch": "2.1.0",
37
+ "@eeacms/volto-globalsearch": "2.1.2",
38
38
  "@eeacms/volto-openlayers-map": "0.3.2",
39
39
  "@eeacms/volto-searchlib": "2.0.16",
40
40
  "@eeacms/volto-tabs-block": "*",
@@ -38,10 +38,10 @@ export default function DemoSitesExplorerView(props) {
38
38
  const [highlightedIndex, setHighlightedIndex] = React.useState(-1);
39
39
 
40
40
  React.useEffect(() => {
41
- const _filters = getFilters(cases, indicatorOnly);
41
+ const _filters = getFilters(activeItems, indicatorOnly);
42
42
  setFilters(_filters);
43
43
  }, [
44
- cases,
44
+ activeItems,
45
45
  activeFilters.objective_filter,
46
46
  activeFilters.target_filter,
47
47
  activeFilters.indicator_filter,
@@ -107,7 +107,7 @@ export default function DemoSitesExplorerView(props) {
107
107
  <VisibilitySensor>
108
108
  <ObjectivesChart
109
109
  items={cases}
110
- // activeItems={activeItems}
110
+ activeItems={activeItems}
111
111
  // filters={filters}
112
112
  activeFilters={activeFilters}
113
113
  setActiveFilters={setActiveFilters}
@@ -82,15 +82,11 @@ export function DemoSitesFilter(props) {
82
82
  {Object.entries(filters?.[filterName] || {})
83
83
  // .sort((item1, item2) => item1[1].localeCompare(item2[1]))
84
84
  .map(([value, label], index) => (
85
- <label
86
- htmlFor={label + index}
87
- className="filter-input"
88
- key={index}
89
- >
85
+ <label htmlFor={label} className="filter-input" key={label}>
90
86
  <input
91
87
  value={value}
92
88
  type="checkbox"
93
- id={label + index}
89
+ id={label}
94
90
  onChange={(e) => {
95
91
  const temp = JSON.parse(JSON.stringify(activeFilters));
96
92
  if (e.target.checked) {
@@ -91,10 +91,14 @@ export default function DemoSitesMap(props) {
91
91
  const coords = selectedCase.geometry.flatCoordinates;
92
92
  const pixel = map.getPixelFromCoordinate(coords);
93
93
  map.getInteractions().array_[9].getFeatures().clear();
94
- map
95
- .getInteractions()
96
- .array_[9].getFeatures()
97
- .push(map.getFeaturesAtPixel(pixel)[0]);
94
+ try {
95
+ map
96
+ .getInteractions()
97
+ .array_[9].getFeatures()
98
+ .push(map.getFeaturesAtPixel(pixel)[0]);
99
+ } catch (e) {
100
+ // console.error(e);
101
+ }
98
102
  } else {
99
103
  map.getInteractions().array_[9].getFeatures().clear();
100
104
  }
@@ -9,7 +9,7 @@ const Plot = loadable(() => import('react-plotly.js'));
9
9
 
10
10
  const ObjectivesChart = ({
11
11
  items,
12
- // activeItems,
12
+ activeItems,
13
13
  // filters,
14
14
  activeFilters,
15
15
  setActiveFilters,
@@ -21,9 +21,29 @@ const ObjectivesChart = ({
21
21
  setInitialized,
22
22
  }) => {
23
23
  const chartRef = useRef(null);
24
- const objectiveCounts = {};
24
+ let objectiveCounts = {};
25
25
 
26
- for (const item of items) {
26
+ // if (!items) return;
27
+
28
+ items.forEach((item) => {
29
+ const _obj = item.properties.objective;
30
+
31
+ _obj.forEach((_o) => {
32
+ if (!(_o in objectiveCounts)) {
33
+ objectiveCounts[_o] = 0;
34
+ }
35
+ });
36
+ });
37
+
38
+ let itemsUsedForChart = [];
39
+
40
+ if (initialized) {
41
+ itemsUsedForChart = activeItems;
42
+ } else {
43
+ itemsUsedForChart = items;
44
+ }
45
+
46
+ for (const item of itemsUsedForChart) {
27
47
  item.properties.objective.map((obj) => {
28
48
  objectiveCounts[obj] = (objectiveCounts[obj] || 0) + 1;
29
49
  return [];
@@ -43,9 +63,9 @@ const ObjectivesChart = ({
43
63
 
44
64
  const interval = setInterval(() => {
45
65
  setHighlightedIndex((prevIndex) => {
66
+ if (prevIndex + 1 >= objectivesLength) setInitialized(true);
46
67
  if (prevIndex + 1 >= objectivesLength + 1) {
47
68
  clearInterval(interval); // Stop after last item
48
- setInitialized(true);
49
69
  return prevIndex;
50
70
  }
51
71
  return prevIndex + 1;
@@ -63,6 +83,7 @@ const ObjectivesChart = ({
63
83
  ]);
64
84
 
65
85
  React.useEffect(() => {
86
+ // set the objectives filter based on chartclick or list selection
66
87
  // if (!objectives) return;
67
88
  const filterKey = 'objective_filter';
68
89
 
@@ -172,6 +193,7 @@ const ObjectivesChart = ({
172
193
  labels: labels,
173
194
  values: values,
174
195
  textinfo: 'none',
196
+ sort: false,
175
197
  // textinfo: highlightedIndex === 5 ? 'value' : 'none',
176
198
  hole: 0.4,
177
199
  insidetextorientation: 'radial',
@@ -240,6 +262,7 @@ const ObjectivesChart = ({
240
262
  className={cx(
241
263
  index === highlightedIndex ? 'active' : '',
242
264
  customColors[index].replace('#', 'C'),
265
+ count === 0 ? 'disabled' : '',
243
266
  )}
244
267
  >
245
268
  <div
@@ -42,7 +42,7 @@
42
42
  font-size: 1rem;
43
43
 
44
44
  a:hover {
45
- color: #0083e0;
45
+ color: #004b7f;
46
46
  }
47
47
 
48
48
  h3 {
@@ -128,7 +128,7 @@
128
128
  #cse-filter {
129
129
  display: flex;
130
130
  flex-direction: row;
131
- margin-top: 1em;
131
+ margin-top: 0.5em;
132
132
  font-family: sans-serif;
133
133
  // gap: 3em;
134
134
 
@@ -138,7 +138,7 @@
138
138
  &.active {
139
139
  button span {
140
140
  // box-shadow: 0 5px 0 #ffffff, 0 0 4px rgba(0, 0, 0, 0.25);
141
- color: #0083e0;
141
+ color: #004b7f;
142
142
  }
143
143
 
144
144
  button {
@@ -161,8 +161,9 @@
161
161
  z-index: 9;
162
162
  display: inline-block;
163
163
  overflow: hidden;
164
- padding: 0.5em 0em;
165
- margin: 0 0.25em 0.25em 0;
164
+ padding: 0;
165
+ // padding: 0.5em 0em;
166
+ margin: 0 0.25em 0 0;
166
167
  // background-color: white !important;
167
168
  color: #3d5265 !important;
168
169
 
@@ -174,10 +175,10 @@
174
175
  // &:focus {
175
176
  // color: rgba(0, 0, 0, 0.6) !important;
176
177
  // }
177
- // &:hover {
178
- // box-shadow: none;
179
- // background-color: transparent !important;
180
- // }
178
+ &:hover {
179
+ box-shadow: none;
180
+ // background-color: transparent;
181
+ }
181
182
 
182
183
  span {
183
184
  position: relative !important;
@@ -353,18 +354,18 @@
353
354
  }
354
355
 
355
356
  .searchlib-block .ui.basic.button.clear-btn {
356
- color: #0083e0 !important;
357
+ color: #004b7f !important;
357
358
  }
358
359
 
359
360
  .searchlib-block .result-item .result-info {
360
361
  align-items: center;
361
362
 
362
363
  &.show-on-map {
363
- color: #0083e0 !important;
364
+ color: #004b7f !important;
364
365
  cursor: pointer;
365
366
 
366
367
  .result-info-title {
367
- color: #0083e0 !important;
368
+ color: #004b7f !important;
368
369
  }
369
370
  }
370
371
  }
@@ -386,7 +387,7 @@
386
387
  padding: 8px 6px 8px 12px;
387
388
  border: 4px solid #efefef;
388
389
  border-radius: 2px;
389
- background-color: #0083e0;
390
+ background-color: #004b7f;
390
391
  gap: 0.5em;
391
392
  opacity: 0.6;
392
393
 
@@ -564,5 +565,11 @@
564
565
  height: 1em;
565
566
  }
566
567
  }
568
+
569
+ &.disabled {
570
+ cursor: not-allowed;
571
+ opacity: 0.5;
572
+ pointer-events: none;
573
+ }
567
574
  }
568
575
  }