@eeacms/volto-eea-website-policy 2.4.0 → 2.5.0

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,20 @@ 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.0](https://github.com/eea/volto-eea-website-policy/compare/2.3.2...2.4.0) - 27 February 2025
7
+ ### [2.5.0](https://github.com/eea/volto-eea-website-policy/compare/2.4.1...2.5.0) - 6 June 2025
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - Release 2.5.0 [Alin Voinea - [`b633e0c`](https://github.com/eea/volto-eea-website-policy/commit/b633e0c77705290c5a2d9645efdaa3e7a288e819)]
12
+ ### [2.4.1](https://github.com/eea/volto-eea-website-policy/compare/2.4.0...2.4.1) - 2 June 2025
13
+
14
+ #### :bug: Bug Fixes
15
+
16
+ - fix: IMS History diff is not showing charts - refs #286978 [Nilesh - [`06ee6ad`](https://github.com/eea/volto-eea-website-policy/commit/06ee6ad641132445f4a54eecd265aac95bf0f827)]
17
+
18
+ #### :hammer_and_wrench: Others
19
+
20
+ ### [2.4.0](https://github.com/eea/volto-eea-website-policy/compare/2.3.2...2.4.0) - 28 February 2025
8
21
 
9
22
  #### :bug: Bug Fixes
10
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-website-policy",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
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",
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
 
@@ -98,6 +108,34 @@ const applyConfig = (config) => {
98
108
  rolesWhoCanChangeLayout: ['Manager'],
99
109
  };
100
110
 
111
+ // mega menu layout settings
112
+ config.settings.menuItemsLayouts = {
113
+ '/en/topics': {
114
+ menuItemChildrenListColumns: [1, 4],
115
+ menuItemColumns: [
116
+ 'at-a-glance three wide column',
117
+ 'topics-right-column nine wide column',
118
+ ],
119
+ hideChildrenFromNavigation: false,
120
+ },
121
+ '/en/countries': {
122
+ menuItemColumns: ['eight wide column', 'four wide column'],
123
+ menuItemChildrenListColumns: [5, 2],
124
+ appendExtraMenuItemsToLastColumn: true,
125
+ hideChildrenFromNavigation: false,
126
+ },
127
+ '/en/about': {
128
+ hideChildrenFromNavigation: false,
129
+ },
130
+ '/en/ghg-knowledge-hub': {
131
+ hideChildrenFromNavigation: false,
132
+ },
133
+ // if you want to set default settings for all menu items that don't have a specific path
134
+ // '*': {
135
+ // hideChildrenFromNavigation: false,
136
+ // },
137
+ };
138
+
101
139
  // Add groups
102
140
  config.blocks.groupBlocksOrder = appendGroup(
103
141
  config,