diff --git a/locales/de/LC_MESSAGES/volto.po b/locales/de/LC_MESSAGES/volto.po index 2765e821b..d207e2f78 100644 --- a/locales/de/LC_MESSAGES/volto.po +++ b/locales/de/LC_MESSAGES/volto.po @@ -384,6 +384,11 @@ msgstr "" msgid "L'evento non si terrà nelle seguenti date" msgstr "" +#: overrideTranslations +# defaultMessage: This is a language independent field. Any value you enter here will overwrite the corresponding field of all members of the translation group when you save this form. +msgid "Language independent icon title" +msgstr "" + #: components/ItaliaTheme/Blocks/Calendar/ListingSidebar # defaultMessage: Link more msgid "Link more" diff --git a/locales/en/LC_MESSAGES/volto.po b/locales/en/LC_MESSAGES/volto.po index f2e4ab097..0021504c3 100644 --- a/locales/en/LC_MESSAGES/volto.po +++ b/locales/en/LC_MESSAGES/volto.po @@ -369,6 +369,11 @@ msgstr "Subscribe to receive newsletter" msgid "L'evento non si terrà nelle seguenti date" msgstr "The event will not be held on the following dates" +#: overrideTranslations +# defaultMessage: This is a language independent field. Any value you enter here will overwrite the corresponding field of all members of the translation group when you save this form. +msgid "Language independent icon title" +msgstr "" + #: components/ItaliaTheme/Blocks/Calendar/ListingSidebar # defaultMessage: Link more msgid "Link more" diff --git a/locales/es/LC_MESSAGES/volto.po b/locales/es/LC_MESSAGES/volto.po index 3df4e30af..57a1845de 100644 --- a/locales/es/LC_MESSAGES/volto.po +++ b/locales/es/LC_MESSAGES/volto.po @@ -378,6 +378,11 @@ msgstr "Suscríbete para recibir el boletín" msgid "L'evento non si terrà nelle seguenti date" msgstr "El evento no se realizará en las siguientes fechas" +#: overrideTranslations +# defaultMessage: This is a language independent field. Any value you enter here will overwrite the corresponding field of all members of the translation group when you save this form. +msgid "Language independent icon title" +msgstr "Este es un campo independiente del idioma. Cualquier valor que ingreses aquí sobrescribirá el campo correspondiente de todos los miembros del grupo de traducción al guardar este formulario." + #: components/ItaliaTheme/Blocks/Calendar/ListingSidebar # defaultMessage: Link more msgid "Link more" diff --git a/locales/fr/LC_MESSAGES/volto.po b/locales/fr/LC_MESSAGES/volto.po index 2d3b70aaa..0d013b339 100644 --- a/locales/fr/LC_MESSAGES/volto.po +++ b/locales/fr/LC_MESSAGES/volto.po @@ -386,6 +386,11 @@ msgstr "Inscrivez-vous pour recevoir la newsletter" msgid "L'evento non si terrà nelle seguenti date" msgstr "L'événement n'aura pas lieu aux dates suivantes" +#: overrideTranslations +# defaultMessage: This is a language independent field. Any value you enter here will overwrite the corresponding field of all members of the translation group when you save this form. +msgid "Language independent icon title" +msgstr "l s'agit d'un champ indépendant de la langue. Toute valeur saisie ici écrasera le champ correspondant de tous les membres du groupe de traduction lors de l'enregistrement de ce formulaire." + #: components/ItaliaTheme/Blocks/Calendar/ListingSidebar # defaultMessage: Link more msgid "Link more" diff --git a/locales/it/LC_MESSAGES/volto.po b/locales/it/LC_MESSAGES/volto.po index bbe8c9661..5e123443c 100644 --- a/locales/it/LC_MESSAGES/volto.po +++ b/locales/it/LC_MESSAGES/volto.po @@ -369,6 +369,11 @@ msgstr "Iscriviti per ricevere la newsletter" msgid "L'evento non si terrà nelle seguenti date" msgstr "L'evento non si terrà nelle seguenti date" +#: overrideTranslations +# defaultMessage: This is a language independent field. Any value you enter here will overwrite the corresponding field of all members of the translation group when you save this form. +msgid "Language independent icon title" +msgstr "Questo è un campo indipendente dalla lingua. Qualsiasi valore inserito qui sovrascriverà il campo corrispondente di tutti i membri del gruppo di traduzione al momento del salvataggio del modulo." + #: components/ItaliaTheme/Blocks/Calendar/ListingSidebar # defaultMessage: Link more msgid "Link more" diff --git a/locales/volto.pot b/locales/volto.pot index 501b61a6e..80872cd5c 100644 --- a/locales/volto.pot +++ b/locales/volto.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Plone\n" -"POT-Creation-Date: 2025-11-27T13:35:51.867Z\n" +"POT-Creation-Date: 2026-02-05T15:34:29.857Z\n" "Last-Translator: Plone i18n \n" "Language-Team: Plone i18n \n" "MIME-Version: 1.0\n" @@ -371,6 +371,11 @@ msgstr "" msgid "L'evento non si terrà nelle seguenti date" msgstr "" +#: overrideTranslations +# defaultMessage: This is a language independent field. Any value you enter here will overwrite the corresponding field of all members of the translation group when you save this form. +msgid "Language independent icon title" +msgstr "" + #: components/ItaliaTheme/Blocks/Calendar/ListingSidebar # defaultMessage: Link more msgid "Link more" diff --git a/src/customizations/volto/components/manage/Widgets/FormFieldWrapper.jsx b/src/customizations/volto/components/manage/Widgets/FormFieldWrapper.jsx new file mode 100644 index 000000000..31603212b --- /dev/null +++ b/src/customizations/volto/components/manage/Widgets/FormFieldWrapper.jsx @@ -0,0 +1,196 @@ +/** + * FormFieldWrapper component. + * @module components/manage/Widgets/FormFieldWrapper + * - Rifattorazione del componente FormFieldWrapper, con l'obiettivo di aggiornarlo alla versione 19 di Volto https://github.com/plone/volto/blob/main/packages/volto/src/components/manage/Widgets/FormFieldWrapper.jsx + * - aria-required e aria-invalid vengono aggiunti solo se il campo è richiesto e se ci sono errori, rispettivamente + */ +import React, { Children, isValidElement, cloneElement } from 'react'; +import PropTypes from 'prop-types'; +import { Form, Grid, Icon as IconOld, Label } from 'semantic-ui-react'; +import map from 'lodash/map'; +import cx from 'classnames'; +import { defineMessages, useIntl } from 'react-intl'; +import LanguageSVG from '@plone/volto/icons/language.svg'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; + +const messages = defineMessages({ + edit: { + id: 'Edit', + defaultMessage: 'Edit', + }, + delete: { + id: 'Delete', + defaultMessage: 'Delete', + }, + language_independent: { + id: 'Language independent field.', + defaultMessage: 'Language independent field.', + }, + language_independent_icon_title: { + id: 'Language independent icon title', + defaultMessage: + 'This is a language independent field. Any value you enter here will overwrite the corresponding field of all members of the translation group when you save this form.', + }, +}); +/** + * FormFieldWrapper component. + * @function FormFieldWrapper + * @param {Object} props - Component props + * @returns {JSX.Element} Markup for the component. + */ +const FormFieldWrapper = ({ + id, + title, + description = null, + fieldSet, + required = false, + error = [], + wrapped = true, + columns = 2, + draggable = null, + onEdit, + className, + isDisabled = null, + onDelete = null, + noForInFieldLabel, + multilingual_options, + children, +}) => { + const intl = useIntl(); + const languageIndependent = multilingual_options?.language_independent; + + const wdg = ( + <> + {Children.map(children, (child) => { + if (isValidElement(child) && required && child.type.name === 'Input') { + return cloneElement(child, { + 'aria-required': true, + 'aria-invalid': !!(error && error.length > 0), + }); + } + return child; + })} + + {map(error, (message) => ( + + ))} + + ); + + return wrapped ? ( + 0} + className={cx( + description ? 'help' : '', + className, + `field-wrapper-${id}`, + languageIndependent ? 'language-independent-field' : null, + )} + > + + + {columns === 2 && ( + +
+