Skip to content

Commit

Permalink
Merge branch 'main' into update_volto_blocks_widget_
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliaghisini authored Dec 20, 2024
2 parents 6b831df + a3815f3 commit 71a8382
Show file tree
Hide file tree
Showing 25 changed files with 233 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
build-args: |
ADDON_NAME=design-comuni-plone-theme
ADDON_PATH=design-comuni-plone-theme
VOLTO_VERSION=17.19.0
VOLTO_VERSION=17.20.3
# - name: Deploy to rancher
# uses: redturtle/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
build-args: |
ADDON_NAME=design-comuni-plone-theme
ADDON_PATH=design-comuni-plone-theme
VOLTO_VERSION=17.19.0
VOLTO_VERSION=17.20.3
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ jobs:
build-args: |
ADDON_NAME=design-comuni-plone-theme
ADDON_PATH=design-comuni-plone-theme
VOLTO_VERSION=17.19.0
VOLTO_VERSION=17.20.3
2 changes: 1 addition & 1 deletion .github/workflows/withnewsletter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
build-args: |
ADDON_NAME=design-comuni-plone-theme
ADDON_PATH=design-comuni-plone-theme
VOLTO_VERSION=17.19.0
VOLTO_VERSION=17.20.3
- name: Deploy to rancher
uses: redturtle/[email protected]
Expand Down
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# Changelog

## [12.0.0-alpha.32](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v12.0.0-alpha.31...v12.0.0-alpha.32) (2024-12-16)


### Bug Fixes

