From 1017b47d62e4063657596e1732d237b3b81cc417 Mon Sep 17 00:00:00 2001 From: Fred van Dijk Date: Thu, 22 Feb 2024 21:38:02 +0100 Subject: [PATCH] frontend, run make i18n, make format. Fix regression in fix for mobile labe, add htmlFor backend: use latest plone/code-qualiry --- backend/Makefile | 2 +- frontend/locales/de/LC_MESSAGES/volto.po | 5 ++ frontend/locales/en/LC_MESSAGES/volto.po | 5 ++ frontend/locales/es/LC_MESSAGES/volto.po | 5 ++ frontend/locales/eu/LC_MESSAGES/volto.po | 5 ++ frontend/locales/fr/LC_MESSAGES/volto.po | 5 ++ frontend/locales/it/LC_MESSAGES/volto.po | 5 ++ frontend/locales/ja/LC_MESSAGES/volto.po | 5 ++ frontend/locales/nl/LC_MESSAGES/volto.po | 5 ++ frontend/locales/pt/LC_MESSAGES/volto.po | 5 ++ frontend/locales/pt_BR/LC_MESSAGES/volto.po | 5 ++ frontend/locales/ro/LC_MESSAGES/volto.po | 5 ++ frontend/locales/volto.pot | 7 ++- frontend/package.json | 3 +- .../components/Blocks/IconsAndText/Edit.jsx | 6 ++- .../Blocks/IconsAndText/Sidebar.jsx | 50 +++++++++++++++---- .../components/Blocks/IconsAndText/View.jsx | 16 +++++- .../components/blocks/icons_and_text.less | 1 + frontend/theme/globals/site.overrides | 22 +++++--- 19 files changed, 138 insertions(+), 24 deletions(-) diff --git a/backend/Makefile b/backend/Makefile index 5aba2f7..8562816 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -20,7 +20,7 @@ PLONE_VERSION=$$(cat version.txt) BACKEND_FOLDER=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) -CODE_QUALITY_VERSION=2.0.2 +CODE_QUALITY_VERSION=2.1.1 ifndef LOG_LEVEL LOG_LEVEL=INFO endif diff --git a/frontend/locales/de/LC_MESSAGES/volto.po b/frontend/locales/de/LC_MESSAGES/volto.po index a15098d..1a2fdcc 100644 --- a/frontend/locales/de/LC_MESSAGES/volto.po +++ b/frontend/locales/de/LC_MESSAGES/volto.po @@ -840,6 +840,11 @@ msgstr "" msgid "link_to_description" msgstr "" +#: components/Blocks/IconsAndText/Sidebar +# defaultMessage: Center column heading on mobile +msgid "mobileStyles" +msgstr "" + #: components/Blocks/IconsAndText/Sidebar # defaultMessage: Do not fit the columns to the available space msgid "noAdaptColumns" diff --git a/frontend/locales/en/LC_MESSAGES/volto.po b/frontend/locales/en/LC_MESSAGES/volto.po index 15a267b..14c8a31 100644 --- a/frontend/locales/en/LC_MESSAGES/volto.po +++ b/frontend/locales/en/LC_MESSAGES/volto.po @@ -825,6 +825,11 @@ msgstr "" msgid "link_to_description" msgstr "" +#: components/Blocks/IconsAndText/Sidebar +# defaultMessage: Center column heading on mobile +msgid "mobileStyles" +msgstr "" + #: components/Blocks/IconsAndText/Sidebar # defaultMessage: Do not fit the columns to the available space msgid "noAdaptColumns" diff --git a/frontend/locales/es/LC_MESSAGES/volto.po b/frontend/locales/es/LC_MESSAGES/volto.po index deb7a64..42f5b76 100644 --- a/frontend/locales/es/LC_MESSAGES/volto.po +++ b/frontend/locales/es/LC_MESSAGES/volto.po @@ -835,6 +835,11 @@ msgstr "" msgid "link_to_description" msgstr "" +#: components/Blocks/IconsAndText/Sidebar +# defaultMessage: Center column heading on mobile +msgid "mobileStyles" +msgstr "" + #: components/Blocks/IconsAndText/Sidebar # defaultMessage: Do not fit the columns to the available space msgid "noAdaptColumns" diff --git a/frontend/locales/eu/LC_MESSAGES/volto.po b/frontend/locales/eu/LC_MESSAGES/volto.po index 1d6c495..8bfe178 100644 --- a/frontend/locales/eu/LC_MESSAGES/volto.po +++ b/frontend/locales/eu/LC_MESSAGES/volto.po @@ -830,6 +830,11 @@ msgstr "" msgid "link_to_description" msgstr "" +#: components/Blocks/IconsAndText/Sidebar +# defaultMessage: Center column heading on mobile +msgid "mobileStyles" +msgstr "" + #: components/Blocks/IconsAndText/Sidebar # defaultMessage: Do not fit the columns to the available space msgid "noAdaptColumns" diff --git a/frontend/locales/fr/LC_MESSAGES/volto.po b/frontend/locales/fr/LC_MESSAGES/volto.po index 7fc1f90..d12c554 100644 --- a/frontend/locales/fr/LC_MESSAGES/volto.po +++ b/frontend/locales/fr/LC_MESSAGES/volto.po @@ -840,6 +840,11 @@ msgstr "" msgid "link_to_description" msgstr "" +#: components/Blocks/IconsAndText/Sidebar +# defaultMessage: Center column heading on mobile +msgid "mobileStyles" +msgstr "" + #: components/Blocks/IconsAndText/Sidebar # defaultMessage: Do not fit the columns to the available space msgid "noAdaptColumns" diff --git a/frontend/locales/it/LC_MESSAGES/volto.po b/frontend/locales/it/LC_MESSAGES/volto.po index 15a267b..14c8a31 100644 --- a/frontend/locales/it/LC_MESSAGES/volto.po +++ b/frontend/locales/it/LC_MESSAGES/volto.po @@ -825,6 +825,11 @@ msgstr "" msgid "link_to_description" msgstr "" +#: components/Blocks/IconsAndText/Sidebar +# defaultMessage: Center column heading on mobile +msgid "mobileStyles" +msgstr "" + #: components/Blocks/IconsAndText/Sidebar # defaultMessage: Do not fit the columns to the available space msgid "noAdaptColumns" diff --git a/frontend/locales/ja/LC_MESSAGES/volto.po b/frontend/locales/ja/LC_MESSAGES/volto.po index 8e9ebf2..6600bd7 100644 --- a/frontend/locales/ja/LC_MESSAGES/volto.po +++ b/frontend/locales/ja/LC_MESSAGES/volto.po @@ -832,6 +832,11 @@ msgstr "" msgid "link_to_description" msgstr "" +#: components/Blocks/IconsAndText/Sidebar +# defaultMessage: Center column heading on mobile +msgid "mobileStyles" +msgstr "" + #: components/Blocks/IconsAndText/Sidebar # defaultMessage: Do not fit the columns to the available space msgid "noAdaptColumns" diff --git a/frontend/locales/nl/LC_MESSAGES/volto.po b/frontend/locales/nl/LC_MESSAGES/volto.po index 70ad13d..a9720f4 100644 --- a/frontend/locales/nl/LC_MESSAGES/volto.po +++ b/frontend/locales/nl/LC_MESSAGES/volto.po @@ -844,6 +844,11 @@ msgstr "" msgid "link_to_description" msgstr "" +#: components/Blocks/IconsAndText/Sidebar +# defaultMessage: Center column heading on mobile +msgid "mobileStyles" +msgstr "" + #: components/Blocks/IconsAndText/Sidebar # defaultMessage: Do not fit the columns to the available space msgid "noAdaptColumns" diff --git a/frontend/locales/pt/LC_MESSAGES/volto.po b/frontend/locales/pt/LC_MESSAGES/volto.po index 45512a0..b61a527 100644 --- a/frontend/locales/pt/LC_MESSAGES/volto.po +++ b/frontend/locales/pt/LC_MESSAGES/volto.po @@ -833,6 +833,11 @@ msgstr "" msgid "link_to_description" msgstr "" +#: components/Blocks/IconsAndText/Sidebar +# defaultMessage: Center column heading on mobile +msgid "mobileStyles" +msgstr "" + #: components/Blocks/IconsAndText/Sidebar # defaultMessage: Do not fit the columns to the available space msgid "noAdaptColumns" diff --git a/frontend/locales/pt_BR/LC_MESSAGES/volto.po b/frontend/locales/pt_BR/LC_MESSAGES/volto.po index 7df704a..4415e2d 100644 --- a/frontend/locales/pt_BR/LC_MESSAGES/volto.po +++ b/frontend/locales/pt_BR/LC_MESSAGES/volto.po @@ -831,6 +831,11 @@ msgstr "" msgid "link_to_description" msgstr "" +#: components/Blocks/IconsAndText/Sidebar +# defaultMessage: Center column heading on mobile +msgid "mobileStyles" +msgstr "" + #: components/Blocks/IconsAndText/Sidebar # defaultMessage: Do not fit the columns to the available space msgid "noAdaptColumns" diff --git a/frontend/locales/ro/LC_MESSAGES/volto.po b/frontend/locales/ro/LC_MESSAGES/volto.po index 4d2e1fa..31ff4f4 100644 --- a/frontend/locales/ro/LC_MESSAGES/volto.po +++ b/frontend/locales/ro/LC_MESSAGES/volto.po @@ -831,6 +831,11 @@ msgstr "" msgid "link_to_description" msgstr "" +#: components/Blocks/IconsAndText/Sidebar +# defaultMessage: Center column heading on mobile +msgid "mobileStyles" +msgstr "" + #: components/Blocks/IconsAndText/Sidebar # defaultMessage: Do not fit the columns to the available space msgid "noAdaptColumns" diff --git a/frontend/locales/volto.pot b/frontend/locales/volto.pot index 1de8577..aef4c2b 100644 --- a/frontend/locales/volto.pot +++ b/frontend/locales/volto.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Plone\n" -"POT-Creation-Date: 2023-09-18T18:44:24.417Z\n" +"POT-Creation-Date: 2024-02-22T20:31:53.047Z\n" "Last-Translator: Plone i18n \n" "Language-Team: Plone i18n \n" "MIME-Version: 1.0\n" @@ -827,6 +827,11 @@ msgstr "" msgid "link_to_description" msgstr "" +#: components/Blocks/IconsAndText/Sidebar +# defaultMessage: Center column heading on mobile +msgid "mobileStyles" +msgstr "" + #: components/Blocks/IconsAndText/Sidebar # defaultMessage: Do not fit the columns to the available space msgid "noAdaptColumns" diff --git a/frontend/package.json b/frontend/package.json index e57add9..8148b73 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -192,6 +192,7 @@ }, "packageManager": "yarn@3.2.3", "volta": { - "node": "16.20.2" + "node": "16.20.2", + "yarn": "3.8.0" } } diff --git a/frontend/src/components/Blocks/IconsAndText/Edit.jsx b/frontend/src/components/Blocks/IconsAndText/Edit.jsx index acfa5b2..34e90ed 100644 --- a/frontend/src/components/Blocks/IconsAndText/Edit.jsx +++ b/frontend/src/components/Blocks/IconsAndText/Edit.jsx @@ -106,7 +106,11 @@ const Edit = (props) => { /> ))} - + ); diff --git a/frontend/src/components/Blocks/IconsAndText/Sidebar.jsx b/frontend/src/components/Blocks/IconsAndText/Sidebar.jsx index 5232666..1919e29 100644 --- a/frontend/src/components/Blocks/IconsAndText/Sidebar.jsx +++ b/frontend/src/components/Blocks/IconsAndText/Sidebar.jsx @@ -1,8 +1,19 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Segment } from 'semantic-ui-react'; -import { FormattedMessage, useIntl, injectIntl, defineMessages } from 'react-intl'; -import { CheckboxWidget, ObjectListWidget, TextWidget, ObjectBrowserWidget, SelectWidget } from '@plone/volto/components'; +import { + FormattedMessage, + useIntl, + injectIntl, + defineMessages, +} from 'react-intl'; +import { + CheckboxWidget, + ObjectListWidget, + TextWidget, + ObjectBrowserWidget, + SelectWidget, +} from '@plone/volto/components'; import { ColorListWidget, AlignWidget } from '@package/components/Widgets'; @@ -67,7 +78,11 @@ const Sidebar = (props) => {

