design-comuni-plone-theme 11.16.0 → 11.17.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.
Files changed (32) hide show
  1. package/.yarn/cache/volto-site-settings-npm-0.4.3-7926886a97-690d1c03a0.zip +0 -0
  2. package/.yarn/cache/{volto-subsites-npm-4.0.1-97a0109675-0796a9f77c.zip → volto-subsites-npm-4.0.2-715672140c-77408b4ea1.zip} +0 -0
  3. package/.yarn/install-state.gz +0 -0
  4. package/CHANGELOG.md +26 -0
  5. package/RELEASE.md +10 -0
  6. package/locales/volto.pot +1 -1
  7. package/package.json +5 -3
  8. package/publiccode.yml +2 -2
  9. package/src/components/ItaliaTheme/AppExtras/GenericAppExtras.jsx +1 -6
  10. package/src/components/ItaliaTheme/AppExtras/SiteSettingsExtras.jsx +35 -0
  11. package/src/components/ItaliaTheme/Blocks/EventSearch/DefaultFilters.js +3 -1
  12. package/src/components/ItaliaTheme/Blocks/Listing/SliderTemplate.jsx +3 -2
  13. package/src/components/ItaliaTheme/BrandText/BrandText.jsx +39 -7
  14. package/src/components/ItaliaTheme/BrandTextFooter/BrandTextFooter.jsx +1 -1
  15. package/src/components/ItaliaTheme/Breadcrumbs/Breadcrumbs.jsx +3 -1
  16. package/src/components/ItaliaTheme/Footer/FooterInfos.jsx +4 -2
  17. package/src/components/ItaliaTheme/Footer/FooterMain.jsx +4 -4
  18. package/src/components/ItaliaTheme/Footer/FooterSmall.jsx +10 -5
  19. package/src/components/ItaliaTheme/Header/HeaderCenter.jsx +5 -6
  20. package/src/components/ItaliaTheme/Header/HeaderSlim/HeaderSlim.jsx +25 -7
  21. package/src/components/ItaliaTheme/Header/ParentSiteMenu.jsx +3 -1
  22. package/src/components/ItaliaTheme/Logo/Logo.jsx +15 -7
  23. package/src/components/ItaliaTheme/LogoFooter/LogoFooter.jsx +11 -3
  24. package/src/components/ItaliaTheme/Slider/NextArrow.jsx +1 -1
  25. package/src/components/ItaliaTheme/Slider/PrevArrow.jsx +1 -1
  26. package/src/components/ItaliaTheme/View/ServizioView/ServizioMetatag.jsx +13 -1
  27. package/src/config/italiaConfig.js +10 -0
  28. package/src/customizations/volto/components/theme/Navigation/Navigation.jsx +6 -5
  29. package/src/customizations/volto/helpers/Html/Html.jsx +2 -2
  30. package/src/helpers/index.js +1 -0
  31. package/src/helpers/url.js +15 -0
  32. package/src/theme/_cms-ui.scss +6 -0
Binary file
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
 
2
2
 
