From 75b27ad5298e4733cab9784a1e7ad1c2f622fdee Mon Sep 17 00:00:00 2001 From: Giulia Ghisini Date: Mon, 9 Dec 2024 13:03:18 +0100 Subject: [PATCH 1/3] fix: component HandleAnchor when loading deferred items --- .../ItaliaTheme/AppExtras/HandleAnchor.jsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/ItaliaTheme/AppExtras/HandleAnchor.jsx b/src/components/ItaliaTheme/AppExtras/HandleAnchor.jsx index ea2b6977f..efbdb2a01 100644 --- a/src/components/ItaliaTheme/AppExtras/HandleAnchor.jsx +++ b/src/components/ItaliaTheme/AppExtras/HandleAnchor.jsx @@ -1,10 +1,16 @@ import React, { useEffect } from 'react'; import { useLocation } from 'react-router-dom'; - +import { useSelector } from 'react-redux'; const HandleAnchor = () => { const location = useLocation(); + const content = useSelector((state) => state.content); + useEffect(() => { - if (location.hash) { + const sr = Object.keys(content.subrequests ?? {}); + const loaded = + content.get?.loaded && + sr.filter((k) => content.subrequests[k].loaded).length === sr.length; + if (location.hash && content && loaded) { // eslint-disable-next-line no-unused-expressions document.getElementById(location.hash.replace('#', ''))?.scrollIntoView({ behavior: 'smooth', @@ -12,7 +18,7 @@ const HandleAnchor = () => { inline: 'center', }); } - }, [location]); + }, [location, content]); return <>; }; From 6104b86659b8381c1c76c5b29105e5d30c9e9e6d Mon Sep 17 00:00:00 2001 From: Giulia Ghisini Date: Mon, 9 Dec 2024 13:05:19 +0100 Subject: [PATCH 2/3] preparing release --- RELEASE.md | 6 ++++++ publiccode.yml | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 7ac1c391b..ffad48c35 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -30,6 +30,12 @@ - ... --> +## Versione 7.33.2 (09/12/2024) + +### Fix + +- Sistemato lo scroll delle pagine con url con ancora, nel caso in cui la pagina abbia degli oggetti caricati separatamente. (es la vista di una UO). + ## Versione 7.33.1 (26/11/2024) ### Fix diff --git a/publiccode.yml b/publiccode.yml index 068dd2f1f..29b4c1466 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-11-26' +releaseDate: '2024-12-09' softwareType: standalone/web -softwareVersion: 7.33.1 +softwareVersion: 7.33.2 url: 'https://github.com/italia/design-comuni-plone-theme' usedBy: - ASP Comuni Modenesi Area Nord From aaa7549edb38b1c606b00a8e9552498190bf2dc7 Mon Sep 17 00:00:00 2001 From: Giulia Ghisini Date: Mon, 9 Dec 2024 13:05:36 +0100 Subject: [PATCH 3/3] chore: release v7.33.2 --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61a0575c1..6d7cdccaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +### [7.33.2](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v7.33.1...v7.33.2) (2024-12-09) + + +### Bug Fixes + +* component HandleAnchor when loading deferred items ([75b27ad](https://github.com/RedTurtle/design-comuni-plone-theme/commit/75b27ad5298e4733cab9784a1e7ad1c2f622fdee)) + ### [7.33.1](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v7.33.0...v7.33.1) (2024-11-26) diff --git a/package.json b/package.json index 37c6ba433..e319da9bb 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "design-comuni-plone-theme", "description": "Volto Theme for Italia design guidelines", "license": "MIT", - "version": "7.33.1", + "version": "7.33.2", "addons": [ "@plone-collective/volto-sentry", "volto-multilingual-widget",