@eeacms/volto-marine-policy 3.0.0 → 3.0.2

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,7 +4,33 @@ 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
- ### [3.0.0](https://github.com/eea/volto-marine-policy/compare/2.0.41...3.0.0) - 24 April 2026
7
+ ### [3.0.2](https://github.com/eea/volto-marine-policy/compare/3.0.1...3.0.2) - 10 June 2026
8
+
9
+ #### :rocket: Dependency updates
10
+
11
+ - Release @eeacms/volto-openlayers-map@2.0.1 [EEA Jenkins - [`8c4dbb3`](https://github.com/eea/volto-marine-policy/commit/8c4dbb3f7e95dfa5f1247ad5912ad141a7c3a077)]
12
+
13
+ #### :bug: Bug Fixes
14
+
15
+ - fix: custom NIS status widget to not show 'No value' [laszlocseh - [`7823b63`](https://github.com/eea/volto-marine-policy/commit/7823b63f2f8a042368a7dc2156f92e3ebc5722f1)]
16
+ - fix: format assigned to in NisListingView [laszlocseh - [`702d3fd`](https://github.com/eea/volto-marine-policy/commit/702d3fdbeabad42f270499f29c0c2e8f4212e5dd)]
17
+
18
+ #### :hammer_and_wrench: Others
19
+
20
+ - test: remove TextAlign.test.jsx [laszlocseh - [`3f8a47f`](https://github.com/eea/volto-marine-policy/commit/3f8a47f035e55313e83b9a686dd635eb30e1c012)]
21
+ - test: fix TextAlign.test.jsx snapshot [laszlocseh - [`94b1431`](https://github.com/eea/volto-marine-policy/commit/94b1431295dda5a4a457398521c862a78fa4f5f0)]
22
+ - fix jest-config [nileshgulia1 - [`866cbb9`](https://github.com/eea/volto-marine-policy/commit/866cbb980d2238f74a164047e4660598b31f793f)]
23
+ ### [3.0.1](https://github.com/eea/volto-marine-policy/compare/3.0.0...3.0.1) - 28 April 2026
24
+
25
+ #### :house: Internal changes
26
+
27
+ - style: Automated code fix [eea-jenkins - [`114ccd4`](https://github.com/eea/volto-marine-policy/commit/114ccd4ceefcd2c76e595762c84611120d0a4048)]
28
+
29
+ #### :hammer_and_wrench: Others
30
+
31
+ - add @eeacms/volto-block-style to deps [nileshgulia1 - [`8ac077b`](https://github.com/eea/volto-marine-policy/commit/8ac077bd64842e99557ff7c1a3da4089bb594eef)]
32
+ - fix hydration warnings and remove unnecesary deps [nileshgulia1 - [`4cab29e`](https://github.com/eea/volto-marine-policy/commit/4cab29e0d0b27a571459e5098ede4460d6e01caf)]
33
+ ## [3.0.0](https://github.com/eea/volto-marine-policy/compare/2.0.41...3.0.0) - 27 April 2026
8
34
 
9
35
  #### :rocket: Dependency updates
10
36
 
@@ -38,6 +64,8 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
38
64
  #### :house: Internal changes
39
65
 
40
66
  - style: Automated code fix [eea-jenkins - [`0421290`](https://github.com/eea/volto-marine-policy/commit/0421290d7fdd9fdd0b6d483b53c424a0747137b3)]
67
+ - chore: [JENKINSFILE] add package version in sonarqube [valentinab25 - [`fb1d0f0`](https://github.com/eea/volto-marine-policy/commit/fb1d0f083474b3a14b0ec36a329c7efc7499dd3d)]
68
+ - chore: [JENKINSFILE] use sonarqube branches [EEA Jenkins - [`40d0b36`](https://github.com/eea/volto-marine-policy/commit/40d0b368836d32544b46ae7c7b070ffb71989b55)]
41
69
 
42
70
  #### :hammer_and_wrench: Others
43
71
 
@@ -66,7 +66,7 @@ module.exports = {
66
66
  },
67
67
  ...(process.env.JEST_USE_SETUP === 'ON' && {
68
68
  setupFilesAfterEnv: [
69
- '<rootDir>/node_modules/@eeacms/volto-eea-website-policy/jest.setup.js',
69
+ '<rootDir>/node_modules/@eeacms/volto-marine-policy/jest.setup.js',
70
70
  ],
71
71
  }),
72
72
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-marine-policy",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
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",
@@ -18,35 +18,29 @@
18
18
  },
19
19
  "addons": [
20
20
  "@eeacms/volto-openlayers-map",
21
- "@eeacms/volto-tabs-block",
22
21
  "@eeacms/volto-embed",
23
22
  "@eeacms/volto-eea-design-system",
24
23
  "@eeacms/volto-eea-website-theme",
25
24
  "@eeacms/volto-globalsearch",
26
25
  "@eeacms/volto-metadata-block",
27
26
  "@eeacms/volto-workflow-progress",
28
- "@plone-collective/volto-authomatic",
29
- "@eeacms/volto-group-block"
27
+ "@eeacms/volto-block-style"
30
28
  ],
31
29
  "resolutions": {
32
30
  "react-countup/countup.js": "2.5.0",
33
31
  "d3-array": "^2.12.1",
34
32
  "@eeacms/countup": "^2.0.6",
35
- "@elastic/search-ui": "1.21.2",
36
- "@eeacms/volto-group-block": "^9.0.0"
33
+ "@elastic/search-ui": "1.21.2"
37
34
  },
38
35
  "dependencies": {
36
+ "@eeacms/volto-block-style": "9.0.1",
39
37
  "@eeacms/volto-eea-design-system": "*",
40
38
  "@eeacms/volto-eea-website-theme": "*",
41
39
  "@eeacms/volto-embed": "*",
42
40
  "@eeacms/volto-globalsearch": "^2.0.0",
43
- "@eeacms/volto-group-block": "^9.0.0",
44
41
  "@eeacms/volto-metadata-block": "*",
45
- "@eeacms/volto-openlayers-map": "2.0.0",
46
- "@eeacms/volto-searchlib": "^2.0.2",
47
- "@eeacms/volto-tabs-block": "*",
42
+ "@eeacms/volto-openlayers-map": "2.0.1",
48
43
  "@eeacms/volto-workflow-progress": "*",
49
- "@plone-collective/volto-authomatic": "2.0.1",
50
44
  "axios": "0.30.0",
51
45
  "d3-array": "^2.12.1",
52
46
  "jquery": "3.6.0",
@@ -82,7 +82,7 @@ function DemoSitesMap(props) {
82
82
  );
83
83
 
84
84
  React.useEffect(() => {
85
- if (!map) return null;
85
+ if (!map) return;
86
86
 
87
87
  if (activeItems) {
88
88
  pointsSource.clear();
@@ -93,7 +93,7 @@ function DemoSitesMap(props) {
93
93
  }, [map, activeItems, pointsSource, hideFilters, ol]);
94
94
 
95
95
  React.useEffect(() => {
96
- if (!map) return null;
96
+ if (!map) return;
97
97
 
98
98
  const moveendListener = (e) => {
99
99
  // console.log('map.getView()', map.getView());
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import SelectWidget from '@plone/volto/components/manage/Widgets/SelectWidget';
3
+
4
+ /**
5
+ * NISStatusWidget — wraps the default SelectWidget and disables the
6
+ * client-side "No value" option that Volto injects for hardcoded-choice
7
+ * fields when noValueOption=true (the default) and default is nullish.
8
+ */
9
+ const NISStatusWidget = (props) => (
10
+ <SelectWidget {...props} noValueOption={false} />
11
+ );
12
+
13
+ export default NISStatusWidget;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { useState, useEffect } from 'react';
2
2
  import { Portal } from 'react-portal';
3
3
  import { compose } from 'redux';
4
4
  import { connect } from 'react-redux';
@@ -22,6 +22,11 @@ const PrintPage = (props) => {
22
22
  const { pathname } = props;
23
23
  const intl = useIntl();
24
24
  const cmsView = isCmsUi(pathname);
25
+ const [isMounted, setIsMounted] = useState(false);
26
+
27
+ useEffect(() => {
28
+ setIsMounted(true);
29
+ }, []);
25
30
 
26
31
  const printPage = () => {
27
32
  document.getElementById('main').classList.add('print');
@@ -34,8 +39,8 @@ const PrintPage = (props) => {
34
39
 
35
40
  return (
36
41
  <>
37
- {!cmsView && (
38
- <Portal node={__CLIENT__ && document.querySelector('.content-area')}>
42
+ {!cmsView && isMounted && (
43
+ <Portal node={document.querySelector('.content-area')}>
39
44
  <BodyClass className="has-print-button" />
40
45
  <div className="ui container">
41
46
  <div className="print-button">
@@ -7,6 +7,7 @@ import { useState, useEffect } from 'react';
7
7
  import { useSelector } from 'react-redux';
8
8
  import { Checkbox } from 'semantic-ui-react';
9
9
  import { Button, Select, Dimmer, Loader } from 'semantic-ui-react';
10
+ import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink';
10
11
 
11
12
  function normalizeQueryOperators(query) {
12
13
  return query.map((q) => {
@@ -46,19 +47,33 @@ async function getCurrentSearchItems() {
46
47
 
47
48
  // call Plone
48
49
  try {
49
- const response = await fetch('/marine/++api++/@querystring-search', {
50
- method: 'POST',
51
- headers: {
52
- 'Content-Type': 'application/json',
50
+ const response = await fetch(
51
+ `${window.env.apiPath}/++api++/@querystring-search`,
52
+ {
53
+ method: 'POST',
54
+ headers: {
55
+ 'Content-Type': 'application/json',
56
+ },
57
+ body: JSON.stringify(payload),
53
58
  },
54
- body: JSON.stringify(payload),
55
- });
59
+ );
56
60
  return response;
57
61
  } catch (err) {
58
62
  // console.error('Querystring search failed:', err);
59
63
  }
60
64
  }
61
65
 
66
+ function formatAssignedTo(assignedTo) {
67
+ if (!assignedTo) return '';
68
+ // Fix Python-style unicode escape sequences (\UXXXXXXXX -> actual char)
69
+ let result = assignedTo.replace(/\\U([0-9A-Fa-f]{8})/g, (_, hex) =>
70
+ String.fromCodePoint(parseInt(hex, 16)),
71
+ );
72
+ // Strip the "(userid)" suffix to show only the display name
73
+ result = result.replace(/\s*\([^)]+\)\s*$/, '').trim();
74
+ return result;
75
+ }
76
+
62
77
  const NISListingView = ({ items, isEditMode }) => {
63
78
  const [isLoading, setIsLoading] = useState(false);
64
79
  const [selectedItems, setSelectedItems] = useState([]);
@@ -94,7 +109,7 @@ const NISListingView = ({ items, isEditMode }) => {
94
109
  const onBulkAssign = async (ids, assignee) => {
95
110
  setIsLoading(true);
96
111
  await fetch(
97
- `${window.location.origin}/marine/++api++/@bulk-assign${window.location.search}`,
112
+ `${window.env.apiPath}/++api++/@bulk-assign${window.location.search}`,
98
113
  {
99
114
  method: 'POST',
100
115
  headers: {
@@ -116,7 +131,7 @@ const NISListingView = ({ items, isEditMode }) => {
116
131
  useEffect(() => {
117
132
  const fetchUsers = async () => {
118
133
  const res = await fetch(
119
- `${window.location.origin}/marine/++api++/@vocabularies/nis_experts_vocabulary`,
134
+ `${window.env.apiPath}/++api++/@vocabularies/nis_experts_vocabulary`,
120
135
  {
121
136
  headers: {
122
137
  Accept: 'application/json',
@@ -129,7 +144,7 @@ const NISListingView = ({ items, isEditMode }) => {
129
144
  setUsers(
130
145
  data.items.map((u) => ({
131
146
  key: u.token,
132
- text: u.title,
147
+ text: formatAssignedTo(u.title),
133
148
  value: u.token,
134
149
  })),
135
150
  );
@@ -194,12 +209,12 @@ const NISListingView = ({ items, isEditMode }) => {
194
209
  <td>{item.nis_scientificname_accepted}</td>
195
210
  <td>{item.nis_region}</td>
196
211
  <td>{item.nis_subregion}</td>
197
- <td>{item.nis_country && item.nis_country.join(', ')}</td>
212
+ <td>{item.nis_country}</td>
198
213
  <td>{item.nis_status}</td>
199
214
  <td>{item.nis_group}</td>
200
215
  <td>
201
216
  <div className="assigned-to-container">
202
- <div>{item.nis_assigned_to}</div>
217
+ <div>{formatAssignedTo(item.nis_assigned_to)}</div>
203
218
  {canEditPage && (
204
219
  <Checkbox
205
220
  checked={selectedItems.includes(item['@id'])}
@@ -211,22 +226,18 @@ const NISListingView = ({ items, isEditMode }) => {
211
226
  <td>
212
227
  <div className="workflow-actions">
213
228
  <div className="action-buttons">
214
- <a
229
+ <UniversalLink
215
230
  className="ui button secondary mini"
216
231
  href={`${item['@id']}`}
217
- target="_blank"
218
- rel="noopener"
219
232
  >
220
233
  View
221
- </a>
222
- <a
234
+ </UniversalLink>
235
+ <UniversalLink
223
236
  className="ui button primary mini"
224
237
  href={`${item['@id']}/edit`}
225
- target="_blank"
226
- rel="noopener"
227
238
  >
228
239
  Edit
229
- </a>
240
+ </UniversalLink>
230
241
  </div>
231
242
  <div className="workflow-progress">
232
243
  <ProgressWorkflow
package/src/index.js CHANGED
@@ -16,6 +16,7 @@ import installMsfdDataExplorerBlock from './components/Blocks/MsfdDataExplorerBl
16
16
  import { breadcrumb, localnavigation, workflowProgressPath } from './reducers';
17
17
  import customBlockTemplates from '@eeacms/volto-marine-policy/components/Blocks/CustomBlockTemplates/customBlockTemplates';
18
18
  import TextAlignWidget from './components/Widgets/TextAlign';
19
+ import NISStatusWidget from './components/Widgets/NISStatusWidget';
19
20
  import './slate-styles.less';
20
21
  import './less/toc-title-sizes.less';
21
22
 
@@ -113,6 +114,7 @@ const applyConfig = (config) => {
113
114
  }
114
115
 
115
116
  config.widgets.widget.text_align = TextAlignWidget;
117
+ config.widgets.id.nis_status = NISStatusWidget;
116
118
  // check if it breaks the 'theme' field in volto-tabs-block in the 'horizontal carousel' layout
117
119
  // We have a 'theme' field in the wise catalogue metadata (CatalogueMetadata)
118
120
  config.widgets.id.indicator_theme = TokenWidget;
@@ -1,33 +0,0 @@
1
- import React from 'react';
2
- import renderer from 'react-test-renderer';
3
- import configureStore from 'redux-mock-store';
4
- import { Provider } from 'react-intl-redux';
5
-
6
- import TextAlign from './TextAlign';
7
-
8
- const mockStore = configureStore();
9
-
10
- test('renders a text align component', () => {
11
- const store = mockStore({
12
- intl: {
13
- locale: 'en',
14
- messages: {},
15
- },
16
- });
17
-
18
- const component = renderer.create(
19
- <Provider store={store}>
20
- <TextAlign
21
- id="my-field"
22
- title="My field"
23
- value="left"
24
- fieldSet="default"
25
- onChange={() => {}}
26
- onBlur={() => {}}
27
- onClick={() => {}}
28
- />
29
- </Provider>,
30
- );
31
- const json = component.toJSON();
32
- expect(json).toMatchSnapshot();
33
- });