diff --git a/CHANGELOG.md b/CHANGELOG.md index d5e2a3e6..83286d09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,15 +4,19 @@ 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). +### [2.2.1](https://github.com/eea/volto-eea-website-theme/compare/2.2.0...2.2.1) - 28 August 2024 + +#### :bug: Bug Fixes + +- fix: transform empty blocks to slate - refs #273976 [dobri1408 - [`0925e79`](https://github.com/eea/volto-eea-website-theme/commit/0925e79e2bb4a1e378a90299274777a3866fade7)] +- fix: Footer explore our env label - refs #265857 [Alin Voinea - [`a98304a`](https://github.com/eea/volto-eea-website-theme/commit/a98304a6904e0524611d5abdf768bdf5e584cb15)] + ### [2.2.0](https://github.com/eea/volto-eea-website-theme/compare/2.1.6...2.2.0) - 26 August 2024 #### :nail_care: Enhancements - refactor: Simplify footer according to the #265857 [dobri1408 - [`27d0393`](https://github.com/eea/volto-eea-website-theme/commit/27d0393fdf84230f8e77a3f851b09befc882dafa)] -#### :hammer_and_wrench: Others - -- Release 2.2.0 [Alin Voinea - [`0cb60c6`](https://github.com/eea/volto-eea-website-theme/commit/0cb60c6dc7d3aa8e7652e1368cc1d0271a370d3b)] ### [2.1.6](https://github.com/eea/volto-eea-website-theme/compare/2.1.5...2.1.6) - 21 August 2024 ### [2.1.5](https://github.com/eea/volto-eea-website-theme/compare/2.1.4...2.1.5) - 5 August 2024 diff --git a/package.json b/package.json index 0fa76a08..61c1e153 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eeacms/volto-eea-website-theme", - "version": "2.2.0", + "version": "2.2.1", "description": "@eeacms/volto-eea-website-theme: Volto add-on", "main": "src/index.js", "author": "European Environment Agency: IDM2 A-Team", diff --git a/src/config.js b/src/config.js index af4e03b0..9d946f11 100644 --- a/src/config.js +++ b/src/config.js @@ -15,7 +15,7 @@ import climateLogo from '@eeacms/volto-eea-design-system/../theme/themes/eea/ass // TODO: to be consolidated with headerLinks // Footer.jsx config options export const footerOpts = { - buttonName: 'Explore our Environmental information systems', + buttonName: 'Explore our environmental information systems', hrefButton: 'https://www.eea.europa.eu/en/information-systems', logosHeader: '', contactHeader: 'Contact Us', diff --git a/src/customizations/volto/components/manage/Blocks/Grid/View.jsx b/src/customizations/volto/components/manage/Blocks/Grid/View.jsx index 2411fdb9..8bacffb8 100644 --- a/src/customizations/volto/components/manage/Blocks/Grid/View.jsx +++ b/src/customizations/volto/components/manage/Blocks/Grid/View.jsx @@ -4,7 +4,7 @@ import { RenderBlocks } from '@plone/volto/components'; import { withBlockExtensions } from '@plone/volto/helpers'; import config from '@plone/volto/registry'; -const convertTeaserToGridIfNecessary = (data) => { +const convertTeaserToGridIfNecessaryAndTransformEmptyBlocksToSlate = (data) => { if (data?.['@type'] === 'teaserGrid') return { ...data, @@ -13,11 +13,24 @@ const convertTeaserToGridIfNecessary = (data) => { blocks: data?.columns?.reduce((acc, current) => { return { ...acc, - [current?.id]: current, + [current?.id]: { current, '@type': current['@type'] || 'slate' }, }; }, {}), }; - return data; + if (data.blocks) + return { + ...data, + blocks: Object.keys(data.blocks).reduce((acc, current) => { + return { + ...acc, + [current]: { + ...data.blocks[current], + '@type': data.blocks[current]?.['@type'] || 'slate', + }, + }; + }, {}), + }; + else return data; }; const GridBlockView = (props) => { @@ -48,7 +61,9 @@ const GridBlockView = (props) => { {...props} blockWrapperTag={Grid.Column} metadata={metadata} - content={convertTeaserToGridIfNecessary(data)} + content={convertTeaserToGridIfNecessaryAndTransformEmptyBlocksToSlate( + data, + )} location={location} blocksConfig={blocksConfig} isContainer diff --git a/src/customizations/volto/components/manage/Blocks/Grid/readme.md b/src/customizations/volto/components/manage/Blocks/Grid/readme.md index 8ab009d9..90e90706 100644 --- a/src/customizations/volto/components/manage/Blocks/Grid/readme.md +++ b/src/customizations/volto/components/manage/Blocks/Grid/readme.md @@ -1 +1,2 @@ These two customizations ensure backward compatibility with the legacy @kitconcept/volto-blocks-grid. For more details, refer to the ticket here: https://taskman.eionet.europa.eu/issues/265726. +Also, if there is an empty block, it will convert to slate, so the "Unkown block" message will not appear