design-comuni-plone-theme 8.7.12 → 8.8.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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
 
2
2
 
3
+ ## [8.8.0](https://github.com/redturtle/design-comuni-plone-theme/compare/v8.7.12...v8.8.0) (2023-10-31)
4
+
5
+
6
+ ### Features
7
+
8
+ * added id and title_it adttrs and handled h2 title_type in Gallery component ([4d5949e](https://github.com/redturtle/design-comuni-plone-theme/commit/4d5949eb2393f442e6541637e89123153606279e))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * fixed image url in Photogallery listing popup ([#383](https://github.com/redturtle/design-comuni-plone-theme/issues/383)) ([b8d2e20](https://github.com/redturtle/design-comuni-plone-theme/commit/b8d2e207cdefd018824229975ac0f5ac0bdb8d0c))
14
+
15
+
16
+ ### Maintenance
17
+
18
+ * preparing release ([2e6d0a5](https://github.com/redturtle/design-comuni-plone-theme/commit/2e6d0a56ddd96ecbf48e68e03fcc3caf061ceb55))
19
+
3
20
  ## [8.7.12](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v8.7.11...v8.7.12) (2023-10-27)
4
21
 
5
22
 
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": "8.7.12",
5
+ "version": "8.8.0",
6
6
  "main": "src/index.js",
7
7
  "keywords": [
8
8
  "volto-addon",
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: '2023-10-27'
230
+ releaseDate: '2023-10-31'
231
231
  softwareType: standalone/web
232
- softwareVersion: 8.7.12
232
+ softwareVersion: 8.8.0
233
233
  url: 'https://github.com/italia/design-comuni-plone-theme'
234
234
  usedBy:
235
235
  - ASP Comuni Modenesi Area Nord
@@ -10,8 +10,6 @@ import {
10
10
  } from 'design-comuni-plone-theme/components/ItaliaTheme';
11
11
  import React, { useRef, useState } from 'react';
12
12
  import { defineMessages, useIntl } from 'react-intl';
13
-
14
- import DefaultImageSVG from '@plone/volto/components/manage/Blocks/Listing/default-image.svg';
15
13
  import { GalleryPreview } from 'design-comuni-plone-theme/components/ItaliaTheme';
16
14
  import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';
17
15
  import PropTypes from 'prop-types';
@@ -139,12 +137,14 @@ const PhotogalleryTemplate = ({
139
137
 
140
138
  const getCaption = (item) => item.description ?? item.rights ?? null;
141
139
 
142
- const figure = (image, item) => (
143
- <figure className="img-wrapper">
144
- {image ? <>{image}</> : <img src={DefaultImageSVG} alt="" />}
145
- {getCaption(item) && <figcaption>{getCaption(item)}</figcaption>}
146
- </figure>
147
- );
140
+ const figure = (image, item) => {
141
+ return (
142
+ <figure className="img-wrapper">
143
+ {image}
144
+ {getCaption(item) && <figcaption>{getCaption(item)}</figcaption>}
145
+ </figure>
146
+ );
147
+ };
148
148
 
149
149
  return (
150
150
  <div className="photogallery">
@@ -3,7 +3,6 @@ import { defineMessages, useIntl } from 'react-intl';
3
3
  import { flattenToAppURL } from '@plone/volto/helpers';
4
4
 
5
5
  import PropTypes from 'prop-types';
6
-
7
6
  import { Modal, ModalBody, Button, ModalHeader } from 'design-react-kit';
8
7
  import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';
9
8
  import DefaultImageSVG from '@plone/volto/components/manage/Blocks/Listing/default-image.svg';
@@ -34,6 +33,10 @@ const GalleryPreview = ({ id, viewIndex, setViewIndex, items }) => {
34
33
  const intl = useIntl();
35
34
  const [modalIsOpen, setModalIsOpen] = useState(false);
36
35
 
36
+ const checkUrlImage =
37
+ items[viewIndex]?.image?.scales?.larger?.download ||
38
+ items[viewIndex]?.image_scales?.image[0]?.scales?.larger?.download;
39
+
37
40
  const closeModal = () => {
38
41
  setViewIndex(null);
39
42
  };
@@ -92,11 +95,9 @@ const GalleryPreview = ({ id, viewIndex, setViewIndex, items }) => {
92
95
  </Button>
93
96
  )}
94
97
  <div className="image">
95
- {items[viewIndex].image ? (
98
+ {checkUrlImage ? (
96
99
  <img
97
- src={flattenToAppURL(
98
- items[viewIndex].image.scales.larger.download,
99
- )}
100
+ src={flattenToAppURL(checkUrlImage)}
100
101
  loading="lazy"
101
102
  alt={items[viewIndex].title}
102
103
  />
@@ -36,8 +36,10 @@ const messages = defineMessages({
36
36
  const Gallery = ({
37
37
  content,
38
38
  folder_name,
39
+ id = '',
39
40
  title,
40
41
  title_type = 'h4',
42
+ title_id = 'galleria',
41
43
  title_video,
42
44
  className = '',
43
45
  reactSlick,
@@ -121,12 +123,23 @@ const Gallery = ({
121
123
  {images?.length > 0 ? (
122
124
  <div
123
125
  className={`it-carousel-wrapper it-carousel-landscape-abstract-three-cols ${className}`}
126
+ id={id}
124
127
  >
125
128
  <div className="slider-container">
126
129
  <div className="it-header-block">
127
130
  <div className="it-header-block-title">
128
- {title_type === 'h4' && <h4 id="galleria">{gallery_title}</h4>}
129
- {title_type === 'h5' && <h5 id="galleria">{gallery_title}</h5>}
131
+ {title_type === 'h2' && (
132
+ <h2 id={title_id} className="mb-3 h4">
133
+ {gallery_title}
134
+ </h2>
135
+ )}
136
+ {title_type === 'h3' && (
137
+ <h3 id={title_id} className="h5">
138
+ {gallery_title}
139
+ </h3>
140
+ )}
141
+ {title_type === 'h4' && <h4 id={title_id}>{gallery_title}</h4>}
142
+ {title_type === 'h5' && <h5 id={title_id}>{gallery_title}</h5>}
130
143
  </div>
131
144
  </div>
132
145
  <div className="it-carousel-all it-card-bg">
@@ -294,6 +294,11 @@ div.sticky-wrapper {
294
294
  }
295
295
  }
296
296
 
297
+ #view .it-carousel-wrapper .it-header-block .it-header-block-title h2.h4 {
298
+ border-bottom: none;
299
+ padding-bottom: 0;
300
+ }
301
+
297
302
  form.ui.form.vertical-form fieldset.invisible {
298
303
  min-width: 0;
299
304
  }