design-comuni-plone-theme 8.4.6 → 8.5.1

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 (48) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/locales/de/LC_MESSAGES/volto.po +10 -0
  3. package/locales/en/LC_MESSAGES/volto.po +10 -0
  4. package/locales/es/LC_MESSAGES/volto.po +10 -0
  5. package/locales/fr/LC_MESSAGES/volto.po +10 -0
  6. package/locales/it/LC_MESSAGES/volto.po +10 -0
  7. package/locales/volto.pot +11 -1
  8. package/package.json +2 -2
  9. package/publiccode.yml +3 -2
  10. package/src/components/ItaliaTheme/Blocks/ContactsBlock/Block/ViewBlock.jsx +1 -1
  11. package/src/components/ItaliaTheme/Blocks/ContactsBlock/Edit.jsx +2 -2
  12. package/src/components/ItaliaTheme/Blocks/ContactsBlock/View.jsx +2 -2
  13. package/src/components/ItaliaTheme/Blocks/Listing/BandiInEvidenceTemplate.jsx +7 -4
  14. package/src/components/ItaliaTheme/Blocks/Listing/Commons/utils.js +9 -2
  15. package/src/components/ItaliaTheme/Blocks/Listing/PhotogalleryTemplate.jsx +3 -1
  16. package/src/components/ItaliaTheme/Blocks/Listing/SliderTemplate.jsx +5 -5
  17. package/src/components/ItaliaTheme/Blocks/VideoGallery/Body.jsx +49 -3
  18. package/src/components/ItaliaTheme/Blocks/VideoGallery/Edit.jsx +7 -5
  19. package/src/components/ItaliaTheme/LoginAgid/LoginAgid.jsx +9 -2
  20. package/src/components/ItaliaTheme/Search/Search.jsx +76 -67
  21. package/src/components/ItaliaTheme/Unauthorized/Unauthorized.jsx +9 -6
  22. package/src/components/ItaliaTheme/View/Commons/LocationsMap.jsx +1 -6
  23. package/src/components/ItaliaTheme/View/Commons/Metadata.jsx +2 -2
  24. package/src/components/ItaliaTheme/View/Commons/OfficeCard.jsx +4 -2
  25. package/src/components/ItaliaTheme/View/Commons/RichText.jsx +1 -1
  26. package/src/components/ItaliaTheme/View/EventoView/EventoCosE.jsx +3 -1
  27. package/src/components/ItaliaTheme/View/EventoView/EventoUlterioriInformazioni.jsx +0 -3
  28. package/src/components/ItaliaTheme/View/PersonaView/PersonaRuolo.jsx +44 -13
  29. package/src/components/ItaliaTheme/View/__tests__/PersonaView.test.jsx +938 -928
  30. package/src/config/Blocks/blocks.js +3 -4
  31. package/src/customizations/volto/components/manage/Blocks/Grid/Edit.jsx +55 -0
  32. package/src/customizations/volto/components/manage/Blocks/Listing/withQuerystringResults.jsx +8 -3
  33. package/src/theme/ItaliaTheme/Blocks/_calendar.scss +14 -26
  34. package/src/theme/ItaliaTheme/Blocks/_contentInEvidenceTemplate.scss +1 -1
  35. package/src/theme/ItaliaTheme/Blocks/_gridBlock.scss +27 -0
  36. package/src/theme/ItaliaTheme/Blocks/_iconBlocks.scss +2 -2
  37. package/src/theme/ItaliaTheme/Blocks/_photogallerytemplate.scss +0 -1
  38. package/src/theme/ItaliaTheme/Blocks/_sliderTemplate.scss +4 -52
  39. package/src/theme/ItaliaTheme/Blocks/_videoGallery.scss +26 -3
  40. package/src/theme/ItaliaTheme/Components/_cmp-timeline.scss +1 -0
  41. package/src/theme/ItaliaTheme/Views/_evento.scss +4 -0
  42. package/src/theme/ItaliaTheme/Views/_slider.scss +58 -6
  43. package/src/theme/ItaliaTheme/_common.scss +12 -0
  44. package/src/theme/ItaliaTheme/_main.scss +1 -0
  45. package/src/theme/extras/_search.scss +6 -0
  46. package/src/theme/site.scss +1 -0
  47. /package/src/customizations/volto/components/theme/View/{View.jsx → disabled_View.jsx} +0 -0
  48. /package/src/customizations/volto/helpers/Api/{Api.jsx → disabled_Api.js} +0 -0
