Skip to content

Commit

Permalink
Merge pull request #257 from eea/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
avoinea authored Aug 28, 2024
2 parents 2c424d1 + 097da24 commit fbb649a
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 9 deletions.
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
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-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",
Expand Down
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
23 changes: 19 additions & 4 deletions src/customizations/volto/components/manage/Blocks/Grid/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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) => {
Expand Down Expand Up @@ -48,7 +61,9 @@ const GridBlockView = (props) => {
{...props}
blockWrapperTag={Grid.Column}
metadata={metadata}
content={convertTeaserToGridIfNecessary(data)}
content={convertTeaserToGridIfNecessaryAndTransformEmptyBlocksToSlate(
data,
)}
location={location}
blocksConfig={blocksConfig}
isContainer
Expand Down
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit fbb649a

Please sign in to comment.