design-comuni-plone-theme 11.16.0 → 11.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.yarn/cache/volto-site-settings-npm-0.4.4-11da224a90-ef0c504b64.zip +0 -0
- package/.yarn/cache/{volto-subsites-npm-4.0.1-97a0109675-0796a9f77c.zip → volto-subsites-npm-4.0.2-715672140c-77408b4ea1.zip} +0 -0
- package/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +43 -0
- package/RELEASE.md +16 -0
- package/locales/volto.pot +1 -1
- package/package.json +5 -3
- package/publiccode.yml +2 -2
- package/src/components/ItaliaTheme/AppExtras/GenericAppExtras.jsx +1 -6
- package/src/components/ItaliaTheme/AppExtras/SiteSettingsExtras.jsx +41 -0
- package/src/components/ItaliaTheme/Blocks/EventSearch/DefaultFilters.js +3 -1
- package/src/components/ItaliaTheme/Blocks/Listing/SliderTemplate.jsx +3 -2
- package/src/components/ItaliaTheme/BrandText/BrandText.jsx +37 -7
- package/src/components/ItaliaTheme/BrandTextFooter/BrandTextFooter.jsx +1 -1
- package/src/components/ItaliaTheme/Breadcrumbs/Breadcrumbs.jsx +3 -1
- package/src/components/ItaliaTheme/Footer/FooterInfos.jsx +4 -2
- package/src/components/ItaliaTheme/Footer/FooterMain.jsx +4 -4
- package/src/components/ItaliaTheme/Footer/FooterSmall.jsx +10 -5
- package/src/components/ItaliaTheme/Header/HeaderCenter.jsx +5 -6
- package/src/components/ItaliaTheme/Header/HeaderSlim/HeaderSlim.jsx +24 -7
- package/src/components/ItaliaTheme/Header/ParentSiteMenu.jsx +3 -1
- package/src/components/ItaliaTheme/Logo/Logo.jsx +15 -7
- package/src/components/ItaliaTheme/LogoFooter/LogoFooter.jsx +11 -3
- package/src/components/ItaliaTheme/Pagination/Pagination.jsx +0 -1
- package/src/components/ItaliaTheme/Slider/NextArrow.jsx +1 -1
- package/src/components/ItaliaTheme/Slider/PrevArrow.jsx +1 -1
- package/src/components/ItaliaTheme/View/Commons/RelatedArticles.jsx +11 -1
- package/src/components/ItaliaTheme/View/ServizioView/ServizioMetatag.jsx +12 -1
- package/src/components/ItaliaTheme/View/UOView/UOServices.jsx +5 -25
- package/src/config/italiaConfig.js +10 -0
- package/src/customizations/volto/components/theme/Navigation/Navigation.jsx +6 -5
- package/src/customizations/volto/helpers/Html/Html.jsx +2 -2
- package/src/helpers/index.js +2 -0
- package/src/helpers/url.js +15 -0
- package/src/helpers/usePaginatedItemsSection.hook.ts +63 -0
- package/src/theme/_cms-ui.scss +6 -0
|
Binary file
|
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [11.18.0](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v11.17.0...v11.18.0) (2024-07-19)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add pagination to cards listings in Venue, refactor pagination logic into custom hook ([#726](https://github.com/RedTurtle/design-comuni-plone-theme/issues/726)) ([305a467](https://github.com/RedTurtle/design-comuni-plone-theme/commit/305a46764ba337ff01ed576f06a6b2bf065e7ff6))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* site settings issues with race conditions and hook rendering ([5f350bc](https://github.com/RedTurtle/design-comuni-plone-theme/commit/5f350bc2548e7d835380d8a1631ca2d37afd1bff))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Documentation
|
|
17
|
+
|
|
18
|
+
* updated publiccode and release log ([955ff49](https://github.com/RedTurtle/design-comuni-plone-theme/commit/955ff499c78b34fb472ce9ddf2df9267d0f432fe))
|
|
19
|
+
|
|
20
|
+
## [11.17.0](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v11.16.0...v11.17.0) (2024-07-16)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
* Site settings to manage title, logo, favicon ([#666](https://github.com/RedTurtle/design-comuni-plone-theme/issues/666)) ([fecf6c2](https://github.com/RedTurtle/design-comuni-plone-theme/commit/fecf6c25281016e6e893c85bfcdce28e5d5967c7))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* added check for subsite to path in venue query for events search filter ([#718](https://github.com/RedTurtle/design-comuni-plone-theme/issues/718)) ([cd96ee0](https://github.com/RedTurtle/design-comuni-plone-theme/commit/cd96ee0c77e2bb91225528db7c85ffdf824f66d5))
|
|
31
|
+
* backward compatibility for new site settings panel ([f186923](https://github.com/RedTurtle/design-comuni-plone-theme/commit/f1869233022ba4372b78c8b404034b1e97b708e2))
|
|
32
|
+
* better variables naming and resolved minor warnings ([4eb0c8d](https://github.com/RedTurtle/design-comuni-plone-theme/commit/4eb0c8d630bec8cb830a1903d4f3d6643a1dd2a4))
|
|
33
|
+
* blocks widget table block toolbar position ([#716](https://github.com/RedTurtle/design-comuni-plone-theme/issues/716)) ([a116542](https://github.com/RedTurtle/design-comuni-plone-theme/commit/a116542fa741193fe754417e3cd777a2b7c375eb))
|
|
34
|
+
* home link per languageRootFoolder ([#724](https://github.com/RedTurtle/design-comuni-plone-theme/issues/724)) ([5b0f809](https://github.com/RedTurtle/design-comuni-plone-theme/commit/5b0f8099ec411a86d63c0a755451615f28238f3c))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Maintenance
|
|
38
|
+
|
|
39
|
+
* resolve linting issue ([c67a574](https://github.com/RedTurtle/design-comuni-plone-theme/commit/c67a574480053edd493d54729489b2e58e301323))
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Documentation
|
|
43
|
+
|
|
44
|
+
* updated publiccode and release log ([f7becf8](https://github.com/RedTurtle/design-comuni-plone-theme/commit/f7becf81ef119ce1dc9c5b1138dd77e71a5c1754))
|
|
45
|
+
|
|
3
46
|
## [11.16.0](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v11.15.0...v11.16.0) (2024-07-10)
|
|
4
47
|
|
|
5
48
|
|
package/RELEASE.md
CHANGED
|
@@ -41,6 +41,22 @@
|
|
|
41
41
|
- ...
|
|
42
42
|
-->
|
|
43
43
|
|
|
44
|
+
## Versione 11.18.0 (19/07/2024)
|
|
45
|
+
|
|
46
|
+
### Migliorie
|
|
47
|
+
|
|
48
|
+
- Aggiunta la paginazione per le card presenti sotto i campi "Sede di" e "Servizi presenti nel luogo", ora verranno mostrati solo 4 elementi alla volta.
|
|
49
|
+
|
|
50
|
+
## Versione 11.17.0 (16/07/2024)
|
|
51
|
+
|
|
52
|
+
### Novità
|
|
53
|
+
|
|
54
|
+
- Ora il titolo, sottotitolo, favicon, logo e logo del footer sono editabili dal pannello di controllo del Sito. Se non impostati, verranno usati quelli definiti dagli sviluppatori.
|
|
55
|
+
|
|
56
|
+
### Fix
|
|
57
|
+
|
|
58
|
+
- Ripristinato il funzionamento del filtro luogo nella ricerca eventi.
|
|
59
|
+
|
|
44
60
|
## Versione 11.16.0 (10/07/2024)
|
|
45
61
|
|
|
46
62
|
### Migliorie
|
package/locales/volto.pot
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
msgid ""
|
|
2
2
|
msgstr ""
|
|
3
3
|
"Project-Id-Version: Plone\n"
|
|
4
|
-
"POT-Creation-Date: 2024-
|
|
4
|
+
"POT-Creation-Date: 2024-07-15T11:07:19.251Z\n"
|
|
5
5
|
"Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
|
|
6
6
|
"Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
|
|
7
7
|
"MIME-Version: 1.0\n"
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "design-comuni-plone-theme",
|
|
3
3
|
"description": "Volto Theme for Italia design guidelines",
|
|
4
4
|
"license": "GPL-v3",
|
|
5
|
-
"version": "11.
|
|
5
|
+
"version": "11.18.0",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"volto-querywidget-with-browser",
|
|
37
37
|
"@eeacms/volto-taxonomy",
|
|
38
38
|
"volto-feedback",
|
|
39
|
-
"volto-slimheader"
|
|
39
|
+
"volto-slimheader",
|
|
40
|
+
"volto-site-settings"
|
|
40
41
|
],
|
|
41
42
|
"scripts": {
|
|
42
43
|
"prepare": "husky install",
|
|
@@ -158,11 +159,12 @@
|
|
|
158
159
|
"volto-querywidget-with-browser": "0.4.2",
|
|
159
160
|
"volto-rss-block": "3.0.0",
|
|
160
161
|
"volto-secondarymenu": "4.1.1",
|
|
162
|
+
"volto-site-settings": "0.4.4",
|
|
161
163
|
"volto-slimheader": "0.1.2",
|
|
162
164
|
"volto-social-settings": "3.0.0",
|
|
163
165
|
"volto-subblocks": "2.1.0",
|
|
164
166
|
"volto-subfooter": "3.1.1",
|
|
165
|
-
"volto-subsites": "4.0.
|
|
167
|
+
"volto-subsites": "4.0.2",
|
|
166
168
|
"volto-venue": "4.1.0",
|
|
167
169
|
"webpack-image-resize-loader": "^5.0.0"
|
|
168
170
|
},
|
package/publiccode.yml
CHANGED
|
@@ -227,9 +227,9 @@ maintenance:
|
|
|
227
227
|
name: io-Comune - Il sito AgID per Comuni ed Enti Pubblici
|
|
228
228
|
platforms:
|
|
229
229
|
- web
|
|
230
|
-
releaseDate: '2024-07-
|
|
230
|
+
releaseDate: '2024-07-19'
|
|
231
231
|
softwareType: standalone/web
|
|
232
|
-
softwareVersion: 11.
|
|
232
|
+
softwareVersion: 11.18.0
|
|
233
233
|
url: 'https://github.com/italia/design-comuni-plone-theme'
|
|
234
234
|
usedBy:
|
|
235
235
|
- ASP Comuni Modenesi Area Nord
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useSelector } from 'react-redux';
|
|
3
|
-
import { useIntl } from 'react-intl';
|
|
4
3
|
import { useLocation } from 'react-router-dom';
|
|
5
|
-
import {
|
|
4
|
+
import { BodyClass } from '@plone/volto/helpers';
|
|
6
5
|
import { RemoveBodyClass } from 'design-comuni-plone-theme/components/ItaliaTheme';
|
|
7
|
-
import { getSiteProperty } from 'design-comuni-plone-theme/helpers';
|
|
8
6
|
import ScrollToTop from 'design-comuni-plone-theme/components/ItaliaTheme/ScrollToTop/ScrollToTop';
|
|
9
7
|
import { SubsiteLoader } from 'volto-subsites';
|
|
10
8
|
import config from '@plone/volto/registry';
|
|
11
9
|
|
|
12
10
|
const GenericAppExtras = (props) => {
|
|
13
|
-
const intl = useIntl();
|
|
14
11
|
const location = useLocation();
|
|
15
12
|
|
|
16
13
|
const subsite = useSelector((state) => state.subsite?.data);
|
|
@@ -19,7 +16,6 @@ const GenericAppExtras = (props) => {
|
|
|
19
16
|
if (subsiteLoadable) {
|
|
20
17
|
subsiteLoadable.load();
|
|
21
18
|
}
|
|
22
|
-
const siteTitle = subsite?.title ?? getSiteProperty('siteTitle', intl.locale);
|
|
23
19
|
|
|
24
20
|
const FORCE_PUBLIC_UI = ['/sitemap', '/search'];
|
|
25
21
|
const isPublicUI = FORCE_PUBLIC_UI.reduce(
|
|
@@ -29,7 +25,6 @@ const GenericAppExtras = (props) => {
|
|
|
29
25
|
|
|
30
26
|
return (
|
|
31
27
|
<>
|
|
32
|
-
<Helmet titleTemplate={`%s - ${siteTitle}`} />
|
|
33
28
|
{isPublicUI && (
|
|
34
29
|
<>
|
|
35
30
|
<BodyClass className="public-ui" />
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*
|
|
2
|
+
CUSTOMIZATIONS:
|
|
3
|
+
- get defaultValue from siteProperties
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { useIntl } from 'react-intl';
|
|
8
|
+
import { useSelector } from 'react-redux';
|
|
9
|
+
import { Helmet } from '@plone/volto/helpers';
|
|
10
|
+
import { SiteProperty } from 'volto-site-settings';
|
|
11
|
+
import { getSiteProperty } from 'design-comuni-plone-theme/helpers';
|
|
12
|
+
|
|
13
|
+
const SiteSettingsExtras = (props) => {
|
|
14
|
+
const intl = useIntl();
|
|
15
|
+
const subsite = useSelector((state) => state.subsite?.data);
|
|
16
|
+
let siteTitle = SiteProperty({
|
|
17
|
+
property: 'site_title',
|
|
18
|
+
getValue: true,
|
|
19
|
+
defaultValue: getSiteProperty('siteTitle', intl.locale),
|
|
20
|
+
// TODO DEPRECATED: remove and only use defaultValue in v12
|
|
21
|
+
forceValue: subsite?.title || getSiteProperty('siteTitle', intl.locale),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const parentSiteTitle = SiteProperty({
|
|
25
|
+
property: 'site_title',
|
|
26
|
+
getValue: true,
|
|
27
|
+
getParent: true,
|
|
28
|
+
defaultValue: getSiteProperty('siteTitle', intl.locale),
|
|
29
|
+
// TODO DEPRECATED: remove and only use defaultValue in v12
|
|
30
|
+
forceValue: getSiteProperty('siteTitle', intl.locale),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
if (parentSiteTitle !== siteTitle) {
|
|
34
|
+
siteTitle = siteTitle + ' - ' + parentSiteTitle;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
siteTitle = siteTitle?.replaceAll('\\n', ' - ') ?? '';
|
|
38
|
+
|
|
39
|
+
return <Helmet titleTemplate={`%s - ${siteTitle}`} />;
|
|
40
|
+
};
|
|
41
|
+
export default SiteSettingsExtras;
|
|
@@ -36,6 +36,8 @@ const DefaultFilters = () => {
|
|
|
36
36
|
const intl = useIntl();
|
|
37
37
|
moment.locale(intl.locale);
|
|
38
38
|
const subsite = useSelector((state) => state.subsite?.data);
|
|
39
|
+
const isSubsiteValid = subsite && Object.keys(subsite).length > 0;
|
|
40
|
+
const path = isSubsiteValid ? flattenToAppURL(subsite['@id']) : '/';
|
|
39
41
|
|
|
40
42
|
return {
|
|
41
43
|
text_filter: {
|
|
@@ -68,7 +70,7 @@ const DefaultFilters = () => {
|
|
|
68
70
|
isSearchable: true,
|
|
69
71
|
options: {
|
|
70
72
|
dispatch: {
|
|
71
|
-
path:
|
|
73
|
+
path: path,
|
|
72
74
|
portal_types: ['Venue'],
|
|
73
75
|
fullobjects: 0,
|
|
74
76
|
b_size: 10000,
|
|
@@ -41,7 +41,7 @@ const messages = defineMessages({
|
|
|
41
41
|
|
|
42
42
|
const Slide = (props) => {
|
|
43
43
|
const intl = useIntl();
|
|
44
|
-
const {
|
|
44
|
+
const { index, appearance, appearanceProp, onKeyDown } = props;
|
|
45
45
|
|
|
46
46
|
const appearances = config.blocks.blocksConfig.listing.variations.filter(
|
|
47
47
|
(v) => v.id === 'slider',
|
|
@@ -50,7 +50,6 @@ const Slide = (props) => {
|
|
|
50
50
|
|
|
51
51
|
return (
|
|
52
52
|
<SingleSlideWrapper
|
|
53
|
-
key={item['@id'] + index}
|
|
54
53
|
index={index}
|
|
55
54
|
onKeyDown={onKeyDown}
|
|
56
55
|
aria-label={
|
|
@@ -130,6 +129,7 @@ const SliderTemplate = ({
|
|
|
130
129
|
};
|
|
131
130
|
return (
|
|
132
131
|
<El
|
|
132
|
+
key={index}
|
|
133
133
|
className={`${item.props.className} slick-dot`}
|
|
134
134
|
tabIndex={-1}
|
|
135
135
|
title={intl.formatMessage(messages.slideDot, {
|
|
@@ -228,6 +228,7 @@ const SliderTemplate = ({
|
|
|
228
228
|
const prevIndex = index > 0 ? index - 1 : null;
|
|
229
229
|
return (
|
|
230
230
|
<Slide
|
|
231
|
+
key={item['@id'] + index}
|
|
231
232
|
image={image}
|
|
232
233
|
index={index}
|
|
233
234
|
full_width={full_width}
|
|
@@ -1,18 +1,48 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cx from 'classnames';
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
|
+
import { SiteProperty } from 'volto-site-settings';
|
|
4
5
|
import { getSiteProperty } from 'design-comuni-plone-theme/helpers';
|
|
5
6
|
|
|
6
|
-
const BrandText = ({ mobile = false, subsite }) => {
|
|
7
|
+
const BrandText = ({ mobile = false, subsite, getParent = false }) => {
|
|
7
8
|
const intl = useIntl();
|
|
9
|
+
// TODO DEPRECATED: remove and only use SiteProperty
|
|
10
|
+
const deprecatedSiteTitle =
|
|
11
|
+
subsite?.title || getSiteProperty('siteTitle', intl.locale);
|
|
12
|
+
let title = SiteProperty({
|
|
13
|
+
property: 'site_title',
|
|
14
|
+
forceValue: deprecatedSiteTitle,
|
|
15
|
+
defaultValue: getSiteProperty('siteTitle', intl.locale),
|
|
16
|
+
getValue: true,
|
|
17
|
+
getParent: getParent,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// TODO DEPRECATED: remove and only use SiteProperty
|
|
21
|
+
const deprecatedSiteSubtitle =
|
|
22
|
+
subsite?.description || getSiteProperty('siteSubtitle', intl.locale);
|
|
23
|
+
const description = SiteProperty({
|
|
24
|
+
property: 'site_subtitle',
|
|
25
|
+
forceValue: deprecatedSiteSubtitle,
|
|
26
|
+
defaultValue: getSiteProperty('siteSubtitle', intl.locale),
|
|
27
|
+
getValue: true,
|
|
28
|
+
getParent: getParent,
|
|
29
|
+
});
|
|
30
|
+
const titleSplit = title?.split('\n') ?? null;
|
|
31
|
+
title = titleSplit?.map((t, i) => (
|
|
32
|
+
<React.Fragment key={i}>
|
|
33
|
+
{t}
|
|
34
|
+
{i < titleSplit.length - 1 && <br />}
|
|
35
|
+
</React.Fragment>
|
|
36
|
+
));
|
|
37
|
+
|
|
8
38
|
return (
|
|
9
39
|
<div className="it-brand-text">
|
|
10
|
-
<p className="no_toc h2">
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
40
|
+
{title && <p className="no_toc h2">{title}</p>}
|
|
41
|
+
{description && (
|
|
42
|
+
<p className={cx('no_toc h3', { 'd-none d-md-block': !mobile })}>
|
|
43
|
+
{description}
|
|
44
|
+
</p>
|
|
45
|
+
)}
|
|
16
46
|
</div>
|
|
17
47
|
);
|
|
18
48
|
};
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
import { UniversalLink } from '@plone/volto/components';
|
|
22
22
|
import { Row, Col, BreadcrumbItem } from 'design-react-kit';
|
|
23
23
|
import GoogleBreadcrumbs from 'design-comuni-plone-theme/components/ItaliaTheme/Breadcrumbs/GoogleBreadcrumbs';
|
|
24
|
+
import { useHomePath } from 'design-comuni-plone-theme/helpers';
|
|
24
25
|
import config from '@plone/volto/registry';
|
|
25
26
|
|
|
26
27
|
const messages = defineMessages({
|
|
@@ -98,6 +99,7 @@ const Breadcrumbs = ({ pathname }) => {
|
|
|
98
99
|
items = [];
|
|
99
100
|
}
|
|
100
101
|
}
|
|
102
|
+
const homepath = useHomePath();
|
|
101
103
|
|
|
102
104
|
return items?.length > 0 ? (
|
|
103
105
|
<>
|
|
@@ -110,7 +112,7 @@ const Breadcrumbs = ({ pathname }) => {
|
|
|
110
112
|
>
|
|
111
113
|
<ol className="breadcrumb" data-element="breadcrumb">
|
|
112
114
|
<BreadcrumbItem tag="li">
|
|
113
|
-
<UniversalLink href=
|
|
115
|
+
<UniversalLink href={homepath}>
|
|
114
116
|
{intl.formatMessage(messages.home)}
|
|
115
117
|
</UniversalLink>
|
|
116
118
|
<span className="separator">/</span>
|
|
@@ -17,6 +17,8 @@ import {
|
|
|
17
17
|
FooterSocials,
|
|
18
18
|
} from 'design-comuni-plone-theme/components/ItaliaTheme';
|
|
19
19
|
|
|
20
|
+
import { useHomePath } from 'design-comuni-plone-theme/helpers';
|
|
21
|
+
|
|
20
22
|
const messages = defineMessages({
|
|
21
23
|
goToPage: {
|
|
22
24
|
id: 'Vai alla pagina',
|
|
@@ -29,7 +31,7 @@ const FooterInfos = () => {
|
|
|
29
31
|
const N_COLUMNS = 4;
|
|
30
32
|
const location = useLocation();
|
|
31
33
|
const dispatch = useDispatch();
|
|
32
|
-
|
|
34
|
+
const homepath = useHomePath();
|
|
33
35
|
const footerConfiguration = useSelector(
|
|
34
36
|
(state) => state.editableFooterColumns?.result,
|
|
35
37
|
);
|
|
@@ -41,7 +43,7 @@ const FooterInfos = () => {
|
|
|
41
43
|
//filter rootpaths
|
|
42
44
|
const footerColumns = getItemsByPath(
|
|
43
45
|
footerConfiguration,
|
|
44
|
-
location?.pathname?.length ? location.pathname :
|
|
46
|
+
location?.pathname?.length ? location.pathname : homepath,
|
|
45
47
|
);
|
|
46
48
|
|
|
47
49
|
const colWidth =
|
|
@@ -7,6 +7,7 @@ import React from 'react';
|
|
|
7
7
|
import { Container, Row, Col } from 'design-react-kit';
|
|
8
8
|
|
|
9
9
|
import { UniversalLink } from '@plone/volto/components';
|
|
10
|
+
import { FooterTop } from 'volto-editablefooter';
|
|
10
11
|
import {
|
|
11
12
|
FooterNavigation,
|
|
12
13
|
FooterInfos,
|
|
@@ -14,8 +15,7 @@ import {
|
|
|
14
15
|
BrandTextFooter,
|
|
15
16
|
FooterPNRRLogo,
|
|
16
17
|
} from 'design-comuni-plone-theme/components/ItaliaTheme/';
|
|
17
|
-
|
|
18
|
-
import { FooterTop } from 'volto-editablefooter';
|
|
18
|
+
import { useHomePath } from 'design-comuni-plone-theme/helpers';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* FooterMain component class.
|
|
@@ -24,7 +24,7 @@ import { FooterTop } from 'volto-editablefooter';
|
|
|
24
24
|
*/
|
|
25
25
|
const FooterMain = () => {
|
|
26
26
|
const footerTopContent = FooterTop();
|
|
27
|
-
|
|
27
|
+
const homepath = useHomePath();
|
|
28
28
|
return (
|
|
29
29
|
<div className="it-footer-main">
|
|
30
30
|
<Container tag="div">
|
|
@@ -35,7 +35,7 @@ const FooterMain = () => {
|
|
|
35
35
|
{footerTopContent ?? (
|
|
36
36
|
<>
|
|
37
37
|
<FooterPNRRLogo />
|
|
38
|
-
<UniversalLink href=
|
|
38
|
+
<UniversalLink href={homepath}>
|
|
39
39
|
<LogoFooter />
|
|
40
40
|
<BrandTextFooter />
|
|
41
41
|
</UniversalLink>
|
|
@@ -5,15 +5,18 @@
|
|
|
5
5
|
|
|
6
6
|
import React, { useEffect } from 'react';
|
|
7
7
|
import cx from 'classnames';
|
|
8
|
-
import { UniversalLink } from '@plone/volto/components';
|
|
9
8
|
import { defineMessages, useIntl } from 'react-intl';
|
|
10
9
|
import { Container } from 'design-react-kit';
|
|
11
|
-
import { getSiteProperty } from 'design-comuni-plone-theme/helpers';
|
|
12
10
|
import { useLocation } from 'react-router-dom';
|
|
13
11
|
import { useDispatch, useSelector } from 'react-redux';
|
|
14
12
|
import { getSubFooter, getItemsByPath } from 'volto-subfooter';
|
|
15
|
-
import { flattenToAppURL } from '@plone/volto/helpers';
|
|
16
13
|
import { displayBanner } from 'volto-gdpr-privacy';
|
|
14
|
+
import { UniversalLink } from '@plone/volto/components';
|
|
15
|
+
import { flattenToAppURL } from '@plone/volto/helpers';
|
|
16
|
+
import {
|
|
17
|
+
getSiteProperty,
|
|
18
|
+
useHomePath,
|
|
19
|
+
} from 'design-comuni-plone-theme/helpers';
|
|
17
20
|
|
|
18
21
|
const messages = defineMessages({
|
|
19
22
|
goToPage: {
|
|
@@ -35,7 +38,7 @@ const FooterSmall = () => {
|
|
|
35
38
|
const intl = useIntl();
|
|
36
39
|
const pathname = useLocation().pathname;
|
|
37
40
|
const dispatch = useDispatch();
|
|
38
|
-
|
|
41
|
+
const homepath = useHomePath();
|
|
39
42
|
const subFooter = useSelector((state) => state.subFooter?.result);
|
|
40
43
|
const subFooterItems = getItemsByPath(subFooter, pathname)?.filter(
|
|
41
44
|
(item) => item.visible,
|
|
@@ -54,7 +57,9 @@ const FooterSmall = () => {
|
|
|
54
57
|
{subFooterItems?.length > 0 &&
|
|
55
58
|
subFooterItems.map((item, index) => {
|
|
56
59
|
let url =
|
|
57
|
-
item.href ||
|
|
60
|
+
item.href ||
|
|
61
|
+
flattenToAppURL(item.linkUrl?.[0]?.['@id']) ||
|
|
62
|
+
homepath;
|
|
58
63
|
return (
|
|
59
64
|
<li
|
|
60
65
|
className={cx('list-inline-item', {
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
HeaderSearch,
|
|
16
16
|
BrandText,
|
|
17
17
|
} from 'design-comuni-plone-theme/components/ItaliaTheme';
|
|
18
|
+
import { useHomePath } from 'design-comuni-plone-theme/helpers';
|
|
18
19
|
|
|
19
20
|
const messages = defineMessages({
|
|
20
21
|
logoSubsiteAlt: {
|
|
@@ -32,22 +33,20 @@ const HeaderCenter = () => {
|
|
|
32
33
|
const subsite = useSelector((state) => state.subsite?.data);
|
|
33
34
|
const logoSubsite = subsite?.subsite_logo && (
|
|
34
35
|
<figure className="icon">
|
|
35
|
-
<
|
|
36
|
-
src={flattenToAppURL(subsite.subsite_logo.scales?.mini?.download)}
|
|
37
|
-
alt={intl.formatMessage(messages.logoSubsiteAlt)}
|
|
38
|
-
/>
|
|
36
|
+
<Logo alt={intl.formatMessage(messages.logoSubsiteAlt)} />
|
|
39
37
|
</figure>
|
|
40
38
|
);
|
|
39
|
+
const homepath = useHomePath();
|
|
41
40
|
|
|
42
41
|
return (
|
|
43
42
|
<Header small={false} theme="" type="center">
|
|
44
43
|
<HeaderContent>
|
|
45
44
|
<div className="it-brand-wrapper ps-4">
|
|
46
45
|
<UniversalLink
|
|
47
|
-
href={subsite?.['@id'] ? flattenToAppURL(subsite['@id']) :
|
|
46
|
+
href={subsite?.['@id'] ? flattenToAppURL(subsite['@id']) : homepath}
|
|
48
47
|
title={intl.formatMessage(messages.subsiteUniversalLink)}
|
|
49
48
|
>
|
|
50
|
-
{subsite?.subsite_logo ? logoSubsite : <Logo />}
|
|
49
|
+
{subsite?.subsite_logo ? logoSubsite : <Logo className="icon" />}
|
|
51
50
|
<BrandText subsite={subsite} />
|
|
52
51
|
</UniversalLink>
|
|
53
52
|
</div>
|
|
@@ -13,19 +13,35 @@ import {
|
|
|
13
13
|
HeaderRightZone,
|
|
14
14
|
} from 'design-react-kit';
|
|
15
15
|
import { useIntl } from 'react-intl';
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
getSiteProperty,
|
|
18
|
+
useHomePath,
|
|
19
|
+
} from 'design-comuni-plone-theme/helpers';
|
|
20
|
+
import { SiteProperty } from 'volto-site-settings';
|
|
17
21
|
|
|
18
22
|
const HeaderSlim = () => {
|
|
19
23
|
const subsite = useSelector((state) => state.subsite?.data);
|
|
20
24
|
const intl = useIntl();
|
|
21
|
-
|
|
25
|
+
const homepath = useHomePath();
|
|
22
26
|
const parentSiteURL = subsite
|
|
23
|
-
?
|
|
27
|
+
? homepath
|
|
24
28
|
: getSiteProperty('parentSiteURL', intl.locale);
|
|
25
29
|
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
const staticParentSiteTitle = getSiteProperty('parentSiteTitle', intl.locale);
|
|
31
|
+
|
|
32
|
+
// TODO DEPRECATED use only SiteProperty
|
|
33
|
+
const deprecatedSubsiteParentSiteTitle = getSiteProperty(
|
|
34
|
+
'subsiteParentSiteTitle',
|
|
35
|
+
intl.locale,
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const subsiteParentSiteTitle = SiteProperty({
|
|
39
|
+
property: 'site_title',
|
|
40
|
+
forceValue: deprecatedSubsiteParentSiteTitle,
|
|
41
|
+
defaultValue: getSiteProperty('subsiteParentSiteTitle', intl.locale),
|
|
42
|
+
getValue: true,
|
|
43
|
+
getParent: true,
|
|
44
|
+
});
|
|
29
45
|
|
|
30
46
|
const target = subsite ? null : '_blank';
|
|
31
47
|
return (
|
|
@@ -37,7 +53,8 @@ const HeaderSlim = () => {
|
|
|
37
53
|
target={target}
|
|
38
54
|
rel="noopener noreferrer"
|
|
39
55
|
>
|
|
40
|
-
{
|
|
56
|
+
{!subsite && staticParentSiteTitle}
|
|
57
|
+
{subsite && (subsiteParentSiteTitle?.replaceAll('\\n', ' - ') ?? '')}
|
|
41
58
|
</HeaderBrand>
|
|
42
59
|
<HeaderRightZone>
|
|
43
60
|
<HeaderSlimRightZone />
|
|
@@ -8,12 +8,14 @@ import { useSelector } from 'react-redux';
|
|
|
8
8
|
import { Link } from 'react-router-dom';
|
|
9
9
|
import { flattenToAppURL } from '@plone/volto/helpers';
|
|
10
10
|
import { Nav, NavItem, NavLink } from 'design-react-kit';
|
|
11
|
+
import { useHomePath } from 'design-comuni-plone-theme/helpers';
|
|
11
12
|
|
|
12
13
|
const ParentSiteMenu = () => {
|
|
13
14
|
const dropdownMenu = useSelector(
|
|
14
15
|
(state) => state.dropdownMenuNavItems?.result,
|
|
15
16
|
);
|
|
16
17
|
const subsite = useSelector((state) => state.subsite?.data);
|
|
18
|
+
const homepath = useHomePath();
|
|
17
19
|
|
|
18
20
|
let menu = null;
|
|
19
21
|
if (subsite) {
|
|
@@ -23,7 +25,7 @@ const ParentSiteMenu = () => {
|
|
|
23
25
|
let i = url_split.length - 1;
|
|
24
26
|
while (i > 0) {
|
|
25
27
|
let s = url_split.slice(0, i).join('/');
|
|
26
|
-
s = s.length === 0 ?
|
|
28
|
+
s = s.length === 0 ? homepath : s;
|
|
27
29
|
// eslint-disable-next-line no-loop-func
|
|
28
30
|
dropdownMenu.forEach((m) => {
|
|
29
31
|
if (m.rootPath === s) {
|
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
* Note the icon class.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
/* SVG example
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
/* SVG example
|
|
14
|
+
import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';
|
|
15
|
+
const Logo = () => <Icon color="" icon="it-pa" padding={false} size="" />;
|
|
16
|
+
*/
|
|
16
17
|
|
|
17
18
|
/* PNG example using https://www.npmjs.com/package/webpack-image-resize-loader *
|
|
18
19
|
* works, but some issues with prettier and jest
|
|
@@ -20,9 +21,16 @@
|
|
|
20
21
|
// eslint-disable-next-line import/no-unresolved
|
|
21
22
|
//import logo from './logo.png?width=164';
|
|
22
23
|
import logo from './logo.png';
|
|
24
|
+
import { SiteProperty } from 'volto-site-settings';
|
|
23
25
|
|
|
24
|
-
const Logo = () =>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
const Logo = ({ alt = 'Logo', className }) => {
|
|
27
|
+
return (
|
|
28
|
+
<SiteProperty
|
|
29
|
+
property="site_logo"
|
|
30
|
+
defaultValue={{ url: logo, width: 82, height: 82 }}
|
|
31
|
+
className={className}
|
|
32
|
+
alt={alt}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
28
36
|
export default Logo;
|
|
@@ -12,9 +12,17 @@
|
|
|
12
12
|
|
|
13
13
|
// eslint-disable-next-line import/no-unresolved
|
|
14
14
|
import logo from '../Logo/logo.png';
|
|
15
|
+
import { SiteProperty } from 'volto-site-settings';
|
|
15
16
|
|
|
16
|
-
const LogoFooter = () =>
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
const LogoFooter = () => {
|
|
18
|
+
return (
|
|
19
|
+
<SiteProperty
|
|
20
|
+
property="site_logo_footer"
|
|
21
|
+
defaultValue={{ url: logo, width: 82, height: 82 }}
|
|
22
|
+
className="icon"
|
|
23
|
+
alt="Logo"
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
19
27
|
|
|
20
28
|
export default LogoFooter;
|
|
@@ -58,7 +58,6 @@ class Pagination extends Component {
|
|
|
58
58
|
|
|
59
59
|
handleItemClick = (e, nextActivePage) => {
|
|
60
60
|
const { activePage: prevActivePage } = this.state;
|
|
61
|
-
|
|
62
61
|
// Heads up! We need the cast to the "number" type there, as `activePage` can be a string
|
|
63
62
|
if (+prevActivePage === +nextActivePage) return;
|
|
64
63
|
this.setState({ activePage: nextActivePage.children });
|
|
@@ -27,7 +27,7 @@ export default function PrevArrow(props) {
|
|
|
27
27
|
onKeyDown={onKeyDown}
|
|
28
28
|
>
|
|
29
29
|
<Icon icon="chevron-left" key="chevron-left-prev" title={_title} />
|
|
30
|
-
<span
|
|
30
|
+
<span className="visually-hidden">{_title}</span>
|
|
31
31
|
</button>
|
|
32
32
|
);
|
|
33
33
|
}
|
|
@@ -2,6 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import cx from 'classnames';
|
|
4
4
|
import { OfficeCard } from 'design-comuni-plone-theme/components/ItaliaTheme/View';
|
|
5
|
+
import { usePaginatedItemsSection } from 'design-comuni-plone-theme/helpers';
|
|
6
|
+
import { Pagination } from 'design-comuni-plone-theme/components/ItaliaTheme';
|
|
5
7
|
|
|
6
8
|
const RelatedArticles = ({
|
|
7
9
|
id = 'related-articles',
|
|
@@ -12,6 +14,9 @@ const RelatedArticles = ({
|
|
|
12
14
|
show_title = true,
|
|
13
15
|
noMargin = false,
|
|
14
16
|
}) => {
|
|
17
|
+
const { batches, currentPage, onPaginationChange, pageNumbers } =
|
|
18
|
+
usePaginatedItemsSection({ data: items });
|
|
19
|
+
|
|
15
20
|
return (
|
|
16
21
|
<article
|
|
17
22
|
id={id}
|
|
@@ -27,7 +32,7 @@ const RelatedArticles = ({
|
|
|
27
32
|
) : null}
|
|
28
33
|
|
|
29
34
|
<div className="card-wrapper card-teaser-wrapper card-teaser-wrapper-equal">
|
|
30
|
-
{
|
|
35
|
+
{batches?.map((item, i) => (
|
|
31
36
|
<OfficeCard
|
|
32
37
|
key={item['@id']}
|
|
33
38
|
office={item}
|
|
@@ -36,6 +41,11 @@ const RelatedArticles = ({
|
|
|
36
41
|
/>
|
|
37
42
|
))}
|
|
38
43
|
</div>
|
|
44
|
+
<Pagination
|
|
45
|
+
activePage={currentPage}
|
|
46
|
+
totalPages={pageNumbers}
|
|
47
|
+
onPageChange={onPaginationChange}
|
|
48
|
+
/>
|
|
39
49
|
</article>
|
|
40
50
|
);
|
|
41
51
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { useIntl } from 'react-intl';
|
|
1
2
|
import { Helmet, toPublicURL, isInternalURL } from '@plone/volto/helpers';
|
|
3
|
+
import { SiteProperty } from 'volto-site-settings';
|
|
2
4
|
import { getSiteProperty } from 'design-comuni-plone-theme/helpers';
|
|
3
5
|
import { richTextHasContent } from 'design-comuni-plone-theme/components/ItaliaTheme/View';
|
|
4
6
|
|
|
@@ -13,7 +15,16 @@ const fieldDataToPlainText = (field) => {
|
|
|
13
15
|
};
|
|
14
16
|
|
|
15
17
|
const ServizioMetatag = ({ content }) => {
|
|
16
|
-
const
|
|
18
|
+
const intl = useIntl();
|
|
19
|
+
// TODO DEPRECATED use only SiteProperty
|
|
20
|
+
const deprecatedSiteTitle = getSiteProperty('siteTitle', intl.locale);
|
|
21
|
+
let siteTitle = SiteProperty({
|
|
22
|
+
property: 'site_title',
|
|
23
|
+
forceValue: deprecatedSiteTitle,
|
|
24
|
+
getValue: true,
|
|
25
|
+
defaultTitle: getSiteProperty('siteTitle', intl.locale),
|
|
26
|
+
});
|
|
27
|
+
siteTitle = siteTitle?.replaceAll('\\n', ' - ') ?? '';
|
|
17
28
|
|
|
18
29
|
const schemaOrg = {
|
|
19
30
|
'@context': 'https://schema.org',
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
} from 'design-react-kit';
|
|
12
12
|
import { Pagination } from 'design-comuni-plone-theme/components/ItaliaTheme';
|
|
13
13
|
import { UniversalLink } from '@plone/volto/components';
|
|
14
|
+
import { usePaginatedItemsSection } from 'design-comuni-plone-theme/helpers';
|
|
14
15
|
|
|
15
16
|
const messages = defineMessages({
|
|
16
17
|
servizi_offerti: {
|
|
@@ -19,34 +20,15 @@ const messages = defineMessages({
|
|
|
19
20
|
},
|
|
20
21
|
});
|
|
21
22
|
|
|
22
|
-
//* Pagination **/
|
|
23
|
-
const divideServicesIntoBatches = (arr, batchSize) => {
|
|
24
|
-
const batches = [];
|
|
25
|
-
for (let i = 0; i < arr.length; i += batchSize) {
|
|
26
|
-
batches.push(arr.slice(i, i + batchSize));
|
|
27
|
-
}
|
|
28
|
-
return batches;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
23
|
const UOServices = ({ content }) => {
|
|
32
24
|
const intl = useIntl();
|
|
33
25
|
|
|
34
|
-
const [currentPage, setCurrentPage] = useState(1);
|
|
35
|
-
const bSize = 4;
|
|
36
|
-
|
|
37
|
-
//* Calcolo numero pagine
|
|
38
|
-
|
|
39
26
|
const servizi_offerti =
|
|
40
27
|
content.servizi_offerti === undefined || content.servizi_offerti === null
|
|
41
28
|
? []
|
|
42
29
|
: content.servizi_offerti;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const onPaginationChange = (activePage) => {
|
|
47
|
-
const current = activePage?.children ?? 1;
|
|
48
|
-
setCurrentPage(current);
|
|
49
|
-
};
|
|
30
|
+
const { batches, currentPage, onPaginationChange, pageNumbers } =
|
|
31
|
+
usePaginatedItemsSection({ data: servizi_offerti });
|
|
50
32
|
|
|
51
33
|
return content?.servizi_offerti?.length > 0 ? (
|
|
52
34
|
<section
|
|
@@ -57,9 +39,7 @@ const UOServices = ({ content }) => {
|
|
|
57
39
|
{intl.formatMessage(messages.servizi_offerti)}
|
|
58
40
|
</h2>
|
|
59
41
|
<Row className="card-wrapper card-teaser-wrapper align-items-stretch">
|
|
60
|
-
{
|
|
61
|
-
currentPage - 1
|
|
62
|
-
]?.map((servizio, i) => (
|
|
42
|
+
{batches?.map((servizio, i) => (
|
|
63
43
|
<Col xs="12" lg="6">
|
|
64
44
|
<Card className="shadow rounded card-big-io-comune p-3 my-3">
|
|
65
45
|
<CardBody>
|
|
@@ -79,7 +59,7 @@ const UOServices = ({ content }) => {
|
|
|
79
59
|
<Pagination
|
|
80
60
|
activePage={currentPage}
|
|
81
61
|
totalPages={pageNumbers}
|
|
82
|
-
onPageChange={
|
|
62
|
+
onPageChange={onPaginationChange}
|
|
83
63
|
/>
|
|
84
64
|
</div>
|
|
85
65
|
</section>
|
|
@@ -35,6 +35,8 @@ import GenericAppExtras from 'design-comuni-plone-theme/components/ItaliaTheme/A
|
|
|
35
35
|
import PageLoader from 'design-comuni-plone-theme/components/ItaliaTheme/AppExtras/PageLoader';
|
|
36
36
|
import TrackFocus from 'design-comuni-plone-theme/components/ItaliaTheme/AppExtras/TrackFocus';
|
|
37
37
|
import redraft from 'redraft';
|
|
38
|
+
|
|
39
|
+
import SiteSettingsExtras from 'design-comuni-plone-theme/components/ItaliaTheme/AppExtras/SiteSettingsExtras';
|
|
38
40
|
import { loadables as ItaliaLoadables } from 'design-comuni-plone-theme/config/loadables';
|
|
39
41
|
|
|
40
42
|
// CTs icons
|
|
@@ -298,6 +300,10 @@ export default function applyConfig(voltoConfig) {
|
|
|
298
300
|
match: '',
|
|
299
301
|
component: TrackFocus,
|
|
300
302
|
},
|
|
303
|
+
{
|
|
304
|
+
match: '',
|
|
305
|
+
component: SiteSettingsExtras,
|
|
306
|
+
},
|
|
301
307
|
],
|
|
302
308
|
maxFileUploadSize: null,
|
|
303
309
|
'volto-blocks-widget': {
|
|
@@ -518,6 +524,10 @@ export default function applyConfig(voltoConfig) {
|
|
|
518
524
|
...config.components,
|
|
519
525
|
BlockExtraTags: { component: () => null },
|
|
520
526
|
};
|
|
527
|
+
config.registerComponent({
|
|
528
|
+
name: 'SiteSettingsExtras',
|
|
529
|
+
component: SiteSettingsExtras,
|
|
530
|
+
});
|
|
521
531
|
|
|
522
532
|
// REDUCERS
|
|
523
533
|
config.addonReducers = {
|
|
@@ -38,10 +38,7 @@ const Navigation = ({ pathname }) => {
|
|
|
38
38
|
const subsite = useSelector((state) => state.subsite?.data);
|
|
39
39
|
const logoSubsite = subsite?.subsite_logo && (
|
|
40
40
|
<figure className="icon">
|
|
41
|
-
<
|
|
42
|
-
src={flattenToAppURL(subsite.subsite_logo.scales?.mini?.download)}
|
|
43
|
-
alt="Logo"
|
|
44
|
-
/>
|
|
41
|
+
<Logo />
|
|
45
42
|
</figure>
|
|
46
43
|
);
|
|
47
44
|
|
|
@@ -136,7 +133,11 @@ const Navigation = ({ pathname }) => {
|
|
|
136
133
|
}
|
|
137
134
|
onClick={() => setCollapseOpen(false)}
|
|
138
135
|
>
|
|
139
|
-
{subsite?.subsite_logo ?
|
|
136
|
+
{subsite?.subsite_logo ? (
|
|
137
|
+
logoSubsite
|
|
138
|
+
) : (
|
|
139
|
+
<Logo className="icon" />
|
|
140
|
+
)}
|
|
140
141
|
<BrandText mobile={true} subsite={subsite} />
|
|
141
142
|
</UniversalLink>
|
|
142
143
|
</div>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
/*
|
|
6
6
|
CUSTOMIZATIONS:
|
|
7
|
-
-
|
|
7
|
+
- Rimosso <link rel="shortcut icon" href="/favicon.ico" /> perchè creato da volto-site-settings
|
|
8
8
|
- Add shrink-to-fit=no in viewport meta
|
|
9
9
|
- Remove link for manifest and svg/apple icons
|
|
10
10
|
*/
|
|
@@ -122,7 +122,7 @@ class Html extends Component {
|
|
|
122
122
|
})};`,
|
|
123
123
|
}}
|
|
124
124
|
/>
|
|
125
|
-
<link rel="shortcut icon" href="/favicon.ico" />
|
|
125
|
+
{/* <link rel="shortcut icon" href="/favicon.ico" /> */}
|
|
126
126
|
<meta property="og:type" content="website" />
|
|
127
127
|
<meta name="generator" content="Plone 6 - https://plone.org" />
|
|
128
128
|
<meta
|
package/src/helpers/index.js
CHANGED
|
@@ -52,3 +52,5 @@ export {
|
|
|
52
52
|
export { commonSearchBlockMessages } from 'design-comuni-plone-theme/helpers/Translations/searchBlockExtendedTranslations';
|
|
53
53
|
|
|
54
54
|
export { getComponentWithFallback } from 'design-comuni-plone-theme/helpers/registry';
|
|
55
|
+
export { useHomePath } from 'design-comuni-plone-theme/helpers/url';
|
|
56
|
+
export { usePaginatedItemsSection } from 'design-comuni-plone-theme/helpers/usePaginatedItemsSection.hook.ts';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
|
|
4
|
+
import config from '@plone/volto/registry';
|
|
5
|
+
|
|
6
|
+
export const useHomePath = () => {
|
|
7
|
+
const [path, setPath] = useState('/');
|
|
8
|
+
|
|
9
|
+
const { locale } = useIntl();
|
|
10
|
+
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
setPath(config.settings.isMultilingual ? '/' + locale : '/');
|
|
13
|
+
}, [locale]);
|
|
14
|
+
return path;
|
|
15
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { useState, useMemo } from 'react';
|
|
2
|
+
import type { IntlShape } from 'react-intl';
|
|
3
|
+
|
|
4
|
+
interface usePaginatedItemsSectionProps {
|
|
5
|
+
data: Array<any> | null | undefined;
|
|
6
|
+
bSize?: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type ActivePage = {
|
|
10
|
+
active: boolean;
|
|
11
|
+
type: 'pageItem' | string;
|
|
12
|
+
ellipsisItem: '...' | string | null | undefined;
|
|
13
|
+
isPrevButtonInactive: boolean;
|
|
14
|
+
isForwButtonInactive: boolean;
|
|
15
|
+
children: number;
|
|
16
|
+
intl: IntlShape;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
type PaginationFunctionExtraArgs = {
|
|
20
|
+
activePage: ActivePage;
|
|
21
|
+
onClick: (
|
|
22
|
+
e: MouseEvent | KeyboardEvent,
|
|
23
|
+
obj: PaginationFunctionExtraArgs,
|
|
24
|
+
) => void;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const DEFAULT_PAGINATED_CARDS_SECTION_BSIZE = 4;
|
|
28
|
+
|
|
29
|
+
function getBatches(
|
|
30
|
+
arr: usePaginatedItemsSectionProps['data'],
|
|
31
|
+
batchSize: number,
|
|
32
|
+
): any[][] {
|
|
33
|
+
const batches = [];
|
|
34
|
+
if (arr) {
|
|
35
|
+
for (let i = 0; i < arr.length; i += batchSize) {
|
|
36
|
+
batches.push(arr.slice(i, i + batchSize));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return batches;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function usePaginatedItemsSection({
|
|
43
|
+
data,
|
|
44
|
+
bSize = DEFAULT_PAGINATED_CARDS_SECTION_BSIZE,
|
|
45
|
+
}: usePaginatedItemsSectionProps) {
|
|
46
|
+
const [currentPage, setCurrentPage] = useState<number>(1);
|
|
47
|
+
|
|
48
|
+
const pageNumbers = data ? Math.ceil(data.length / bSize) : 0;
|
|
49
|
+
|
|
50
|
+
const onPaginationChange = (
|
|
51
|
+
_e: MouseEvent | KeyboardEvent,
|
|
52
|
+
{ activePage }: PaginationFunctionExtraArgs,
|
|
53
|
+
) => {
|
|
54
|
+
const current = activePage?.children ?? 1;
|
|
55
|
+
setCurrentPage(current);
|
|
56
|
+
};
|
|
57
|
+
const batches: Array<any> = useMemo(() => {
|
|
58
|
+
const currentIndex = currentPage - 1;
|
|
59
|
+
return getBatches(data, bSize)[currentIndex];
|
|
60
|
+
}, [data, bSize, currentPage]);
|
|
61
|
+
|
|
62
|
+
return { batches, currentPage, onPaginationChange, pageNumbers };
|
|
63
|
+
}
|