* enable ImageWithErrors to return null value ([#841](https://github.com/RedTurtle/design-comuni-plone-theme/issues/841)) ([556158c](https://github.com/RedTurtle/design-comuni-plone-theme/commit/556158c86aceda40f2b6494067f67390088ab72a))


### Maintenance

* upgrade to volto 17.20.3 ([57589e3](https://github.com/RedTurtle/design-comuni-plone-theme/commit/57589e316665d360e43772000e8c104c60171d41))


### Documentation

* updated publiccode ([1830541](https://github.com/RedTurtle/design-comuni-plone-theme/commit/1830541fb10ea74e976dc2b7d3cd435d3f803500))

## [12.0.0-alpha.31](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v12.0.0-alpha.30...v12.0.0-alpha.31) (2024-12-12)


### Bug Fixes

* translations ([20e5ef8](https://github.com/RedTurtle/design-comuni-plone-theme/commit/20e5ef87c76776385581ac478cce1096301ba05e))


### Documentation

* updated publiccode and release log ([0e2f1ff](https://github.com/RedTurtle/design-comuni-plone-theme/commit/0e2f1ff427e5fe36f13843dd484c2e154602951d))

## [12.0.0-alpha.30](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v12.0.0-alpha.29...v12.0.0-alpha.30) (2024-11-28)


Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ CURRENT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
# ADDON ?= "design-comuni-plone-theme"

PLONE_VERSION=6
VOLTO_VERSION=17.19.0
VOLTO_VERSION=17.20.3

ADDON_NAME='design-comuni-plone-theme'
ADDON_PATH='design-comuni-plone-theme'
Expand Down
31 changes: 25 additions & 6 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,26 @@
- ...
-->

## Versione X.X.X (dd/mm/yyyy)

### Migliorie

- Se vengono aggiunte o rimosse date dalla ricorrenza di un CT evento, nel sottotitolo viene aggiunta l'indicazione di controllare le eccezioni nella sezione apposita.

### Novità

- ...

### Fix

- Rimossa l'opzione non selezionabile "nessun valore" dal widget ricorrenza.

## Versione 11.25.3 (12/12/2024)

### Migliorie

- Aggiornate diverse traduzioni italiane.

## Versione 11.25.1 (28/11/2024)

### Fix
Expand All @@ -54,7 +74,6 @@
- Rimossa dal CT Evento la data di scadenza del CT per evitare confusione con le date effettive dell'evento
- Durante la ricerca nel sito dalla popup che compare cliccando sul bottone 'Cerca' nella testa del sito, viene mostrato un loader in overlay durante il caricamento della pagina dei risultati perchè questo potrebbe richiedere un po' di tempo. Prima di questa modifica non era chiaro se la ricerca fosse iniziata.
- Nel CT Evento per una rassegna, se gli eventi figli hanno una ricorrenza o un periodo di date impostato, il range di date verrà mostrato nella card all'interno dell'evento padre.
- uniformato il colore dei link tra modalità di edit e view in alcuni blocchi
- Se l'url di una immagine è rotto, viene mostrato un avviso al posto dell'immagine rotta.

### Novità
Expand Down Expand Up @@ -129,7 +148,7 @@

### Fix

- Rimosso il campo "ID lighthouse" dal blocco elenco con variazione Card con Testo Animato perchè entra in contrasto con asseveratore.
- Rimosso il campo "ID lighthouse" dal blocco elenco con variazione Card con Testo Animato perchè entra in contrasto con asseveratore

## Versione 11.22.0 (05/09/2024)

Expand Down Expand Up @@ -244,16 +263,16 @@

## Versione 11.12.6 (30/05/2024)

### Novità

- Per ragioni di conformità alle linee guida Agid, inibito l'inserimento di CT File nella cartella modulistica.

### Fix

- Il layout delle card con immagini rimane corretto anche selezionando l'opzione "Non alterare le dimensioni naturali dell'immagine".

## Versione 11.12.5 (30/05/2024)

### Novità

- Per ragioni di conformità alle linee guida Agid, inibito l'inserimento di CT File nella cartella modulistica.

### Fix

- Sistemato il layout "Card con immagine" dei blocchi elenco quando gli elementi non hanno immagine.
Expand Down
5 changes: 5 additions & 0 deletions locales/de/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2070,6 +2070,11 @@ msgstr ""
msgid "exceeded_chars"
msgstr ""

#: components/ItaliaTheme/View/Commons/PageHeader/PageHeaderEventDates
# defaultMessage: con alcune eccezioni. Per maggiori informazioni controllare la sezione dedicata.
msgid "exceptionDates"
msgstr ""

#: components/ItaliaTheme/View/Commons/PageHeader/PageHeaderDates
# defaultMessage: Scadenza
msgid "expire"
Expand Down
5 changes: 5 additions & 0 deletions locales/en/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2055,6 +2055,11 @@ msgstr "Read more"
msgid "exceeded_chars"
msgstr ""

#: components/ItaliaTheme/View/Commons/PageHeader/PageHeaderEventDates
# defaultMessage: con alcune eccezioni. Per maggiori informazioni controllare la sezione dedicata.
msgid "exceptionDates"
msgstr "with some exceptions. Please see the dedicated section for more information."

#: components/ItaliaTheme/View/Commons/PageHeader/PageHeaderDates
# defaultMessage: Scadenza
msgid "expire"
Expand Down
5 changes: 5 additions & 0 deletions locales/es/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2064,6 +2064,11 @@ msgstr ""
msgid "exceeded_chars"
msgstr "El texto excede la longitud recomendada"

#: components/ItaliaTheme/View/Commons/PageHeader/PageHeaderEventDates
# defaultMessage: con alcune eccezioni. Per maggiori informazioni controllare la sezione dedicata.
msgid "exceptionDates"
msgstr ""

#: components/ItaliaTheme/View/Commons/PageHeader/PageHeaderDates
# defaultMessage: Scadenza
msgid "expire"
Expand Down
5 changes: 5 additions & 0 deletions locales/fr/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2072,6 +2072,11 @@ msgstr ""
msgid "exceeded_chars"
msgstr ""

#: components/ItaliaTheme/View/Commons/PageHeader/PageHeaderEventDates
# defaultMessage: con alcune eccezioni. Per maggiori informazioni controllare la sezione dedicata.
msgid "exceptionDates"
msgstr ""

#: components/ItaliaTheme/View/Commons/PageHeader/PageHeaderDates
# defaultMessage: Scadenza
msgid "expire"
Expand Down
5 changes: 5 additions & 0 deletions locales/it/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2055,6 +2055,11 @@ msgstr "Leggi di più"
msgid "exceeded_chars"
msgstr "Il testo supera la lunghezza consigliata perciò verrà tagliato."

#: components/ItaliaTheme/View/Commons/PageHeader/PageHeaderEventDates
# defaultMessage: con alcune eccezioni. Per maggiori informazioni controllare la sezione dedicata.
msgid "exceptionDates"
msgstr "con alcune eccezioni. Per maggiori informazioni controllare la sezione dedicata."

#: components/ItaliaTheme/View/Commons/PageHeader/PageHeaderDates
# defaultMessage: Scadenza
msgid "expire"
Expand Down
7 changes: 6 additions & 1 deletion locales/volto.pot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Plone\n"
"POT-Creation-Date: 2024-11-25T15:31:18.424Z\n"
"POT-Creation-Date: 2024-12-12T10:59:56.243Z\n"
"Last-Translator: Plone i18n <[email protected]>\n"
"Language-Team: Plone i18n <[email protected]>\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -2057,6 +2057,11 @@ msgstr ""
msgid "exceeded_chars"
msgstr ""

#: components/ItaliaTheme/View/Commons/PageHeader/PageHeaderEventDates
# defaultMessage: con alcune eccezioni. Per maggiori informazioni controllare la sezione dedicata.
msgid "exceptionDates"
msgstr ""

#: components/ItaliaTheme/View/Commons/PageHeader/PageHeaderDates
# defaultMessage: Scadenza
msgid "expire"
Expand Down
4 changes: 2 additions & 2 deletions 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": "12.0.0-alpha.30",
"version": "12.0.0-alpha.32",
"main": "src/index.js",
"repository": {
"type": "git",
Expand Down Expand Up @@ -202,7 +202,7 @@
"stylelint-prettier": "4.0.2"
},
"peerDependencies": {
"@plone/volto": "17.19.0"
"@plone/volto": "17.20.3"
},
"packageManager": "[email protected]"
}
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: '2024-11-28'
releaseDate: '2024-12-16'
softwareType: standalone/web
softwareVersion: 11.25.2
softwareVersion: 11.25.4
url: 'https://github.com/italia/design-comuni-plone-theme'
usedBy:
- ASP Comuni Modenesi Area Nord
Expand Down
22 changes: 11 additions & 11 deletions src/components/ImageWithErrors/ImageWithErrors.jsx

Large diffs are not rendered by default.

21 changes: 10 additions & 11 deletions src/components/ItaliaTheme/View/Commons/Dates.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import { rrulei18n } from '@plone/volto/components/manage/Widgets/RecurrenceWidg
import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
import { Card, CardTitle, CardBody } from 'design-react-kit';
import PropTypes from 'prop-types';
import { viewDate, getRealEventEnd } from 'design-comuni-plone-theme/helpers';
import {
viewDate,
getRealEventEnd,
getRecurrenceExceptionDates,
} from 'design-comuni-plone-theme/helpers';

const messages = defineMessages({
start: {
Expand Down Expand Up @@ -87,14 +91,9 @@ const Dates = ({ content, show_image, moment: momentlib, rrule }) => {
const end = viewDate(intl.locale, actualEndDate);
const openEnd = content?.open_end;
const wholeDay = content?.whole_day;
const rdates = rruleSet?.rdates() ?? [];
const exdates = rruleSet?.exdates() ?? [];
const additionalDates = rdates.reduce((acc, curr) => {
const isExdate = exdates.some((b) => b.toString() === curr.toString());
if (!isExdate) {
return [...acc, curr];
} else return acc;
}, []);

const { additionalDates, removedDates } =
getRecurrenceExceptionDates(rruleSet);

return content ? (
<>
Expand Down Expand Up @@ -172,10 +171,10 @@ const Dates = ({ content, show_image, moment: momentlib, rrule }) => {
))}
</div>
)}
{exdates.length > 0 && (
{removedDates.length > 0 && (
<div className="mt-4">
<h5>{intl.formatMessage(messages.excluded_dates)}</h5>
{exdates.map((exDate) => (
{removedDates.map((exDate) => (
<div className="font-serif">
{viewDate(intl.locale, exDate, 'dddd DD MMMM YYYY')}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,21 @@ import PropTypes from 'prop-types';

import { rrulei18n } from '@plone/volto/components/manage/Widgets/RecurrenceWidget/Utils';
import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
import { getRealEventEnd } from 'design-comuni-plone-theme/helpers';
import {
getRealEventEnd,
getRecurrenceExceptionDates,
} from 'design-comuni-plone-theme/helpers';

const messages = defineMessages({
dateStart: {
id: 'dal {dateStart} fino a conclusione',
defaultMessage: 'dal {dateStart} fino a conclusione',
},
exceptionDates: {
id: 'exceptionDates',
defaultMessage:
'con alcune eccezioni. Per maggiori informazioni controllare la sezione dedicata.',
},
});

/**
Expand All @@ -36,7 +44,7 @@ const PageHeaderEventDates = ({ content, moment, rrule }) => {

const actualEndDate = getRealEventEnd(content, rruleSet);

const wholeDay = content?.whole_day;
// const wholeDay = content?.whole_day;
const openEnd = content?.open_end;
// show only start when event starts and ends in same day or if a recurrence is set
// because to set a recurrence, the event must have the same date as start and end date
Expand Down Expand Up @@ -75,6 +83,11 @@ const PageHeaderEventDates = ({ content, moment, rrule }) => {

// format and save date into new variable depending on recurrence of event
const endDate = Moment(actualEndDate).format('DD-MM-Y');

// check if there are exception dates added to the recurrence to add info
const { additionalDates, removedDates } =
getRecurrenceExceptionDates(rruleSet);

return content['@type'] === 'Event' ? (
<p className="h4 py-2">
{!Moment(content.end).isSame(actualEndDate) &&
Expand All @@ -89,7 +102,12 @@ const PageHeaderEventDates = ({ content, moment, rrule }) => {
dateStart: `${Moment(content.start).format('DD-MM-Y')}`,
})}
{eventRecurrenceText && (
<div className="recurrence small">{eventRecurrenceText}</div>
<div className="recurrence small">
<span>{eventRecurrenceText}</span>
{(additionalDates.length > 0 || removedDates.length > 0) && (
<span> {intl.formatMessage(messages.exceptionDates)}</span>
)}
</div>
)}
</p>
) : null;
Expand Down
2 changes: 1 addition & 1 deletion src/config/italiaConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export default function applyConfig(voltoConfig) {
...(config.settings.controlpanels ?? []),
{
'@id': '/release-log',
group: 'Generali',
group: 'General',
title: 'Novità ultimi rilasci',
id: 'release-log',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,7 @@ class RecurrenceWidget extends Component {
)}
value={formValues.freq}
onChange={this.onChangeRule}
noValueOption={false}
/>
{OPTIONS.frequences[formValues.freq].interval && (
<IntervalField
Expand Down
19 changes: 19 additions & 0 deletions src/helpers/dates.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,22 @@ export const getRealEventEnd = (content, rruleSet) => {
}
return actualEndDate;
};

export const getRecurrenceExceptionDates = (rruleSet) => {
const rdates = rruleSet?.rdates() ?? [];
const exdates = rruleSet?.exdates() ?? [];

const additionalDates = rdates.reduce((acc, curr) => {
const isExdate = exdates.some((b) => b.toString() === curr.toString());
if (!isExdate) {
return [...acc, curr];
} else return acc;
}, []);

const exceptionDates = {
additionalDates: additionalDates,
removedDates: exdates,
};

return exceptionDates;
};
1 change: 1 addition & 0 deletions src/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export {
viewDate,
getRealStartAndEndWithRecurrence,
getRealEventEnd,
getRecurrenceExceptionDates,
} from 'design-comuni-plone-theme/helpers/dates';
export { getSiteProperty } from 'design-comuni-plone-theme/helpers/config';
export { useDebouncedEffect } from 'design-comuni-plone-theme/helpers/debounce';
Expand Down
Loading

0 comments on commit 71a8382

Please sign in to comment.