Skip to content

Commit

Permalink
Merge pull request #54 from eea/develop
Browse files Browse the repository at this point in the history
feat: move tableau and eea-map to data visualization group
  • Loading branch information
avoinea authored Jun 16, 2023
2 parents 12afd10 + ff1bda3 commit 6e5fb1a
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 8 deletions.
21 changes: 16 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ 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.7.0](https://github.com/eea/volto-eea-website-policy/compare/1.6.3...1.7.0) - 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

- 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)]
### [1.6.3](https://github.com/eea/volto-eea-website-policy/compare/1.6.2...1.6.3) - 13 June 2023

#### :bug: Bug Fixes
Expand Down Expand Up @@ -46,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
Expand Down Expand Up @@ -126,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
Expand Down Expand Up @@ -172,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
Expand Down Expand Up @@ -248,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
Expand All @@ -261,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)]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-eea-website-policy",
"version": "1.6.3",
"version": "1.7.0",
"description": "@eeacms/volto-eea-website-policy: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
18 changes: 18 additions & 0 deletions src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
35 changes: 33 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -15,6 +14,21 @@ const restrictedBlocks = [
'simpleDataConnectedTable',
];

const overrideBlocks = {
embed_tableau_visualization: {
group: 'data_visualizations',
},
tableau_block: {
group: 'data_visualizations',
},
embed_eea_map_block: {
group: 'data_visualizations',
},
dataFigure: {
group: 'data_visualizations',
},
};

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)).*$/;
Expand Down Expand Up @@ -78,13 +92,30 @@ const applyConfig = (config) => {
config,
);

// Add groups
config.blocks.groupBlocksOrder = appendGroup(
config,
'data_visualizations',
'Data Visualizations (Beta)',
);

// Disable some blocks
restrictedBlocks.forEach((block) => {
if (config.blocks.blocksConfig[block]) {
config.blocks.blocksConfig[block].restricted = true;
}
});

// Override blocks config
Object.keys(overrideBlocks).forEach((block) => {
if (config.blocks.blocksConfig[block]) {
config.blocks.blocksConfig[block] = {
...config.blocks.blocksConfig[block],
...overrideBlocks[block],
};
}
});

config.settings.apiExpanders = [
...config.settings.apiExpanders,
{
Expand Down

0 comments on commit 6e5fb1a

Please sign in to comment.