- : + + :

@@ -82,7 +97,9 @@ const Sidebar = (props) => { { name: 'light-grey', label: intl.formatMessage(messages.grey) }, ]} value={data.bg_color ?? 'outline-white'} - onChange={(name, value) => onChangeBlock(block, { ...data, [name]: value })} + onChange={(name, value) => + onChangeBlock(block, { ...data, [name]: value }) + } /> { { name: 'blue', label: intl.formatMessage(messages.blue) }, ]} value={data.title_color ?? 'grey'} - onChange={(name, value) => onChangeBlock(block, { ...data, [name]: value })} + onChange={(name, value) => + onChangeBlock(block, { ...data, [name]: value }) + } /> { {...props} id="columns" value={data?.columns ?? []} - onChange={(id, value) => onChangeBlock(block, { ...data, [id]: value })} + onChange={(id, value) => + onChangeBlock(block, { ...data, [id]: value }) + } schema={() => { const columnsSchema = { title: intl.formatMessage(messages.column), @@ -156,13 +177,21 @@ const Sidebar = (props) => { { id: 'default', title: 'Default', - fields: ['iconImage', 'iconSize', 'headerTextPosition', 'dividerPosition', 'href', 'href_title'], + fields: [ + 'iconImage', + 'iconSize', + 'headerTextPosition', + 'dividerPosition', + 'href', + 'href_title', + ], }, ], properties: { iconImage: { title: intl.formatMessage(messages.icon), - description: 'The image must be a PNG or SVG. The maximum recommended size for PNG is 200x200px.', + description: + 'The image must be a PNG or SVG. The maximum recommended size for PNG is 200x200px.', widget: 'image_upload_widget', openObjectBrowser: props.openObjectBrowser, }, @@ -204,7 +233,8 @@ const Sidebar = (props) => { }, href_title: { title: 'Link title', - description: 'If no title is entered, and a link is selected, the link will be added to the block title.', + description: + 'If no title is entered, and a link is selected, the link will be added to the block title.', }, }, @@ -241,7 +271,7 @@ const Sidebar = (props) => { /> - + { {(data.title || checkHasContent(data.description)) && (
{data.title &&
{data.title}
} - {checkHasContent(data.description) &&
{redraft(data.description, config.settings.richtextViewSettings.ToHTMLRenderers, config.settings.richtextViewSettings.ToHTMLOptions)}
} + {checkHasContent(data.description) && ( +
+ {redraft( + data.description, + config.settings.richtextViewSettings.ToHTMLRenderers, + config.settings.richtextViewSettings.ToHTMLOptions, + )} +
+ )}
)}
@@ -26,7 +34,11 @@ const View = ({ data }) => { ))}
- + ); diff --git a/frontend/theme/extras/site/components/blocks/icons_and_text.less b/frontend/theme/extras/site/components/blocks/icons_and_text.less index 071f384..fbb153d 100644 --- a/frontend/theme/extras/site/components/blocks/icons_and_text.less +++ b/frontend/theme/extras/site/components/blocks/icons_and_text.less @@ -316,6 +316,7 @@ .column-head { display: flex; justify-content: center; + .header-text { flex: none; } diff --git a/frontend/theme/globals/site.overrides b/frontend/theme/globals/site.overrides index 7e84f6b..758115c 100644 --- a/frontend/theme/globals/site.overrides +++ b/frontend/theme/globals/site.overrides @@ -72,18 +72,24 @@ h5:last-child { } } -#page-document, #page-edit { - - p a, ul a, ol a { - text-decoration:underline; +#page-document, +#page-edit { + p a, + ul a, + ol a { + text-decoration: underline; text-underline-position: under; + &:hover { - text-decoration:none; + text-decoration: none; } } } + #page-edit { - p a:hover, ul a:hover, ol a:hover { - text-decoration:underline; - } + p a:hover, + ul a:hover, + ol a:hover { + text-decoration: underline; } +}