Skip to content

Commit 4a1d0ac

Browse files
SaraBianchimamicogiuliaghisinipnicolli
authored
feat: updated volto-form-block v3.3.1 and added new features in custom components, fixed layout and invalid field messages and select from drop-down menu (#556)
* feat!: upgrade to volto 17.5.0 (#382) * fix: change image component in ctablock * ci: upgrade volto * fix: change image component in hlcontent * fix: change image component listingimage * fix: change image component subevents * fix: change image component gallery * fix: change image component GenericCard * fix: change image component * fix: change image component (sponsor + venuesmall) * fix: change image component * fix: minutes with 00 format * docs: rimosso commento obsoleto * fix: review giulia * fix: review giulia * fix: scroll position on h2 .visually-hidden * feat: upgrade to volto 17.5.0 * docs: fix order Co-authored-by: Piero Nicolli <pnicolli@users.noreply.github.com> * fix: review piero * fix: sponsor evento without image * fix: gallery preview --------- Co-authored-by: Giulia Ghisini <giulia.ghisini@redturtle.it> Co-authored-by: Piero Nicolli <pnicolli@users.noreply.github.com> * feat!: upgrade to design-react-kit 5.0.0-1 and bootstrap-italia 2.6.1 (#407) * fix: change image component in ctablock * ci: upgrade volto * fix: change image component in hlcontent * fix: change image component listingimage * fix: change image component subevents * fix: change image component gallery * fix: change image component GenericCard * fix: change image component * fix: change image component (sponsor + venuesmall) * fix: change image component * fix: minutes with 00 format * docs: rimosso commento obsoleto * fix: review giulia * fix: review giulia * fix: scroll position on h2 .visually-hidden * feat: upgrade to volto 17.5.0 * docs: fix order Co-authored-by: Piero Nicolli <pnicolli@users.noreply.github.com> * fix: review piero * fix: sponsor evento without image * fix: gallery preview * feat: upgrade to design-react-kit 5.0.0-1 and bootstrap-italia 2.6.1 * fix: fix for new design-react-kit * fix: card image height changed like bootstrap-italia templates * fix: revert card image height changed like bootstrap-italia templates * fix: stepper style ul * fix. pr fixes * chore: updated locales * fix: screen reader for SearchModal * fix: screen reader in SearchModal * chore: update dependencies * fix: bootstrap imports * fix: locales * fix: duplicate css --------- Co-authored-by: Mauro Amico <mauro.amico@gmail.com> Co-authored-by: Piero Nicolli <pnicolli@users.noreply.github.com> Co-authored-by: Piero Nicolli <piero.nicolli@redturtle.it> * chore: release v11.0.0-alpha.0 * feat!: card image height from newest bootstrap-italia version (#406) * fix: change image component in ctablock * ci: upgrade volto * fix: change image component in hlcontent * fix: change image component listingimage * fix: change image component subevents * fix: change image component gallery * fix: change image component GenericCard * fix: change image component * fix: change image component (sponsor + venuesmall) * fix: change image component * fix: minutes with 00 format * docs: rimosso commento obsoleto * fix: review giulia * fix: review giulia * fix: scroll position on h2 .visually-hidden * feat: upgrade to volto 17.5.0 * docs: fix order Co-authored-by: Piero Nicolli <pnicolli@users.noreply.github.com> * fix: review piero * fix: sponsor evento without image * fix: gallery preview * feat: upgrade to design-react-kit 5.0.0-1 and bootstrap-italia 2.6.1 * fix: fix for new design-react-kit * fix: card image height changed like bootstrap-italia templates * fix: revert card image height changed like bootstrap-italia templates * fix: revert text-secondary class * fix: stepper style ul * fix. pr fixes * chore: updated locales * fix: screen reader for SearchModal * fix: screen reader in SearchModal * chore: update dependencies * fix: bootstrap imports * chore: release v11.0.0-alpha.0 * feat:change image card height --------- Co-authored-by: Mauro Amico <mauro.amico@gmail.com> Co-authored-by: Piero Nicolli <pnicolli@users.noreply.github.com> Co-authored-by: Piero Nicolli <piero.nicolli@redturtle.it> * fix: listing block card-slide-text-template read-more alignment (#416) * chore: release v11.0.0-alpha.1 * fix: image size in listing * fix: update volto-editablefooter to 5.0.3 * fix: gallery component for ct views breaking with newer backend versions (#422) * fix: background image for NumbersBlock and Countdown block (#423) * fix: background image for NumbersBlock and Countdown block * fix: tests * chore: release v11.0.0-alpha.2 * style: fixed input form style * docs: updated release.md and changelog files * fix: remain in form if there's errors on sending form * chore: updated input type file with aria-invalid and required attributes * chore: updated formView with legend tag for required fields * chore: updated locales and release.md * feat: updated volto-form-block v3.3.1 and added new features in custom components --------- Co-authored-by: Mauro Amico <mauro.amico@gmail.com> Co-authored-by: Giulia Ghisini <giulia.ghisini@redturtle.it> Co-authored-by: Piero Nicolli <pnicolli@users.noreply.github.com> Co-authored-by: Giulia Ghisini <51911425+giuliaghisini@users.noreply.github.com> Co-authored-by: Piero Nicolli <piero.nicolli@redturtle.it>
1 parent 62aa71b commit 4a1d0ac

File tree

17 files changed

+288
-30
lines changed

17 files changed

+288
-30
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6773,4 +6773,4 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
67736773
- added onclick to viewAll button [`baa258a`](https://github.com/RedTurtle/design-volto-theme/commit/baa258a983f9619b18f9c8d9fb078fe9b17f338b)
67746774
- todo [`7814f01`](https://github.com/RedTurtle/design-volto-theme/commit/7814f01e5dd883c83bca4ecf53425ada9942d9ab)
67756775
- updated gitignore with .history [`e73a28c`](https://github.com/RedTurtle/design-volto-theme/commit/e73a28c94176a172219c1a740a97047b5e2fa400)
6776-
- Added nvmrc [`fd54a3c`](https://github.com/RedTurtle/design-volto-theme/commit/fd54a3cbcf8df22997f036919dfafda870f85db7)
6776+
- Added nvmrc [`fd54a3c`](https://github.com/RedTurtle/design-volto-theme/commit/fd54a3cbcf8df22997f036919dfafda870f85db7)

RELEASE.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,22 @@
4343

4444
## Versione X.X.X (dd/mm/yyyy)
4545

46+
### Migliorie
47+
48+
- Nel blocco form è stata aggiunta una legenda per i campi obbligatori.
49+
50+
### Novità
51+
52+
- Aggiornato il plugin del blocco Form, adesso si ha la possibilità di aggiungere un pulsante per resettare i campi e nella sidebar è presente un nuovo campo per creare un messaggio personalizzato dopo l'invio della form, i campi di tipo: testo, email, data e textarea hanno un identificativo che può essere utilizzato per restituire il valore di quei campi nel messaggio personalizzato.
53+
4654
### Fix
4755

4856
- L'icona per aprire il menu in mobile è ora visibile anche quando l'header del sito è bianca.
4957
- La descrizione nelle card per i punti di contatto non mostrano più tutte le iniziali in maiuscolo.
5058
- Il colore dei link nel menu mobile è ora accessibile per tutti i temi.
59+
- Il layout dei campi di input "in errore" del blocco Form è stato uniformato.
60+
- La tendina delle select nel blocco Form non si sovrappone più ai campi sottostanti.
61+
- Sistemato alert di errore nel blocco Form che nascondeva il form quando un campo non era valido, ora continua a visualizzarsi anche la form.
5162
- Migliorato il testo alternativo per il logo NextGenerationEU nel footer.
5263

5364
## Versione 11.5.1 (19/02/2024)
@@ -65,7 +76,6 @@
6576
### Fix
6677

6778
- Risolto un problema riguardante la visualizzazione delle date nelle card che rappresentano un CT Evento nei vari listati nel caso in cui l'evento si sviluppi su anni diversi
68-
6979
- Risolto un problema di visualizzazione per la sezione Date e Orari nel CT Evento quando l'evento si sviluppa su anni diversi, ora viene mostrato anche l'anno se si rientra in questa casistica
7080
- Nel blocco elenco, sono stati sistemati i filtri per percorso quando si clicca sul bottone configurato.
7181

locales/de/LC_MESSAGES/volto.po

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2115,6 +2115,16 @@ msgstr ""
21152115
msgid "fine_termine"
21162116
msgstr ""
21172117

2118+
#: overrideTranslations
2119+
# defaultMessage: Annulla
2120+
msgid "form_default_cancel_label"
2121+
msgstr ""
2122+
2123+
#: overrideTranslations
2124+
# defaultMessage: Ricomincia
2125+
msgid "form_reset"
2126+
msgstr ""
2127+
21182128
#: components/ItaliaTheme/View/PersonaView/PersonaRuolo
21192129
# defaultMessage: Foto dell'attività politica
21202130
msgid "foto_attivita_politica"
@@ -2275,6 +2285,11 @@ msgstr ""
22752285
msgid "legami_strutture_figlie"
22762286
msgstr ""
22772287

2288+
#: overrideTranslations
2289+
# defaultMessage: I campi contrassegnati da (*) sono obbligatori.
2290+
msgid "legend_required"
2291+
msgstr ""
2292+
22782293
#: components/ItaliaTheme/Blocks/SearchSections/SideBar
22792294
# defaultMessage: Collegamento
22802295
msgid "link"

locales/en/LC_MESSAGES/volto.po

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2100,6 +2100,16 @@ msgstr "Search"
21002100
msgid "fine_termine"
21012101
msgstr "End of term"
21022102

2103+
#: overrideTranslations
2104+
# defaultMessage: Annulla
2105+
msgid "form_default_cancel_label"
2106+
msgstr "Cancel"
2107+
2108+
#: overrideTranslations
2109+
# defaultMessage: Ricomincia
2110+
msgid "form_reset"
2111+
msgstr "Restart"
2112+
21032113
#: components/ItaliaTheme/View/PersonaView/PersonaRuolo
21042114
# defaultMessage: Foto dell'attività politica
21052115
msgid "foto_attivita_politica"
@@ -2260,6 +2270,11 @@ msgstr "Association service or office"
22602270
msgid "legami_strutture_figlie"
22612271
msgstr "Internal services or offices"
22622272

2273+
#: overrideTranslations
2274+
# defaultMessage: I campi contrassegnati da (*) sono obbligatori.
2275+
msgid "legend_required"
2276+
msgstr "Fields marked with (*) are required."
2277+
22632278
#: components/ItaliaTheme/Blocks/SearchSections/SideBar
22642279
# defaultMessage: Collegamento
22652280
msgid "link"

locales/es/LC_MESSAGES/volto.po

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2109,6 +2109,16 @@ msgstr "Buscar"
21092109
msgid "fine_termine"
21102110
msgstr "Fin de los términos"
21112111

2112+
#: overrideTranslations
2113+
# defaultMessage: Annulla
2114+
msgid "form_default_cancel_label"
2115+
msgstr ""
2116+
2117+
#: overrideTranslations
2118+
# defaultMessage: Ricomincia
2119+
msgid "form_reset"
2120+
msgstr ""
2121+
21122122
#: components/ItaliaTheme/View/PersonaView/PersonaRuolo
21132123
# defaultMessage: Foto dell'attività politica
21142124
msgid "foto_attivita_politica"
@@ -2269,6 +2279,11 @@ msgstr "Servicio u oficina de la asociación"
22692279
msgid "legami_strutture_figlie"
22702280
msgstr "Servicios internos u oficinas"
22712281

2282+
#: overrideTranslations
2283+
# defaultMessage: I campi contrassegnati da (*) sono obbligatori.
2284+
msgid "legend_required"
2285+
msgstr ""
2286+
22722287
#: components/ItaliaTheme/Blocks/SearchSections/SideBar
22732288
# defaultMessage: Collegamento
22742289
msgid "link"

locales/fr/LC_MESSAGES/volto.po

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2117,6 +2117,16 @@ msgstr "Rechercher"
21172117
msgid "fine_termine"
21182118
msgstr "Fin du mandat"
21192119

2120+
#: overrideTranslations
2121+
# defaultMessage: Annulla
2122+
msgid "form_default_cancel_label"
2123+
msgstr ""
2124+
2125+
#: overrideTranslations
2126+
# defaultMessage: Ricomincia
2127+
msgid "form_reset"
2128+
msgstr ""
2129+
21202130
#: components/ItaliaTheme/View/PersonaView/PersonaRuolo
21212131
# defaultMessage: Foto dell'attività politica
21222132
msgid "foto_attivita_politica"
@@ -2277,6 +2287,11 @@ msgstr ""
22772287
msgid "legami_strutture_figlie"
22782288
msgstr ""
22792289

2290+
#: overrideTranslations
2291+
# defaultMessage: I campi contrassegnati da (*) sono obbligatori.
2292+
msgid "legend_required"
2293+
msgstr "Les champs marqués d'une (*) sont obligatoires."
2294+
22802295
#: components/ItaliaTheme/Blocks/SearchSections/SideBar
22812296
# defaultMessage: Collegamento
22822297
msgid "link"

locales/it/LC_MESSAGES/volto.po

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2100,6 +2100,16 @@ msgstr "Cerca"
21002100
msgid "fine_termine"
21012101
msgstr "Fine termine"
21022102

2103+
#: overrideTranslations
2104+
# defaultMessage: Annulla
2105+
msgid "form_default_cancel_label"
2106+
msgstr "Annulla"
2107+
2108+
#: overrideTranslations
2109+
# defaultMessage: Ricomincia
2110+
msgid "form_reset"
2111+
msgstr "Ricomincia"
2112+
21032113
#: components/ItaliaTheme/View/PersonaView/PersonaRuolo
21042114
# defaultMessage: Foto dell'attività politica
21052115
msgid "foto_attivita_politica"
@@ -2260,6 +2270,11 @@ msgstr "Unità organizzativa genitore"
22602270
msgid "legami_strutture_figlie"
22612271
msgstr "Servizi o uffici interni"
22622272

2273+
#: overrideTranslations
2274+
# defaultMessage: I campi contrassegnati da (*) sono obbligatori.
2275+
msgid "legend_required"
2276+
msgstr "I campi contrassegnati da (*) sono obbligatori."
2277+
22632278
#: components/ItaliaTheme/Blocks/SearchSections/SideBar
22642279
# defaultMessage: Collegamento
22652280
msgid "link"

locales/volto.pot

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
msgid ""
22
msgstr ""
33
"Project-Id-Version: Plone\n"
4-
"POT-Creation-Date: 2024-02-19T11:08:36.048Z\n"
4+
"POT-Creation-Date: 2024-02-29T16:36:05.160Z\n"
55
"Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
66
"Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
77
"MIME-Version: 1.0\n"
@@ -2102,6 +2102,16 @@ msgstr ""
21022102
msgid "fine_termine"
21032103
msgstr ""
21042104

2105+
#: overrideTranslations
2106+
# defaultMessage: Annulla
2107+
msgid "form_default_cancel_label"
2108+
msgstr ""
2109+
2110+
#: overrideTranslations
2111+
# defaultMessage: Ricomincia
2112+
msgid "form_reset"
2113+
msgstr ""
2114+
21052115
#: components/ItaliaTheme/View/PersonaView/PersonaRuolo
21062116
# defaultMessage: Foto dell'attività politica
21072117
msgid "foto_attivita_politica"
@@ -2262,6 +2272,11 @@ msgstr ""
22622272
msgid "legami_strutture_figlie"
22632273
msgstr ""
22642274

2275+
#: overrideTranslations
2276+
# defaultMessage: I campi contrassegnati da (*) sono obbligatori.
2277+
msgid "legend_required"
2278+
msgstr ""
2279+
22652280
#: components/ItaliaTheme/Blocks/SearchSections/SideBar
22662281
# defaultMessage: Collegamento
22672282
msgid "link"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
"volto-dropdownmenu": "4.1.1",
147147
"volto-editablefooter": "5.0.3",
148148
"volto-feedback": "0.2.0",
149-
"volto-form-block": "3.1.0",
149+
"volto-form-block": "3.3.1",
150150
"volto-gdpr-privacy": "2.1.1",
151151
"volto-google-analytics": "2.0.0",
152152
"volto-multilingual-widget": "3.0.0",

src/components/ItaliaTheme/manage/Widgets/FileWidget.jsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ const messages = defineMessages({
5656
* @returns {string} Markup of the component.
5757
*/
5858
const FileWidget = (props) => {
59-
const { id, value, onChange, label, onEdit, infoText } = props;
59+
const { id, value, onChange, label, onEdit, infoText, required, invalid } =
60+
props;
6061
const [isImage, setIsImage] = React.useState(false);
6162
const intl = useIntl();
6263

@@ -98,8 +99,18 @@ const FileWidget = (props) => {
9899
reader.readAsDataURL(files[0]);
99100
};
100101

102+
let attributes = {};
103+
if (required) {
104+
attributes.required = true;
105+
attributes['aria-required'] = true;
106+
}
107+
108+
const isInvalid = invalid === true || invalid === 'true';
109+
if (isInvalid) {
110+
attributes['aria-invalid'] = true;
111+
}
101112
return (
102-
<div className="form-group ">
113+
<div className="form-group">
103114
<label htmlFor={`field-${id}`} className="active">
104115
{label}
105116
</label>
@@ -154,6 +165,7 @@ const FileWidget = (props) => {
154165
name={id}
155166
type="file"
156167
disabled={props.disabled || null}
168+
{...attributes}
157169
/>
158170
)}
159171
</div>

0 commit comments

Comments
 (0)