@eeacms/volto-eea-website-policy 2.3.2 → 2.4.1

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,94 @@ 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.4.1](https://github.com/eea/volto-eea-website-policy/compare/2.4.0...2.4.1) - 2 June 2025
8
+
9
+ #### :bug: Bug Fixes
10
+
11
+ - fix: IMS History diff is not showing charts - refs #286978 [Nilesh - [`06ee6ad`](https://github.com/eea/volto-eea-website-policy/commit/06ee6ad641132445f4a54eecd265aac95bf0f827)]
12
+
13
+ #### :hammer_and_wrench: Others
14
+
15
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`a6a9310`](https://github.com/eea/volto-eea-website-policy/commit/a6a9310ee50dd7f1608ad6c8c36c0070c24e269d)]
16
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`f399bb5`](https://github.com/eea/volto-eea-website-policy/commit/f399bb5fb56f714000487d0aca6c9e8f08d56886)]
17
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`f97c0f5`](https://github.com/eea/volto-eea-website-policy/commit/f97c0f5cc6b78e9eea4c4b379113a8ffd4e341a8)]
18
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`6f064ef`](https://github.com/eea/volto-eea-website-policy/commit/6f064ef9f395f6620ac0cb4c795bfa2595bba2c7)]
19
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`46431ca`](https://github.com/eea/volto-eea-website-policy/commit/46431caddc9fcb92812314196205aea5681f2163)]
20
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`76f21b4`](https://github.com/eea/volto-eea-website-policy/commit/76f21b4591f405eb287e9d3a1a646f0b8133a755)]
21
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`df557b2`](https://github.com/eea/volto-eea-website-policy/commit/df557b256a138f86eb69140080cf176bc8d2672f)]
22
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`3827993`](https://github.com/eea/volto-eea-website-policy/commit/3827993610788f8830573709ca5076cd328c454f)]
23
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`4b51985`](https://github.com/eea/volto-eea-website-policy/commit/4b51985863633eafdf472a9a169b199136742a94)]
24
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`566e425`](https://github.com/eea/volto-eea-website-policy/commit/566e42554118fdedc2990c812e33291b79c75b39)]
25
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`7d13d7b`](https://github.com/eea/volto-eea-website-policy/commit/7d13d7b5d9f06aa68434188a08856ff4986d7af9)]
26
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`efdf88b`](https://github.com/eea/volto-eea-website-policy/commit/efdf88b91caf6e244844bdc06b0b772c127c73cb)]
27
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`ab41f1e`](https://github.com/eea/volto-eea-website-policy/commit/ab41f1e30e8f685dea290576b3e44dd38ece9ef5)]
28
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`849e24c`](https://github.com/eea/volto-eea-website-policy/commit/849e24cb1115831371ce2a8b67f70318919e91e2)]
29
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`f5ee26e`](https://github.com/eea/volto-eea-website-policy/commit/f5ee26e4f1b3e1f730326030ccd1ffc4c536b1bc)]
30
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`69e6ce5`](https://github.com/eea/volto-eea-website-policy/commit/69e6ce5edd886022e5ae84b389dea0e3fff3b7e2)]
31
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`77a9f7a`](https://github.com/eea/volto-eea-website-policy/commit/77a9f7a040ec3533f5d0e6dce613f7b29f154b00)]
32
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`ae46dc8`](https://github.com/eea/volto-eea-website-policy/commit/ae46dc85ce3caa7196aa2697686a6075a92dc1cc)]
33
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`7afe8cc`](https://github.com/eea/volto-eea-website-policy/commit/7afe8ccff20d111e3b2f21e8bc803b70f7ceee8c)]
34
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`ba3cf05`](https://github.com/eea/volto-eea-website-policy/commit/ba3cf05d18885cb6c8a79a9250c34f2469cc8d6c)]
35
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`2e9c590`](https://github.com/eea/volto-eea-website-policy/commit/2e9c5901deb8557dd76e9de3fb69daef4832cbde)]
36
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`010cec5`](https://github.com/eea/volto-eea-website-policy/commit/010cec50f01cd6b5b5910a56a7802e1da0078c12)]
37
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`b78d1a1`](https://github.com/eea/volto-eea-website-policy/commit/b78d1a16554905f591ed5e9d42cb74e1e5cfcada)]
38
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`7173421`](https://github.com/eea/volto-eea-website-policy/commit/71734214f23fd227a9427c72d057be6c30efd227)]
39
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`d382a07`](https://github.com/eea/volto-eea-website-policy/commit/d382a076baa754069f62580e1bdcce2e91ae6ae9)]
40
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`06ca0d1`](https://github.com/eea/volto-eea-website-policy/commit/06ca0d1ff2f4de9181dab7346574dc83f97f5e4b)]
41
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`b2960d0`](https://github.com/eea/volto-eea-website-policy/commit/b2960d05728c57db637b3edc61b963639ae339b3)]
42
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`c369444`](https://github.com/eea/volto-eea-website-policy/commit/c369444a310f4976d03697f1ebcc98b13c241471)]
43
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`bb23921`](https://github.com/eea/volto-eea-website-policy/commit/bb2392187f515aa03e108440749daa6e1746d88a)]
44
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`b971077`](https://github.com/eea/volto-eea-website-policy/commit/b971077a4331f82951c9210b5daa24720f7737e5)]
45
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`27305d4`](https://github.com/eea/volto-eea-website-policy/commit/27305d4b026bcb4ef8a5700b632eb5d13b906f20)]
46
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`ebf3681`](https://github.com/eea/volto-eea-website-policy/commit/ebf3681664cef068b1f7305730f9570a023b047a)]
47
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`f209e6c`](https://github.com/eea/volto-eea-website-policy/commit/f209e6c1f2d9917d034de75e5028a6b2c5e041a2)]
48
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`5abd2ff`](https://github.com/eea/volto-eea-website-policy/commit/5abd2ff04d1af9d6834df53f4fd889ef0fc01c9c)]
49
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`93acf45`](https://github.com/eea/volto-eea-website-policy/commit/93acf450f2320c95482207bce90e2e7e0c05382f)]
50
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`a0400b6`](https://github.com/eea/volto-eea-website-policy/commit/a0400b6624a1517c9ae13c7c429891ee7912d4a6)]
51
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`bf856c9`](https://github.com/eea/volto-eea-website-policy/commit/bf856c9af15ce9592767bbc7d7c277c563b15973)]
52
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`92cd13e`](https://github.com/eea/volto-eea-website-policy/commit/92cd13e9996a276a1e339a884aee8dcc4cbbfdb0)]
53
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`86b27bf`](https://github.com/eea/volto-eea-website-policy/commit/86b27bf01fec6ef480cb4ad65e869e3a45816f4b)]
54
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`3a50cd6`](https://github.com/eea/volto-eea-website-policy/commit/3a50cd6266e2992edeea4d1471bf15680654080c)]
55
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`7fa9159`](https://github.com/eea/volto-eea-website-policy/commit/7fa9159b461b708a48cf25f93ae81205a4429238)]
56
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`44ec17a`](https://github.com/eea/volto-eea-website-policy/commit/44ec17aec2a863c3e4f6fc07b6f7e9b857f594e7)]
57
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`09d7fdf`](https://github.com/eea/volto-eea-website-policy/commit/09d7fdfaa7834c91d649e222b4bebe7344bed528)]
58
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`e73dd47`](https://github.com/eea/volto-eea-website-policy/commit/e73dd4776de2a8795db37930167cb4020278ce9a)]
59
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`e33db72`](https://github.com/eea/volto-eea-website-policy/commit/e33db725d5bf10724a31dfca6d3f4f3576eb731c)]
60
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`de9d303`](https://github.com/eea/volto-eea-website-policy/commit/de9d3030f595ceeb45842fd8c93cd44d5f1770bb)]
61
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`2bfa09f`](https://github.com/eea/volto-eea-website-policy/commit/2bfa09f3bd73cfd15510abdf14f5da5250eccaf0)]
62
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`a6895a7`](https://github.com/eea/volto-eea-website-policy/commit/a6895a79dec886a16e0e485a1a7a362b6f675f4c)]
63
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`369b797`](https://github.com/eea/volto-eea-website-policy/commit/369b7972a106d7ae2b47bdb4c989990ac75adb22)]
64
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`b9645a8`](https://github.com/eea/volto-eea-website-policy/commit/b9645a86710e589a169771f51231647beba9c9b3)]
65
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`27f252d`](https://github.com/eea/volto-eea-website-policy/commit/27f252dac4a87e2c9a97c862a77bc79e2f27071c)]
66
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`51f78c9`](https://github.com/eea/volto-eea-website-policy/commit/51f78c9379b5839d606f69d366c6eec757ed0cd1)]
67
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`a3263d2`](https://github.com/eea/volto-eea-website-policy/commit/a3263d26e6fadd6197d355a30c03069ed0f170d0)]
68
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`93723fe`](https://github.com/eea/volto-eea-website-policy/commit/93723fe61eef7d816d86f35b4e9d5d7d9d870981)]
69
+ ### [2.4.0](https://github.com/eea/volto-eea-website-policy/compare/2.3.2...2.4.0) - 28 February 2025
70
+
71
+ #### :bug: Bug Fixes
72
+
73
+ - fix(routes): endless reload when we hit routes outside of /en and not found [David Ichim - [`6a99118`](https://github.com/eea/volto-eea-website-policy/commit/6a99118dd9f2b6873f0f82b75569b3fd4f0c873d)]
74
+
75
+ #### :house: Internal changes
76
+
77
+ - style: Automated code fix [eea-jenkins - [`154ca83`](https://github.com/eea/volto-eea-website-policy/commit/154ca83605ac94c8f94dbec176181336be699d78)]
78
+ - chore(docs): added diff information for blacklistRoutes.js changes [David Ichim - [`a0f6e9a`](https://github.com/eea/volto-eea-website-policy/commit/a0f6e9a2c12e8bc5ec9a89134293dc0c973bb842)]
79
+ - style: Automated code fix [eea-jenkins - [`9c9fc11`](https://github.com/eea/volto-eea-website-policy/commit/9c9fc116cb476e3320716965f1dfc17b6e517fe0)]
80
+
81
+ #### :hammer_and_wrench: Others
82
+
83
+ - try to use specific version for plone-backend [David Ichim - [`04e9e8a`](https://github.com/eea/volto-eea-website-policy/commit/04e9e8aac57e9af9b0c8cc5ba24279d5ed22482d)]
84
+ - Update package.json [David Ichim - [`baf866f`](https://github.com/eea/volto-eea-website-policy/commit/baf866f7efed437c1c3f664cadc24aba91ddc6c8)]
85
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`26ceb2f`](https://github.com/eea/volto-eea-website-policy/commit/26ceb2f025f97ae14095478bff6d5238609fac4d)]
86
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`327ea54`](https://github.com/eea/volto-eea-website-policy/commit/327ea54f2fdaae9aff322ca8006197441dcace75)]
87
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`384ee55`](https://github.com/eea/volto-eea-website-policy/commit/384ee5527f861ac0fc20dabcf2c4b57047e9d586)]
88
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`fa9292a`](https://github.com/eea/volto-eea-website-policy/commit/fa9292a36c1fe007451d46beebd4bf5eed44ffe1)]
89
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`6e517d1`](https://github.com/eea/volto-eea-website-policy/commit/6e517d1d77c80a870563cd7000791cb3c4e98279)]
90
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`c1ae827`](https://github.com/eea/volto-eea-website-policy/commit/c1ae827dce5edd392e3079004fa66ca723c8ae88)]
91
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`0913369`](https://github.com/eea/volto-eea-website-policy/commit/0913369fec93b724278e80edb5515bd3d5fe79c4)]
92
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`fe304cc`](https://github.com/eea/volto-eea-website-policy/commit/fe304cc0e1cf4b1547835d3eb57f60a38be1b730)]
93
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`62c94de`](https://github.com/eea/volto-eea-website-policy/commit/62c94de3746a55ced6caaa3c8955377fd447e76e)]
94
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`b84e35d`](https://github.com/eea/volto-eea-website-policy/commit/b84e35d485524b9fc558e3d2c957ae8e94c9d78d)]
7
95
  ### [2.3.2](https://github.com/eea/volto-eea-website-policy/compare/2.3.1...2.3.2) - 30 January 2025
8
96
 
9
97
  #### :bug: Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-website-policy",
3
- "version": "2.3.2",
3
+ "version": "2.4.1",
4
4
  "description": "@eeacms/volto-eea-website-policy: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -0,0 +1,5 @@
1
+ ### Refs #283616 customized `blacklistRoutes` to:
2
+
3
+ - Redirects to /en/resolveuid/ when /resolveuid/ is visited
4
+ - Replace window location only when route match doesn't come from a regex
5
+ to properly handle urls hitting notInEn regex without an endless loop
@@ -0,0 +1,21 @@
1
+ 24,39c24,26
2
+ < // EEA Redirect to /en fixing too many relative ../
3
+ < if (
4
+ < pathname.indexOf('resolveuid') !== -1 &&
5
+ < pathname.indexOf('/en/') === -1
6
+ < ) {
7
+ < window.location.replace(
8
+ < pathname.replace('/resolveuid/', '/en/resolveuid/'),
9
+ < );
10
+ < }
11
+ < // EEA replace location only when route match doesn't come from a regex
12
+ < // to properly handle urls hitting notInEn regex
13
+ < if (!(route.match.path instanceof RegExp)) {
14
+ < window.location.replace(
15
+ < route.url ? route.url(action.payload) : pathname,
16
+ < );
17
+ < }
18
+ ---
19
+ > window.location.replace(
20
+ > route.url ? route.url(action.payload) : pathname,
21
+ > );
@@ -0,0 +1,47 @@
1
+ import config from '@plone/volto/registry';
2
+ import { matchPath } from 'react-router';
3
+
4
+ const blacklistRoutes =
5
+ ({ dispatch, getState }) =>
6
+ (next) =>
7
+ (action) => {
8
+ if (typeof action === 'function') {
9
+ return next(action);
10
+ }
11
+
12
+ switch (action.type) {
13
+ case '@@router/LOCATION_CHANGE':
14
+ const { pathname } = action.payload.location;
15
+ const { externalRoutes = [] } = config.settings;
16
+
17
+ const route = externalRoutes.find((route) =>
18
+ matchPath(pathname, route.match),
19
+ );
20
+
21
+ if (!route) {
22
+ return next(action);
23
+ } else {
24
+ // EEA Redirect to /en fixing too many relative ../
25
+ if (
26
+ pathname.indexOf('resolveuid') !== -1 &&
27
+ pathname.indexOf('/en/') === -1
28
+ ) {
29
+ window.location.replace(
30
+ pathname.replace('/resolveuid/', '/en/resolveuid/'),
31
+ );
32
+ }
33
+ // EEA replace location only when route match doesn't come from a regex
34
+ // to properly handle urls hitting notInEn regex
35
+ if (!(route.match.path instanceof RegExp)) {
36
+ window.location.replace(
37
+ route.url ? route.url(action.payload) : pathname,
38
+ );
39
+ }
40
+ }
41
+ break;
42
+ default:
43
+ return next(action);
44
+ }
45
+ };
46
+
47
+ export default blacklistRoutes;
package/src/helpers.js CHANGED
@@ -1,5 +1,7 @@
1
1
  import { isArray } from 'lodash';
2
2
  import config from '@plone/volto/registry';
3
+ import { getContent } from '@plone/volto/actions';
4
+ import { flattenToAppURL } from '@plone/volto/helpers';
3
5
  import { serializeNodes } from '@plone/volto-slate/editor/render';
4
6
 
5
7
  export const createSlateParagraph = (text) => {
@@ -27,3 +29,12 @@ export const appendGroup = (config, id, title) => {
27
29
 
28
30
  return config.blocks.groupBlocksOrder;
29
31
  };
32
+
33
+ export const getAsyncData = ({ dispatch, id, data, path }) => {
34
+ const diffView = path.slice(path.lastIndexOf('/'), path.length) === '/diff';
35
+ const url = flattenToAppURL(data.url || '');
36
+ if (!url || !diffView) {
37
+ return [Promise.resolve()];
38
+ }
39
+ return [dispatch(getContent(url, null, id))];
40
+ };
package/src/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { runtimeConfig } from '@plone/volto/runtime_config';
2
- import { appendGroup } from './helpers';
2
+ import { appendGroup, getAsyncData } from './helpers';
3
3
  import { FrequencyOfDissemination } from '@eeacms/volto-eea-website-policy/components/Widgets/FrequencyOfDissemination';
4
4
 
5
5
  const restrictedBlocks = [
@@ -75,6 +75,16 @@ const applyConfig = (config) => {
75
75
  ];
76
76
  }
77
77
 
78
+ if (config.blocks.blocksConfig.embed_static_content) {
79
+ //prepopulate data for SSR particularly for history diffs
80
+ config.blocks.blocksConfig.embed_static_content.getAsyncData = getAsyncData;
81
+ }
82
+
83
+ if (config.blocks.blocksConfig.embed_content) {
84
+ //prepopulate data for SSR particularly for history diffs
85
+ config.blocks.blocksConfig.embed_content.getAsyncData = getAsyncData;
86
+ }
87
+
78
88
  // Working-copy
79
89
  config.settings.hasWorkingCopySupport = true;
80
90