diff --git a/CHANGELOG.md b/CHANGELOG.md index 44faf518c..38e151167 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,34 @@ +## [10.4.0](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v10.3.0...v10.4.0) (2023-11-14) + + +### Features + +* added image size and colorListWidget in Alert block ([#396](https://github.com/RedTurtle/design-comuni-plone-theme/issues/396)) ([63f3b5b](https://github.com/RedTurtle/design-comuni-plone-theme/commit/63f3b5b60364e650de5123cf8b8108dd86eab9f9)) +* split VenueDescription component ([#399](https://github.com/RedTurtle/design-comuni-plone-theme/issues/399)) ([68c3ca5](https://github.com/RedTurtle/design-comuni-plone-theme/commit/68c3ca5338f27f4e64ea257f679ae91dc1842491)) + + +### Bug Fixes + +* documentFirstHeading in subsites without style ([#400](https://github.com/RedTurtle/design-comuni-plone-theme/issues/400)) ([9588073](https://github.com/RedTurtle/design-comuni-plone-theme/commit/9588073d4a2a72e4eb3664c5741b0368f59781fb)) +* icons in NumbersBlock and Sidebar Widget not updating ([#402](https://github.com/RedTurtle/design-comuni-plone-theme/issues/402)) ([0df93a5](https://github.com/RedTurtle/design-comuni-plone-theme/commit/0df93a59c100df69085db83b4ade85101601ed35)) +* locales ([c4bdc14](https://github.com/RedTurtle/design-comuni-plone-theme/commit/c4bdc148aa76ad7ee81945185f22b2eeead3feeb)) +* mark section filters correctly when navigating to search page from page header ([#401](https://github.com/RedTurtle/design-comuni-plone-theme/issues/401)) ([fdc6207](https://github.com/RedTurtle/design-comuni-plone-theme/commit/fdc62074fa2b92292b128a31f7d227ed5e97c074)) +* ParentSiteMenu now draws only Visible site menu elements in subsites ([#403](https://github.com/RedTurtle/design-comuni-plone-theme/issues/403)) ([9fc0a24](https://github.com/RedTurtle/design-comuni-plone-theme/commit/9fc0a2456030d1480fbe5b76cf4f9c29eab0d10e)) +* Photogallery popup image ([#395](https://github.com/RedTurtle/design-comuni-plone-theme/issues/395)) ([4fce154](https://github.com/RedTurtle/design-comuni-plone-theme/commit/4fce154045e2cbc710fed9d975842edb1af7e85a)) +* scroll position on h2 .visually-hidden ([#397](https://github.com/RedTurtle/design-comuni-plone-theme/issues/397)) ([9356e6a](https://github.com/RedTurtle/design-comuni-plone-theme/commit/9356e6af8a3273ebb1d51c80d84ae0cce7c7dd3a)) + + +### Maintenance + +* split BandoView Text in different components ([#391](https://github.com/RedTurtle/design-comuni-plone-theme/issues/391)) ([e787f38](https://github.com/RedTurtle/design-comuni-plone-theme/commit/e787f38899519daa2e6743e896e5f8d53fc8bf8a)) + + +### Documentation + +* updated publiccode and release log ([f95133b](https://github.com/RedTurtle/design-comuni-plone-theme/commit/f95133b0ddaa5ac27a07dfa772f48dfb1b59c067)) + ## [10.3.0](https://github.com/redturtle/design-comuni-plone-theme/compare/v10.2.2...v10.3.0) (2023-11-08) diff --git a/RELEASE.md b/RELEASE.md index 8cafea824..b56a84289 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -41,12 +41,18 @@ - ... --> -## Versione X.X.X (dd/mm/yyyy) +## Versione 10.4.0 (14/11/2023) ### Novità - Aggiunta la possibilità di selezionare la dimensione dell'immagine nel blocco Alert, inoltre è stato aggiornato anche il widget per la selezione del colore di sfondo. +### Fix + +- Quando viene effettuata una ricerca dalla barra di ricerca nelle sezioni Amministrazione, Servizi, Novità, o Documenti e Dati, viene automaticamente impostato il filtro sulla sezione stessa così da mostrare solo i contenuti corrispondenti. +- Le icone del Blocco Numeri, del Blocco Icone e della Sidebar si aggiornano istantaneamente quando vengono cambiate +- Sistemato un bug nell'header dei sottositi che mostrava le voci del menu del sito padre anche se queste erano indicate come non visibili nella configurazione del menu. + ## Versione 10.3.0 (08/11/2023) ### Fix diff --git a/locales/de/LC_MESSAGES/volto.po b/locales/de/LC_MESSAGES/volto.po index 765780f51..b3c680b26 100644 --- a/locales/de/LC_MESSAGES/volto.po +++ b/locales/de/LC_MESSAGES/volto.po @@ -697,7 +697,7 @@ msgstr "" msgid "VenuesSmall" msgstr "" -#: components/ItaliaTheme/View/VenueView/VenueDescription +#: components/ItaliaTheme/View/VenueView/VenueMultimedia # defaultMessage: Video msgid "Video" msgstr "" @@ -1813,7 +1813,7 @@ msgstr "" msgid "edit_social_links" msgstr "" -#: components/ItaliaTheme/View/VenueView/VenueDescription +#: components/ItaliaTheme/View/VenueView/VenueElementiDiInteresse # defaultMessage: Elementi di interesse msgid "elementi_di_interesse" msgstr "" @@ -2369,7 +2369,7 @@ msgid "logo-subsite-alt" msgstr "" #: components/ItaliaTheme/View/PuntoDiContattoView/RelatedItemsChipsPDC -#: components/ItaliaTheme/View/VenueView/VenueDescription +#: components/ItaliaTheme/View/VenueView/VenueLuoghiCorrelati # defaultMessage: Luoghi correlati msgid "luoghi_correlati" msgstr "" @@ -3761,7 +3761,7 @@ msgstr "" msgid "tipologia_incarico" msgstr "" -#: components/ItaliaTheme/View/VenueView/VenueDescription +#: components/ItaliaTheme/View/VenueView/VenueTipologia # defaultMessage: Tipo di luogo msgid "tipologia_luogo" msgstr "" diff --git a/locales/en/LC_MESSAGES/volto.po b/locales/en/LC_MESSAGES/volto.po index f2c307fdc..2a34a39c0 100644 --- a/locales/en/LC_MESSAGES/volto.po +++ b/locales/en/LC_MESSAGES/volto.po @@ -682,7 +682,7 @@ msgstr "View all" msgid "VenuesSmall" msgstr "Venues" -#: components/ItaliaTheme/View/VenueView/VenueDescription +#: components/ItaliaTheme/View/VenueView/VenueMultimedia # defaultMessage: Video msgid "Video" msgstr "Video" @@ -1798,7 +1798,7 @@ msgstr "Visibile" msgid "edit_social_links" msgstr "" -#: components/ItaliaTheme/View/VenueView/VenueDescription +#: components/ItaliaTheme/View/VenueView/VenueElementiDiInteresse # defaultMessage: Elementi di interesse msgid "elementi_di_interesse" msgstr "Elements of interest" @@ -2354,7 +2354,7 @@ msgid "logo-subsite-alt" msgstr "" #: components/ItaliaTheme/View/PuntoDiContattoView/RelatedItemsChipsPDC -#: components/ItaliaTheme/View/VenueView/VenueDescription +#: components/ItaliaTheme/View/VenueView/VenueLuoghiCorrelati # defaultMessage: Luoghi correlati msgid "luoghi_correlati" msgstr "" @@ -3746,7 +3746,7 @@ msgstr "Type of call" msgid "tipologia_incarico" msgstr "" -#: components/ItaliaTheme/View/VenueView/VenueDescription +#: components/ItaliaTheme/View/VenueView/VenueTipologia # defaultMessage: Tipo di luogo msgid "tipologia_luogo" msgstr "" diff --git a/locales/es/LC_MESSAGES/volto.po b/locales/es/LC_MESSAGES/volto.po index 6721b5025..ecf1eb318 100644 --- a/locales/es/LC_MESSAGES/volto.po +++ b/locales/es/LC_MESSAGES/volto.po @@ -691,7 +691,7 @@ msgstr "Ver todo" msgid "VenuesSmall" msgstr "Lugares" -#: components/ItaliaTheme/View/VenueView/VenueDescription +#: components/ItaliaTheme/View/VenueView/VenueMultimedia # defaultMessage: Video msgid "Video" msgstr "Vídeo" @@ -1807,7 +1807,7 @@ msgstr "Visibile" msgid "edit_social_links" msgstr "Editar redes sociales" -#: components/ItaliaTheme/View/VenueView/VenueDescription +#: components/ItaliaTheme/View/VenueView/VenueElementiDiInteresse # defaultMessage: Elementi di interesse msgid "elementi_di_interesse" msgstr "Elementos de interés" @@ -2363,7 +2363,7 @@ msgid "logo-subsite-alt" msgstr "" #: components/ItaliaTheme/View/PuntoDiContattoView/RelatedItemsChipsPDC -#: components/ItaliaTheme/View/VenueView/VenueDescription +#: components/ItaliaTheme/View/VenueView/VenueLuoghiCorrelati # defaultMessage: Luoghi correlati msgid "luoghi_correlati" msgstr "" @@ -3755,7 +3755,7 @@ msgstr "Tipo de llamada" msgid "tipologia_incarico" msgstr "" -#: components/ItaliaTheme/View/VenueView/VenueDescription +#: components/ItaliaTheme/View/VenueView/VenueTipologia # defaultMessage: Tipo di luogo msgid "tipologia_luogo" msgstr "" diff --git a/locales/fr/LC_MESSAGES/volto.po b/locales/fr/LC_MESSAGES/volto.po index d3d069cd8..53d5f1eb4 100644 --- a/locales/fr/LC_MESSAGES/volto.po +++ b/locales/fr/LC_MESSAGES/volto.po @@ -699,7 +699,7 @@ msgstr "Voir tout" msgid "VenuesSmall" msgstr "Lieux" -#: components/ItaliaTheme/View/VenueView/VenueDescription +#: components/ItaliaTheme/View/VenueView/VenueMultimedia # defaultMessage: Video msgid "Video" msgstr "Vidéo" @@ -1815,7 +1815,7 @@ msgstr "" msgid "edit_social_links" msgstr "" -#: components/ItaliaTheme/View/VenueView/VenueDescription +#: components/ItaliaTheme/View/VenueView/VenueElementiDiInteresse # defaultMessage: Elementi di interesse msgid "elementi_di_interesse" msgstr "Objets d'intérêt" @@ -2371,7 +2371,7 @@ msgid "logo-subsite-alt" msgstr "" #: components/ItaliaTheme/View/PuntoDiContattoView/RelatedItemsChipsPDC -#: components/ItaliaTheme/View/VenueView/VenueDescription +#: components/ItaliaTheme/View/VenueView/VenueLuoghiCorrelati # defaultMessage: Luoghi correlati msgid "luoghi_correlati" msgstr "" @@ -3763,7 +3763,7 @@ msgstr "Type d'appel" msgid "tipologia_incarico" msgstr "" -#: components/ItaliaTheme/View/VenueView/VenueDescription +#: components/ItaliaTheme/View/VenueView/VenueTipologia # defaultMessage: Tipo di luogo msgid "tipologia_luogo" msgstr "" diff --git a/locales/it/LC_MESSAGES/volto.po b/locales/it/LC_MESSAGES/volto.po index aa4d92561..ef6034c7b 100644 --- a/locales/it/LC_MESSAGES/volto.po +++ b/locales/it/LC_MESSAGES/volto.po @@ -682,7 +682,7 @@ msgstr "Vedi tutto" msgid "VenuesSmall" msgstr "Luoghi" -#: components/ItaliaTheme/View/VenueView/VenueDescription +#: components/ItaliaTheme/View/VenueView/VenueMultimedia # defaultMessage: Video msgid "Video" msgstr "Video" @@ -1798,7 +1798,7 @@ msgstr "Visibile" msgid "edit_social_links" msgstr "Modifica i social" -#: components/ItaliaTheme/View/VenueView/VenueDescription +#: components/ItaliaTheme/View/VenueView/VenueElementiDiInteresse # defaultMessage: Elementi di interesse msgid "elementi_di_interesse" msgstr "Elementi di interesse" @@ -2354,7 +2354,7 @@ msgid "logo-subsite-alt" msgstr "" #: components/ItaliaTheme/View/PuntoDiContattoView/RelatedItemsChipsPDC -#: components/ItaliaTheme/View/VenueView/VenueDescription +#: components/ItaliaTheme/View/VenueView/VenueLuoghiCorrelati # defaultMessage: Luoghi correlati msgid "luoghi_correlati" msgstr "Luoghi correlati" @@ -3746,7 +3746,7 @@ msgstr "Tipologia del bando" msgid "tipologia_incarico" msgstr "Tipo di incarico" -#: components/ItaliaTheme/View/VenueView/VenueDescription +#: components/ItaliaTheme/View/VenueView/VenueTipologia # defaultMessage: Tipo di luogo msgid "tipologia_luogo" msgstr "Tipo di luogo" diff --git a/locales/volto.pot b/locales/volto.pot index 20f9a4396..9601d4dbf 100644 --- a/locales/volto.pot +++ b/locales/volto.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Plone\n" -"POT-Creation-Date: 2023-11-08T17:11:37.097Z\n" +"POT-Creation-Date: 2023-11-14T17:26:17.874Z\n" "Last-Translator: Plone i18n \n" "Language-Team: Plone i18n \n" "MIME-Version: 1.0\n" @@ -684,7 +684,7 @@ msgstr "" msgid "VenuesSmall" msgstr "" -#: components/ItaliaTheme/View/VenueView/VenueDescription +#: components/ItaliaTheme/View/VenueView/VenueMultimedia # defaultMessage: Video msgid "Video" msgstr "" @@ -1800,7 +1800,7 @@ msgstr "" msgid "edit_social_links" msgstr "" -#: components/ItaliaTheme/View/VenueView/VenueDescription +#: components/ItaliaTheme/View/VenueView/VenueElementiDiInteresse # defaultMessage: Elementi di interesse msgid "elementi_di_interesse" msgstr "" @@ -2356,7 +2356,7 @@ msgid "logo-subsite-alt" msgstr "" #: components/ItaliaTheme/View/PuntoDiContattoView/RelatedItemsChipsPDC -#: components/ItaliaTheme/View/VenueView/VenueDescription +#: components/ItaliaTheme/View/VenueView/VenueLuoghiCorrelati # defaultMessage: Luoghi correlati msgid "luoghi_correlati" msgstr "" @@ -3748,7 +3748,7 @@ msgstr "" msgid "tipologia_incarico" msgstr "" -#: components/ItaliaTheme/View/VenueView/VenueDescription +#: components/ItaliaTheme/View/VenueView/VenueTipologia # defaultMessage: Tipo di luogo msgid "tipologia_luogo" msgstr "" diff --git a/package.json b/package.json index 93eb5b070..1642b1f3a 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": "10.3.0", + "version": "10.4.0", "main": "src/index.js", "keywords": [ "volto-addon", diff --git a/publiccode.yml b/publiccode.yml index 3de90f065..ed289e88d 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: '2023-11-07' +releaseDate: '2023-11-14' softwareType: standalone/web -softwareVersion: 10.3.0 +softwareVersion: 10.4.0 url: 'https://github.com/italia/design-comuni-plone-theme' usedBy: - ASP Comuni Modenesi Area Nord diff --git a/src/components/ItaliaTheme/Blocks/NumbersBlock/Edit.jsx b/src/components/ItaliaTheme/Blocks/NumbersBlock/Edit.jsx index ecefd8fc4..c72cdd6e7 100644 --- a/src/components/ItaliaTheme/Blocks/NumbersBlock/Edit.jsx +++ b/src/components/ItaliaTheme/Blocks/NumbersBlock/Edit.jsx @@ -49,6 +49,7 @@ class Edit extends SubblocksEdit { super(props); this.state.selectedField = 'title'; } + /** * Render method. * @method render diff --git a/src/components/ItaliaTheme/Header/ParentSiteMenu.jsx b/src/components/ItaliaTheme/Header/ParentSiteMenu.jsx index 00c1b3afe..15ddde162 100644 --- a/src/components/ItaliaTheme/Header/ParentSiteMenu.jsx +++ b/src/components/ItaliaTheme/Header/ParentSiteMenu.jsx @@ -27,7 +27,8 @@ const ParentSiteMenu = () => { // eslint-disable-next-line no-loop-func dropdownMenu.forEach((m) => { if (m.rootPath === s) { - menu = m; + // Filter non visible dropdown menu entries + menu = { ...m, items: m.items.filter((mi) => mi.visible) }; i = 0; } }); diff --git a/src/components/ItaliaTheme/Icons/FontAwesomeIcon.jsx b/src/components/ItaliaTheme/Icons/FontAwesomeIcon.jsx index 36bb975f2..1b998739b 100644 --- a/src/components/ItaliaTheme/Icons/FontAwesomeIcon.jsx +++ b/src/components/ItaliaTheme/Icons/FontAwesomeIcon.jsx @@ -7,7 +7,11 @@ import { fontAwesomeAliases } from 'design-comuni-plone-theme/helpers/index'; const FontAwesomeIcon = (props) => { const { className, icon, prefix, title } = props; - const [loadedIcon, setLoadedIcon] = React.useState(null); + const [loadedIcon, setLoadedIcon] = React.useState({ + module: null, + iconName: '', + family: 'solid', + }); const getIconAlias = (icon, aliasList) => { if (icon in aliasList) { @@ -17,40 +21,58 @@ const FontAwesomeIcon = (props) => { } }; - let prefixKey = prefix; - let iconName = ''; - - if (Array.isArray(icon)) { - prefixKey = icon[0]; - iconName = getIconAlias(icon[1], fontAwesomeAliases); - } else { - iconName = getIconAlias(icon, fontAwesomeAliases); - } + const getIconInfo = (icon, prefix) => { + let prefixKey = prefix; + let iconName = ''; + if (Array.isArray(icon)) { + prefixKey = icon[0]; + iconName = getIconAlias(icon[1], fontAwesomeAliases); + } else { + iconName = getIconAlias(icon, fontAwesomeAliases); + } - const prefixFolder = - prefixKey === 'fab' ? 'brands' : prefixKey === 'far' ? 'regular' : 'solid'; + return [ + prefixKey === 'fab' + ? 'brands' + : prefixKey === 'far' + ? 'regular' + : 'solid', + iconName, + ]; + }; React.useEffect(() => { - if (iconName && !loadedIcon) { + const [prefixFolder, iconName] = getIconInfo(icon, prefix); + if ( + iconName && + (iconName !== loadedIcon.iconName || prefixFolder !== loadedIcon.family) + ) { import( `design-comuni-plone-theme/icons/fontawesome-free-6.4.0-web/svgs/${prefixFolder}/${iconName}.svg` ) .then((_loadedIcon) => { - setLoadedIcon(_loadedIcon); + setLoadedIcon({ + module: _loadedIcon.default, + iconName, + family: prefixFolder, + }); }) .catch((error) => {}); } - }, [iconName, loadedIcon, prefixFolder]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [icon, prefix, loadedIcon]); - return loadedIcon ? ( + return loadedIcon.module ? ( ${title}${loadedIcon.content}` - : loadedIcon.content, + ? `${title}${loadedIcon.module.content}` + : loadedIcon.module.content, }} /> ) : icon ? ( diff --git a/src/components/ItaliaTheme/View/Commons/SearchSectionForm.jsx b/src/components/ItaliaTheme/View/Commons/SearchSectionForm.jsx index 9e1c134c5..daa5f8b75 100644 --- a/src/components/ItaliaTheme/View/Commons/SearchSectionForm.jsx +++ b/src/components/ItaliaTheme/View/Commons/SearchSectionForm.jsx @@ -28,6 +28,26 @@ const messages = defineMessages({ const SearchSectionForm = ({ content }) => { const intl = useIntl(); + const path = content['@id']; + const searchFilters = useSelector( + (state) => state?.searchFilters?.result?.sections, + ); + + const customPath = []; + + const sections = searchFilters?.[0]?.items ?? []; + + sections.forEach((section) => { + if (!section.items) { + return; + } else { + if (path === section['@id']) { + customPath.push( + section.items.map((item) => flattenToAppURL(item['@id'])), + ); + } + } + }); const subsite = useSelector((state) => state.subsite?.data); const [searchableText, setSearchableText] = useState(''); @@ -44,13 +64,14 @@ const SearchSectionForm = ({ content }) => { {}, null, null, - null, + customPath.length > 0 ? customPath : null, subsite, intl.locale, false, ) + - '&custom_path=' + - flattenToAppURL(content['@id']); + (customPath.length === 0 + ? `&custom_path=${flattenToAppURL(path)}` + : ''); } }; return ( diff --git a/src/components/ItaliaTheme/manage/Widgets/IconPreviewWidget.jsx b/src/components/ItaliaTheme/manage/Widgets/IconPreviewWidget.jsx index 7c8f2606c..6b4c249b6 100644 --- a/src/components/ItaliaTheme/manage/Widgets/IconPreviewWidget.jsx +++ b/src/components/ItaliaTheme/manage/Widgets/IconPreviewWidget.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import PropTypes from 'prop-types'; import { FontAwesomeIcon } from 'design-comuni-plone-theme/components/ItaliaTheme'; import { defineMessages, useIntl } from 'react-intl'; @@ -14,6 +13,7 @@ const messages = defineMessages({ const IconPreviewWidget = ({ icon, onEdit, title, description, children }) => { const intl = useIntl(); const parts = icon?.split(' ') ?? []; + return (