Skip to content

Commit

Permalink
Merge branch 'main' into upgrade_volto_17.3_v3
Browse files Browse the repository at this point in the history
  • Loading branch information
mamico authored Oct 31, 2023
2 parents 668d98e + 080416c commit 4cabb5d
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 19 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@


## [8.8.0](https://github.com/redturtle/design-comuni-plone-theme/compare/v8.7.12...v8.8.0) (2023-10-31)


### Features

* 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))


### Bug Fixes

* 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))


### Maintenance

* preparing release ([2e6d0a5](https://github.com/redturtle/design-comuni-plone-theme/commit/2e6d0a56ddd96ecbf48e68e03fcc3caf061ceb55))

## [8.7.12](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v8.7.11...v8.7.12) (2023-10-27)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "design-comuni-plone-theme",
"description": "Volto Theme for Italia design guidelines",
"license": "GPL-v3",
"version": "8.7.12",
"version": "8.8.0",
"main": "src/index.js",
"keywords": [
"volto-addon",
Expand Down
4 changes: 2 additions & 2 deletions publiccode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ maintenance:
name: io-Comune - Il sito AgID per Comuni ed Enti Pubblici
platforms:
- web
releaseDate: '2023-10-27'
releaseDate: '2023-10-31'
softwareType: standalone/web
softwareVersion: 8.7.12
softwareVersion: 8.8.0
url: 'https://github.com/italia/design-comuni-plone-theme'
usedBy:
- ASP Comuni Modenesi Area Nord
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import {
} from 'design-comuni-plone-theme/components/ItaliaTheme';
import React, { useRef, useState } from 'react';
import { defineMessages, useIntl } from 'react-intl';

import DefaultImageSVG from '@plone/volto/components/manage/Blocks/Listing/default-image.svg';
import { GalleryPreview } from 'design-comuni-plone-theme/components/ItaliaTheme';
import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';
import PropTypes from 'prop-types';
Expand Down Expand Up @@ -142,12 +140,14 @@ const PhotogalleryTemplate = ({

const getCaption = (item) => item.description ?? item.rights ?? null;

const figure = (image, item) => (
<figure className="img-wrapper volto-image responsive">
{image ? <>{image}</> : <img src={DefaultImageSVG} alt="" />}
{getCaption(item) && <figcaption>{getCaption(item)}</figcaption>}
</figure>
);
const figure = (image, item) => {
return (
<figure className="img-wrapper volto-image responsive">
{image}
{getCaption(item) && <figcaption>{getCaption(item)}</figcaption>}
</figure>
);
};

return (
<div className="photogallery">
Expand Down
11 changes: 6 additions & 5 deletions src/components/ItaliaTheme/GalleryPreview/GalleryPreview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { defineMessages, useIntl } from 'react-intl';
import { flattenToAppURL } from '@plone/volto/helpers';

import PropTypes from 'prop-types';

import { Modal, ModalBody, Button, ModalHeader } from 'design-react-kit';
import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';
import DefaultImageSVG from '@plone/volto/components/manage/Blocks/Listing/default-image.svg';
Expand Down Expand Up @@ -34,6 +33,10 @@ const GalleryPreview = ({ id, viewIndex, setViewIndex, items }) => {
const intl = useIntl();
const [modalIsOpen, setModalIsOpen] = useState(false);

const checkUrlImage =
items[viewIndex]?.image?.scales?.larger?.download ||
items[viewIndex]?.image_scales?.image[0]?.scales?.larger?.download;

const closeModal = () => {
setViewIndex(null);
};
Expand Down Expand Up @@ -92,11 +95,9 @@ const GalleryPreview = ({ id, viewIndex, setViewIndex, items }) => {
</Button>
)}
<div className="image">
{items[viewIndex].image ? (
{checkUrlImage ? (
<img
src={flattenToAppURL(
items[viewIndex].image.scales.larger.download,
)}
src={flattenToAppURL(checkUrlImage)}
loading="lazy"
alt={items[viewIndex].title}
/>
Expand Down
17 changes: 15 additions & 2 deletions src/components/ItaliaTheme/View/Commons/Gallery.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ const messages = defineMessages({
const Gallery = ({
content,
folder_name,
id = '',
title,
title_type = 'h4',
title_id = 'galleria',
title_video,
className = '',
reactSlick,
Expand Down Expand Up @@ -121,12 +123,23 @@ const Gallery = ({
{images?.length > 0 ? (
<div
className={`it-carousel-wrapper it-carousel-landscape-abstract-three-cols ${className}`}
id={id}
>
<div className="slider-container">
<div className="it-header-block">
<div className="it-header-block-title">
{title_type === 'h4' && <h4 id="galleria">{gallery_title}</h4>}
{title_type === 'h5' && <h5 id="galleria">{gallery_title}</h5>}
{title_type === 'h2' && (
<h2 id={title_id} className="mb-3 h4">
{gallery_title}
</h2>
)}
{title_type === 'h3' && (
<h3 id={title_id} className="h5">
{gallery_title}
</h3>
)}
{title_type === 'h4' && <h4 id={title_id}>{gallery_title}</h4>}
{title_type === 'h5' && <h5 id={title_id}>{gallery_title}</h5>}
</div>
</div>
<div className="it-carousel-all it-card-bg">
Expand Down
5 changes: 5 additions & 0 deletions src/theme/ItaliaTheme/Views/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,11 @@ div.sticky-wrapper {
}
}

#view .it-carousel-wrapper .it-header-block .it-header-block-title h2.h4 {
border-bottom: none;
padding-bottom: 0;
}

form.ui.form.vertical-form fieldset.invisible {
min-width: 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/theme/ItaliaTheme/Views/_slider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
ul.slick-dots {
bottom: unset;
padding: 0;
margin: 1.5rem 0 0;
margin: 0 0 0;

li {
button:before {
Expand Down

0 comments on commit 4cabb5d

Please sign in to comment.