diff --git a/CHANGELOG.md b/CHANGELOG.md index 8301df78d..768bb4ddd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,38 @@ +## [10.6.1](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v10.6.0...v10.6.1) (2023-12-13) + + +### Bug Fixes + +* patch data grid widget for allow_reorder ([41dd7ea](https://github.com/RedTurtle/design-comuni-plone-theme/commit/41dd7ea62d0af8557a61f558996fe076c9638d40)) + + +### Documentation + +* updated publiccode and release log ([055a8c8](https://github.com/RedTurtle/design-comuni-plone-theme/commit/055a8c84e1d55974d59ca17ac7da6a3dbb6e101b)) + +## [10.6.0](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v10.5.0...v10.6.0) (2023-12-12) + + +### Features + +* added breadcrumbs for static routes ([#392](https://github.com/RedTurtle/design-comuni-plone-theme/issues/392)) ([55f9512](https://github.com/RedTurtle/design-comuni-plone-theme/commit/55f95123bcc69b6c15a3faf0ffa530937fe746f7)) +* new data grid widget version with allow_reorder param ([#435](https://github.com/RedTurtle/design-comuni-plone-theme/issues/435)) ([560576c](https://github.com/RedTurtle/design-comuni-plone-theme/commit/560576cdb2b1cb75a3c39e58192c3f78ad5969cd)) + + +### Bug Fixes + +* removed automatic pager-link and updated available manual data-elements ([2553322](https://github.com/RedTurtle/design-comuni-plone-theme/commit/2553322f8e8e61d877546bc7303d3a1c460a70f6)) +* schema.org metadata per i servizi ([ee21c7d](https://github.com/RedTurtle/design-comuni-plone-theme/commit/ee21c7d4b0a4b4362f42239bb2ff7b4b7f6ac3b9)) +* traduzioni mancanti ([#432](https://github.com/RedTurtle/design-comuni-plone-theme/issues/432)) ([14ee678](https://github.com/RedTurtle/design-comuni-plone-theme/commit/14ee678fc710f15b0db8018ac508c5c5b13964ef)) + + +### Documentation + +* update publiccode.yml con nuovi comuni ([#157](https://github.com/RedTurtle/design-comuni-plone-theme/issues/157)) ([43afda6](https://github.com/RedTurtle/design-comuni-plone-theme/commit/43afda6b780b5c6e5b1b86af49959108067d8b13)) +* updated publiccode and release log ([7e3dc2f](https://github.com/RedTurtle/design-comuni-plone-theme/commit/7e3dc2f915ae1b8d13753a3ff24b87a20cd9a7d2)) + ## [10.5.0](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v10.4.3...v10.5.0) (2023-12-06) diff --git a/RELEASE.md b/RELEASE.md index 2acca9d54..54a9a6fbb 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -46,6 +46,15 @@ ### Fix - Sistemati tutti gli stili per i sottositi per l'accessibilità +## Versione 10.6.1 (13/12/2023) + +### Novità + +- I seguenti campi sono ora riordinabili liberamente: "Timeline tempi e scadenze" per il tipo di contenuto *Servizio* e "Valore punto di contatto" del tipo di contenuto *Punto di contatto*. + +### Fix + +- Rimosso pager-link automatico dal paginatore perché non riconosciuto dal validatore. È ora possibile inserire a mano il data-element pager-link nei blocchi di testo. ## Versione 10.5.0 (06/12/2023) @@ -93,6 +102,7 @@ ### 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. +- Aggiunte le breadcrumbs nella pagina dei risultati della ricerca ### Fix diff --git a/locales/de/LC_MESSAGES/volto.po b/locales/de/LC_MESSAGES/volto.po index 634e93dc1..4aa0afcf0 100644 --- a/locales/de/LC_MESSAGES/volto.po +++ b/locales/de/LC_MESSAGES/volto.po @@ -3123,6 +3123,11 @@ msgstr "" msgid "search_adv_filters" msgstr "" +#: config/italiaConfig +# defaultMessage: Ricerca +msgid "search_brdc" +msgstr "" + #: components/ItaliaTheme/Search/Search # defaultMessage: Tipologia msgid "search_content_types" diff --git a/locales/en/LC_MESSAGES/volto.po b/locales/en/LC_MESSAGES/volto.po index 9bdfd40b2..44a67ff00 100644 --- a/locales/en/LC_MESSAGES/volto.po +++ b/locales/en/LC_MESSAGES/volto.po @@ -3108,6 +3108,11 @@ msgstr "Search site" msgid "search_adv_filters" msgstr "Advanced filters" +#: config/italiaConfig +# defaultMessage: Ricerca +msgid "search_brdc" +msgstr "Search" + #: components/ItaliaTheme/Search/Search # defaultMessage: Tipologia msgid "search_content_types" diff --git a/locales/es/LC_MESSAGES/volto.po b/locales/es/LC_MESSAGES/volto.po index 90b0e163d..1d6967378 100644 --- a/locales/es/LC_MESSAGES/volto.po +++ b/locales/es/LC_MESSAGES/volto.po @@ -3117,6 +3117,11 @@ msgstr "Busca en el sitio" msgid "search_adv_filters" msgstr "Filtros avanzados" +#: config/italiaConfig +# defaultMessage: Ricerca +msgid "search_brdc" +msgstr "" + #: components/ItaliaTheme/Search/Search # defaultMessage: Tipologia msgid "search_content_types" diff --git a/locales/fr/LC_MESSAGES/volto.po b/locales/fr/LC_MESSAGES/volto.po index 9f21e84d8..8ab920836 100644 --- a/locales/fr/LC_MESSAGES/volto.po +++ b/locales/fr/LC_MESSAGES/volto.po @@ -3125,6 +3125,11 @@ msgstr "Rechercher sur le site" msgid "search_adv_filters" msgstr "Filtres avancés" +#: config/italiaConfig +# defaultMessage: Ricerca +msgid "search_brdc" +msgstr "" + #: components/ItaliaTheme/Search/Search # defaultMessage: Tipologia msgid "search_content_types" diff --git a/locales/it/LC_MESSAGES/volto.po b/locales/it/LC_MESSAGES/volto.po index 9135efb0b..ded056cea 100644 --- a/locales/it/LC_MESSAGES/volto.po +++ b/locales/it/LC_MESSAGES/volto.po @@ -152,17 +152,17 @@ msgstr "Date aggiuntive" #: helpers/Translations/searchBlockExtendedTranslations # defaultMessage: Al {end} msgid "DateRangeFacetFilterListEntryAl" -msgstr "" +msgstr "Al {end}" #: helpers/Translations/searchBlockExtendedTranslations # defaultMessage: Dal {start} msgid "DateRangeFacetFilterListEntryDal" -msgstr "" +msgstr "Dal {start}" #: helpers/Translations/searchBlockExtendedTranslations # defaultMessage: Dal {start} al {end} msgid "DateRangeFacetFilterListEntryDalAl" -msgstr "" +msgstr "Dal {start} al {end}" #: components/ItaliaTheme/Blocks/ContactsBlock/Edit #: components/ItaliaTheme/Blocks/NumbersBlock/Edit @@ -189,7 +189,7 @@ msgstr "Dimensione della mappa" #: components/ItaliaTheme/View/Commons/TrasparenzaFields # defaultMessage: Download msgid "Download" -msgstr "" +msgstr "Download" #: config/RichTextEditor/Plugins/AnchorPlugin/components/LinkButton/AddLinkForm # defaultMessage: Enter URL or select an item @@ -268,7 +268,7 @@ msgstr "Identificativo di servizio a solo uso interno, utilizzato per le verific #: components/ItaliaTheme/manage/Widgets/SubFooterConfigurationForm # defaultMessage: ID lighthouse msgid "ID lighthouse" -msgstr "" +msgstr "ID lighthouse" #: components/ItaliaTheme/Blocks/NumbersBlock/Edit # defaultMessage: Seleziona le icone dalla barra a lato @@ -283,7 +283,7 @@ msgstr "Immagine" #: components/ItaliaTheme/View/Commons/Events # defaultMessage: Immagine msgid "Immagine" -msgstr "" +msgstr "Immagine" #: components/ItaliaTheme/Footer/FooterSmall # defaultMessage: Impostazioni cookie @@ -383,7 +383,7 @@ msgstr "Mostra i filtri per percorso" #: components/ItaliaTheme/Blocks/Calendar/ListingSidebar # defaultMessage: Mostra le immagini di anteprima msgid "Mostra le immagini di anteprima" -msgstr "" +msgstr "Mostra le immagini di anteprima" #: components/ItaliaTheme/Blocks/Calendar/ListingSidebar #: components/ItaliaTheme/Blocks/HeroImageLeft/HeroSidebar @@ -501,7 +501,7 @@ msgstr "Ricerca bandi" #: helpers/Translations/searchBlockExtendedTranslations # defaultMessage: Cerca una parola chiave msgid "SearchSearchBlock" -msgstr "" +msgstr "Cerca una parola chiave" #: helpers/Translations/searchBlockExtendedTranslations # defaultMessage: Search @@ -878,7 +878,7 @@ msgstr "Usa le frecce Su e Giu per scegliere un'opzione" #: components/SelectInput/SelectInput # defaultMessage: Annulla msgid "ay11_select cancel" -msgstr "" +msgstr "Annulla" #: components/SelectInput/SelectInput # defaultMessage: deselezionata @@ -1087,7 +1087,7 @@ msgstr "Precedente" #: components/ItaliaTheme/manage/Widgets/CanaleDigitaleWidget # defaultMessage: Accedere al servizio msgid "canale_digitale_widget_title" -msgstr "" +msgstr "Accedere al servizio" #: components/ItaliaTheme/Blocks/TextCard/CardWithImage/Sidebar # defaultMessage: Seleziona l'immagine da mostrare @@ -1161,7 +1161,7 @@ msgstr "Circoscrizione" #: helpers/Translations/searchBlockExtendedTranslations # defaultMessage: Clear all filters msgid "clearAllFilters" -msgstr "" +msgstr "Rimuovi tutti i filtri" #: helpers/Translations/searchBlockExtendedTranslations # defaultMessage: Clear {filterName} filter @@ -1176,7 +1176,7 @@ msgstr "Rimuovi ricerca testuale" #: components/Collapse # defaultMessage: Chiudi menu msgid "close-menu" -msgstr "" +msgstr "Chiudi menu" #: components/ItaliaTheme/Header/HeaderSearch/SearchModal # defaultMessage: Chiudi cerca @@ -1191,12 +1191,12 @@ msgstr "Codice dell'ente erogatore (ipa)" #: components/ItaliaTheme/Blocks/Alert/Sidebar # defaultMessage: Rosso msgid "color_danger" -msgstr "" +msgstr "Rosso" #: components/ItaliaTheme/Blocks/Alert/Sidebar # defaultMessage: Arancione msgid "color_orange" -msgstr "" +msgstr "Arancione" #: components/ItaliaTheme/Blocks/ContactsBlock/Sidebar #: components/ItaliaTheme/Blocks/HighlightedContent/Sidebar @@ -1212,7 +1212,7 @@ msgstr "Trasparente" #: components/ItaliaTheme/Blocks/Alert/Sidebar # defaultMessage: Giallo msgid "color_warning" -msgstr "" +msgstr "Giallo" #: components/ItaliaTheme/View/IncaricoView/IncaricoView #: components/ItaliaTheme/View/PersonaView/PersonaDocumenti @@ -1373,7 +1373,7 @@ msgstr "Risultati indagini di customer satisfaction" #: components/ItaliaTheme/View/Commons/PageHeader/PageHeaderEventDates # defaultMessage: dal {dateStart} fino a conclusione msgid "dal {dateStart} fino a conclusione" -msgstr "" +msgstr "dal {dateStart} fino a conclusione" #: components/ItaliaTheme/View/IncaricoView/IncaricoView # defaultMessage: Data conclusione incarico @@ -1583,7 +1583,7 @@ msgstr "Descrizione" #: components/ItaliaTheme/View/BandoView/BandoText # defaultMessage: Descrizione msgid "descrizione_bando" -msgstr "" +msgstr "Descrizione" #: components/ItaliaTheme/Header/HeaderSearch/SearchModal # defaultMessage: Non cercare nella sezione @@ -1695,7 +1695,7 @@ msgstr "Fatto" #: components/ItaliaTheme/Blocks/Listing/SliderTemplate # defaultMessage: Navigazione elementi slider msgid "dots" -msgstr "" +msgstr "Navigazione elementi slider" #: components/ItaliaTheme/View/VenueView/VenueWhere # defaultMessage: Indirizzo @@ -1711,7 +1711,7 @@ msgstr "Scarica" #: components/ItaliaTheme/View/Commons/EmbeddedVideo # defaultMessage: Download and Play video msgid "downloadPlayVideo" -msgstr "" +msgstr "Scarica e riproduci video" #: components/ItaliaTheme/manage/Widgets/MenuConfigurationForm # defaultMessage: Additional classes @@ -1816,7 +1816,7 @@ msgstr "E-mail" #: components/ItaliaTheme/View/Commons/EmbeddedVideo # defaultMessage: YouTube Video {id} msgid "embedVideo" -msgstr "" +msgstr "YouTube Video {id}" #: components/ItaliaTheme/Blocks/HighlightedContent/Edit # defaultMessage: Please select an item in the sidebar in order to show it here @@ -1851,7 +1851,7 @@ msgstr "Documenti" #: helpers/FormValidation/FormValidationHelpers # defaultMessage: La data di fine deve essere successiva alla data di inizio msgid "event_end" -msgstr "" +msgstr "La data di fine deve essere successiva alla data di inizio" #: components/ItaliaTheme/Blocks/EventSearch/Edit #: components/ItaliaTheme/Blocks/UOSearch/Edit @@ -2243,7 +2243,7 @@ msgstr "Collegamento" #: components/ItaliaTheme/Header/HeaderCenter # defaultMessage: homepage msgid "link-subsite-homepage-title" -msgstr "" +msgstr "Home page" #: components/ItaliaTheme/Blocks/Accordion/Sidebar #: components/ItaliaTheme/Blocks/ContactsBlock/Sidebar @@ -2356,7 +2356,7 @@ msgstr "Accedi con Spid" #: components/ItaliaTheme/Header/HeaderCenter # defaultMessage: Logo msgid "logo-subsite-alt" -msgstr "" +msgstr "Logo" #: components/ItaliaTheme/View/PuntoDiContattoView/RelatedItemsChipsPDC #: components/ItaliaTheme/View/VenueView/VenueLuoghiCorrelati @@ -2377,7 +2377,7 @@ msgstr "Luogo" #: components/ItaliaTheme/Footer/FooterNewsletterSubscribe # defaultMessage: mail@example.com msgid "mail@example.com" -msgstr "" +msgstr "mail@example.com" #: components/ItaliaTheme/View/Commons/Actions # defaultMessage: Invia @@ -2624,7 +2624,7 @@ msgstr "Ulteriori informazioni" #: config/Blocks/ListingOptions/smallBlockLinksTemplate # defaultMessage: Non mostrare l'icona di accessibilità per i link a siti esterni msgid "override_links_accessibility_marker" -msgstr "" +msgstr "Non mostrare l'icona di accessibilità per i link a siti esterni" #: components/ItaliaTheme/View/Commons/TrasparenzaFields # defaultMessage: Pagamenti previsti e modalità @@ -2695,7 +2695,7 @@ msgstr "PlayStore Link" #: components/ItaliaTheme/Blocks/Listing/SliderTemplate # defaultMessage: Precedente msgid "precedente" -msgstr "" +msgstr "Precedente" #: components/ItaliaTheme/manage/Widgets/IconPreviewWidget # defaultMessage: Anteprima dell'icona scelta @@ -3108,6 +3108,11 @@ msgstr "Cerca nel sito" msgid "search_adv_filters" msgstr "Filtri avanzati" +#: config/italiaConfig +# defaultMessage: Ricerca +msgid "search_brdc" +msgstr "" + #: components/ItaliaTheme/Search/Search # defaultMessage: Tipologia msgid "search_content_types" @@ -3146,7 +3151,7 @@ msgstr "Data inizio" #: helpers/Translations/searchBlockExtendedTranslations # defaultMessage: Ricerca per: {searchedtext}. msgid "searchedFor" -msgstr "" +msgstr "Ricerca per: {searchedtext}." #: components/ItaliaTheme/manage/Widgets/SearchSectionsConfigurationWidget/SearchSectionsConfigurationWidget # defaultMessage: Add path @@ -3504,7 +3509,7 @@ msgstr "Qui puoi selezionare, per il template 'Card semplice', un aspetto divers #: config/Blocks/ListingOptions/simpleCardTemplate # defaultMessage: Un elemento per riga msgid "simplecard_listing_appearance_oneforrow" -msgstr "" +msgstr "Un elemento per riga" #: components/ItaliaTheme/View/PersonaView/PersonaDocumenti # defaultMessage: Situazione patrimoniale @@ -3534,7 +3539,7 @@ msgstr "Skype" #: components/ItaliaTheme/Blocks/Listing/SliderTemplate # defaultMessage: Vai alla slide {index} msgid "slideDot" -msgstr "" +msgstr "Vai alla slide {index}" #: config/Blocks/ListingOptions/sliderTemplate # defaultMessage: N° slide da mostrare @@ -3679,7 +3684,7 @@ msgstr "Tags" #: components/ItaliaTheme/Blocks/Listing/SliderTemplate # defaultMessage: Successivo msgid "successivo" -msgstr "" +msgstr "Successivo" #: components/ItaliaTheme/View/EventoView/EventoContattiSupportatoDa # defaultMessage: Con il supporto di @@ -3728,7 +3733,7 @@ msgstr "Termini del procedimento" #: config/RichTextEditor/ToolbarButtons/TextSizeButton # defaultMessage: Dimensione del testo msgid "text-size-button" -msgstr "" +msgstr "Dimensione del testo" #: components/ItaliaTheme/Blocks/Common/SearchFilters/TextFilter # defaultMessage: Inserisci un valore @@ -3738,7 +3743,7 @@ msgstr "Inserisci un valore" #: helpers/FormValidation/DataGridFormValidationHelpers # defaultMessage: Impossibile aggiungere un elemento alla timeline senza aver compilato il campo "Titolo" msgid "timeline_tempi_scadenze_validation_error" -msgstr "" +msgstr "Impossibile aggiungere un elemento alla timeline senza aver compilato il campo "Titolo"" #: components/ItaliaTheme/View/BandoView/BandoTextTipologia # defaultMessage: Tipologia del bando diff --git a/locales/volto.pot b/locales/volto.pot index d73fd32ec..56d4b88ca 100644 --- a/locales/volto.pot +++ b/locales/volto.pot @@ -3110,6 +3110,11 @@ msgstr "" msgid "search_adv_filters" msgstr "" +#: config/italiaConfig +# defaultMessage: Ricerca +msgid "search_brdc" +msgstr "" + #: components/ItaliaTheme/Search/Search # defaultMessage: Tipologia msgid "search_content_types" diff --git a/package.json b/package.json index 6a6099f7b..6afce9b20 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.5.0", + "version": "10.6.1", "main": "src/index.js", "keywords": [ "volto-addon", @@ -141,7 +141,7 @@ "typeface-roboto-mono": "0.0.75", "typeface-titillium-web": "0.0.72", "volto-blocks-widget": "3.1.0", - "volto-data-grid-widget": "2.2.3", + "volto-data-grid-widget": "2.3.1", "volto-dropdownmenu": "4.1.0", "volto-editablefooter": "5.0.1", "volto-feedback": "0.1.5", diff --git a/publiccode.yml b/publiccode.yml index 183fbab6e..c684aa31e 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-12-06' +releaseDate: '2023-12-13' softwareType: standalone/web -softwareVersion: 10.5.0 +softwareVersion: 10.6.1 url: 'https://github.com/italia/design-comuni-plone-theme' usedBy: - ASP Comuni Modenesi Area Nord @@ -243,11 +243,15 @@ usedBy: - Biblioteche Pianura Est - Camera di Commercio dell'Umbria - Camera di Commercio di Reggio Emilia + - Comune della Spezia - Comune di Bibbiano - Comune di Camposanto - Comune di Cantagallo + - Comune di Cavezzo - Comune di Cavriago + - Comune di Concordia sul Secchia - Comune di Gattatico + - Comune di Finale Emilia - Comune di Imola - Comune di Medolla - Comune di Mirandola @@ -257,10 +261,13 @@ usedBy: - Comune di Parma - Comune di Piacenza - Comune di Reggio Emilia + - Comune di San Felice sul Panaro - Comune di San Lazzaro di Savena - Comune di San Polo d'Enza - Comune di San Possidonio + - Comune di San Prospero - Comune di Santilario d'Enza + - Comune di Toscolano Maderno - Comune di Vaiano - Comune di Vernio - Comando Generale della Guardia di Finanza diff --git a/src/components/ItaliaTheme/Breadcrumbs/Breadcrumbs.jsx b/src/components/ItaliaTheme/Breadcrumbs/Breadcrumbs.jsx index ad8b78f04..d8b32f067 100644 --- a/src/components/ItaliaTheme/Breadcrumbs/Breadcrumbs.jsx +++ b/src/components/ItaliaTheme/Breadcrumbs/Breadcrumbs.jsx @@ -7,13 +7,17 @@ import React, { useEffect } from 'react'; import PropTypes from 'prop-types'; import { useDispatch, useSelector } from 'react-redux'; import { defineMessages, useIntl } from 'react-intl'; -import { isEqual } from 'lodash'; +import { matchPath } from 'react-router'; + +import { useLocation } from 'react-router-dom'; +import { isEqual, isEmpty } from 'lodash'; import { getBreadcrumbs } from '@plone/volto/actions'; import { getBaseUrl, flattenToAppURL } from '@plone/volto/helpers'; import { UniversalLink } from '@plone/volto/components'; import { Row, Col, BreadcrumbItem } from 'design-react-kit'; import GoogleBreadcrumbs from 'design-comuni-plone-theme/components/ItaliaTheme/Breadcrumbs/GoogleBreadcrumbs'; +import config from '@plone/volto/registry'; const messages = defineMessages({ home: { @@ -25,17 +29,58 @@ const messages = defineMessages({ const Breadcrumbs = ({ pathname }) => { const intl = useIntl(); const dispatch = useDispatch(); + const location = useLocation(); - let items = useSelector((state) => state.breadcrumbs.items, isEqual); + let items = + useSelector((state) => { + return state.breadcrumbs.items; + }, isEqual) || []; const subsite = useSelector((state) => state.subsite?.data); + const bcLoaded = useSelector((state) => { + return state.breadcrumbs.loaded; + }); + + // Funzione per fare match di routes + const getMatchingRoute = (p) => + matchPath(location.pathname, p) !== null || + matchPath(location.pathname, p.replace('**/', '')) !== null; + + // Funzione per riconoscere se siamo in una route statica + const getCurrentPathFromAddonRoutes = () => + config.addonRoutes.find((route) => { + const paths = typeof route.path === 'string' ? [route.path] : route.path; + return paths.find(getMatchingRoute); + }) || {}; + + // Gestione delle rotte statiche. Se definito nel config della rotta un breadcrumbs_title, lo aggiungo alle breadcrumbs + const route = getCurrentPathFromAddonRoutes(); + if ( + (!(items === null || isEmpty(route)) && + items.length > 0 && + route.breadcrumbs_title && + items[items.length - 1].url !== location.pathname) || + (items.length === 0 && bcLoaded && route.breadcrumbs_title) + ) { + items.push({ + url: location.pathname, + title: intl.formatMessage(route.breadcrumbs_title), + }); + } + /** fine della gestione delle rotte statiche */ useEffect(() => { - dispatch(getBreadcrumbs(getBaseUrl(pathname))); + let actualPathForBreadcrumbs = pathname; + const { path, buildFullNavTree } = getCurrentPathFromAddonRoutes(); + if (buildFullNavTree) { + const replacedPath = path.replace('**/', ''); + actualPathForBreadcrumbs = pathname.replace(replacedPath, ''); + } + dispatch(getBreadcrumbs(getBaseUrl(actualPathForBreadcrumbs))); // eslint-disable-next-line react-hooks/exhaustive-deps }, [pathname]); + // Se siamo nella root di un sottosito, non mostriamo le breadcrumbs. Serve anche per nasconderle dalla pagina dei risultati di ricerca quando si fa la ricerca in un sottosito if (subsite) { - //se siamo nella root di un sottosito, non mostriamo le breadcrumbs. Serve anche per nasconderle dalla pagina dei risultati di ricerca quando si fa la ricerca in un sottosito if ( items.length === 1 && items[0].url === flattenToAppURL(subsite['@id']) diff --git a/src/components/ItaliaTheme/Pagination/Pagination.jsx b/src/components/ItaliaTheme/Pagination/Pagination.jsx index 4c0ee86c4..ad6f745d0 100644 --- a/src/components/ItaliaTheme/Pagination/Pagination.jsx +++ b/src/components/ItaliaTheme/Pagination/Pagination.jsx @@ -43,9 +43,6 @@ class Pagination extends Component { /** Total number of pages. */ totalPages: PropTypes.oneOfType([PropTypes.number, PropTypes.string]) .isRequired, - - /** Lighthouse ID to set Agid data-element on pager link for CT Servizio*/ - isServiceLink: PropTypes.bool, }; static defaultProps = { @@ -72,13 +69,8 @@ class Pagination extends Component { }; render() { - const { - boundaryRange, - ellipsisItem, - siblingRange, - totalPages, - isServiceLink, - } = this.props; + const { boundaryRange, ellipsisItem, siblingRange, totalPages } = + this.props; const { activePage } = this.state; const items = createPaginationItems({ @@ -104,7 +96,6 @@ class Pagination extends Component { onClick={this.handleItemClick} type={type} ellipsisItem={ellipsisItem} - isServiceLink={isServiceLink} > {value} diff --git a/src/components/ItaliaTheme/Pagination/PaginationItem.jsx b/src/components/ItaliaTheme/Pagination/PaginationItem.jsx index f53e14949..b7e2d9de9 100644 --- a/src/components/ItaliaTheme/Pagination/PaginationItem.jsx +++ b/src/components/ItaliaTheme/Pagination/PaginationItem.jsx @@ -46,9 +46,6 @@ class PaginationItem extends Component { 'nextItem', 'lastItem', ]), - - /** Lighthouse ID to set Agid data-element on pager link for CT Servizio*/ - isServiceLink: PropTypes.bool, }; handleClick = (e) => { @@ -62,8 +59,7 @@ class PaginationItem extends Component { }; render() { - const { active, type, children, intl, ellipsisItem, isServiceLink } = - this.props; + const { active, type, children, intl, ellipsisItem } = this.props; const disabled = this.props.disabled || type === 'ellipsisItem'; return ( @@ -72,9 +68,6 @@ class PaginationItem extends Component { onClick={this.handleClick} onKeyDown={this.handleKeyDown} aria-current={active ? 'page' : null} - data-element={ - isServiceLink && type !== 'prevItem' ? 'pager-link' : null - } > {type === 'prevItem' && ( <> diff --git a/src/components/ItaliaTheme/Search/Search.jsx b/src/components/ItaliaTheme/Search/Search.jsx index 97507cdb5..830cb4ec3 100644 --- a/src/components/ItaliaTheme/Search/Search.jsx +++ b/src/components/ItaliaTheme/Search/Search.jsx @@ -358,7 +358,7 @@ const Search = () => { - +

