design-comuni-plone-theme 11.26.3 → 11.26.5

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 (55) hide show
  1. package/.github/workflows/main.yml +1 -1
  2. package/.github/workflows/prs.yml +1 -1
  3. package/.github/workflows/release.yml +1 -1
  4. package/.yarn/cache/{volto-venue-npm-4.1.0-481d5ba425-64ca36bc93.zip → volto-venue-npm-4.1.1-d5be247928-f796d519ad.zip} +0 -0
  5. package/.yarn/install-state.gz +0 -0
  6. package/CHANGELOG.md +41 -0
  7. package/Makefile +1 -1
  8. package/RELEASE.md +22 -0
  9. package/locales/de/LC_MESSAGES/volto.po +38 -7
  10. package/locales/en/LC_MESSAGES/volto.po +39 -8
  11. package/locales/es/LC_MESSAGES/volto.po +38 -7
  12. package/locales/fr/LC_MESSAGES/volto.po +38 -7
  13. package/locales/it/LC_MESSAGES/volto.po +39 -8
  14. package/locales/volto.pot +39 -8
  15. package/package.json +3 -3
  16. package/publiccode.yml +2 -2
  17. package/src/components/ImageWithErrors/ImageWithErrors.jsx +0 -1
  18. package/src/components/ItaliaTheme/Blocks/Listing/AttachmentCardTemplate.jsx +13 -10
  19. package/src/components/ItaliaTheme/Blocks/Listing/CardWithImage/CardWithImageDefault.jsx +7 -7
  20. package/src/components/ItaliaTheme/Blocks/Listing/Commons/ListingImage.jsx +35 -13
  21. package/src/components/ItaliaTheme/Blocks/Listing/CompleteBlockLinksTemplate.jsx +16 -10
  22. package/src/components/ItaliaTheme/Blocks/Listing/ContentInEvidenceTemplate.jsx +12 -9
  23. package/src/components/ItaliaTheme/Blocks/Listing/GridGalleryTemplate.jsx +7 -7
  24. package/src/components/ItaliaTheme/Blocks/Listing/InEvidenceTemplate.jsx +9 -8
  25. package/src/components/ItaliaTheme/Blocks/Listing/PhotogalleryTemplate.jsx +7 -6
  26. package/src/components/ItaliaTheme/Blocks/Listing/SliderTemplate.jsx +9 -6
  27. package/src/components/ItaliaTheme/Blocks/Listing/SmallBlockLinksTemplate.jsx +19 -23
  28. package/src/components/ItaliaTheme/Cards/CardPersona.jsx +5 -8
  29. package/src/components/ItaliaTheme/View/Commons/GenericCard.jsx +14 -13
  30. package/src/components/ItaliaTheme/View/Commons/LocationItem.jsx +15 -9
  31. package/src/components/ItaliaTheme/View/Commons/OfficeCard.jsx +7 -3
  32. package/src/components/ItaliaTheme/View/Commons/Sponsors.jsx +14 -10
  33. package/src/components/ItaliaTheme/View/Commons/VenuesSmall.jsx +13 -6
  34. package/src/components/ItaliaTheme/View/EventoView/EventoContatti.jsx +8 -7
  35. package/src/components/ItaliaTheme/View/EventoView/EventoContattiOrganizzatoreEsterno.jsx +1 -12
  36. package/src/components/ItaliaTheme/View/EventoView/EventoContattiOrganizzatoreInterno.jsx +1 -12
  37. package/src/components/ItaliaTheme/View/EventoView/EventoOrganizzatoDa.jsx +38 -0
  38. package/src/components/ItaliaTheme/View/EventoView/EventoPatrocinatoDa.jsx +38 -0
  39. package/src/components/ItaliaTheme/View/EventoView/EventoUlterioriInformazioni.jsx +0 -18
  40. package/src/components/ItaliaTheme/View/NewsItemView/NewsItemText.jsx +1 -0
  41. package/src/components/SelectInput/SelectInput.jsx +9 -4
  42. package/src/config/Blocks/ListingOptions/attachmentCardTemplate.js +1 -1
  43. package/src/customizations/volto/components/manage/UniversalLink/UniversalLink.jsx +15 -11
  44. package/src/customizations/volto/components/theme/View/ListingView.jsx +3 -3
  45. package/src/helpers/images.js +25 -1
  46. package/src/helpers/index.js +4 -1
  47. package/src/overrideTranslations.jsx +25 -0
  48. package/src/theme/ItaliaTheme/Blocks/_cardWithImage.scss +4 -0
  49. package/src/theme/ItaliaTheme/Blocks/_gridBlock.scss +9 -0
  50. package/src/theme/ItaliaTheme/Components/_cardLocationItem.scss +12 -0
  51. package/src/theme/ItaliaTheme/Components/_cardPersona.scss +19 -1
  52. package/src/theme/ItaliaTheme/Widgets/_blocksWidget.scss +36 -0
  53. package/src/theme/_cms-ui.scss +21 -0
  54. package/src/theme/bootstrap-override/_bootstrap-italia-site.scss +1 -0
  55. package/src/theme/bootstrap-override/bootstrap-italia/_avatar.scss +28 -0