3
+ ## [11.17.0](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v11.16.0...v11.17.0) (2024-07-16)
4
+
5
+
6
+ ### Features
7
+
8
+ * 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))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * 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))
14
+ * backward compatibility for new site settings panel ([f186923](https://github.com/RedTurtle/design-comuni-plone-theme/commit/f1869233022ba4372b78c8b404034b1e97b708e2))
15
+ * better variables naming and resolved minor warnings ([4eb0c8d](https://github.com/RedTurtle/design-comuni-plone-theme/commit/4eb0c8d630bec8cb830a1903d4f3d6643a1dd2a4))
16
+ * 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))
17
+ * 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))
18
+
19
+
20
+ ### Maintenance
21
+
22
+ * resolve linting issue ([c67a574](https://github.com/RedTurtle/design-comuni-plone-theme/commit/c67a574480053edd493d54729489b2e58e301323))
23
+
24
+
25
+ ### Documentation
26
+
27
+ * updated publiccode and release log ([f7becf8](https://github.com/RedTurtle/design-comuni-plone-theme/commit/f7becf81ef119ce1dc9c5b1138dd77e71a5c1754))
28
+
3
29
  ## [11.16.0](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v11.15.0...v11.16.0) (2024-07-10)
4
30
 
5
31
 
package/RELEASE.md CHANGED
@@ -41,6 +41,16 @@
41
41
  - ...
42
42
  -->
43
43
 
44
+ ## Versione 11.17.0 (16/07/2024)
45
+
46
+ ### Novità
47
+
48
+ - 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.
49
+
50
+ ### Fix
51
+
52
+ - Ripristinato il funzionamento del filtro luogo nella ricerca eventi.
53
+
44
54
  ## Versione 11.16.0 (10/07/2024)
45
55
 
46
56
  ### 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-06-25T15:14:34.369Z\n"
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.16.0",
5
+ "version": "11.17.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.3",
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.1",
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-10'
230
+ releaseDate: '2024-07-16'
231
231
  softwareType: standalone/web
232
- softwareVersion: 11.16.0
232
+ softwareVersion: 11.17.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 { Helmet, BodyClass } from '@plone/volto/helpers';
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,35 @@
1
+ /*
2
+ CUSTOMIZATIONS:
3
+ - get defaultValue from siteProperties
4
+ */
5
+
6
+ import React from 'react';
7
+ import { useIntl } from 'react-intl';
8
+ import { Helmet } from '@plone/volto/helpers';
9
+ import { SiteProperty } from 'volto-site-settings';
10
+ import { getSiteProperty } from 'design-comuni-plone-theme/helpers';
11
+
12
+ const SiteSettingsExtras = (props) => {
13
+ const intl = useIntl();
14
+ let siteTitle = SiteProperty({
15
+ property: 'site_title',
16
+ getValue: true,
17
+ defaultValue: getSiteProperty('siteTitle', intl.locale),
18
+ });
19
+
20
+ const parentSiteTitle = SiteProperty({
21
+ property: 'site_title',
22
+ getValue: true,
23
+ getParent: true,
24
+ defaultValue: getSiteProperty('parentSiteTitle', intl.locale),
25
+ });
26
+
27
+ if (parentSiteTitle !== siteTitle) {
28
+ siteTitle = siteTitle + ' - ' + parentSiteTitle;
29
+ }
30
+
31
+ siteTitle = siteTitle.replaceAll('\\n', ' - ');
32
+
33
+ return <Helmet titleTemplate={`%s - ${siteTitle}`} />;
34
+ };
35
+ 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: subsite ? flattenToAppURL(subsite['@id']) : '/',
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 { item, index, appearance, appearanceProp, onKeyDown } = props;
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,50 @@
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 =
13
+ deprecatedSiteTitle ||
14
+ SiteProperty({
15
+ property: 'site_title',
16
+ defaultValue: getSiteProperty('siteTitle', intl.locale),
17
+ getValue: true,
18
+ getParent: getParent,
19
+ });
20
+
21
+ // TODO DEPRECATED: remove and only use SiteProperty
22
+ const deprecatedSiteSubtitle =
23
+ subsite?.description || getSiteProperty('siteSubtitle', intl.locale);
24
+ const description =
25
+ deprecatedSiteSubtitle ||
26
+ SiteProperty({
27
+ property: 'site_subtitle',
28
+ defaultValue: getSiteProperty('siteSubtitle', intl.locale),
29
+ getValue: true,
30
+ getParent: getParent,
31
+ });
32
+ const titleSplit = title?.split('\n') ?? null;
33
+ title = titleSplit?.map((t, i) => (
34
+ <React.Fragment key={i}>
35
+ {t}
36
+ {i < titleSplit.length - 1 && <br />}
37
+ </React.Fragment>
38
+ ));
39
+
8
40
  return (
9
41
  <div className="it-brand-text">
10
- <p className="no_toc h2">
11
- {subsite?.title || getSiteProperty('siteTitle', intl.locale)}
12
- </p>
13
- <p className={cx('no_toc h3', { 'd-none d-md-block': !mobile })}>
14
- {subsite?.description || getSiteProperty('siteSubtitle', intl.locale)}
15
- </p>
42
+ {title && <p className="no_toc h2">{title}</p>}
43
+ {description && (
44
+ <p className={cx('no_toc h3', { 'd-none d-md-block': !mobile })}>
45
+ {description}
46
+ </p>
47
+ )}
16
48
  </div>
17
49
  );
18
50
  };
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { BrandText } from 'design-comuni-plone-theme/components/ItaliaTheme';
3
3
 
4
4
  const BrandTextFooter = () => {
5
- return <BrandText />;
5
+ return <BrandText getParent={true} />;
6
6
  };
7
7
 
8
8
  export default BrandTextFooter;
@@ -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 || flattenToAppURL(item.linkUrl?.[0]?.['@id']) || '/';
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
- <img
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,36 @@ import {
13
13
  HeaderRightZone,
14
14
  } from 'design-react-kit';
15
15
  import { useIntl } from 'react-intl';
16
- import { getSiteProperty } from 'design-comuni-plone-theme/helpers';
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 parentSiteTile = subsite
27
- ? getSiteProperty('subsiteParentSiteTitle', intl.locale)
28
- : getSiteProperty('parentSiteTitle', intl.locale);
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 =
39
+ deprecatedSubsiteParentSiteTitle ||
40
+ SiteProperty({
41
+ property: 'site_title',
42
+ defaultValue: getSiteProperty('subsiteParentSiteTitle', intl.locale),
43
+ getValue: true,
44
+ getParent: true,
45
+ });
29
46
 
30
47
  const target = subsite ? null : '_blank';
31
48
  return (
@@ -37,7 +54,8 @@ const HeaderSlim = () => {
37
54
  target={target}
38
55
  rel="noopener noreferrer"
39
56
  >
40
- {parentSiteTile}
57
+ {!subsite && staticParentSiteTitle}
58
+ {subsite && subsiteParentSiteTitle.replaceAll('\\n', ' - ')}
41
59
  </HeaderBrand>
42
60
  <HeaderRightZone>
43
61
  <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 ? '/' : s;
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
- // import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';
15
- // const Logo = () => <Icon color="" icon="it-pa" padding={false} size="" />;
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
- <img className="icon" src={logo} width="82" height="82" alt="Logo" />
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
- <img className="icon" src={logo} width="82" height="82" alt="Logo" />
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;
@@ -25,7 +25,7 @@ export default function NextArrow(props) {
25
25
  id={id}
26
26
  >
27
27
  <Icon icon="chevron-right" key="chevron-right" title={_title} />
28
- <span class="visually-hidden">{_title}</span>
28
+ <span className="visually-hidden">{_title}</span>
29
29
  </button>
30
30
  );
31
31
  }
@@ -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 class="visually-hidden">{_title}</span>
30
+ <span className="visually-hidden">{_title}</span>
31
31
  </button>
32
32
  );
33
33
  }
@@ -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,17 @@ const fieldDataToPlainText = (field) => {
13
15
  };
14
16
 
15
17
  const ServizioMetatag = ({ content }) => {
16
- const siteTitle = getSiteProperty('siteTitle');
18
+ const intl = useIntl();
19
+ // TODO DEPRECATED use only SiteProperty
20
+ const deprecatedSiteTitle = getSiteProperty('siteTitle', intl.locale);
21
+ let siteTitle =
22
+ deprecatedSiteTitle ||
23
+ SiteProperty({
24
+ property: 'site_title',
25
+ getValue: true,
26
+ defaultTitle: getSiteProperty('siteTitle', intl.locale),
27
+ });
28
+ siteTitle = siteTitle.replaceAll('\\n', ' - ');
17
29
 
18
30
  const schemaOrg = {
19
31
  '@context': 'https://schema.org',
@@ -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
- <img
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 ? logoSubsite : <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
- - Add <link rel="shortcut icon" href="/favicon.ico" />
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
@@ -52,3 +52,4 @@ 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';
@@ -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
+ };
@@ -94,6 +94,12 @@ body.cms-ui {
94
94
  }
95
95
  }
96
96
 
97
+ .blocks-widget-container {
98
+ .block.table .toolbar {
99
+ top: -3.34rem;
100
+ }
101
+ }
102
+
97
103
  .it-header-wrapper,
98
104
  .public-ui {
99
105
  font-size: 18px;