@@ -6,7 +6,7 @@
6
6
  import React, { useState, useEffect } from 'react';
7
7
  import { useDispatch, useSelector } from 'react-redux';
8
8
  import { useIntl, defineMessages } from 'react-intl';
9
- import { values } from 'lodash';
9
+ import { values, isEmpty } from 'lodash';
10
10
  import cx from 'classnames';
11
11
  import qs from 'query-string';
12
12
  import moment from 'moment';
@@ -324,7 +324,7 @@ const Search = () => {
324
324
  true,
325
325
  );
326
326
 
327
- searchResults.result &&
327
+ !isEmpty(searchResults.result) &&
328
328
  history.push(
329
329
  getSearchParamsURL(
330
330
  searchableText,
@@ -349,7 +349,6 @@ const Search = () => {
349
349
  }, 0);
350
350
  let activeTopics = values(topics).filter((t) => t.value).length;
351
351
  let activePortalTypes = values(portalTypes).filter((ct) => ct.value).length;
352
-
353
352
  return (
354
353
  <>
355
354
  <Helmet title={intl.formatMessage(messages.searchResults)} />
@@ -612,72 +611,82 @@ const Search = () => {
612
611
  </aside>
613
612
 
614
613
  <Col lg={9} tag="section" className="py-lg-5">
615
- {searchResults.loadingResults ? (
616
- <Spinner active />
617
- ) : searchResults?.result?.items_total > 0 ? (
618
- <div
619
- className="search-results-wrapper"
620
- role="region"
621
- id="search-results-region"
622
- aria-live="polite"
623
- >
624
- <div className="d-block ordering-widget">
625
- <Row className="pb-3 border-bottom">
626
- <Col xs={6} className="align-self-center">
627
- <p className="d-none d-lg-block" aria-live="polite">
628
- {intl.formatMessage(messages.foundNResults, {
629
- total: searchResults.result.items_total,
630
- })}
631
- </p>
632
- <p className="d-block d-lg-none mb-0 text-end">
633
- {intl.formatMessage(messages.orderBy)}
634
- </p>
635
- </Col>
636
- <Col xs={6}>
637
- <SelectInput
638
- id="search-sort-on"
639
- value={
640
- sortOnOptions.filter((o) => o.value === sortOn)[0]
641
- }
642
- label={intl.formatMessage(messages.orderBy)}
643
- placeholder={intl.formatMessage(messages.orderBy)}
644
- onChange={(opt) => setSortOn(opt.value)}
645
- options={sortOnOptions}
646
- />
647
- </Col>
648
- </Row>
649
- </div>
650
- <Row>
651
- {searchResults?.result?.items?.map((item, index) => (
652
- <Col md={12} key={item['@id']} className="p-0">
653
- <SearchResultItem
654
- item={item}
655
- index={index}
656
- searchableText={searchableText}
657
- section={getSectionFromId(item['@id'])}
658
- />
659
- </Col>
660
- ))}
614
+ <div
615
+ className="search-results-wrapper"
616
+ role="region"
617
+ id="search-results-region"
618
+ aria-live="polite"
619
+ >
620
+ <div className="d-block ordering-widget">
621
+ <Row className="pb-3 border-bottom">
622
+ <Col xs={6} className="align-self-center">
623
+ <p className="d-none d-lg-block" aria-live="polite">
624
+ {intl.formatMessage(messages.foundNResults, {
625
+ total: searchResults?.result?.items_total || 0,
626
+ })}
627
+ </p>
628
+ <p className="d-block d-lg-none mb-0 text-end">
629
+ {intl.formatMessage(messages.orderBy)}
630
+ </p>
631
+ </Col>
632
+ <Col xs={6}>
633
+ <SelectInput
634
+ id="search-sort-on"
635
+ value={
636
+ sortOnOptions.filter((o) => o.value === sortOn)[0]
637
+ }
638
+ label={intl.formatMessage(messages.orderBy)}
639
+ placeholder={intl.formatMessage(messages.orderBy)}
640
+ onChange={(opt) => setSortOn(opt.value)}
641
+ options={sortOnOptions}
642
+ />
643
+ </Col>
661
644
  </Row>
662
- {searchResults?.result?.batching && (
663
- <Pagination
664
- activePage={currentPage}
665
- totalPages={Math.ceil(
666
- (searchResults?.result?.items_total ?? 0) /
667
- config.settings.defaultPageSize,
668
- )}
669
- onPageChange={handleQueryPaginationChange}
670
- />
671
- )}
672
645
  </div>
673
- ) : searchResults.error ? (
674
- <Alert color="danger">
675
- <strong>{intl.formatMessage(messages.attenzione)}</strong>{' '}
676
- {intl.formatMessage(messages.errors_occured)}
677
- </Alert>
678
- ) : (
679
- <p>{intl.formatMessage(messages.no_results)}</p>
680
- )}
646
+
647
+ {searchResults.loadingResults ||
648
+ (!searchResults.hasError && isEmpty(searchResults.result)) ? (
649
+ <div className="searchSpinnerWrapper">
650
+ <Spinner active />
651
+ </div>
652
+ ) : searchResults?.result?.items_total > 0 ? (
653
+ <>
654
+ <Row>
655
+ {searchResults?.result?.items?.map((item, index) => (
656
+ <Col md={12} key={item['@id']} className="p-0">
657
+ <SearchResultItem
658
+ item={item}
659
+ index={index}
660
+ searchableText={searchableText}
661
+ section={getSectionFromId(item['@id'])}
662
+ />
663
+ </Col>
664
+ ))}
665
+ </Row>
666
+ {searchResults?.result?.batching && (
667
+ <Pagination
668
+ activePage={currentPage}
669
+ totalPages={Math.ceil(
670
+ (searchResults?.result?.items_total ?? 0) /
671
+ config.settings.defaultPageSize,
672
+ )}
673
+ onPageChange={handleQueryPaginationChange}
674
+ />
675
+ )}
676
+ </>
677
+ ) : searchResults.error ? (
678
+ <Alert color="danger">
679
+ <strong>{intl.formatMessage(messages.attenzione)}</strong>{' '}
680
+ {intl.formatMessage(messages.errors_occured)}
681
+ </Alert>
682
+ ) : (
683
+ !searchResults?.hasError &&
684
+ !isEmpty(searchResults?.result) &&
685
+ searchResults.result?.items.length === 0 && (
686
+ <p>{intl.formatMessage(messages.no_results)}</p>
687
+ )
688
+ )}
689
+ </div>
681
690
  </Col>
682
691
  </Row>
683
692
  </Container>
@@ -53,6 +53,7 @@ const Unauthorized = (props) => {
53
53
  : process.env.RAZZLE_SPID_LOGIN_URL;
54
54
  // BBB: per retrocompatibilità con il vecchio config arLoginUrl
55
55
  const spidLogin = config.settings.siteProperties?.spidLogin;
56
+ const came_from = `${getBaseUrl(location.pathname)}${location.search}`;
56
57
 
57
58
  return (
58
59
  <div id="unauthorized-agid" className="view-wrapper">
@@ -88,9 +89,10 @@ const Unauthorized = (props) => {
88
89
  <Button
89
90
  color="primary"
90
91
  outline
91
- href={`${getBaseUrl(
92
- location.pathname,
93
- )}/login?login_operatore=1`}
92
+ href={`/login?${new URLSearchParams({
93
+ login_operatore: 1,
94
+ return_url: came_from,
95
+ })}`}
94
96
  tag="button"
95
97
  >
96
98
  <span>{intl.formatMessage(messages.loginPloneUser)}</span>
@@ -117,9 +119,10 @@ const Unauthorized = (props) => {
117
119
  values={{
118
120
  login: (
119
121
  <Link
120
- to={`${getBaseUrl(
121
- location.pathname,
122
- )}/login?login_operatore=1`}
122
+ to={`/login?${new URLSearchParams({
123
+ login_operatore: 1,
124
+ return_url: came_from,
125
+ })}`}
123
126
  >
124
127
  <FormattedMessage id="log in" defaultMessage="log in" />
125
128
  </Link>
@@ -43,12 +43,7 @@ const LocationsMap = ({ center, locations }) => {
43
43
 
44
44
  useEffect(() => {
45
45
  venues.forEach((loc) => {
46
- if (
47
- !fetchedLocations?.[loc.key]?.loading &&
48
- !fetchedLocations?.[loc.key]?.loaded
49
- ) {
50
- dispatch(getContent(loc.url, null, loc.key));
51
- }
46
+ dispatch(getContent(loc.url, null, loc.key));
52
47
  });
53
48
 
54
49
  return () =>
@@ -48,13 +48,13 @@ const Metadata = ({
48
48
  </h4>
49
49
  )}
50
50
  {children}
51
- <p className="font-serif mb-0 mt-4">
51
+ <p className="font-serif mb-0 mt-4 last-modified">
52
52
  <strong>{intl.formatMessage(messages.modified)}:</strong>{' '}
53
53
  {viewDate(intl.locale, content.modified, 'DD-MM-Y, HH:MM')}
54
54
  </p>
55
55
  {content.rights && (
56
56
  <>
57
- <p className="font-serif mb-0 mt-4">
57
+ <p className="font-serif mb-0 mt-4 metadata">
58
58
  {intl.formatMessage(messages.rights)}
59
59
  </p>
60
60
  <strong>{content.rights}</strong>
@@ -42,7 +42,6 @@ const OfficeCard = ({
42
42
  }, [url]);
43
43
 
44
44
  let office_fo = load_data ? officeContent?.[key]?.data : office;
45
-
46
45
  return office_fo ? (
47
46
  <div
48
47
  className={cx(
@@ -86,7 +85,10 @@ const OfficeCard = ({
86
85
  <ContactLink tel={pdc.pdc_value} label={false} />
87
86
  </div>
88
87
  );
89
- } else if (pdc.pdc_type === 'email')
88
+ } else if (
89
+ pdc.pdc_type === 'email' ||
90
+ pdc.pdc_type === 'pec'
91
+ )
90
92
  return (
91
93
  <div key={i}>
92
94
  <ContactLink email={pdc.pdc_value} label={false} />
@@ -31,7 +31,7 @@ const RichText = ({
31
31
  <>
32
32
  {title && (
33
33
  <Tag
34
- className={cx('mt-4', {
34
+ className={cx('mt-4 it-page-subsection', {
35
35
  'fw-bold': title_size === 'h6',
36
36
  })}
37
37
  >
@@ -45,7 +45,9 @@ const EventoCosE = ({ content }) => {
45
45
  >
46
46
  {content?.persone_amministrazione?.length > 0 && (
47
47
  <>
48
- <h5>{intl.formatMessage(messages.parteciperanno)}</h5>
48
+ <h5 className="parteciperanno-section">
49
+ {intl.formatMessage(messages.parteciperanno)}
50
+ </h5>
49
51
  {content.persone_amministrazione.map((item, i) => (
50
52
  <UniversalLink
51
53
  href={flattenToAppURL(item['@id'])}
@@ -43,7 +43,6 @@ const EventoUlterioriInformazioni = ({ content }) => {
43
43
  {richTextHasContent(content?.ulteriori_informazioni) && (
44
44
  <HelpBox text={content?.ulteriori_informazioni} />
45
45
  )}
46
-
47
46
  {content?.event_url && (
48
47
  <div className="mt-4">
49
48
  <h5>{intl.formatMessage(messages.event_url)}</h5>
@@ -52,7 +51,6 @@ const EventoUlterioriInformazioni = ({ content }) => {
52
51
  </UniversalLink>
53
52
  </div>
54
53
  )}
55
-
56
54
  {richTextHasContent(content?.patrocinato_da) && (
57
55
  <div className="mt-4">
58
56
  {richTextHasContent(content?.patrocinato_da) && (
@@ -66,7 +64,6 @@ const EventoUlterioriInformazioni = ({ content }) => {
66
64
  )}
67
65
  </div>
68
66
  )}
69
-
70
67
  {content?.strutture_politiche.length > 0 && (
71
68
  <div className="mt-4">
72
69
  <h5>{intl.formatMessage(messages.strutture_politiche)}</h5>
@@ -78,7 +78,6 @@ const messages = defineMessages({
78
78
 
79
79
  const PersonaRuolo = ({ content }) => {
80
80
  const intl = useIntl();
81
-
82
81
  return (
83
82
  <>
84
83
  {content?.incarichi_persona?.length > 0 && (
@@ -188,18 +187,50 @@ const PersonaRuolo = ({ content }) => {
188
187
  )}
189
188
  </RichTextSection>
190
189
  )}
191
- <RichTextSection
192
- tag_id="data_insediamento"
193
- title={intl.formatMessage(messages.data_insediamento)}
194
- >
195
- <div className="font-serif">
196
- {viewDate(
197
- intl.locale,
198
- content.incarichi_persona[0].data_inizio_incarico,
199
- 'DD MMMM Y',
200
- )}
201
- </div>
202
- </RichTextSection>
190
+ {content.incarichi_persona[0].data_insediamento && (
191
+ <RichTextSection
192
+ tag_id="data_insediamento"
193
+ title={intl.formatMessage(messages.data_insediamento)}
194
+ >
195
+ <div className="font-serif">
196
+ {viewDate(
197
+ intl.locale,
198
+ content.incarichi_persona[0].data_insediamento,
199
+ 'DD MMMM Y',
200
+ )}
201
+ </div>
202
+ </RichTextSection>
203
+ )}
204
+ {content.incarichi_persona[0].data_inizio_incarico && (
205
+ <RichTextSection
206
+ tag_id="data_inizio_incarico"
207
+ title={intl.formatMessage(messages.data_inizio_incarico)}
208
+ >
209
+ <div className="font-serif">
210
+ {viewDate(
211
+ intl.locale,
212
+ content.incarichi_persona[0].data_inizio_incarico,
213
+ 'DD MMMM Y',
214
+ )}
215
+ </div>
216
+ </RichTextSection>
217
+ )}
218
+ {content.incarichi_persona[0].data_conclusione_incarico && (
219
+ <RichTextSection
220
+ tag_id="data_conclusione_incarico"
221
+ title={intl.formatMessage(messages.data_conclusione_incarico, {
222
+ incarico: content.incarichi_persona[0].title,
223
+ })}
224
+ >
225
+ <div className="font-serif">
226
+ {viewDate(
227
+ intl.locale,
228
+ content.incarichi_persona[0].data_conclusione_incarico,
229
+ 'DD MMMM Y',
230
+ )}
231
+ </div>
232
+ </RichTextSection>
233
+ )}
203
234
  </>
204
235
  )}
205
236
  {content.assessore_di?.length > 0 && (