Skip to content

Commit

Permalink
Merge branch 'main' into bug_62497_events_search_location_list_not_up…
Browse files Browse the repository at this point in the history
…dating_v3
  • Loading branch information
pnicolli authored Dec 20, 2024
2 parents 6441750 + 1f7a8a1 commit 72a13d4
Show file tree
Hide file tree
Showing 28 changed files with 596 additions and 169 deletions.
4 changes: 3 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@

### 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.
- Sistemata l'accessibilità riguardante il focus lato operatore.

### Novità

Expand All @@ -54,6 +55,7 @@
### Fix

- Il menu a tendina da cui è possibile filtrare i luoghi nel blocco Ricerca Eventi mostra tutti i luoghi collegati agli eventi presenti nel percorso selezionato dalla Sidebar, senza limitarne il numero.
- Rimossa l'opzione non selezionabile "nessun valore" dal widget ricorrenza.

## Versione 11.25.3 (12/12/2024)

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
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@
"typeface-lora": "0.0.72",
"typeface-roboto-mono": "0.0.75",
"typeface-titillium-web": "0.0.72",
"volto-blocks-widget": "3.4.1",
"volto-blocks-widget": "3.4.3",
"volto-data-grid-widget": "2.3.1",
"volto-dropdownmenu": "4.1.3",
"volto-editablefooter": "5.1.7",
"volto-feedback": "0.3.2",
"volto-feedback": "0.5.2",
"volto-form-block": "3.10.0",
"volto-gdpr-privacy": "2.2.9",
"volto-gdpr-privacy": "2.2.12",
"volto-google-analytics": "2.0.0",
"volto-multilingual-widget": "3.2.1",
"volto-querywidget-with-browser": "0.4.2",
Expand Down
5 changes: 2 additions & 3 deletions src/components/ItaliaTheme/Cards/CardCategory.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ const CardCategory = (props) => {
const categoryText = !href && children && (
<span className="text">{children}</span>
);
const categoryIcon = iconName && (
<Icon icon={iconName} title={intl.formatMessage(messages.categoryIcon)} />
);
const iconTitle = rest.title || intl.formatMessage(messages.categoryIcon);
const categoryIcon = iconName && <Icon icon={iconName} title={iconTitle} />;

return (
<div className={classes} {...rest}>
Expand Down
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
21 changes: 11 additions & 10 deletions src/customizations/volto-form-block/components/View.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// CUSTOMIZATION:
// - added warning state to form
// - backport for https://github.com/collective/volto-form-block/pull/122

import React, { useState, useEffect, useReducer, useRef } from 'react';
import { useSelector, useDispatch } from 'react-redux';
Expand All @@ -8,7 +9,6 @@ import { useIntl, defineMessages } from 'react-intl';
import { submitForm, resetOTP } from 'volto-form-block/actions';
import { getFieldName } from 'volto-form-block/components/utils';
import FormView from 'volto-form-block/components/FormView';
import { formatDate } from '@plone/volto/helpers/Utils/Date';
import config from '@plone/volto/registry';
import { Captcha } from 'volto-form-block/components/Widget';
import { isValidEmail } from 'volto-form-block/helpers/validators';
Expand Down Expand Up @@ -260,20 +260,21 @@ const View = ({ data, id, path }) => {
config.blocks.blocksConfig.form.attachment_fields.includes(
subblock.field_type,
);
const isDate = subblock.field_type === 'date';
// const isDate = subblock.field_type === 'date';

if (isAttachment) {
attachments[name] = formattedFormData[name].value;
delete formattedFormData[name];
}

if (isDate) {
formattedFormData[name].value = formatDate({
date: formattedFormData[name].value,
format: 'DD-MM-YYYY',
locale: intl.locale,
});
}
// XXX: dates should be sent as ISO format, not DD-MM-YYYY !
// if (isDate) {
// formattedFormData[name].value = formatDate({
// date: formattedFormData[name].value,
// format: 'DD-MM-YYYY',
// locale: intl.locale,
// });
// }
}
});
dispatch(
Expand Down Expand Up @@ -323,7 +324,7 @@ const View = ({ data, id, path }) => {

useEffect(() => {
if (submitResults?.loaded) {
if (submitResults?.result?.data?.waiting_list) {
if (submitResults?.result?.waiting_list) {
setFormState({
type: FORM_STATES.warning,
result: {
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
23 changes: 7 additions & 16 deletions src/theme/ItaliaTheme/Blocks/_contacts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -91,48 +91,39 @@
}

.contact-title {

margin-bottom: 1rem;
font-size: 1.35rem;
font-weight: bold;
line-height: 1.4em;

margin-bottom: 1rem;
}

.contact-text {
font-size: 0.9rem;

.detached-slate-editor {
margin-bottom: 1rem;
}
}

.contact-info {
display: flex;

&:first-of-type {
align-items: center;

.icon-wrapper {
margin-top: 0;
}
}

&:not(:last-of-type) {
margin-bottom: 1rem;
}
align-items: center;

[role='textbox'] {
//slate editor
width: 100%;

&[data-slate-editor='true'] {
min-height: 1em;
}
}

.icon-wrapper {
margin-top: 0.2rem;
margin-right: 1rem;
display: flex;
align-items: center;
margin-top: 0.2rem;
margin-right: 1rem;
}

.tel {
Expand Down
Loading

0 comments on commit 72a13d4

Please sign in to comment.