diff --git a/CHANGELOG.md b/CHANGELOG.md index d4e975c9d..fc2bce8eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,137 @@ +## [11.8.1](https://github.com/redturtle/design-comuni-plone-theme/compare/v11.8.0...v11.8.1) (2024-03-26) + + +### Bug Fixes + +* moved HeaderSlim compoonent inside his folder to enable customizations ([#602](https://github.com/redturtle/design-comuni-plone-theme/issues/602)) ([38c6f3d](https://github.com/redturtle/design-comuni-plone-theme/commit/38c6f3d1312f3b7dbd2e73875cc51af0811adabd)) +* view background image in icons block ([#580](https://github.com/redturtle/design-comuni-plone-theme/issues/580)) ([fee11d1](https://github.com/redturtle/design-comuni-plone-theme/commit/fee11d1126f764d1cb4b3cde720714a1f2934b75)) +* volto-form-block ([#600](https://github.com/redturtle/design-comuni-plone-theme/issues/600)) ([9ac3cac](https://github.com/redturtle/design-comuni-plone-theme/commit/9ac3cac30ff846ae716b73fd1db2019e01760adc)) + + +### Documentation + +* updated publiccode ([ac87cf3](https://github.com/redturtle/design-comuni-plone-theme/commit/ac87cf398b789b1cd9dcd3c4cfed3030e8809499)) + +## [11.8.0](https://github.com/redturtle/design-comuni-plone-theme/compare/v11.7.0...v11.8.0) (2024-03-19) + + +### Features + +* added download link to filename in file widget ([#587](https://github.com/redturtle/design-comuni-plone-theme/issues/587)) ([96649e2](https://github.com/redturtle/design-comuni-plone-theme/commit/96649e29e79a7b71bf93a27406baa4fc1994a213)) +* print styles for UO ([#581](https://github.com/redturtle/design-comuni-plone-theme/issues/581)) ([91b4752](https://github.com/redturtle/design-comuni-plone-theme/commit/91b47526b69b0957eba6c8e803798f4b3ffcf9bb)) +* TextWidget to add alt text to image ([#573](https://github.com/redturtle/design-comuni-plone-theme/issues/573)) ([d183f27](https://github.com/redturtle/design-comuni-plone-theme/commit/d183f2749a2604ebecb0f0df09ec8770d84c7f59)) +* updated volto-form-block with email validation ([#596](https://github.com/redturtle/design-comuni-plone-theme/issues/596)) ([c21f65b](https://github.com/redturtle/design-comuni-plone-theme/commit/c21f65bc7e54d2fa092ae4bcfbfd1c99670cab5c)) + + +### Bug Fixes + +* link in header doesn't change color when inside cms-ui ([#583](https://github.com/redturtle/design-comuni-plone-theme/issues/583)) ([d076b0a](https://github.com/redturtle/design-comuni-plone-theme/commit/d076b0a540cf3de3c9f7f08cefca27eff3917f70)) +* updated volto-querywidget-with-browser to fix infinite loops on lost reference ([#599](https://github.com/redturtle/design-comuni-plone-theme/issues/599)) ([c6d4cb6](https://github.com/redturtle/design-comuni-plone-theme/commit/c6d4cb6b51447514fedf2938f40031e42779644e)) +* view form block ([5ff7ea7](https://github.com/redturtle/design-comuni-plone-theme/commit/5ff7ea70474963e3dca126a44d531cc4dc17be74)) + + +### Maintenance + +* updated volto-form-block to fix view form ([80a6586](https://github.com/redturtle/design-comuni-plone-theme/commit/80a6586ac7d458c46efe51bcc4fa4a9cb3b8d619)) + + +### Documentation + +* updated publiccode and release log ([3c52c12](https://github.com/redturtle/design-comuni-plone-theme/commit/3c52c12edfed3c12a4fdac212b9f229644bf913f)) + +## [11.7.0](https://github.com/redturtle/design-comuni-plone-theme/compare/v11.6.2...v11.7.0) (2024-03-15) + + +### Features + +* editable footer top ([#528](https://github.com/redturtle/design-comuni-plone-theme/issues/528)) ([542e2ec](https://github.com/redturtle/design-comuni-plone-theme/commit/542e2ecc95be9b182f7d9f6b45ef893852587022)) +* update volto-feedback 0.3.0 ([3d9dfbe](https://github.com/redturtle/design-comuni-plone-theme/commit/3d9dfbe16111065ec04924430a6d3487ab6d1b05)) +* updated volto-form-block to fix multiple form in same page and added schema field custom validator ([#586](https://github.com/redturtle/design-comuni-plone-theme/issues/586)) ([407ae18](https://github.com/redturtle/design-comuni-plone-theme/commit/407ae18d876f6d5ada3095a2990ccbe3727ba06e)) +* view error for each form field, validate form config ([#578](https://github.com/redturtle/design-comuni-plone-theme/issues/578)) ([45e2f72](https://github.com/redturtle/design-comuni-plone-theme/commit/45e2f727ac6ea5f23f57661a1acef83f94b19a2e)) + + +### Bug Fixes + +* added condition for focus when going back within feedback form ([#588](https://github.com/redturtle/design-comuni-plone-theme/issues/588)) ([7911d89](https://github.com/redturtle/design-comuni-plone-theme/commit/7911d892e04fcb5584ba52d180f8bb79768d5c28)) +* button clear in form block ([68c8bf8](https://github.com/redturtle/design-comuni-plone-theme/commit/68c8bf85183edfeb53cd5525327d6210fae18df3)) +* button type of cancel button in form block ([9a10ff8](https://github.com/redturtle/design-comuni-plone-theme/commit/9a10ff8f40b20753c9400ceb6909e3ff5a543805)) +* default value for show_type in card-with-image-template ([#579](https://github.com/redturtle/design-comuni-plone-theme/issues/579)) ([fe95462](https://github.com/redturtle/design-comuni-plone-theme/commit/fe95462a49e99c5a442023d727676b485ab8edfe)) +* imaged full width view in edit mode ([#570](https://github.com/redturtle/design-comuni-plone-theme/issues/570)) ([053183b](https://github.com/redturtle/design-comuni-plone-theme/commit/053183baea2ce3e11b365bf29559ea532af33fc1)) +* restored right border in listing block small links template ([#582](https://github.com/redturtle/design-comuni-plone-theme/issues/582)) ([beb07ad](https://github.com/redturtle/design-comuni-plone-theme/commit/beb07ad251cb5e5b96c67c6a64ac01ea3f229526)) +* update volto-form-block for subdomain mail validation ([#584](https://github.com/redturtle/design-comuni-plone-theme/issues/584)) ([92939a2](https://github.com/redturtle/design-comuni-plone-theme/commit/92939a28e59d829e05423f83dc0564b9c008692e)) + + +### Maintenance + +* Update RELEASE.md ([f308e6b](https://github.com/redturtle/design-comuni-plone-theme/commit/f308e6bf000ca0d41ccfd63557f73b1372ab8faa)) + + +### Documentation + +* fix merge mistake in the release docs ([232af7a](https://github.com/redturtle/design-comuni-plone-theme/commit/232af7a1624724e60722c346533223bea95fd8be)) +* updated publiccode and release log ([3e48692](https://github.com/redturtle/design-comuni-plone-theme/commit/3e48692faa06bf6fff7ee16a06032e1b1e7dd782)) + +## [11.6.2](https://github.com/redturtle/design-comuni-plone-theme/compare/v11.6.1...v11.6.2) (2024-03-08) + + +### Bug Fixes + +* added class to apply color style to all icons ([#542](https://github.com/redturtle/design-comuni-plone-theme/issues/542)) ([3431318](https://github.com/redturtle/design-comuni-plone-theme/commit/3431318e48df0ba389f37598f5be16c8179b4337)) +* layout feedback form per validatore pa ([#575](https://github.com/redturtle/design-comuni-plone-theme/issues/575)) ([c31a61e](https://github.com/redturtle/design-comuni-plone-theme/commit/c31a61e8e6f4b666dc75a4ff1a076e560ec49a77)) + + +### Documentation + +* updated publiccode ([d4a177b](https://github.com/redturtle/design-comuni-plone-theme/commit/d4a177b293293e2764e4742d330381ad162cbf69)) + +## [11.6.1](https://github.com/redturtle/design-comuni-plone-theme/compare/v11.6.0...v11.6.1) (2024-03-06) + + +### Bug Fixes + +* changed translations for weekdays in recurrence widget ([#569](https://github.com/redturtle/design-comuni-plone-theme/issues/569)) ([54868c5](https://github.com/redturtle/design-comuni-plone-theme/commit/54868c58571768408cf374dac6c790c7cfa5e61f)) + + +### Documentation + +* updated publiccode and release log ([aa2ffcb](https://github.com/redturtle/design-comuni-plone-theme/commit/aa2ffcb09478362163255e85a99fd41161aafb62)) + +## [11.6.0](https://github.com/redturtle/design-comuni-plone-theme/compare/v11.5.1...v11.6.0) (2024-03-05) + + +### Features + +* 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](https://github.com/redturtle/design-comuni-plone-theme/issues/556)) ([4a1d0ac](https://github.com/redturtle/design-comuni-plone-theme/commit/4a1d0ac708c06d1945b76f56673c3c8b89755825)), closes [#382](https://github.com/redturtle/design-comuni-plone-theme/issues/382) + + +### Bug Fixes + +* a11y for feedback section ([#560](https://github.com/redturtle/design-comuni-plone-theme/issues/560)) ([f5f907a](https://github.com/redturtle/design-comuni-plone-theme/commit/f5f907a8834ce67fd17c6444a14bb99d3772c292)) +* added id to SearchInput template label to match aria-describedby attr ([#566](https://github.com/redturtle/design-comuni-plone-theme/issues/566)) ([49940f7](https://github.com/redturtle/design-comuni-plone-theme/commit/49940f7fc27f4f065f28b5345dd283f93ba79374)) +* better alt text for nexGenerationEU logo ([#552](https://github.com/redturtle/design-comuni-plone-theme/issues/552)) ([62aa71b](https://github.com/redturtle/design-comuni-plone-theme/commit/62aa71bac27cc141417e8b8901ec5ed27db58e1c)) +* changed color of icon on primary background ([#550](https://github.com/redturtle/design-comuni-plone-theme/issues/550)) ([aa04c9d](https://github.com/redturtle/design-comuni-plone-theme/commit/aa04c9da2feb4d04e9fdb279dab87394ac69663a)) +* condition for showing the title and description for iconBlock ([#567](https://github.com/redturtle/design-comuni-plone-theme/issues/567)) ([c7c1456](https://github.com/redturtle/design-comuni-plone-theme/commit/c7c145626e8125751accaa566eb968034c2cb459)) +* fixed btn-primary icon with focus-visible ([#565](https://github.com/redturtle/design-comuni-plone-theme/issues/565)) ([0bbb6b5](https://github.com/redturtle/design-comuni-plone-theme/commit/0bbb6b500a15f223b46e0ec5cfba39fce9745d23)) +* link styles for mobile menu in subsites ([#551](https://github.com/redturtle/design-comuni-plone-theme/issues/551)) ([a4af563](https://github.com/redturtle/design-comuni-plone-theme/commit/a4af563d75790bfba332b1c70285d414db6dfa68)) +* reactSelect widget layout and subsite search buttons ([#564](https://github.com/redturtle/design-comuni-plone-theme/issues/564)) ([6b25ba2](https://github.com/redturtle/design-comuni-plone-theme/commit/6b25ba22653e40e844a08ae4f6377c9a7eed3807)) +* remove contacts from OfficeCard component, minor margin fixes of CuredBy section ([#504](https://github.com/redturtle/design-comuni-plone-theme/issues/504)) ([688dceb](https://github.com/redturtle/design-comuni-plone-theme/commit/688dcebb63c17d747752586d814c23505da45545)) +* remove title attr from some cards through prop in ListingImage to remove title attr where needed ([#558](https://github.com/redturtle/design-comuni-plone-theme/issues/558)) ([8459177](https://github.com/redturtle/design-comuni-plone-theme/commit/845917713dfff50bca54ea79f77d13e6ac57603b)) +* remove title attribute in WideImage component ([#559](https://github.com/redturtle/design-comuni-plone-theme/issues/559)) ([da10eaa](https://github.com/redturtle/design-comuni-plone-theme/commit/da10eaabad1f50fc5aa5958bae235fda2c151449)) +* removed capitalized style from pdc description ([#549](https://github.com/redturtle/design-comuni-plone-theme/issues/549)) ([77ff653](https://github.com/redturtle/design-comuni-plone-theme/commit/77ff653c0f9ed5af3a87748da75bb7cb7481fecb)) +* removed unnecessary special character from HeaderToggler aria-controls attribute ([#553](https://github.com/redturtle/design-comuni-plone-theme/issues/553)) ([900e4da](https://github.com/redturtle/design-comuni-plone-theme/commit/900e4da5ff4b6c1fd11cdd73625e4482b57e2001)) + + +### Maintenance + +* **deps:** bump ip from 1.1.8 to 1.1.9 ([#548](https://github.com/redturtle/design-comuni-plone-theme/issues/548)) ([01ed12b](https://github.com/redturtle/design-comuni-plone-theme/commit/01ed12b577e6e30e5d5b8cae60bb38ef2708156c)) + + +### Documentation + +* updated publiccode and release log ([b8e8ba5](https://github.com/redturtle/design-comuni-plone-theme/commit/b8e8ba5cae3b51317b9d998fd61258d52f4c6fd1)) + ## [11.5.1](https://github.com/redturtle/design-comuni-plone-theme/compare/v11.5.0...v11.5.1) (2024-02-19) diff --git a/README.md b/README.md index 3b8dda3a5..550f0e753 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ Si veda ad esempio: - [Comune di Cantagallo](https://www.comune.cantagallo.po.it/) - [Comune di Casalfiumanese](https://www.comune.casalfiumanese.bo.it/) - [Comune di Castel del Rio](https://www.comune.casteldelrio.bo.it/) +- [Comune di Castel Guelfo di Bologna](https://www.comune.castelguelfo.bo.it/) - [Comune di Cavezzo](https://www.comune.cavezzo.mo.it/) - [Comune di Cavriago](https://www.comune.cavriago.re.it/) - [Comune di Concordia sul Secchia](https://www.comune.concordia.mo.it/) @@ -101,6 +102,7 @@ Si veda ad esempio: - [Comune di Piacenza](https://www.comune.piacenza.it/) - [Comune di Prignano sulla Secchia](https://www.comune.prignano.mo.it/) - [Comune di Reggio Emilia](https://www.comune.re.it/) +- [Comune di Rolo](https://www.comune.rolo.re.it/) - [Comune di San Felice sul Panaro](https://www.comune.sanfelice.mo.it/) - [Comune di San Lazzaro di Savena](https://www.comune.sanlazzaro.bo.it) - [Comune di San Polo d'Enza](https://www.comune.sanpolodenza.re.it/) diff --git a/RELEASE.md b/RELEASE.md index 48174e912..d24ef00d3 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -34,7 +34,7 @@ ### Novità -- ... [`Istruzioni`](url della documentazione relativa alla novità) +- ... ### Fix @@ -43,11 +43,85 @@ ## Versione X.X.X (dd/mm/yyyy) +### Migliorie + +- ... + +### Novità + +- ... + +### Fix + +- ... + +## Versione 11.8.0 (19/03/2024) + +### Migliorie + +- Gli stili del tipo di contenuto Unità Organizzativa sono stati ottimizzati per la stampa. + +### Novità + +- È possibile scaricare il file o l'immagine caricata dal widget di upload file cliccando sul nome del file stesso. +- È possibile aggiungere un testo alternativo per l'immagine del blocco Card con Immagine. + +### Fix + +- Nel blocco con icone, se era impostata una immagine di sfondo non si vedeva. + +## Versione 11.7.0 (15/03/2024) + +### Novità + +- Ora la fascia del footer contenente il logo e il nome del sito è configurabile da pannello di controllo. +- Nel pannello di controllo dei Feedback, ora gli utenti con permesso di eliminare elementi da questa sezione, possono eliminare i feedback. + +### Migliorie + +- Nel blocco form, se in fase di compilazione ci sono degli errori, viene mostrato un messaggio di errore specifico per ogni campo con errori. + +### Fix + +- Il bordo destro della variazione Link solo immagine del blocco Elenco è stato ripristinato. +- Se si mettono due blocchi Form nella stessa pagina, ora funzionano correttamente. +- Aggiustato il modulo di Feedback quando si cambia valutazione dopo averne già selezionata un'altra. + +## Versione 11.6.1 (06/03/2024) + +### Fix + +- Quando si imposta una ricorrenza per giorni feriali negli Eventi, viene visualizzato il testo corretto "ogni giorno feriale". +- Le icone social nel menu laterale mobile sono tutte dello stesso colore. + +## Versione 11.6.0 (05/03/2024) + +### Migliorie + +- Nel blocco form è stata aggiunta una legenda per i campi obbligatori. + +### Novità + +- Rimosso i contatti dalle card che rappresentano Unità Organizzative nelle varie viste dei diversi content type in cui sono implementate. + La lista delle viste comprende i CT: Persona, Unità Organizzativa, Documento, Bando, Servizio, Notizia, Evento, Incarico, Luogo, Argomento. +- 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. + ### Fix - L'icona per aprire il menu in mobile è ora visibile anche quando l'header del sito è bianca. - La descrizione nelle card per i punti di contatto non mostrano più tutte le iniziali in maiuscolo. - Il colore dei link nel menu mobile è ora accessibile per tutti i temi. +- Titolo e descrizione sistemati su blocco icone. Adesso quando il loro contenuto è cancellato non resta lo spazio vuoto sopra le icone. +- Migliorata l'accessibilità della sezione dedicata al feedback utente per tutti i contenuti del sito. +- Rimosso il title dall'immagine di apertura dei contenuti. +- Rimosso attributo title dall'immagine delle card: card con immagine, persona, blocco link completo, contenuto in evidenza, gallery a griglia, in evidenza. +- Migliorata l'accessibilità del menu in versione mobile. +- Il layout dei campi di input "in errore" del blocco Form è stato uniformato. +- La tendina delle select nel blocco Form non si sovrappone più ai campi sottostanti. +- Sistemato alert di errore nel blocco Form che nascondeva il form quando un campo non era valido, ora continua a visualizzarsi anche la form. +- Migliorato il testo alternativo per il logo NextGenerationEU nel footer. +- Migliorata l'accessibilità del blocco Cerca. +- Sistemato il contrasto delle icone nei pulsanti "primary" quando si attiva il focus col tab da tastiera. ## Versione 11.5.1 (19/02/2024) @@ -64,7 +138,6 @@ ### Fix - 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 - - 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 - Nel blocco elenco, sono stati sistemati i filtri per percorso quando si clicca sul bottone configurato. diff --git a/jest-addon.config.js b/jest-addon.config.js index 59ad11305..d2e69502d 100644 --- a/jest-addon.config.js +++ b/jest-addon.config.js @@ -39,6 +39,8 @@ module.exports = { '^volto-dropdownmenu/(.*)$': '/node_modules/volto-dropdownmenu/src/$1', '^volto-feedback/(.*)$': '/node_modules/volto-feedback/src/$1', + '^volto-blocks-widget/(.*)$': + '/node_modules/volto-blocks-widget/src/$1', }, collectCoverage: false, collectCoverageFrom: [ diff --git a/locales/de/LC_MESSAGES/volto.po b/locales/de/LC_MESSAGES/volto.po index e59fe61db..553272b06 100644 --- a/locales/de/LC_MESSAGES/volto.po +++ b/locales/de/LC_MESSAGES/volto.po @@ -778,6 +778,11 @@ msgstr "" msgid "allegati" msgstr "" +#: components/ItaliaTheme/Blocks/TextCard/CardWithImage/Sidebar +# defaultMessage: Testo alternativo per l'immagine +msgid "altText" +msgstr "" + #: components/ItaliaTheme/View/PersonaView/PersonaDocumenti # defaultMessage: Altre cariche msgid "altre_cariche" @@ -2087,6 +2092,11 @@ msgstr "" msgid "feedback_sent" msgstr "" +#: components/ItaliaTheme/CustomerSatisfaction/FeedbackForm +# defaultMessage: Valuta da 1 a 5 stelle +msgid "feedback_stars" +msgstr "" + #: components/ItaliaTheme/CustomerSatisfaction/FeedbackForm # defaultMessage: I ran into technical problems msgid "feedback_technical_problems" @@ -2131,6 +2141,16 @@ msgstr "" msgid "fine_termine" msgstr "" +#: overrideTranslations +# defaultMessage: Annulla +msgid "form_default_cancel_label" +msgstr "" + +#: overrideTranslations +# defaultMessage: Ricomincia +msgid "form_reset" +msgstr "" + #: components/ItaliaTheme/View/PersonaView/PersonaRuolo # defaultMessage: Foto dell'attività politica msgid "foto_attivita_politica" @@ -2311,6 +2331,11 @@ msgstr "" msgid "legami_strutture_figlie" msgstr "" +#: overrideTranslations +# defaultMessage: I campi contrassegnati da (*) sono obbligatori. +msgid "legend_required" +msgstr "" + #: components/ItaliaTheme/Blocks/SearchSections/SideBar # defaultMessage: Collegamento msgid "link" @@ -3006,6 +3031,16 @@ msgstr "" msgid "rrule_th" msgstr "" +#: overrideTranslations +# defaultMessage: giorno feriale +msgid "rrule_weekday" +msgstr "" + +#: overrideTranslations +# defaultMessage: giorni feriali +msgid "rrule_weekdays" +msgstr "" + #: components/ItaliaTheme/Blocks/RssBlock/CardWithImageRssTemplate #: components/ItaliaTheme/Blocks/RssBlock/CardWithoutImageRssTemplate # defaultMessage: No results from RSS feed. diff --git a/locales/en/LC_MESSAGES/volto.po b/locales/en/LC_MESSAGES/volto.po index a2f86d8e1..6ec6cf9e0 100644 --- a/locales/en/LC_MESSAGES/volto.po +++ b/locales/en/LC_MESSAGES/volto.po @@ -763,6 +763,11 @@ msgstr "All topics" msgid "allegati" msgstr "Attached documents" +#: components/ItaliaTheme/Blocks/TextCard/CardWithImage/Sidebar +# defaultMessage: Testo alternativo per l'immagine +msgid "altText" +msgstr "" + #: components/ItaliaTheme/View/PersonaView/PersonaDocumenti # defaultMessage: Altre cariche msgid "altre_cariche" @@ -2072,6 +2077,11 @@ msgstr "" msgid "feedback_sent" msgstr "" +#: components/ItaliaTheme/CustomerSatisfaction/FeedbackForm +# defaultMessage: Valuta da 1 a 5 stelle +msgid "feedback_stars" +msgstr "Rate from 1 to 5 stars" + #: components/ItaliaTheme/CustomerSatisfaction/FeedbackForm # defaultMessage: I ran into technical problems msgid "feedback_technical_problems" @@ -2116,6 +2126,16 @@ msgstr "Search" msgid "fine_termine" msgstr "End of term" +#: overrideTranslations +# defaultMessage: Annulla +msgid "form_default_cancel_label" +msgstr "Cancel" + +#: overrideTranslations +# defaultMessage: Ricomincia +msgid "form_reset" +msgstr "Restart" + #: components/ItaliaTheme/View/PersonaView/PersonaRuolo # defaultMessage: Foto dell'attività politica msgid "foto_attivita_politica" @@ -2296,6 +2316,11 @@ msgstr "Association service or office" msgid "legami_strutture_figlie" msgstr "Internal services or offices" +#: overrideTranslations +# defaultMessage: I campi contrassegnati da (*) sono obbligatori. +msgid "legend_required" +msgstr "Fields marked with (*) are required." + #: components/ItaliaTheme/Blocks/SearchSections/SideBar # defaultMessage: Collegamento msgid "link" @@ -2991,6 +3016,16 @@ msgstr "st" msgid "rrule_th" msgstr "th" +#: overrideTranslations +# defaultMessage: giorno feriale +msgid "rrule_weekday" +msgstr "weekday" + +#: overrideTranslations +# defaultMessage: giorni feriali +msgid "rrule_weekdays" +msgstr "weekdays" + #: components/ItaliaTheme/Blocks/RssBlock/CardWithImageRssTemplate #: components/ItaliaTheme/Blocks/RssBlock/CardWithoutImageRssTemplate # defaultMessage: No results from RSS feed. diff --git a/locales/es/LC_MESSAGES/volto.po b/locales/es/LC_MESSAGES/volto.po index 3ea7c410d..ae8ab1c7c 100644 --- a/locales/es/LC_MESSAGES/volto.po +++ b/locales/es/LC_MESSAGES/volto.po @@ -772,6 +772,11 @@ msgstr "Todos los temas" msgid "allegati" msgstr "Documentos adjuntos" +#: components/ItaliaTheme/Blocks/TextCard/CardWithImage/Sidebar +# defaultMessage: Testo alternativo per l'immagine +msgid "altText" +msgstr "" + #: components/ItaliaTheme/View/PersonaView/PersonaDocumenti # defaultMessage: Altre cariche msgid "altre_cariche" @@ -2081,6 +2086,11 @@ msgstr "" msgid "feedback_sent" msgstr "" +#: components/ItaliaTheme/CustomerSatisfaction/FeedbackForm +# defaultMessage: Valuta da 1 a 5 stelle +msgid "feedback_stars" +msgstr "" + #: components/ItaliaTheme/CustomerSatisfaction/FeedbackForm # defaultMessage: I ran into technical problems msgid "feedback_technical_problems" @@ -2125,6 +2135,16 @@ msgstr "Buscar" msgid "fine_termine" msgstr "Fin de los términos" +#: overrideTranslations +# defaultMessage: Annulla +msgid "form_default_cancel_label" +msgstr "" + +#: overrideTranslations +# defaultMessage: Ricomincia +msgid "form_reset" +msgstr "" + #: components/ItaliaTheme/View/PersonaView/PersonaRuolo # defaultMessage: Foto dell'attività politica msgid "foto_attivita_politica" @@ -2305,6 +2325,11 @@ msgstr "Servicio u oficina de la asociación" msgid "legami_strutture_figlie" msgstr "Servicios internos u oficinas" +#: overrideTranslations +# defaultMessage: I campi contrassegnati da (*) sono obbligatori. +msgid "legend_required" +msgstr "" + #: components/ItaliaTheme/Blocks/SearchSections/SideBar # defaultMessage: Collegamento msgid "link" @@ -3000,6 +3025,16 @@ msgstr "" msgid "rrule_th" msgstr "" +#: overrideTranslations +# defaultMessage: giorno feriale +msgid "rrule_weekday" +msgstr "" + +#: overrideTranslations +# defaultMessage: giorni feriali +msgid "rrule_weekdays" +msgstr "" + #: components/ItaliaTheme/Blocks/RssBlock/CardWithImageRssTemplate #: components/ItaliaTheme/Blocks/RssBlock/CardWithoutImageRssTemplate # defaultMessage: No results from RSS feed. diff --git a/locales/fr/LC_MESSAGES/volto.po b/locales/fr/LC_MESSAGES/volto.po index fc9658341..fff6d8e73 100644 --- a/locales/fr/LC_MESSAGES/volto.po +++ b/locales/fr/LC_MESSAGES/volto.po @@ -780,6 +780,11 @@ msgstr "Tous les sujets" msgid "allegati" msgstr "Documents attachés" +#: components/ItaliaTheme/Blocks/TextCard/CardWithImage/Sidebar +# defaultMessage: Testo alternativo per l'immagine +msgid "altText" +msgstr "" + #: components/ItaliaTheme/View/PersonaView/PersonaDocumenti # defaultMessage: Altre cariche msgid "altre_cariche" @@ -2089,6 +2094,11 @@ msgstr "" msgid "feedback_sent" msgstr "" +#: components/ItaliaTheme/CustomerSatisfaction/FeedbackForm +# defaultMessage: Valuta da 1 a 5 stelle +msgid "feedback_stars" +msgstr "" + #: components/ItaliaTheme/CustomerSatisfaction/FeedbackForm # defaultMessage: I ran into technical problems msgid "feedback_technical_problems" @@ -2133,6 +2143,16 @@ msgstr "Rechercher" msgid "fine_termine" msgstr "Fin du mandat" +#: overrideTranslations +# defaultMessage: Annulla +msgid "form_default_cancel_label" +msgstr "" + +#: overrideTranslations +# defaultMessage: Ricomincia +msgid "form_reset" +msgstr "" + #: components/ItaliaTheme/View/PersonaView/PersonaRuolo # defaultMessage: Foto dell'attività politica msgid "foto_attivita_politica" @@ -2313,6 +2333,11 @@ msgstr "" msgid "legami_strutture_figlie" msgstr "" +#: overrideTranslations +# defaultMessage: I campi contrassegnati da (*) sono obbligatori. +msgid "legend_required" +msgstr "Les champs marqués d'une (*) sont obligatoires." + #: components/ItaliaTheme/Blocks/SearchSections/SideBar # defaultMessage: Collegamento msgid "link" @@ -3008,6 +3033,16 @@ msgstr "" msgid "rrule_th" msgstr "" +#: overrideTranslations +# defaultMessage: giorno feriale +msgid "rrule_weekday" +msgstr "" + +#: overrideTranslations +# defaultMessage: giorni feriali +msgid "rrule_weekdays" +msgstr "" + #: components/ItaliaTheme/Blocks/RssBlock/CardWithImageRssTemplate #: components/ItaliaTheme/Blocks/RssBlock/CardWithoutImageRssTemplate # defaultMessage: No results from RSS feed. diff --git a/locales/it/LC_MESSAGES/volto.po b/locales/it/LC_MESSAGES/volto.po index 1cce72a34..f7725de98 100644 --- a/locales/it/LC_MESSAGES/volto.po +++ b/locales/it/LC_MESSAGES/volto.po @@ -763,6 +763,11 @@ msgstr "Tutti gli argomenti" msgid "allegati" msgstr "Documenti allegati" +#: components/ItaliaTheme/Blocks/TextCard/CardWithImage/Sidebar +# defaultMessage: Testo alternativo per l'immagine +msgid "altText" +msgstr "" + #: components/ItaliaTheme/View/PersonaView/PersonaDocumenti # defaultMessage: Altre cariche msgid "altre_cariche" @@ -2072,6 +2077,11 @@ msgstr "Altro" msgid "feedback_sent" msgstr "Il tuo feedback è stato inviato!" +#: components/ItaliaTheme/CustomerSatisfaction/FeedbackForm +# defaultMessage: Valuta da 1 a 5 stelle +msgid "feedback_stars" +msgstr "" + #: components/ItaliaTheme/CustomerSatisfaction/FeedbackForm # defaultMessage: I ran into technical problems msgid "feedback_technical_problems" @@ -2116,6 +2126,16 @@ msgstr "Cerca" msgid "fine_termine" msgstr "Fine termine" +#: overrideTranslations +# defaultMessage: Annulla +msgid "form_default_cancel_label" +msgstr "Annulla" + +#: overrideTranslations +# defaultMessage: Ricomincia +msgid "form_reset" +msgstr "Ricomincia" + #: components/ItaliaTheme/View/PersonaView/PersonaRuolo # defaultMessage: Foto dell'attività politica msgid "foto_attivita_politica" @@ -2296,6 +2316,11 @@ msgstr "Unità organizzativa genitore" msgid "legami_strutture_figlie" msgstr "Servizi o uffici interni" +#: overrideTranslations +# defaultMessage: I campi contrassegnati da (*) sono obbligatori. +msgid "legend_required" +msgstr "I campi contrassegnati da (*) sono obbligatori." + #: components/ItaliaTheme/Blocks/SearchSections/SideBar # defaultMessage: Collegamento msgid "link" @@ -2991,6 +3016,16 @@ msgstr " " msgid "rrule_th" msgstr " " +#: overrideTranslations +# defaultMessage: giorno feriale +msgid "rrule_weekday" +msgstr "giorno feriale" + +#: overrideTranslations +# defaultMessage: giorni feriali +msgid "rrule_weekdays" +msgstr "giorni feriali" + #: components/ItaliaTheme/Blocks/RssBlock/CardWithImageRssTemplate #: components/ItaliaTheme/Blocks/RssBlock/CardWithoutImageRssTemplate # defaultMessage: No results from RSS feed. diff --git a/locales/volto.pot b/locales/volto.pot index d8ede7669..d61d81e59 100644 --- a/locales/volto.pot +++ b/locales/volto.pot @@ -765,6 +765,11 @@ msgstr "" msgid "allegati" msgstr "" +#: components/ItaliaTheme/Blocks/TextCard/CardWithImage/Sidebar +# defaultMessage: Testo alternativo per l'immagine +msgid "altText" +msgstr "" + #: components/ItaliaTheme/View/PersonaView/PersonaDocumenti # defaultMessage: Altre cariche msgid "altre_cariche" @@ -2074,6 +2079,11 @@ msgstr "" msgid "feedback_sent" msgstr "" +#: components/ItaliaTheme/CustomerSatisfaction/FeedbackForm +# defaultMessage: Valuta da 1 a 5 stelle +msgid "feedback_stars" +msgstr "" + #: components/ItaliaTheme/CustomerSatisfaction/FeedbackForm # defaultMessage: I ran into technical problems msgid "feedback_technical_problems" @@ -2118,6 +2128,16 @@ msgstr "" msgid "fine_termine" msgstr "" +#: overrideTranslations +# defaultMessage: Annulla +msgid "form_default_cancel_label" +msgstr "" + +#: overrideTranslations +# defaultMessage: Ricomincia +msgid "form_reset" +msgstr "" + #: components/ItaliaTheme/View/PersonaView/PersonaRuolo # defaultMessage: Foto dell'attività politica msgid "foto_attivita_politica" @@ -2298,6 +2318,11 @@ msgstr "" msgid "legami_strutture_figlie" msgstr "" +#: overrideTranslations +# defaultMessage: I campi contrassegnati da (*) sono obbligatori. +msgid "legend_required" +msgstr "" + #: components/ItaliaTheme/Blocks/SearchSections/SideBar # defaultMessage: Collegamento msgid "link" @@ -2993,6 +3018,16 @@ msgstr "" msgid "rrule_th" msgstr "" +#: overrideTranslations +# defaultMessage: giorno feriale +msgid "rrule_weekday" +msgstr "" + +#: overrideTranslations +# defaultMessage: giorni feriali +msgid "rrule_weekdays" +msgstr "" + #: components/ItaliaTheme/Blocks/RssBlock/CardWithImageRssTemplate #: components/ItaliaTheme/Blocks/RssBlock/CardWithoutImageRssTemplate # defaultMessage: No results from RSS feed. @@ -3279,7 +3314,7 @@ msgid "search_startDate" msgstr "" #: helpers/Translations/searchBlockExtendedTranslations -# defaultMessage: Ricerca per: {searchedtext}. +# defaultMessage: Ricerca per: {searchedtext}. msgid "searchedFor" msgstr "" diff --git a/package.json b/package.json index 1cffd6c7f..f6125dc02 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "design-comuni-plone-theme", "description": "Volto Theme for Italia design guidelines", "license": "GPL-v3", - "version": "11.5.1", + "version": "11.8.1", "main": "src/index.js", "keywords": [ "volto-addon", @@ -141,16 +141,16 @@ "typeface-lora": "0.0.72", "typeface-roboto-mono": "0.0.75", "typeface-titillium-web": "0.0.72", - "volto-blocks-widget": "3.1.0", + "volto-blocks-widget": "3.4.0", "volto-data-grid-widget": "2.3.1", "volto-dropdownmenu": "4.1.1", - "volto-editablefooter": "5.0.3", - "volto-feedback": "0.2.0", - "volto-form-block": "3.1.0", + "volto-editablefooter": "5.1.0", + "volto-feedback": "0.3.0", + "volto-form-block": "3.7.1", "volto-gdpr-privacy": "2.1.1", "volto-google-analytics": "2.0.0", "volto-multilingual-widget": "3.0.0", - "volto-querywidget-with-browser": "0.4.1", + "volto-querywidget-with-browser": "0.4.2", "volto-rss-block": "3.0.0", "volto-secondarymenu": "4.0.0", "volto-social-settings": "3.0.0", diff --git a/publiccode.yml b/publiccode.yml index 42033cd04..2bd9fccf3 100644 --- a/publiccode.yml +++ b/publiccode.yml @@ -227,9 +227,9 @@ maintenance: name: io-Comune - Il sito AgID per Comuni ed Enti Pubblici platforms: - web -releaseDate: '2024-02-19' +releaseDate: '2024-03-26' softwareType: standalone/web -softwareVersion: 11.5.1 +softwareVersion: 11.8.1 url: 'https://github.com/italia/design-comuni-plone-theme' usedBy: - ASP Comuni Modenesi Area Nord @@ -252,6 +252,7 @@ usedBy: - Comune di Cantagallo - Comune di Casalfiumanese - Comune di Castel del Rio + - Comune di Castel Guelfo di Bologna - Comune di Cavezzo - Comune di Cavriago - Comune di Concordia sul Secchia @@ -276,6 +277,7 @@ usedBy: - Comune di Piacenza - Comune di Prignano - Comune di Reggio Emilia + - Comune di Rolo - Comune di San Felice sul Panaro - Comune di San Lazzaro di Savena - Comune di San Polo d'Enza diff --git a/src/components/ItaliaTheme/Blocks/IconBlocks/Edit.jsx b/src/components/ItaliaTheme/Blocks/IconBlocks/Edit.jsx index 685266b06..d6aa29d36 100644 --- a/src/components/ItaliaTheme/Blocks/IconBlocks/Edit.jsx +++ b/src/components/ItaliaTheme/Blocks/IconBlocks/Edit.jsx @@ -8,7 +8,7 @@ import { defineMessages } from 'react-intl'; import { Container, Row, Col } from 'design-react-kit'; import { SidebarPortal } from '@plone/volto/components'; -import { flattenToAppURL, addAppURL } from '@plone/volto/helpers'; +import { flattenToAppURL } from '@plone/volto/helpers'; import { UniversalLink } from '@plone/volto/components'; import { @@ -21,6 +21,8 @@ import { TextEditorWidget } from 'design-comuni-plone-theme/components/ItaliaThe import EditBlock from './Block/EditBlock'; import Sidebar from './Sidebar.jsx'; +import config from '@plone/volto/registry'; + const messages = defineMessages({ addItem: { id: 'Add accordion item', @@ -54,23 +56,23 @@ class Edit extends SubblocksEdit { if (__SERVER__) { return
; } + const Image = config.getComponent({ name: 'Image' }).component; return (
{this.props.data.background?.[0] ? ( -
+
+ +
) : ( -
+
)} diff --git a/src/components/ItaliaTheme/Blocks/IconBlocks/Sidebar.jsx b/src/components/ItaliaTheme/Blocks/IconBlocks/Sidebar.jsx index 3b1476cd2..b43183683 100644 --- a/src/components/ItaliaTheme/Blocks/IconBlocks/Sidebar.jsx +++ b/src/components/ItaliaTheme/Blocks/IconBlocks/Sidebar.jsx @@ -58,7 +58,10 @@ const Sidebar = ({ description="" required={false} widgetOptions={{ - pattern_options: { selectableTypes: ['Image'] }, + pattern_options: { + selectableTypes: ['Image'], + maximumSelectionSize: 1, + }, }} value={data.background ?? []} onChange={(id, value) => diff --git a/src/components/ItaliaTheme/Blocks/IconBlocks/View.jsx b/src/components/ItaliaTheme/Blocks/IconBlocks/View.jsx index d2a985e2c..85f498126 100644 --- a/src/components/ItaliaTheme/Blocks/IconBlocks/View.jsx +++ b/src/components/ItaliaTheme/Blocks/IconBlocks/View.jsx @@ -1,5 +1,5 @@ /** - * View Accordion block. + * View IconsBlock block. * @module components/ItaliaTheme/Blocks/Accordion/View */ @@ -8,38 +8,40 @@ import PropTypes from 'prop-types'; import redraft from 'redraft'; import ViewBlock from './Block/ViewBlock'; import { Container, Row, Col } from 'design-react-kit'; -import { flattenToAppURL, addAppURL } from '@plone/volto/helpers'; +import { flattenToAppURL } from '@plone/volto/helpers'; import { UniversalLink } from '@plone/volto/components'; import config from '@plone/volto/registry'; +import { checkRedraftHasContent } from 'design-comuni-plone-theme/helpers'; /** - * View Accordion block class. + * View IconsBlock block class. * @class View * @extends Component */ -const AccordionView = ({ data, block }) => { +const IconsBlockView = ({ data, block }) => { const id = new Date().getTime(); + const Image = config.getComponent({ name: 'Image' }).component; return (
{data.background?.[0] ? ( -
+
+ +
) : ( -
+
)}
- {data.title && ( + {checkRedraftHasContent(data.title) && (
{redraft( data.title, @@ -48,7 +50,7 @@ const AccordionView = ({ data, block }) => { )}
)} - {data.description && ( + {checkRedraftHasContent(data.description) && (
{redraft( data.description, @@ -93,8 +95,8 @@ const AccordionView = ({ data, block }) => { * @property {Object} propTypes Property types. * @static */ -AccordionView.propTypes = { +IconsBlockView.propTypes = { data: PropTypes.objectOf(PropTypes.any).isRequired, }; -export default AccordionView; +export default IconsBlockView; diff --git a/src/components/ItaliaTheme/Blocks/Listing/CardWithImageTemplate.jsx b/src/components/ItaliaTheme/Blocks/Listing/CardWithImageTemplate.jsx index a85db4a65..65e723954 100644 --- a/src/components/ItaliaTheme/Blocks/Listing/CardWithImageTemplate.jsx +++ b/src/components/ItaliaTheme/Blocks/Listing/CardWithImageTemplate.jsx @@ -50,7 +50,7 @@ const CardWithImageTemplate = (props) => { show_block_bg = false, always_show_image = false, set_four_columns = false, - show_type = true, + show_type = false, show_section, show_icon = true, show_description = true, @@ -93,7 +93,7 @@ const CardWithImageTemplate = (props) => { ) : null; - const image = ListingImage({ item }); + const image = ListingImage({ item, showTitleAttr: false }); const showImage = (index < imagesToShow || always_show_image) && image != null; diff --git a/src/components/ItaliaTheme/Blocks/Listing/Commons/ListingImage.jsx b/src/components/ItaliaTheme/Blocks/Listing/Commons/ListingImage.jsx index cda17063d..f9e128e7a 100644 --- a/src/components/ItaliaTheme/Blocks/Listing/Commons/ListingImage.jsx +++ b/src/components/ItaliaTheme/Blocks/Listing/Commons/ListingImage.jsx @@ -8,24 +8,27 @@ const ListingImage = ({ showDefault = false, className = 'listing-image', responsive = true, + showTitleAttr = true, sizes = '(max-width:320px) 200px, (max-width:425px) 300px, (max-width:767px) 500px, 410px', ...imageProps }) => { const Image = config.getComponent({ name: 'Image' }).component; - // photogallery needs to check for null image - // https://stackoverflow.com/questions/33136399/is-there-a-way-to-tell-if-reactelement-renders-null - const image = Image({ + let commonImageProps = { item, 'aria-hidden': true, alt: '', role: 'presentation', className, loading, - title: item.title, responsive, sizes, ...imageProps, - }); + }; + if (showTitleAttr) + commonImageProps = { ...commonImageProps, title: item.title }; + // photogallery needs to check for null image + // https://stackoverflow.com/questions/33136399/is-there-a-way-to-tell-if-reactelement-renders-null + const image = Image(commonImageProps); if (image === null) return showDefault ? : null; diff --git a/src/components/ItaliaTheme/Blocks/Listing/CompleteBlockLinksTemplate.jsx b/src/components/ItaliaTheme/Blocks/Listing/CompleteBlockLinksTemplate.jsx index 6934686e1..9a137d09c 100644 --- a/src/components/ItaliaTheme/Blocks/Listing/CompleteBlockLinksTemplate.jsx +++ b/src/components/ItaliaTheme/Blocks/Listing/CompleteBlockLinksTemplate.jsx @@ -56,7 +56,12 @@ const CompleteBlockLinksTemplate = (props) => { )} {items.map((item, index) => { - const image = ListingImage({ item, className: '', sizes: '60px' }); + const image = ListingImage({ + item, + className: '', + sizes: '60px', + showTitleAttr: false, + }); const BlockExtraTags = getComponentWithFallback({ name: 'BlockExtraTags', diff --git a/src/components/ItaliaTheme/Blocks/Listing/ContentInEvidenceTemplate.jsx b/src/components/ItaliaTheme/Blocks/Listing/ContentInEvidenceTemplate.jsx index 105d6f663..63002c741 100644 --- a/src/components/ItaliaTheme/Blocks/Listing/ContentInEvidenceTemplate.jsx +++ b/src/components/ItaliaTheme/Blocks/Listing/ContentInEvidenceTemplate.jsx @@ -70,6 +70,7 @@ const ContentInEvidenceTemplate = (props) => { className: 'item-image', loading: 'eager', sizes: '(max-width:425px) 400px, (max-width:767px) 520px, 650px', + showTitleAttr: false, }); const icon = getItemIcon(item); const BlockExtraTags = getComponentWithFallback({ diff --git a/src/components/ItaliaTheme/Blocks/Listing/GridGalleryTemplate.jsx b/src/components/ItaliaTheme/Blocks/Listing/GridGalleryTemplate.jsx index 1e21911ad..0b311f313 100644 --- a/src/components/ItaliaTheme/Blocks/Listing/GridGalleryTemplate.jsx +++ b/src/components/ItaliaTheme/Blocks/Listing/GridGalleryTemplate.jsx @@ -58,6 +58,7 @@ const GridGalleryTemplate = ({ let image = ListingImage({ item, className: '', + showTitleAttr: false, }); let scale = null; if (index % 7 === 0 || index % 7 === 6 || index % 7 === 3) { diff --git a/src/components/ItaliaTheme/Blocks/Listing/InEvidenceTemplate.jsx b/src/components/ItaliaTheme/Blocks/Listing/InEvidenceTemplate.jsx index c67bfbb5b..869f1842b 100644 --- a/src/components/ItaliaTheme/Blocks/Listing/InEvidenceTemplate.jsx +++ b/src/components/ItaliaTheme/Blocks/Listing/InEvidenceTemplate.jsx @@ -89,6 +89,7 @@ const InEvidenceTemplate = (props) => { const image = ListingImage({ item, sizes: '(max-width:320px) 200px, 300px', + showTitleAttr: false, }); const category = getCategory(item, show_type, show_section, props); const topics = show_topics ? item.tassonomia_argomenti : null; diff --git a/src/components/ItaliaTheme/Blocks/TextCard/CardWithImage/Block.jsx b/src/components/ItaliaTheme/Blocks/TextCard/CardWithImage/Block.jsx index c1f084b73..5857eb02c 100644 --- a/src/components/ItaliaTheme/Blocks/TextCard/CardWithImage/Block.jsx +++ b/src/components/ItaliaTheme/Blocks/TextCard/CardWithImage/Block.jsx @@ -24,7 +24,7 @@ const messages = defineMessages({ }, }); -const renderImage = (image, showImage, sizeNatural) => +const renderImage = (image, showImage, sizeNatural, altText = '') => showImage && image ? (
@@ -117,7 +117,12 @@ const Block = ({ > {hasImage && ( - {renderImage(data?.image, hasImage, data?.sizeNatural)} + {renderImage( + data?.image, + hasImage, + data?.sizeNatural, + data?.altText, + )} )}
- {renderImage(data?.image, hasImage, data?.sizeNatural)} + {renderImage( + data?.image, + hasImage, + data?.sizeNatural, + data?.altText, + )}
{ @@ -105,6 +110,14 @@ const Sidebar = ({ data, block, onChangeBlock }) => { value={data.sizeImage || 's'} /> + { + onChangeBlock({ ...data, altText: value }); + }} + /> diff --git a/src/components/ItaliaTheme/Blocks/__tests__/IconBlocks.test.jsx b/src/components/ItaliaTheme/Blocks/__tests__/IconBlocks.test.jsx index a136004ed..8ff0e5fd1 100644 --- a/src/components/ItaliaTheme/Blocks/__tests__/IconBlocks.test.jsx +++ b/src/components/ItaliaTheme/Blocks/__tests__/IconBlocks.test.jsx @@ -378,10 +378,8 @@ test('View renders all fields', async () => { screen.getByText(/With his brim pulled way down low/i), ).toBeInTheDocument(); //immagine di background - const backgroundImage = document.querySelector('.background-image'); - expect(backgroundImage).toHaveStyle( - `background-image: url(http://localhost:3000/is-this-the-real-life/business-teamwork-join-hands-together-business-teamwork-concept_1150-1804.webp/@@images/image/huge);`, - ); + const backgroundImage = document.querySelector('.background-image img'); + expect(backgroundImage).toBeInTheDocument(); //link ad altro expect( screen.getByRole('link', { diff --git a/src/components/ItaliaTheme/Cards/CardPersona.jsx b/src/components/ItaliaTheme/Cards/CardPersona.jsx index 922ce71d2..ac09a27b3 100644 --- a/src/components/ItaliaTheme/Cards/CardPersona.jsx +++ b/src/components/ItaliaTheme/Cards/CardPersona.jsx @@ -23,6 +23,7 @@ export const CardPersona = ({ const image = ListingImage({ item, sizes: '130px', + showTitleAttr: false, }); const hasImage = image !== null && showImage; diff --git a/src/components/ItaliaTheme/CustomerSatisfaction/FeedbackForm.jsx b/src/components/ItaliaTheme/CustomerSatisfaction/FeedbackForm.jsx index cbf73ecd1..900fef33f 100644 --- a/src/components/ItaliaTheme/CustomerSatisfaction/FeedbackForm.jsx +++ b/src/components/ItaliaTheme/CustomerSatisfaction/FeedbackForm.jsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect, useCallback, useMemo } from 'react'; +import React, { useState, useEffect, useCallback } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import { useLocation } from 'react-router-dom'; import { useIntl, defineMessages } from 'react-intl'; @@ -9,7 +9,6 @@ import { Col, Spinner, Card, - Button, CardHeader, CardBody, } from 'design-react-kit'; @@ -25,7 +24,7 @@ import { import cx from 'classnames'; import AnswersStep from './Steps/AnswersStep'; import CommentsStep from './Steps/CommentsStep'; -import Rating from './Steps/Commons/Rating'; +import RTRating from './Steps/Commons/Rating'; import { PropTypes } from 'prop-types'; const messages = defineMessages({ @@ -111,6 +110,10 @@ const messages = defineMessages({ id: 'feedback_other_positive', defaultMessage: 'Other', }, + feedback: { + id: 'feedback_stars', + defaultMessage: 'Valuta da 1 a 5 stelle', + }, error: { id: 'feedback_error', defaultMessage: 'Error', @@ -134,12 +137,11 @@ const FeedbackForm = ({ contentType, pathname }) => { ? window.env.RAZZLE_HONEYPOT_FIELD : process.env.RAZZLE_HONEYPOT_FIELD; - const numberOfSteps = useMemo(() => getNumberOfSteps(), []); + const numberOfSteps = getNumberOfSteps(); const changeSatisfaction = (e) => { setSatisfaction(e); }; - const updateFormData = (field, value) => { if (field === 'comment') { if (value?.length > 200) setInvalidForm(true); @@ -154,12 +156,17 @@ const FeedbackForm = ({ contentType, pathname }) => { [field]: value, }); }; - const getFormFieldValue = (field) => formData?.[field] ?? undefined; - const nextStep = () => setStep(step + 1); + const nextStep = () => { + if (!invalidForm) setStep(step + 1); + }; - const prevStep = () => setStep(step - 1); + const prevStep = () => { + if (!invalidForm && step !== 0) { + setStep(step - 1); + } + }; useEffect(() => { setValidToken(null); @@ -171,6 +178,12 @@ const FeedbackForm = ({ contentType, pathname }) => { }, [path]); useEffect(() => { + const currentVote = getFormFieldValue('vote'); + if ( + (currentVote > threshold && satisfaction < threshold) || + (currentVote < threshold && satisfaction > threshold) + ) + updateFormData('answer', null); updateFormData('vote', satisfaction ?? null); setStep(0); // eslint-disable-next-line react-hooks/exhaustive-deps @@ -182,6 +195,27 @@ const FeedbackForm = ({ contentType, pathname }) => { // eslint-disable-next-line react-hooks/exhaustive-deps }, [fieldHoney]); + // Motivazioni del focus programmatico + // - su alcuni browser viene dichiarato "object replacement character" ai rerender di react + // che sono inevitabili mentre il focus rimane sul bottone ma non viene detto + // - replichiamo 1:1 il comportamento del secondo step, quando vai avanti hai autofocus sulla + // textarea per i commenti + // - essendo annunciato ora il titolo dello step, l'utente sr sa comunque benissimo dove si trova, + // anzi, il flow di compilazione del form kb+sr e' molto piu' agevole + useEffect(() => { + if (step === 0 && getFormFieldValue('answer')) { + const selectedAnswer = document.getElementById( + `${ + satisfaction > threshold ? 'positive' : 'negative' + }-${getFormFieldValue('answer')}`, + ); + if (selectedAnswer) { + selectedAnswer.focus(); + } + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [step]); + const onVerifyCaptcha = useCallback( (token) => { if (satisfaction !== null && !validToken) { @@ -198,6 +232,7 @@ const FeedbackForm = ({ contentType, pathname }) => { }; const sendFormData = () => { + if (invalidForm) return; setStep(2); const data = { ...formData, @@ -220,7 +255,7 @@ const FeedbackForm = ({ contentType, pathname }) => { } return ( -
+
@@ -252,15 +287,31 @@ const FeedbackForm = ({ contentType, pathname }) => { : intl.formatMessage(messages.title)}
- threshold @@ -269,7 +320,7 @@ const FeedbackForm = ({ contentType, pathname }) => { } className="volto-feedback-rating mb-0" onChangeRating={changeSatisfaction} - legend=" " + legend={intl.formatMessage(messages.feedback)} wrapperClassName={'rating'} />
@@ -300,47 +351,61 @@ const FeedbackForm = ({ contentType, pathname }) => { />
- + + {step !== numberOfSteps - 1 && ( - + )} {step === numberOfSteps - 1 && ( - + )}
@@ -385,7 +450,7 @@ const FeedbackForm = ({ contentType, pathname }) => {
-
+ ); }; diff --git a/src/components/ItaliaTheme/CustomerSatisfaction/Steps/AnswersStep.jsx b/src/components/ItaliaTheme/CustomerSatisfaction/Steps/AnswersStep.jsx index a3c737172..bd37d7b9c 100644 --- a/src/components/ItaliaTheme/CustomerSatisfaction/Steps/AnswersStep.jsx +++ b/src/components/ItaliaTheme/CustomerSatisfaction/Steps/AnswersStep.jsx @@ -1,6 +1,6 @@ import React, { useState, useEffect, useMemo } from 'react'; import { usePrevious } from '@plone/volto/helpers'; -import { Form, FormGroup, Input, Label } from 'design-react-kit'; +import { Form, FormGroup, Label } from 'design-react-kit'; import { defineMessages } from 'react-intl'; import { FormHeader, @@ -76,6 +76,9 @@ const AnswersStep = ({ step={step + 1} totalSteps={totalSteps} className={'answers-header'} + hidden={ + userFeedback === null || userFeedback < threshold || step !== 0 + } />
@@ -85,14 +88,13 @@ const AnswersStep = ({ key={'positive-' + s} className="border-bottom border-light mb-4" > -