From 1134a968d7df0817cb8b6fbc537a7af868388da0 Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Tue, 10 Dec 2024 19:05:59 +0100 Subject: [PATCH 1/4] Add missing styleWrapper style builder information in container/Grid block --- .../components/manage/Blocks/Container/EditBlockWrapper.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/volto/src/components/manage/Blocks/Container/EditBlockWrapper.jsx b/packages/volto/src/components/manage/Blocks/Container/EditBlockWrapper.jsx index 20d22753a6..60a2c5c952 100644 --- a/packages/volto/src/components/manage/Blocks/Container/EditBlockWrapper.jsx +++ b/packages/volto/src/components/manage/Blocks/Container/EditBlockWrapper.jsx @@ -4,7 +4,7 @@ import { defineMessages, useIntl } from 'react-intl'; import NewBlockAddButton from './NewBlockAddButton'; import cx from 'classnames'; import { isInteractiveElement } from '@plone/volto/helpers/Utils/Utils'; - +import { buildStyleObjectFromData } from '@plone/volto/helpers/Blocks/Blocks'; import clearSVG from '@plone/volto/icons/clear.svg'; const messages = defineMessages({ @@ -38,12 +38,15 @@ const EditBlockWrapper = (props) => { onChangeBlock(block, { '@type': 'empty' }); } + const style = buildStyleObjectFromData(data); + return (
Date: Tue, 10 Dec 2024 19:07:15 +0100 Subject: [PATCH 2/4] Add disable Teaser block Align handlers for teasers inside containers/grids --- .../src/components/manage/Blocks/Teaser/schema.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/volto/src/components/manage/Blocks/Teaser/schema.js b/packages/volto/src/components/manage/Blocks/Teaser/schema.js index 0950a0a909..2d3db65e2b 100644 --- a/packages/volto/src/components/manage/Blocks/Teaser/schema.js +++ b/packages/volto/src/components/manage/Blocks/Teaser/schema.js @@ -127,3 +127,15 @@ export const gridTeaserDisableStylingSchema = ({ schema, formData, intl }) => { schema.fieldsets = schema.fieldsets.filter((item) => item.id !== 'styling'); return schema; }; + +export const gridTeaserDisableAlignHandlersSchema = ({ + schema, + formData, + intl, +}) => { + schema.properties.styles.schema.fieldsets[0].fields = + schema.properties.styles.schema.fieldsets[0].fields.filter( + (item) => !['align'].includes(item), + ); + return schema; +}; From 289b3ceb4289adef23f991bc3932d72d27713daa Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Tue, 10 Dec 2024 19:11:10 +0100 Subject: [PATCH 3/4] Changelog --- packages/volto/news/6527.bugfix | 1 + packages/volto/news/6527.feature | 1 + 2 files changed, 2 insertions(+) create mode 100644 packages/volto/news/6527.bugfix create mode 100644 packages/volto/news/6527.feature diff --git a/packages/volto/news/6527.bugfix b/packages/volto/news/6527.bugfix new file mode 100644 index 0000000000..4a00c421f7 --- /dev/null +++ b/packages/volto/news/6527.bugfix @@ -0,0 +1 @@ +Add missing styleWrapper style builder information in container/Grid. @sneridagh diff --git a/packages/volto/news/6527.feature b/packages/volto/news/6527.feature new file mode 100644 index 0000000000..09ccd3175d --- /dev/null +++ b/packages/volto/news/6527.feature @@ -0,0 +1 @@ +Add disable Teaser block Align handlers for teasers inside containers. @sneridagh From 9f2f948045bd0ea78f2fa84ed7e923e480218c6d Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Wed, 11 Dec 2024 09:16:18 +0100 Subject: [PATCH 4/4] Remove `gridTeaserDisableAlignHandlersSchema` move to VLT only for now --- .../src/components/manage/Blocks/Teaser/schema.js | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/packages/volto/src/components/manage/Blocks/Teaser/schema.js b/packages/volto/src/components/manage/Blocks/Teaser/schema.js index 2d3db65e2b..0950a0a909 100644 --- a/packages/volto/src/components/manage/Blocks/Teaser/schema.js +++ b/packages/volto/src/components/manage/Blocks/Teaser/schema.js @@ -127,15 +127,3 @@ export const gridTeaserDisableStylingSchema = ({ schema, formData, intl }) => { schema.fieldsets = schema.fieldsets.filter((item) => item.id !== 'styling'); return schema; }; - -export const gridTeaserDisableAlignHandlersSchema = ({ - schema, - formData, - intl, -}) => { - schema.properties.styles.schema.fieldsets[0].fields = - schema.properties.styles.schema.fieldsets[0].fields.filter( - (item) => !['align'].includes(item), - ); - return schema; -};