@eeacms/volto-eea-website-policy 1.6.2 → 1.7.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,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.6.2](https://github.com/eea/volto-eea-website-policy/compare/1.6.1...1.6.2) - 12 June 2023
7
+ ### [1.7.0](https://github.com/eea/volto-eea-website-policy/compare/1.6.3...1.7.0) - 16 June 2023
8
+
9
+ #### :rocket: New Features
10
+
11
+ - feat: move tableau and eea-map to data visualization group [Miu Razvan - [`6e4d954`](https://github.com/eea/volto-eea-website-policy/commit/6e4d954cee33d41d34283427c17470c6cc1acfc4)]
12
+
13
+ #### :house: Internal changes
14
+
15
+ - chore: Move IMS dataFigure to data_visualizations group - refs #253827 [Alin Voinea - [`0d782f9`](https://github.com/eea/volto-eea-website-policy/commit/0d782f90c72080f48f14f5f28a6ef63fba12cc7c)]
16
+
17
+ #### :hammer_and_wrench: Others
18
+
19
+ - Release 1.7.0 [Alin Voinea - [`93c05fa`](https://github.com/eea/volto-eea-website-policy/commit/93c05fae93b075223ef3f232963b7b4c9c682f42)]
20
+ - fix overrideBlocks [Miu Razvan - [`6e1a27e`](https://github.com/eea/volto-eea-website-policy/commit/6e1a27e15d1576643be6b88d2b8e888a538fc6e5)]
21
+ - call appendGroup with all parameters [Miu Razvan - [`09a914e`](https://github.com/eea/volto-eea-website-policy/commit/09a914e695c0f05a3076c2e7ae5c708dac2a7787)]
22
+ - changed gropup of plotly to data_visualizations [Miu Razvan - [`6974dc4`](https://github.com/eea/volto-eea-website-policy/commit/6974dc4126d876510bb8ec63732bf350cf79d1ab)]
23
+ ### [1.6.3](https://github.com/eea/volto-eea-website-policy/compare/1.6.2...1.6.3) - 13 June 2023
24
+
25
+ #### :bug: Bug Fixes
26
+
27
+ - fix(notInEn): Fix regex to consider internal path only if the path starts with /en - refs #254258 [Alin Voinea - [`9e9ecd0`](https://github.com/eea/volto-eea-website-policy/commit/9e9ecd00a13ebe1767d11a145fc7869c36034e9e)]
28
+
29
+ ### [1.6.2](https://github.com/eea/volto-eea-website-policy/compare/1.6.1...1.6.2) - 13 June 2023
8
30
 
9
31
  #### :hammer_and_wrench: Others
10
32
 
@@ -40,7 +62,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
40
62
 
41
63
  - Release 1.5.0 [Alin Voinea - [`a3dea8e`](https://github.com/eea/volto-eea-website-policy/commit/a3dea8ea15cb8d2a876dc10da926ece3a5707ea9)]
42
64
  - test(Jenkinsfile): Use latest stable volto for testing [Alin Voinea - [`a8f7123`](https://github.com/eea/volto-eea-website-policy/commit/a8f712364187f9638886667c249fa102cb49b5c0)]
43
- - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`124a8f8`](https://github.com/eea/volto-eea-website-policy/commit/124a8f8ad4ced507aeec27012d725f2e2b977e08)]
44
65
  ### [1.4.0](https://github.com/eea/volto-eea-website-policy/compare/1.3.4...1.4.0) - 21 February 2023
45
66
 
46
67
  #### :rocket: New Features
@@ -120,7 +141,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
120
141
  #### :hammer_and_wrench: Others
121
142
 
122
143
  - Release 1.1.0 [Alin Voinea - [`0291b3b`](https://github.com/eea/volto-eea-website-policy/commit/0291b3bb7b4c6ab09ca98728885cea4051eac8e3)]
123
- - yarn 3 [Alin Voinea - [`593aa58`](https://github.com/eea/volto-eea-website-policy/commit/593aa58eaa4d28aced0603b7f7dd125c857a6f54)]
124
144
  ### [1.0.4](https://github.com/eea/volto-eea-website-policy/compare/1.0.3...1.0.4) - 22 November 2022
125
145
 
126
146
  #### :nail_care: Enhancements
@@ -166,7 +186,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
166
186
 
167
187
  #### :hammer_and_wrench: Others
168
188
 
169
- - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`d153f54`](https://github.com/eea/volto-eea-website-policy/commit/d153f54e55e918fa4746e05488c734624eaf14a9)]
170
189
  ### [0.4.0](https://github.com/eea/volto-eea-website-policy/compare/0.3.3...0.4.0) - 19 September 2022
171
190
 
172
191
  #### :hammer_and_wrench: Others
@@ -242,7 +261,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
242
261
  - format index.js [Andrei Grigore - [`db4481a`](https://github.com/eea/volto-eea-website-policy/commit/db4481aeeba59a769272659f33278c902fc69bec)]
243
262
  - Update index.js [Alexandru Ghica - [`dc09886`](https://github.com/eea/volto-eea-website-policy/commit/dc0988640a76a9914381b120f58bb61a9ab1eb39)]
244
263
  - Added externalRoutes [Alexandru Ghica - [`b68135b`](https://github.com/eea/volto-eea-website-policy/commit/b68135b013fafa93a41ea602ea2fad30879abe0f)]
245
- - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`575cca6`](https://github.com/eea/volto-eea-website-policy/commit/575cca674602ca2e1c2a41300c47ba594ff49aa0)]
246
264
  ### [0.1.1](https://github.com/eea/volto-eea-website-policy/compare/0.1.0...0.1.1) - 4 March 2022
247
265
 
248
266
  #### :hammer_and_wrench: Others
@@ -255,5 +273,4 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
255
273
 
256
274
  #### :hammer_and_wrench: Others
257
275
 
258
- - yarn bootstrap [Alin Voinea - [`9b4d197`](https://github.com/eea/volto-eea-website-policy/commit/9b4d197cbc7992566cb36524d190078d5ad21a44)]
259
276
  - Initial commit [Alin Voinea - [`3800692`](https://github.com/eea/volto-eea-website-policy/commit/3800692f7a4de6460815bd6061facacb986cbef0)]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-website-policy",
3
- "version": "1.6.2",
3
+ "version": "1.7.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
@@ -9,3 +9,21 @@ export const createSlateParagraph = (text) => {
9
9
  export const serializeText = (text) => {
10
10
  return isArray(text) ? serializeNodes(text) : text;
11
11
  };
12
+
13
+ export const appendGroup = (config, id, title) => {
14
+ const groupExists =
15
+ config.blocks.groupBlocksOrder.filter((group) => group.id === id).length >
16
+ 0;
17
+
18
+ if (!groupExists) {
19
+ config.blocks.groupBlocksOrder = [
20
+ ...config.blocks.groupBlocksOrder,
21
+ {
22
+ id,
23
+ title,
24
+ },
25
+ ];
26
+ }
27
+
28
+ return config.blocks.groupBlocksOrder;
29
+ };
package/src/index.js CHANGED
@@ -1,10 +1,9 @@
1
1
  import { runtimeConfig } from '@plone/volto/runtime_config';
2
2
  import installContextNavigationBlock from '@eeacms/volto-eea-website-policy/components/Blocks/ContextNavigation';
3
+ import { appendGroup } from './helpers';
3
4
 
4
5
  const restrictedBlocks = [
5
6
  'imagecards',
6
- 'embed_eea_tableau_block',
7
- 'embed_eea_map_block',
8
7
  // TODO: use what is needed from volto-datablocks after clean-up
9
8
  'conditionalDataBlock',
10
9
  'countryFlag',
@@ -15,9 +14,24 @@ const restrictedBlocks = [
15
14
  'simpleDataConnectedTable',
16
15
  ];
17
16
 
17
+ const overrideBlocks = {
18
+ embed_tableau_visualization: {
19
+ group: 'data_visualizations',
20
+ },
21
+ tableau_block: {
22
+ group: 'data_visualizations',
23
+ },
24
+ embed_eea_map_block: {
25
+ group: 'data_visualizations',
26
+ },
27
+ dataFigure: {
28
+ group: 'data_visualizations',
29
+ },
30
+ };
31
+
18
32
  const applyConfig = (config) => {
19
33
  // #158717#note-25 any path that isn't static, en or controlpanel is treated as external
20
- const notInEN = /^(?!.*(#|\/en|\/static|\/controlpanel|\/cypress|\/login|\/logout|\/contact-form)).*$/;
34
+ const notInEN = /^(?!(#|\/en|\/static|\/controlpanel|\/cypress|\/login|\/logout|\/contact-form)).*$/;
21
35
  config.settings.externalRoutes = [
22
36
  ...(config.settings.externalRoutes || []),
23
37
  {
@@ -78,6 +92,13 @@ const applyConfig = (config) => {
78
92
  config,
79
93
  );
80
94
 
95
+ // Add groups
96
+ config.blocks.groupBlocksOrder = appendGroup(
97
+ config,
98
+ 'data_visualizations',
99
+ 'Data Visualizations (Beta)',
100
+ );
101
+
81
102
  // Disable some blocks
82
103
  restrictedBlocks.forEach((block) => {
83
104
  if (config.blocks.blocksConfig[block]) {
@@ -85,6 +106,16 @@ const applyConfig = (config) => {
85
106
  }
86
107
  });
87
108
 
109
+ // Override blocks config
110
+ Object.keys(overrideBlocks).forEach((block) => {
111
+ if (config.blocks.blocksConfig[block]) {
112
+ config.blocks.blocksConfig[block] = {
113
+ ...config.blocks.blocksConfig[block],
114
+ ...overrideBlocks[block],
115
+ };
116
+ }
117
+ });
118
+
88
119
  config.settings.apiExpanders = [
89
120
  ...config.settings.apiExpanders,
90
121
  {