From 6e4d954cee33d41d34283427c17470c6cc1acfc4 Mon Sep 17 00:00:00 2001 From: Miu Razvan Date: Fri, 16 Jun 2023 10:39:56 +0300 Subject: [PATCH 1/8] feat: move tableau and eea-map to data visualization group --- src/helpers.js | 18 ++++++++++++++++++ src/index.js | 31 +++++++++++++++++++++++++++++-- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/src/helpers.js b/src/helpers.js index 6791250..a542d8e 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -9,3 +9,21 @@ export const createSlateParagraph = (text) => { export const serializeText = (text) => { return isArray(text) ? serializeNodes(text) : text; }; + +export const appendGroup = (config, id, title) => { + const groupExists = + config.blocks.groupBlocksOrder.filter((group) => group.id === id).length > + 0; + + if (!groupExists) { + config.blocks.groupBlocksOrder = [ + ...config.blocks.groupBlocksOrder, + { + id, + title, + }, + ]; + } + + return config.blocks.groupBlocksOrder; +}; diff --git a/src/index.js b/src/index.js index ef67cff..cdfd15b 100644 --- a/src/index.js +++ b/src/index.js @@ -1,10 +1,9 @@ import { runtimeConfig } from '@plone/volto/runtime_config'; import installContextNavigationBlock from '@eeacms/volto-eea-website-policy/components/Blocks/ContextNavigation'; +import { appendGroup } from './helpers'; const restrictedBlocks = [ 'imagecards', - 'embed_eea_tableau_block', - 'embed_eea_map_block', // TODO: use what is needed from volto-datablocks after clean-up 'conditionalDataBlock', 'countryFlag', @@ -15,6 +14,18 @@ const restrictedBlocks = [ 'simpleDataConnectedTable', ]; +const overrideBlocks = { + embed_tableau_visualization: { + group: 'plotly', + }, + tableau_block: { + group: 'plotly', + }, + embed_eea_map_block: { + group: 'plotly', + }, +}; + const applyConfig = (config) => { // #158717#note-25 any path that isn't static, en or controlpanel is treated as external const notInEN = /^(?!(#|\/en|\/static|\/controlpanel|\/cypress|\/login|\/logout|\/contact-form)).*$/; @@ -78,6 +89,12 @@ const applyConfig = (config) => { config, ); + // Add groups + config.blocks.groupBlocksOrder = appendGroup( + 'plotly', + 'Data Visualizations (Beta)', + ); + // Disable some blocks restrictedBlocks.forEach((block) => { if (config.blocks.blocksConfig[block]) { @@ -85,6 +102,16 @@ const applyConfig = (config) => { } }); + // Override blocks config + overrideBlocks.forEach((block) => { + if (config.blocks.blocksConfig[block]) { + config.blocks.blocksConfig[block] = { + ...config.blocks.blocksConfig[block], + ...overrideBlocks[block], + }; + } + }); + config.settings.apiExpanders = [ ...config.settings.apiExpanders, { From 6974dc4126d876510bb8ec63732bf350cf79d1ab Mon Sep 17 00:00:00 2001 From: Miu Razvan Date: Fri, 16 Jun 2023 11:57:57 +0300 Subject: [PATCH 2/8] changed gropup of plotly to data_visualizations --- src/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index cdfd15b..69371f6 100644 --- a/src/index.js +++ b/src/index.js @@ -16,13 +16,13 @@ const restrictedBlocks = [ const overrideBlocks = { embed_tableau_visualization: { - group: 'plotly', + group: 'data_visualizations', }, tableau_block: { - group: 'plotly', + group: 'data_visualizations', }, embed_eea_map_block: { - group: 'plotly', + group: 'data_visualizations', }, }; @@ -91,7 +91,7 @@ const applyConfig = (config) => { // Add groups config.blocks.groupBlocksOrder = appendGroup( - 'plotly', + 'data_visualizations', 'Data Visualizations (Beta)', ); From 09a914e695c0f05a3076c2e7ae5c708dac2a7787 Mon Sep 17 00:00:00 2001 From: Miu Razvan Date: Fri, 16 Jun 2023 12:29:50 +0300 Subject: [PATCH 3/8] call appendGroup with all parameters --- src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.js b/src/index.js index 69371f6..3f301da 100644 --- a/src/index.js +++ b/src/index.js @@ -91,6 +91,7 @@ const applyConfig = (config) => { // Add groups config.blocks.groupBlocksOrder = appendGroup( + config, 'data_visualizations', 'Data Visualizations (Beta)', ); From 6e1a27e15d1576643be6b88d2b8e888a538fc6e5 Mon Sep 17 00:00:00 2001 From: Miu Razvan Date: Fri, 16 Jun 2023 12:36:42 +0300 Subject: [PATCH 4/8] fix overrideBlocks --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 3f301da..6028c6c 100644 --- a/src/index.js +++ b/src/index.js @@ -104,7 +104,7 @@ const applyConfig = (config) => { }); // Override blocks config - overrideBlocks.forEach((block) => { + Object.keys(overrideBlocks).forEach((block) => { if (config.blocks.blocksConfig[block]) { config.blocks.blocksConfig[block] = { ...config.blocks.blocksConfig[block], From 0d782f90c72080f48f14f5f28a6ef63fba12cc7c Mon Sep 17 00:00:00 2001 From: Alin Voinea Date: Fri, 16 Jun 2023 12:43:52 +0300 Subject: [PATCH 5/8] chore: Move IMS dataFigure to data_visualizations group - refs #253827 --- src/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/index.js b/src/index.js index 6028c6c..eea20c0 100644 --- a/src/index.js +++ b/src/index.js @@ -24,6 +24,9 @@ const overrideBlocks = { embed_eea_map_block: { group: 'data_visualizations', }, + dataFigure: { + group: 'data_visualizations', + }, }; const applyConfig = (config) => { From 9e81b472b184482a25c3f20da4ed95b1e86ed5bb Mon Sep 17 00:00:00 2001 From: EEA Jenkins <@users.noreply.github.com> Date: Fri, 16 Jun 2023 09:56:38 +0000 Subject: [PATCH 6/8] Automated release 1.6.4 --- CHANGELOG.md | 15 +++++++++++++++ package.json | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7260c71..8d98b64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +### [1.6.4](https://github.com/eea/volto-eea-website-policy/compare/1.6.3...1.6.4) - 16 June 2023 + +#### :rocket: New Features + +- feat: move tableau and eea-map to data visualization group [Miu Razvan - [`6e4d954`](https://github.com/eea/volto-eea-website-policy/commit/6e4d954cee33d41d34283427c17470c6cc1acfc4)] + +#### :house: Internal changes + +- chore: Move IMS dataFigure to data_visualizations group - refs #253827 [Alin Voinea - [`0d782f9`](https://github.com/eea/volto-eea-website-policy/commit/0d782f90c72080f48f14f5f28a6ef63fba12cc7c)] + +#### :hammer_and_wrench: Others + +- fix overrideBlocks [Miu Razvan - [`6e1a27e`](https://github.com/eea/volto-eea-website-policy/commit/6e1a27e15d1576643be6b88d2b8e888a538fc6e5)] +- call appendGroup with all parameters [Miu Razvan - [`09a914e`](https://github.com/eea/volto-eea-website-policy/commit/09a914e695c0f05a3076c2e7ae5c708dac2a7787)] +- changed gropup of plotly to data_visualizations [Miu Razvan - [`6974dc4`](https://github.com/eea/volto-eea-website-policy/commit/6974dc4126d876510bb8ec63732bf350cf79d1ab)] ### [1.6.3](https://github.com/eea/volto-eea-website-policy/compare/1.6.2...1.6.3) - 13 June 2023 #### :bug: Bug Fixes diff --git a/package.json b/package.json index 07e5aab..6088943 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eeacms/volto-eea-website-policy", - "version": "1.6.3", + "version": "1.6.4", "description": "@eeacms/volto-eea-website-policy: Volto add-on", "main": "src/index.js", "author": "European Environment Agency: IDM2 A-Team", From 93c05fae93b075223ef3f232963b7b4c9c682f42 Mon Sep 17 00:00:00 2001 From: Alin Voinea Date: Fri, 16 Jun 2023 13:03:01 +0300 Subject: [PATCH 7/8] Release 1.7.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6088943..077d44d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eeacms/volto-eea-website-policy", - "version": "1.6.4", + "version": "1.7.0", "description": "@eeacms/volto-eea-website-policy: Volto add-on", "main": "src/index.js", "author": "European Environment Agency: IDM2 A-Team", From ff1bda31bc3f9f210a52863d35a0d558a2c69240 Mon Sep 17 00:00:00 2001 From: EEA Jenkins <@users.noreply.github.com> Date: Fri, 16 Jun 2023 10:12:28 +0000 Subject: [PATCH 8/8] Automated release 1.7.0 --- CHANGELOG.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d98b64..e8dadb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). -### [1.6.4](https://github.com/eea/volto-eea-website-policy/compare/1.6.3...1.6.4) - 16 June 2023 +### [1.7.0](https://github.com/eea/volto-eea-website-policy/compare/1.6.3...1.7.0) - 16 June 2023 #### :rocket: New Features @@ -16,6 +16,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others +- Release 1.7.0 [Alin Voinea - [`93c05fa`](https://github.com/eea/volto-eea-website-policy/commit/93c05fae93b075223ef3f232963b7b4c9c682f42)] - fix overrideBlocks [Miu Razvan - [`6e1a27e`](https://github.com/eea/volto-eea-website-policy/commit/6e1a27e15d1576643be6b88d2b8e888a538fc6e5)] - call appendGroup with all parameters [Miu Razvan - [`09a914e`](https://github.com/eea/volto-eea-website-policy/commit/09a914e695c0f05a3076c2e7ae5c708dac2a7787)] - changed gropup of plotly to data_visualizations [Miu Razvan - [`6974dc4`](https://github.com/eea/volto-eea-website-policy/commit/6974dc4126d876510bb8ec63732bf350cf79d1ab)] @@ -61,7 +62,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Release 1.5.0 [Alin Voinea - [`a3dea8e`](https://github.com/eea/volto-eea-website-policy/commit/a3dea8ea15cb8d2a876dc10da926ece3a5707ea9)] - test(Jenkinsfile): Use latest stable volto for testing [Alin Voinea - [`a8f7123`](https://github.com/eea/volto-eea-website-policy/commit/a8f712364187f9638886667c249fa102cb49b5c0)] -- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`124a8f8`](https://github.com/eea/volto-eea-website-policy/commit/124a8f8ad4ced507aeec27012d725f2e2b977e08)] ### [1.4.0](https://github.com/eea/volto-eea-website-policy/compare/1.3.4...1.4.0) - 21 February 2023 #### :rocket: New Features @@ -141,7 +141,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others - Release 1.1.0 [Alin Voinea - [`0291b3b`](https://github.com/eea/volto-eea-website-policy/commit/0291b3bb7b4c6ab09ca98728885cea4051eac8e3)] -- yarn 3 [Alin Voinea - [`593aa58`](https://github.com/eea/volto-eea-website-policy/commit/593aa58eaa4d28aced0603b7f7dd125c857a6f54)] ### [1.0.4](https://github.com/eea/volto-eea-website-policy/compare/1.0.3...1.0.4) - 22 November 2022 #### :nail_care: Enhancements @@ -187,7 +186,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others -- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`d153f54`](https://github.com/eea/volto-eea-website-policy/commit/d153f54e55e918fa4746e05488c734624eaf14a9)] ### [0.4.0](https://github.com/eea/volto-eea-website-policy/compare/0.3.3...0.4.0) - 19 September 2022 #### :hammer_and_wrench: Others @@ -263,7 +261,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - format index.js [Andrei Grigore - [`db4481a`](https://github.com/eea/volto-eea-website-policy/commit/db4481aeeba59a769272659f33278c902fc69bec)] - Update index.js [Alexandru Ghica - [`dc09886`](https://github.com/eea/volto-eea-website-policy/commit/dc0988640a76a9914381b120f58bb61a9ab1eb39)] - Added externalRoutes [Alexandru Ghica - [`b68135b`](https://github.com/eea/volto-eea-website-policy/commit/b68135b013fafa93a41ea602ea2fad30879abe0f)] -- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`575cca6`](https://github.com/eea/volto-eea-website-policy/commit/575cca674602ca2e1c2a41300c47ba594ff49aa0)] ### [0.1.1](https://github.com/eea/volto-eea-website-policy/compare/0.1.0...0.1.1) - 4 March 2022 #### :hammer_and_wrench: Others @@ -276,5 +273,4 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others -- yarn bootstrap [Alin Voinea - [`9b4d197`](https://github.com/eea/volto-eea-website-policy/commit/9b4d197cbc7992566cb36524d190078d5ad21a44)] - Initial commit [Alin Voinea - [`3800692`](https://github.com/eea/volto-eea-website-policy/commit/3800692f7a4de6460815bd6061facacb986cbef0)]