{intl.formatMessage(messages.searchResults)}

diff --git a/src/components/ItaliaTheme/View/ServizioView/ServizioMetatag.jsx b/src/components/ItaliaTheme/View/ServizioView/ServizioMetatag.jsx index 0e89643ac..975927c43 100644 --- a/src/components/ItaliaTheme/View/ServizioView/ServizioMetatag.jsx +++ b/src/components/ItaliaTheme/View/ServizioView/ServizioMetatag.jsx @@ -44,7 +44,7 @@ const ServizioMetatag = ({ content }) => { if (richTextHasContent(content.a_chi_si_rivolge)) { schemaOrg.audience = { '@type': 'Audience', - name: fieldDataToPlainText(content.a_chi_si_rivolge), + audienceType: fieldDataToPlainText(content.a_chi_si_rivolge), }; } @@ -52,8 +52,6 @@ const ServizioMetatag = ({ content }) => { schemaOrg.availableChannel.serviceUrl = toPublicURL( content.canale_digitale_link, ); - } else { - schemaOrg.availableChannel.serviceUrl = ''; } if (content.ufficio_responsabile[0]) { diff --git a/src/config/Blocks/ListingOptions/utils.js b/src/config/Blocks/ListingOptions/utils.js index 2e13dfbd9..322ae0b90 100644 --- a/src/config/Blocks/ListingOptions/utils.js +++ b/src/config/Blocks/ListingOptions/utils.js @@ -165,7 +165,6 @@ export const addLighthouseField = (schema, intl, position = 0) => { ['service-category-link', 'service-category-link'], ['topic-element', 'topic-element'], ['service-link', 'service-link'], - ['administration-element', 'administration-element'], ['management-category-link', 'management-category-link'], ['news-category-link', 'news-category-link'], ['custom-category-link', 'custom-category-link'], diff --git a/src/config/RichTextEditor/Plugins/AnchorPlugin/components/LinkButton/AddLinkForm.jsx b/src/config/RichTextEditor/Plugins/AnchorPlugin/components/LinkButton/AddLinkForm.jsx index 34f3eace2..cbecedc87 100644 --- a/src/config/RichTextEditor/Plugins/AnchorPlugin/components/LinkButton/AddLinkForm.jsx +++ b/src/config/RichTextEditor/Plugins/AnchorPlugin/components/LinkButton/AddLinkForm.jsx @@ -87,6 +87,7 @@ class AddLinkForm extends Component { ['accessibility-link', 'accessibility-link'], ['privacy-policy-link', 'privacy-policy-link'], ['legal-notes', 'legal-notes'], + ['pager-link', 'pager-link'], ]; } diff --git a/src/config/italiaConfig.js b/src/config/italiaConfig.js index ec7021ca4..e9d80772e 100644 --- a/src/config/italiaConfig.js +++ b/src/config/italiaConfig.js @@ -6,7 +6,7 @@ import contentSVG from '@plone/volto/icons/content.svg'; import bookSVG from '@plone/volto/icons/book.svg'; import shareSVG from '@plone/volto/icons/share.svg'; import searchIcon from 'bootstrap-italia/src/svg/it-search.svg'; - +import { defineMessages } from 'react-intl'; import { Search } from '@plone/volto/components'; import { @@ -69,6 +69,13 @@ const ReleaseLog = loadable( () => import('design-comuni-plone-theme/components/ReleaseLog/ReleaseLog'), ); +const messages = defineMessages({ + search_brdc: { + id: 'search_brdc', + defaultMessage: 'Ricerca', + }, +}); + export default function applyConfig(voltoConfig) { let config = applyRichTextConfig(voltoConfig); @@ -496,6 +503,7 @@ export default function applyConfig(voltoConfig) { { path: '/**/search', component: Search, + breadcrumbs_title: messages.search_brdc, }, { path: ['/login', '/**/login'], diff --git a/src/customizations/volto/components/manage/Blocks/Listing/ListingBody.jsx b/src/customizations/volto/components/manage/Blocks/Listing/ListingBody.jsx index c9c980914..cad27aa3f 100644 --- a/src/customizations/volto/components/manage/Blocks/Listing/ListingBody.jsx +++ b/src/customizations/volto/components/manage/Blocks/Listing/ListingBody.jsx @@ -93,13 +93,6 @@ const ListingBody = React.memo( // Also need to purge title from searchblock schema, it's the name of the listing template used const listingBodyProps = variation?.['@type'] !== 'search' ? data : { ...variation, title: '' }; - - // Need to know if data-element is "service-link" - // to add data-element="pager-link" to pagination links - const isServiceLink = - data?.id_lighthouse === 'service-link' || - variation?.id_lighthouse === 'service-link'; - return (
{loadingQuery && ( @@ -130,7 +123,6 @@ const ListingBody = React.memo( activePage={currentPage} totalPages={totalPages} onPageChange={onPaginationChange} - isServiceLink={isServiceLink} />
)} diff --git a/src/reducers/breadcrumbs.js b/src/reducers/breadcrumbs.js new file mode 100644 index 000000000..ffc4f58c9 --- /dev/null +++ b/src/reducers/breadcrumbs.js @@ -0,0 +1,89 @@ +/** + * Breadcrumbs reducer. + * @module reducers/breadcrumbs/breadcrumbs + */ + +import { map } from 'lodash'; +import { + flattenToAppURL, + getBaseUrl, + hasApiExpander, +} from '@plone/volto/helpers'; + +import { + GET_BREADCRUMBS, + GET_CONTENT, +} from '@plone/volto/constants/ActionTypes'; + +const initialState = { + error: null, + items: [], + root: null, + loaded: false, + loading: false, +}; + +/** + * Breadcrumbs reducer. + * @function breadcrumbs + * @param {Object} state Current state. + * @param {Object} action Action to be handled. + * @returns {Object} New state. + */ +export function breadcrumbs(state = initialState, action = {}) { + let hasExpander; + switch (action.type) { + case `${GET_BREADCRUMBS}_PENDING`: + return { + ...state, + error: null, + loaded: false, + loading: true, + }; + case `${GET_CONTENT}_SUCCESS`: + hasExpander = hasApiExpander( + 'breadcrumbs', + getBaseUrl(flattenToAppURL(action.result['@id'])), + ); + if (hasExpander && !action.subrequest) { + return { + ...state, + error: null, + items: map( + action.result['@components'].breadcrumbs.items, + (item) => ({ + title: item.title, + url: flattenToAppURL(item['@id']), + }), + ), + root: flattenToAppURL(action.result['@components'].breadcrumbs.root), + loaded: true, + loading: false, + }; + } + return state; + case `${GET_BREADCRUMBS}_SUCCESS`: + return { + ...state, + error: null, + items: map(action.result.items, (item) => ({ + title: item.title, + url: flattenToAppURL(item['@id']), + })), + root: flattenToAppURL(action.result.root), + loaded: true, + loading: false, + }; + + case `${GET_BREADCRUMBS}_FAIL`: + return { + ...state, + error: action.error, + items: [], + loaded: false, + loading: false, + }; + default: + return state; + } +} diff --git a/src/reducers/index.js b/src/reducers/index.js index 0f5675576..9ec3c1e5c 100644 --- a/src/reducers/index.js +++ b/src/reducers/index.js @@ -12,6 +12,7 @@ import { dettagliProcedimento } from './dettagliProcedimento'; import { modulisticaItems } from './modulisticaItems'; import { originalQueryReducer } from './originalQueryReducer'; import { searchBandiFiltersReducer } from './searchBandiFiltersReducer'; +import { breadcrumbs } from './breadcrumbs'; /** * Root reducer. @@ -30,6 +31,7 @@ const reducers = { modulisticaItems, originalQuery: originalQueryReducer, searchBandiFilters: searchBandiFiltersReducer, + breadcrumbs: breadcrumbs, }; export default reducers; diff --git a/src/theme/ItaliaTheme/Widgets/_dataGridWidget.scss b/src/theme/ItaliaTheme/Widgets/_dataGridWidget.scss index 59388159b..0591509f2 100644 --- a/src/theme/ItaliaTheme/Widgets/_dataGridWidget.scss +++ b/src/theme/ItaliaTheme/Widgets/_dataGridWidget.scss @@ -32,21 +32,10 @@ } .row { - position: relative; - flex-direction: row; - flex-wrap: wrap; - .column.field-column { width: unset !important ; flex-basis: 45%; - - &:not(:nth-last-child(2)) { - flex-grow: 0; - } - - &:nth-child(2n) { - flex-grow: 0; - } + flex-grow: 0; .ui.input { width: 100% !important; diff --git a/yarn.lock b/yarn.lock index aa641bc19..ccd8b3f3e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6474,7 +6474,7 @@ __metadata: typeface-roboto-mono: 0.0.75 typeface-titillium-web: 0.0.72 volto-blocks-widget: 3.1.0 - volto-data-grid-widget: 2.2.3 + volto-data-grid-widget: 2.3.1 volto-dropdownmenu: 4.1.0 volto-editablefooter: 5.0.1 volto-feedback: 0.1.5 @@ -14101,12 +14101,12 @@ __metadata: languageName: node linkType: hard -"volto-data-grid-widget@npm:2.2.3": - version: 2.2.3 - resolution: "volto-data-grid-widget@npm:2.2.3" +"volto-data-grid-widget@npm:2.3.1": + version: 2.3.1 + resolution: "volto-data-grid-widget@npm:2.3.1" peerDependencies: "@plone/volto": ">=16.0.0-alpha.38" - checksum: 17f680b8b4f4d598b32c536df098befe8dc0eef275dc93cb887b391dbe09b34724989380c2e2f6d008660ef5d8ed66d5b377b6f0a92fcc543d7a896950ea6f12 + checksum: a464c7cbc7a4eef49bb0753c713fdd54842c425cb58dfb06c2debe85714ca5ca00e563bcefc00b21d4d3d05d225f16cf642b4a95197022953faf4f0071cdb0ea languageName: node linkType: hard