@@ -4,7 +4,10 @@ import cx from 'classnames';
4
4
 
5
5
  import { UniversalLink } from '@plone/volto/components';
6
6
  import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
7
- import { getCalendarDate } from 'design-comuni-plone-theme/helpers';
7
+ import {
8
+ getCalendarDate,
9
+ contentHasImage,
10
+ } from 'design-comuni-plone-theme/helpers';
8
11
  import {
9
12
  Icon,
10
13
  CardCategory,
@@ -48,23 +51,21 @@ const GenericCard = ({
48
51
  </>
49
52
  );
50
53
  const cooked_image_field = image_field || item.image_field;
51
- // (item.preview_image ? 'preview_image' : 'image');
52
- const image =
53
- showimage &&
54
- item &&
55
- Image({
56
- item: item,
57
- imageField: cooked_image_field,
58
- alt: '',
59
- title: item.title,
60
- });
54
+ const showImage = showimage && contentHasImage(item) && cooked_image_field;
61
55
 
62
56
  return item ? (
63
- image ? (
57
+ showImage ? (
64
58
  <div className={cx('genericcard card shadow rounded mt-3')}>
65
59
  <div className="img-responsive-wrapper">
66
60
  <div className="img-responsive img-responsive-panoramic">
67
- <figure className="img-wrapper">{image}</figure>
61
+ <figure className="img-wrapper">
62
+ <Image
63
+ item={item}
64
+ imageField={cooked_image_field}
65
+ alt={''}
66
+ title={item.title}
67
+ />
68
+ </figure>
68
69
  </div>
69
70
  </div>
70
71
  <div className="card-body px-4">
@@ -8,6 +8,7 @@ import { UniversalLink } from '@plone/volto/components';
8
8
  import PropTypes from 'prop-types';
9
9
  import { flattenToAppURL } from '@plone/volto/helpers';
10
10
  import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';
11
+ import { contentHasImage } from 'design-comuni-plone-theme/helpers';
11
12
  import config from '@plone/volto/registry';
12
13
 
13
14
  const messages = defineMessages({
@@ -41,24 +42,25 @@ const LocationItem = ({
41
42
  }) => {
42
43
  const intl = useIntl();
43
44
  const Image = config.getComponent({ name: 'Image' }).component;
44
- const image = Image({ item: location, sizes: '80px', loading: 'lazy' });
45
+ const showImage = contentHasImage(location) && location['@type'] === 'Venue';
45
46
  const address = ['street', 'city', 'zip_code']
46
47
  .map((key) => location?.[key])
47
48
  .filter(Boolean)
48
49
  .join(' - ');
49
50
 
50
51
  return location ? (
51
- <div className="card card-teaser shadow mt-3 border-left-card card-big-io-comune p-4 rounded location-item">
52
- {show_icon && (
53
- <Icon
54
- icon={'it-pin'}
55
- title={intl.formatMessage(messages.icona_luoghi)}
56
- />
57
- )}
52
+ <div className="card card-teaser shadow mt-3 border-left-card card-big-io-comune pt-4 pb-4 ps-3 pe-4 rounded location-item">
58
53
  <div className="card-body">
59
54
  <div className="card-title h5 venue-card-title">
60
55
  {(location.nome_sede || location.title) && (
61
56
  <>
57
+ {show_icon && (
58
+ <Icon
59
+ icon={'it-pin'}
60
+ title={intl.formatMessage(messages.icona_luoghi)}
61
+ className="pin-icon"
62
+ />
63
+ )}
62
64
  {location['@type'] === 'Venue' ||
63
65
  (location['@type'] === 'UnitaOrganizzativa' &&
64
66
  show_title_link) ? (
@@ -104,7 +106,11 @@ const LocationItem = ({
104
106
  )}
105
107
  </div>
106
108
  </div>
107
- {image && <div className="avatar size-xl">{image}</div>}
109
+ {showImage && (
110
+ <div className="avatar size-lg">
111
+ <Image item={location} sizes="80px" loading="lazy" />
112
+ </div>
113
+ )}
108
114
  </div>
109
115
  ) : (
110
116
  ''
@@ -3,6 +3,7 @@ import { UniversalLink } from '@plone/volto/components';
3
3
  import PropTypes from 'prop-types';
4
4
  import cx from 'classnames';
5
5
  import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';
6
+ import { contentHasImage } from 'design-comuni-plone-theme/helpers';
6
7
  import config from '@plone/volto/registry';
7
8
 
8
9
  /**
@@ -24,8 +25,7 @@ const OfficeCard = ({
24
25
  }) => {
25
26
  const intl = useIntl();
26
27
  const Image = config.getComponent({ name: 'Image' }).component;
27
- const image =
28
- showimage && Image({ item: office, sizes: '80px', loading: 'lazy' });
28
+ const showImage = showimage && contentHasImage(office);
29
29
 
30
30
  return (
31
31
  <div
@@ -74,7 +74,11 @@ const OfficeCard = ({
74
74
 
75
75
  {children && <div className="card-text">{children}</div>}
76
76
  </div>
77
- {image && <div className="image-container">{image}</div>}
77
+ {showImage && (
78
+ <div className="avatar size-lg">
79
+ <Image item={office} sizes="80px" loading="lazy" />
80
+ </div>
81
+ )}
78
82
  </div>
79
83
  );
80
84
  };
@@ -4,6 +4,7 @@ import React, { useEffect } from 'react';
4
4
  import { searchContent, resetSearchContent } from '@plone/volto/actions';
5
5
  import { flattenToAppURL } from '@plone/volto/helpers';
6
6
  import PropTypes from 'prop-types';
7
+ import { contentHasImage } from 'design-comuni-plone-theme/helpers';
7
8
  import { UniversalLink } from '@plone/volto/components';
8
9
  import config from '@plone/volto/registry';
9
10
 
@@ -23,19 +24,22 @@ const messages = defineMessages({
23
24
  */
24
25
  const Sponsor = ({ item }) => {
25
26
  const Image = config.getComponent({ name: 'Image' }).component;
26
- const image =
27
- item?.image &&
28
- Image({
29
- item: item,
30
- sizes: '600px',
31
- loading: 'lazy',
32
- className: 'img-fluid',
33
- alt: item.image.filename ?? item.title,
34
- });
27
+ const showImage = contentHasImage(item);
28
+
35
29
  return item ? (
36
30
  <div className="sponsor-item">
37
31
  <UniversalLink href={item.remoteUrl}>
38
- {image ? image : item.title}
32
+ {showImage ? (
33
+ <Image
34
+ item={item}
35
+ sizes="600px"
36
+ loading="lazy"
37
+ className="img-fluid"
38
+ alt={item.image.filename ?? item.title}
39
+ />
40
+ ) : (
41
+ item.title
42
+ )}
39
43
  </UniversalLink>
40
44
  </div>
41
45
  ) : null;
@@ -2,6 +2,7 @@ import { defineMessages, useIntl } from 'react-intl';
2
2
  import { Link } from 'react-router-dom';
3
3
  import PropTypes from 'prop-types';
4
4
  import { flattenToAppURL } from '@plone/volto/helpers';
5
+ import { contentHasImage } from 'design-comuni-plone-theme/helpers';
5
6
  import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';
6
7
  import config from '@plone/volto/registry';
7
8
 
@@ -26,13 +27,15 @@ const messages = defineMessages({
26
27
  const Location = ({ location, show_icon }) => {
27
28
  const intl = useIntl();
28
29
  const Image = config.getComponent({ name: 'Image' }).component;
29
- const image = Image({ item: location, loading: 'lazy', sizes: '80px' });
30
+ const showImage = contentHasImage(location);
30
31
  return (
31
32
  location && (
32
- <div className="card card-teaser shadow border-left-card mt-3 rounded location-item">
33
- {show_icon && <Icon icon={'it-pin'} />}
33
+ <div className="card card-teaser shadow border-left-card mt-3 card-small rounded location-item">
34
34
  <div className="card-body">
35
- <div className="card-title h5">{location.title}</div>
35
+ <div className="card-title h5">
36
+ {show_icon && <Icon icon={'it-pin'} />}
37
+ {location.title}
38
+ </div>
36
39
  <div className="card-text">
37
40
  {(location.street || location.zip_code) && (
38
41
  <p>
@@ -51,7 +54,11 @@ const Location = ({ location, show_icon }) => {
51
54
  </p>
52
55
  </div>
53
56
  </div>
54
- {image && <div className="avatar size-xl">{image}</div>}
57
+ {showImage && (
58
+ <div className="avatar size-lg">
59
+ <Image item={location} loading="lazy" sizes="80px" />
60
+ </div>
61
+ )}
55
62
  </div>
56
63
  )
57
64
  );
@@ -65,7 +72,7 @@ const Location = ({ location, show_icon }) => {
65
72
  */
66
73
  const VenuesSmall = ({ venues, show_icon }) => {
67
74
  return venues ? (
68
- <div className="card-wrapper card-teaser-wrapper">
75
+ <div className="card-wrapper card-teaser-wrapper align-items-stretch">
69
76
  {venues.map((item) => (
70
77
  <Location key={item['@id']} location={item} show_icon={show_icon} />
71
78
  ))}
@@ -5,9 +5,10 @@ import {
5
5
  RichTextSection,
6
6
  ContactsCard,
7
7
  } from 'design-comuni-plone-theme/components/ItaliaTheme/View';
8
- import EventoContattiOrganizzatoreEsterno from 'design-comuni-plone-theme/components/ItaliaTheme/View/EventoView/EventoContattiOrganizzatoreEsterno';
9
- import EventoContattiOrganizzatoreInterno from 'design-comuni-plone-theme/components/ItaliaTheme/View/EventoView/EventoContattiOrganizzatoreInterno';
8
+
10
9
  import EventoContattiSupportatoDa from 'design-comuni-plone-theme/components/ItaliaTheme/View/EventoView/EventoContattiSupportatoDa';
10
+ import EventoOrganizzatoDa from 'design-comuni-plone-theme/components/ItaliaTheme/View/EventoView/EventoOrganizzatoDa';
11
+ import EventoPatrocinatoDa from 'design-comuni-plone-theme/components/ItaliaTheme/View/EventoView/EventoPatrocinatoDa';
11
12
 
12
13
  const messages = defineMessages({
13
14
  contatti: {
@@ -31,14 +32,14 @@ const EventoContatti = ({ content }) => {
31
32
  <ContactsCard contact={contact} key={contact['@id']} />
32
33
  ))}
33
34
 
34
- {/* ---organizzato da esterno */}
35
- <EventoContattiOrganizzatoreEsterno content={content} />
36
-
37
- {/* ---contatti interno */}
38
- <EventoContattiOrganizzatoreInterno content={content} />
35
+ {/* ---organizzato da */}
36
+ <EventoOrganizzatoDa content={content} />
39
37
 
40
38
  {/* ---supportato da */}
41
39
  <EventoContattiSupportatoDa content={content} />
40
+
41
+ {/* ---patrocinato da */}
42
+ <EventoPatrocinatoDa content={content} />
42
43
  </RichTextSection>
43
44
  ) : null;
44
45
  };
@@ -1,5 +1,4 @@
1
1
  import PropTypes from 'prop-types';
2
- import { defineMessages, useIntl } from 'react-intl';
3
2
  import { Card, CardBody } from 'design-react-kit';
4
3
  import {
5
4
  RichText,
@@ -7,22 +6,12 @@ import {
7
6
  ContactLink,
8
7
  } from 'design-comuni-plone-theme/components/ItaliaTheme/View';
9
8
 
10
- const messages = defineMessages({
11
- organizzatore: {
12
- id: 'organizzatore',
13
- defaultMessage: 'Organizzatore',
14
- },
15
- });
16
-
17
9
  const EventoContattiOrganizzatoreEsterno = ({ content }) => {
18
- const intl = useIntl();
19
-
20
10
  return richTextHasContent(content?.organizzato_da_esterno) ||
21
11
  content?.telefono ||
22
12
  content?.email ||
23
13
  content?.fax ? (
24
- <div className="mb-5 mt-3">
25
- <h3 className="h5">{intl.formatMessage(messages.organizzatore)}</h3>
14
+ <div className="mb-5">
26
15
  <Card
27
16
  className="card card-teaser rounded shadow mt-3"
28
17
  noWrapper={true}
@@ -1,23 +1,12 @@
1
1
  import PropTypes from 'prop-types';
2
- import { defineMessages, useIntl } from 'react-intl';
3
2
  import {
4
3
  richTextHasContent,
5
4
  OfficeCard,
6
5
  } from 'design-comuni-plone-theme/components/ItaliaTheme/View';
7
6
 
8
- const messages = defineMessages({
9
- organizzato_da: {
10
- id: 'organizzato_da',
11
- defaultMessage: 'Organizzato da',
12
- },
13
- });
14
-
15
7
  const EventoContattiOrganizzatoreInterno = ({ content }) => {
16
- const intl = useIntl();
17
-
18
8
  return content?.organizzato_da_interno?.length > 0 ? (
19
- <div className="mb-5">
20
- <h3 className="h5">{intl.formatMessage(messages.organizzato_da)}</h3>
9
+ <div className="mb-3">
21
10
  {content?.organizzato_da_interno?.map((item, index) => (
22
11
  <OfficeCard
23
12
  margin_bottom={index < content?.organizzato_da_interno?.length - 1}
@@ -0,0 +1,38 @@
1
+ import { defineMessages, useIntl } from 'react-intl';
2
+ import { richTextHasContent } from 'design-comuni-plone-theme/components/ItaliaTheme/View';
3
+ import EventoContattiOrganizzatoreInterno from 'design-comuni-plone-theme/components/ItaliaTheme/View/EventoView/EventoContattiOrganizzatoreInterno';
4
+ import EventoContattiOrganizzatoreEsterno from 'design-comuni-plone-theme/components/ItaliaTheme/View/EventoView/EventoContattiOrganizzatoreEsterno';
5
+
6
+ const messages = defineMessages({
7
+ organizzato_da: {
8
+ id: 'organizzato_da',
9
+ defaultMessage: 'Organizzato da',
10
+ },
11
+ });
12
+
13
+ const EventoOrganizzatoDa = ({ content }) => {
14
+ const intl = useIntl();
15
+
16
+ return content?.organizzato_da_interno?.length > 0 ||
17
+ richTextHasContent(content?.organizzato_da_esterno) ||
18
+ content?.telefono ||
19
+ content?.email ||
20
+ content?.fax ? (
21
+ <div className="mb-5 mt-3">
22
+ <h3 className="h5 mb-3">{intl.formatMessage(messages.organizzato_da)}</h3>
23
+
24
+ {content?.organizzato_da_interno.length > 0 && (
25
+ <EventoContattiOrganizzatoreInterno content={content} />
26
+ )}
27
+
28
+ {(richTextHasContent(content?.organizzato_da_esterno) ||
29
+ content?.telefono ||
30
+ content?.email ||
31
+ content?.fax) && (
32
+ <EventoContattiOrganizzatoreEsterno content={content} />
33
+ )}
34
+ </div>
35
+ ) : null;
36
+ };
37
+
38
+ export default EventoOrganizzatoDa;
@@ -0,0 +1,38 @@
1
+ import { defineMessages, useIntl } from 'react-intl';
2
+ import { Card, CardBody } from 'design-react-kit';
3
+
4
+ import {
5
+ richTextHasContent,
6
+ RichText,
7
+ } from 'design-comuni-plone-theme/components/ItaliaTheme/View';
8
+
9
+ const messages = defineMessages({
10
+ patrocinato_da: {
11
+ id: 'patrocinato_da',
12
+ defaultMessage: 'Patrocinato da',
13
+ },
14
+ });
15
+
16
+ const EventoPatrocinatoDa = ({ content }) => {
17
+ const intl = useIntl();
18
+ return richTextHasContent(content?.patrocinato_da) ? (
19
+ <div className="mb-5">
20
+ <h3 className="mt-4 patrocinato-da h5">
21
+ {intl.formatMessage(messages.patrocinato_da)}
22
+ </h3>
23
+ <Card
24
+ className="card card-teaser rounded shadow mt-3"
25
+ noWrapper={true}
26
+ tag="div"
27
+ >
28
+ <CardBody tag="div" className={'card-body pe-3'}>
29
+ <div className="mb-5">
30
+ <RichText data={content?.patrocinato_da} />
31
+ </div>
32
+ </CardBody>
33
+ </Card>
34
+ </div>
35
+ ) : null;
36
+ };
37
+
38
+ export default EventoPatrocinatoDa;
@@ -6,7 +6,6 @@ import { defineMessages, useIntl } from 'react-intl';
6
6
  import { UniversalLink } from '@plone/volto/components';
7
7
  import {
8
8
  richTextHasContent,
9
- RichText,
10
9
  Metadata,
11
10
  HelpBox,
12
11
  GenericCard,
@@ -51,18 +50,6 @@ const EventoUlterioriInformazioni = ({ content }) => {
51
50
  </UniversalLink>
52
51
  </div>
53
52
  )}
54
- {richTextHasContent(content?.patrocinato_da) && (
55
- <div className="mt-4">
56
- {richTextHasContent(content?.patrocinato_da) && (
57
- <div className="mb-5">
58
- <RichText
59
- title={intl.formatMessage(messages.patrocinato_da)}
60
- data={content?.patrocinato_da}
61
- />
62
- </div>
63
- )}
64
- </div>
65
- )}
66
53
  {content?.strutture_politiche?.length > 0 && (
67
54
  <div className="mt-4">
68
55
  <h3 className="h5">
@@ -91,11 +78,6 @@ EventoUlterioriInformazioni.propTypes = {
91
78
  ulteriori_informazioni: PropTypes.shape({
92
79
  data: PropTypes.string,
93
80
  }),
94
- patrocinato_da: PropTypes.shape({
95
- 'content-type': PropTypes.string,
96
- data: PropTypes.string,
97
- encoding: PropTypes.string,
98
- }),
99
81
  strutture_politiche: PropTypes.array,
100
82
  items: PropTypes.array,
101
83
  }).isRequired,
@@ -16,6 +16,7 @@ const messages = defineMessages({
16
16
 
17
17
  const NewsItemText = ({ content }) => {
18
18
  const intl = useIntl();
19
+ if (typeof content !== 'object') return null;
19
20
 
20
21
  // NewsItem ha la descrizione_estesa (testo con blocchi)
21
22
  // altri CT (come i Comunicati Stampa) potrebbero avere `text`
@@ -92,6 +92,10 @@ const messages = defineMessages({
92
92
  id: 'dropdown_indicator',
93
93
  defaultMessage: 'Apri il menu',
94
94
  },
95
+ SelectInput_default_label: {
96
+ id: 'SelectInput_default_label',
97
+ defaultMessage: "Seleziona un'opzione",
98
+ },
95
99
  });
96
100
 
97
101
  const SelectContainer = injectLazyLibs('reactSelect')(({
@@ -313,14 +317,15 @@ const SelectInput = ({
313
317
  options,
314
318
  components = {},
315
319
  reactSelect,
320
+ labelledby,
316
321
  defaultValue,
317
322
  }) => {
318
323
  const intl = useIntl();
324
+ const labelDefined =
325
+ label || intl.formatMessage(messages.SelectInput_default_label);
319
326
  const Select = reactSelect.default;
320
327
  return (
321
328
  <div className="bootstrap-select-wrapper">
322
- {label && <label htmlFor={id}>{label}</label>}
323
-
324
329
  <Select
325
330
  components={{
326
331
  MenuList,
@@ -341,9 +346,9 @@ const SelectInput = ({
341
346
  isSearchable={isSearchable}
342
347
  isMulti={isMulti}
343
348
  isClearable={isClearable}
344
- aria-label={label}
349
+ aria-label={labelDefined}
350
+ aria-labelledby={labelledby}
345
351
  aria-live="polite"
346
- aria-labelledby={id}
347
352
  ariaLiveMessages={getSelectAriaLiveMessages(intl)}
348
353
  noOptionsMessage={() =>
349
354
  intl.formatMessage(messages.select_noOptionsMessage)
@@ -10,7 +10,7 @@ const messages = defineMessages({
10
10
  show_pdf_desc: {
11
11
  id: 'show_pdf_desc',
12
12
  defaultMessage:
13
- "Permette di aprire l'anteprima di tutti i PDF di questo elenco in una tab separata altrimenti vengono scaricati.",
13
+ "Permette di aprire l'anteprima di tutti i PDF di questo elenco in una tab separata. Se non impostato, i PDF vengono scaricati.",
14
14
  },
15
15
  });
16
16
 
@@ -5,6 +5,7 @@
5
5
  * CUSTOMIZATIONS:
6
6
  * - aggiunto icona per link esterni
7
7
  * - aggiunto title informativo per link esterni
8
+ * - aggiunta la condizione su @@display-file e @download-file per gestire i casi in cui questi parametri vengono imposti a monte
8
9
  */
9
10
 
10
11
  import React from 'react';
@@ -59,18 +60,21 @@ const UniversalLink = ({
59
60
  }
60
61
 
61
62
  //case: item of type 'File'
62
- if (
63
- !token &&
64
- config.settings.downloadableObjects.includes(item['@type'])
65
- ) {
66
- url = `${url}/@@download/file`;
67
- }
63
+ if (!url.includes('@@download') && !url.includes('@@display-file')) {
64
+ //se non è gia stato aggiunto il suffisso per il download nell'@id dell'item
65
+ if (
66
+ !token &&
67
+ config.settings.downloadableObjects.includes(item['@type'])
68
+ ) {
69
+ url = `${url}/@@download/file`;
70
+ }
68
71
 
69
- if (
70
- !token &&
71
- config.settings.viewableInBrowserObjects.includes(item['@type'])
72
- ) {
73
- url = `${url}/@@display-file/file`;
72
+ if (
73
+ !token &&
74
+ config.settings.viewableInBrowserObjects.includes(item['@type'])
75
+ ) {
76
+ url = `${url}/@@display-file/file`;
77
+ }
74
78
  }
75
79
  }
76
80
  }
@@ -10,6 +10,7 @@ import PropTypes from 'prop-types';
10
10
  import { Link } from 'react-router-dom';
11
11
  import { PageHeader } from 'design-comuni-plone-theme/components/ItaliaTheme/View';
12
12
  import { ListingImage } from 'design-comuni-plone-theme/components/ItaliaTheme';
13
+ import { contentHasImage } from 'design-comuni-plone-theme/helpers';
13
14
 
14
15
  /**
15
16
  * List view component class.
@@ -23,8 +24,7 @@ const ListingView = ({ content }) => (
23
24
  <PageHeader content={content} />
24
25
  <section id="content-core">
25
26
  {content.items.map((item) => {
26
- const image = ListingImage({ item });
27
-
27
+ const hasImage = contentHasImage(item);
28
28
  return (
29
29
  <div key={item.url} className="listing-item my-4">
30
30
  <div>
@@ -35,7 +35,7 @@ const ListingView = ({ content }) => (
35
35
  </h2>
36
36
  {item.description && <p>{item.description}</p>}
37
37
  </div>
38
- {image && <>{image}</>}
38
+ {hasImage && <ListingImage item={item} />}
39
39
  </div>
40
40
  );
41
41
  })}
@@ -50,4 +50,28 @@ const useFallbackImageSrc = ({
50
50
  return { currentSrc, handleError, getFallbackImageStyle };
51
51
  };
52
52
 
53
- export { FALLBACK_IMAGE_SRC, FALLBACK_IMAGE_SRC_MAX_W, useFallbackImageSrc };
53
+ /*
54
+ Check if a Content item has a related image
55
+ This check is done on image_field and image_scales fields, which are
56
+ the default fields in a JSON response for a content in plone.restapi
57
+
58
+ @param {Object} item - The Plone item/brain/content
59
+ */
60
+ const contentHasImage = (item) => {
61
+ if (!item) return false;
62
+ const isFromRealObject = !item.image_scales;
63
+ const imageFieldWithDefault = item.image_field || 'image';
64
+
65
+ const image = isFromRealObject
66
+ ? item[imageFieldWithDefault]
67
+ : item.image_scales[imageFieldWithDefault]?.[0];
68
+
69
+ return Boolean(image);
70
+ };
71
+
72
+ export {
73
+ FALLBACK_IMAGE_SRC,
74
+ FALLBACK_IMAGE_SRC_MAX_W,
75
+ useFallbackImageSrc,
76
+ contentHasImage,
77
+ };
@@ -59,4 +59,7 @@ export {
59
59
  isResolveUID,
60
60
  } from 'design-comuni-plone-theme/helpers/url';
61
61
  export { usePaginatedItemsSection } from 'design-comuni-plone-theme/helpers/usePaginatedItemsSection.hook.ts';
62
- export { useFallbackImageSrc } from 'design-comuni-plone-theme/helpers/images';
62
+ export {
63
+ useFallbackImageSrc,
64
+ contentHasImage,
65
+ } from 'design-comuni-plone-theme/helpers/images';
@@ -99,4 +99,29 @@ defineMessages({
99
99
  defaultMessage:
100
100
  'As per the official information architecture outlined in measure 1.4.1, all forms must be properly uploaded in the designated section within Amministrazione > Documenti e Dati > Modulistica, and linked to the relevant service sheet. It is no longer possible to upload files and attachments directly into this container.',
101
101
  },
102
+ //table block
103
+ hideHeaders: {
104
+ id: 'Hide headers',
105
+ defaultMessage: 'Hide headers',
106
+ },
107
+ sortable: {
108
+ id: 'Make the table sortable',
109
+ defaultMessage: 'Make the table sortable',
110
+ },
111
+ sortableDescription: {
112
+ id: 'Visible only in view mode',
113
+ defaultMessage: 'Visible only in view mode',
114
+ },
115
+ inverted: {
116
+ id: 'Table color inverted',
117
+ defaultMessage: 'Table color inverted',
118
+ },
119
+ table_block: {
120
+ id: 'Table block',
121
+ defaultMessage: 'Table block',
122
+ },
123
+ divideRows: {
124
+ id: 'Divide each row into separate cells',
125
+ defaultMessage: 'Add border to inner columns',
126
+ },
102
127
  });
@@ -13,6 +13,10 @@
13
13
  display: inline-block;
14
14
  }
15
15
 
16
+ .card-with-image-additional-links a {
17
+ width: auto;
18
+ }
19
+
16
20
  .img-responsive-wrapper {
17
21
  width: inherit;
18
22
 
@@ -89,6 +89,15 @@
89
89
  }
90
90
  }
91
91
  }
92
+
93
+ @media (max-width: #{map-get($grid-breakpoints, md)}) {
94
+ > .row {
95
+ gap: 1em;
96
+ > .col {
97
+ flex: 1 0 100%;
98
+ }
99
+ }
100
+ }
92
101
  }
93
102
 
94
103
  body.cms-ui.has-toolbar.has-sidebar {