design-comuni-plone-theme 11.29.2 → 11.30.1
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/.release-it.json +2 -1
- package/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +40 -0
- package/RELEASE.md +24 -1
- package/locales/de/LC_MESSAGES/volto.po +21 -0
- package/locales/en/LC_MESSAGES/volto.po +21 -0
- package/locales/es/LC_MESSAGES/volto.po +21 -0
- package/locales/fr/LC_MESSAGES/volto.po +21 -0
- package/locales/it/LC_MESSAGES/volto.po +21 -0
- package/locales/volto.pot +22 -1
- package/package.json +1 -1
- package/publiccode.yml +2 -2
- package/src/components/ItaliaTheme/Blocks/Common/SearchFilters/TextFilter.jsx +6 -1
- package/src/components/ItaliaTheme/Blocks/Teaser/ItaliaTeaserBody.jsx +190 -0
- package/src/components/ItaliaTheme/Blocks/Teaser/schema.js +179 -0
- package/src/components/ItaliaTheme/Blocks/UOSearch/Body.jsx +3 -0
- package/src/components/ItaliaTheme/BrandText/BrandText.jsx +9 -1
- package/src/components/ItaliaTheme/Icons/common/common.js +9 -8
- package/src/components/ItaliaTheme/Search/Search.jsx +5 -3
- package/src/components/__tests__/FormValidation.test.js +10 -0
- package/src/config/Blocks/blocks.js +4 -3
- package/src/config/italiaConfig.js +4 -0
- package/src/customizations/volto/components/manage/Blocks/Teaser/Body.jsx +30 -0
- package/src/customizations/volto/components/manage/Widgets/ObjectBrowserWidget.jsx +1 -1
- package/src/customizations/volto/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.jsx +3 -1
- package/src/customizations/volto/helpers/FormValidation/FormValidation.js +1 -1
- package/src/helpers/files.js +2 -2
- package/src/overrideTranslations.jsx +5 -0
package/locales/volto.pot
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
msgid ""
|
|
2
2
|
msgstr ""
|
|
3
3
|
"Project-Id-Version: Plone\n"
|
|
4
|
-
"POT-Creation-Date: 2025-
|
|
4
|
+
"POT-Creation-Date: 2025-04-04T13:47:56.109Z\n"
|
|
5
5
|
"Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
|
|
6
6
|
"Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
|
|
7
7
|
"MIME-Version: 1.0\n"
|
|
@@ -138,6 +138,7 @@ msgid "Content"
|
|
|
138
138
|
msgstr ""
|
|
139
139
|
|
|
140
140
|
#: components/ItaliaTheme/Blocks/HighlightedContent/Sidebar
|
|
141
|
+
#: components/ItaliaTheme/Blocks/Teaser/schema
|
|
141
142
|
# defaultMessage: Contenuto in primo piano
|
|
142
143
|
msgid "Content in evidence"
|
|
143
144
|
msgstr ""
|
|
@@ -339,6 +340,7 @@ msgstr ""
|
|
|
339
340
|
msgid "Link more"
|
|
340
341
|
msgstr ""
|
|
341
342
|
|
|
343
|
+
#: components/ItaliaTheme/Blocks/Teaser/schema
|
|
342
344
|
#: components/ItaliaTheme/manage/Widgets/LinkToWidget
|
|
343
345
|
# defaultMessage: Link a
|
|
344
346
|
msgid "Link to"
|
|
@@ -346,12 +348,14 @@ msgstr ""
|
|
|
346
348
|
|
|
347
349
|
#: components/ItaliaTheme/Blocks/HeroImageLeft/HeroSidebar
|
|
348
350
|
#: components/ItaliaTheme/Blocks/HighlightedContent/Sidebar
|
|
351
|
+
#: components/ItaliaTheme/Blocks/Teaser/schema
|
|
349
352
|
# defaultMessage: Link ad altro
|
|
350
353
|
msgid "LinkMore"
|
|
351
354
|
msgstr ""
|
|
352
355
|
|
|
353
356
|
#: components/ItaliaTheme/Blocks/HeroImageLeft/HeroSidebar
|
|
354
357
|
#: components/ItaliaTheme/Blocks/HighlightedContent/Sidebar
|
|
358
|
+
#: components/ItaliaTheme/Blocks/Teaser/schema
|
|
355
359
|
# defaultMessage: Testo per il link ad altro
|
|
356
360
|
msgid "Linkto title"
|
|
357
361
|
msgstr ""
|
|
@@ -489,6 +493,11 @@ msgstr ""
|
|
|
489
493
|
msgid "Play slider"
|
|
490
494
|
msgstr ""
|
|
491
495
|
|
|
496
|
+
#: components/ItaliaTheme/Blocks/Teaser/ItaliaTeaserBody
|
|
497
|
+
# defaultMessage: Please choose an existing content as source for this element
|
|
498
|
+
msgid "Please choose an existing content as source for this element"
|
|
499
|
+
msgstr ""
|
|
500
|
+
|
|
492
501
|
#: components/ItaliaTheme/Pagination/PaginationItem
|
|
493
502
|
# defaultMessage: Pagina precedente
|
|
494
503
|
msgid "Previous page"
|
|
@@ -601,6 +610,11 @@ msgstr ""
|
|
|
601
610
|
msgid "Table color inverted"
|
|
602
611
|
msgstr ""
|
|
603
612
|
|
|
613
|
+
#: overrideTranslations
|
|
614
|
+
# defaultMessage: Teaser
|
|
615
|
+
msgid "Teaser"
|
|
616
|
+
msgstr ""
|
|
617
|
+
|
|
604
618
|
#: components/ItaliaTheme/Blocks/Accordion/Block/EditBlock
|
|
605
619
|
#: components/ItaliaTheme/Blocks/ContactsBlock/Block/EditBlock
|
|
606
620
|
#: components/ItaliaTheme/Blocks/IconBlocks/Block/EditBlock
|
|
@@ -1146,6 +1160,7 @@ msgstr ""
|
|
|
1146
1160
|
|
|
1147
1161
|
#: components/ItaliaTheme/Blocks/ContactsBlock/Sidebar
|
|
1148
1162
|
#: components/ItaliaTheme/Blocks/HighlightedContent/Sidebar
|
|
1163
|
+
#: components/ItaliaTheme/Blocks/Teaser/schema
|
|
1149
1164
|
# defaultMessage: Colore di sfondo
|
|
1150
1165
|
msgid "bg_color"
|
|
1151
1166
|
msgstr ""
|
|
@@ -1326,11 +1341,13 @@ msgstr ""
|
|
|
1326
1341
|
|
|
1327
1342
|
#: components/ItaliaTheme/Blocks/ContactsBlock/Sidebar
|
|
1328
1343
|
#: components/ItaliaTheme/Blocks/HighlightedContent/Sidebar
|
|
1344
|
+
#: components/ItaliaTheme/Blocks/Teaser/schema
|
|
1329
1345
|
# defaultMessage: Primario
|
|
1330
1346
|
msgid "color_primary"
|
|
1331
1347
|
msgstr ""
|
|
1332
1348
|
|
|
1333
1349
|
#: components/ItaliaTheme/Blocks/HighlightedContent/Sidebar
|
|
1350
|
+
#: components/ItaliaTheme/Blocks/Teaser/schema
|
|
1334
1351
|
# defaultMessage: Trasparente
|
|
1335
1352
|
msgid "color_transparent"
|
|
1336
1353
|
msgstr ""
|
|
@@ -2741,6 +2758,7 @@ msgid "modulo_formati_alternativi"
|
|
|
2741
2758
|
msgstr ""
|
|
2742
2759
|
|
|
2743
2760
|
#: components/ItaliaTheme/Blocks/HighlightedContent/Sidebar
|
|
2761
|
+
#: components/ItaliaTheme/Blocks/Teaser/schema
|
|
2744
2762
|
#: components/ItaliaTheme/Blocks/TextCard/CardWithImage/Sidebar
|
|
2745
2763
|
#: config/Blocks/ListingOptions/cardWithImageTemplate
|
|
2746
2764
|
# defaultMessage: undefined
|
|
@@ -3749,6 +3767,7 @@ msgid "share"
|
|
|
3749
3767
|
msgstr ""
|
|
3750
3768
|
|
|
3751
3769
|
#: components/ItaliaTheme/Blocks/HighlightedContent/Sidebar
|
|
3770
|
+
#: components/ItaliaTheme/Blocks/Teaser/schema
|
|
3752
3771
|
# defaultMessage: Mostra la data
|
|
3753
3772
|
msgid "show_date"
|
|
3754
3773
|
msgstr ""
|
|
@@ -3820,6 +3839,7 @@ msgid "show_pointer_list"
|
|
|
3820
3839
|
msgstr ""
|
|
3821
3840
|
|
|
3822
3841
|
#: components/ItaliaTheme/Blocks/HighlightedContent/Sidebar
|
|
3842
|
+
#: components/ItaliaTheme/Blocks/Teaser/schema
|
|
3823
3843
|
#: config/Blocks/ListingOptions/utils
|
|
3824
3844
|
# defaultMessage: Mostra la sezione
|
|
3825
3845
|
msgid "show_section"
|
|
@@ -3837,6 +3857,7 @@ msgid "show_topics"
|
|
|
3837
3857
|
msgstr ""
|
|
3838
3858
|
|
|
3839
3859
|
#: components/ItaliaTheme/Blocks/HighlightedContent/Sidebar
|
|
3860
|
+
#: components/ItaliaTheme/Blocks/Teaser/schema
|
|
3840
3861
|
#: config/Blocks/ListingOptions/utils
|
|
3841
3862
|
# defaultMessage: Mostra il tipo
|
|
3842
3863
|
msgid "show_type"
|
package/package.json
CHANGED
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: '2025-
|
|
230
|
+
releaseDate: '2025-04-14'
|
|
231
231
|
softwareType: standalone/web
|
|
232
|
-
softwareVersion: 11.
|
|
232
|
+
softwareVersion: 11.30.1
|
|
233
233
|
url: 'https://github.com/italia/design-comuni-plone-theme'
|
|
234
234
|
usedBy:
|
|
235
235
|
- ASP Comuni Modenesi Area Nord
|
|
@@ -8,10 +8,14 @@ const messages = defineMessages({
|
|
|
8
8
|
},
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
const TextFilter = ({ value, id, onChange, placeholder }) => {
|
|
11
|
+
const TextFilter = ({ value, id, onChange, placeholder, blockID }) => {
|
|
12
12
|
const intl = useIntl();
|
|
13
|
+
|
|
13
14
|
return (
|
|
14
15
|
<div className="me-lg-3 my-2 my-lg-1 filter-wrapper text-filter">
|
|
16
|
+
<label htmlFor={`${blockID}-${id}`} className="visually-hidden">
|
|
17
|
+
{placeholder}
|
|
18
|
+
</label>
|
|
15
19
|
<input
|
|
16
20
|
type="text"
|
|
17
21
|
placeholder={
|
|
@@ -22,6 +26,7 @@ const TextFilter = ({ value, id, onChange, placeholder }) => {
|
|
|
22
26
|
onChange(id, e.target.value ?? '');
|
|
23
27
|
}}
|
|
24
28
|
autocomplete="off"
|
|
29
|
+
id={`${blockID}-${id}`}
|
|
25
30
|
/>
|
|
26
31
|
</div>
|
|
27
32
|
);
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { Message } from 'semantic-ui-react';
|
|
4
|
+
import { defineMessages, useIntl } from 'react-intl';
|
|
5
|
+
import imageBlockSVG from '@plone/volto/components/manage/Blocks/Image/block-image.svg';
|
|
6
|
+
import { isInternalURL, flattenToAppURL } from '@plone/volto/helpers';
|
|
7
|
+
import {
|
|
8
|
+
Row,
|
|
9
|
+
Col,
|
|
10
|
+
Chip,
|
|
11
|
+
Card,
|
|
12
|
+
CardBody,
|
|
13
|
+
CardText,
|
|
14
|
+
CardTitle,
|
|
15
|
+
CardReadMore,
|
|
16
|
+
} from 'design-react-kit';
|
|
17
|
+
import {
|
|
18
|
+
CardCategory,
|
|
19
|
+
getItemIcon,
|
|
20
|
+
} from 'design-comuni-plone-theme/components/ItaliaTheme';
|
|
21
|
+
import {
|
|
22
|
+
viewDate,
|
|
23
|
+
getComponentWithFallback,
|
|
24
|
+
} from 'design-comuni-plone-theme/helpers';
|
|
25
|
+
import { getCategory } from 'design-comuni-plone-theme/components/ItaliaTheme/Blocks/Listing/Commons/utils';
|
|
26
|
+
import { UniversalLink, ConditionalLink } from '@plone/volto/components';
|
|
27
|
+
import cx from 'classnames';
|
|
28
|
+
import config from '@plone/volto/registry';
|
|
29
|
+
|
|
30
|
+
const messages = defineMessages({
|
|
31
|
+
PleaseChooseContent: {
|
|
32
|
+
id: 'Please choose an existing content as source for this element',
|
|
33
|
+
defaultMessage:
|
|
34
|
+
'Please choose an existing content as source for this element',
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const ALIGNMENTS = {
|
|
39
|
+
left: 1,
|
|
40
|
+
right: 2,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const alignmentHelper = (align) => {
|
|
44
|
+
const alignment = ALIGNMENTS[align];
|
|
45
|
+
if (alignment === 1) {
|
|
46
|
+
return {
|
|
47
|
+
imageAlignment: { order: alignment, offset: 0, size: 6 },
|
|
48
|
+
contentAlignment: { order: 2, offset: 0, size: 6 },
|
|
49
|
+
};
|
|
50
|
+
} else if (alignment === 2) {
|
|
51
|
+
return {
|
|
52
|
+
imageAlignment: { order: alignment, offset: 1, size: 6 },
|
|
53
|
+
contentAlignment: { order: 1, offset: 0, size: 5 },
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const ItaliaTeaserBody = (props) => {
|
|
59
|
+
const { className, data, isEditMode, style } = props;
|
|
60
|
+
const intl = useIntl();
|
|
61
|
+
const content = data.href?.[0];
|
|
62
|
+
const image = data.preview_image?.[0];
|
|
63
|
+
const Image = config.getComponent('Image').component;
|
|
64
|
+
const icon = getItemIcon(content);
|
|
65
|
+
const category = getCategory(
|
|
66
|
+
content,
|
|
67
|
+
data.show_type,
|
|
68
|
+
data.show_section,
|
|
69
|
+
props,
|
|
70
|
+
);
|
|
71
|
+
const BlockExtraTags = getComponentWithFallback({
|
|
72
|
+
name: 'BlockExtraTags',
|
|
73
|
+
dependencies: ['HighlightedContent', content?.['@type'] || ''],
|
|
74
|
+
}).component;
|
|
75
|
+
|
|
76
|
+
const { imageAlignment, contentAlignment } = alignmentHelper(
|
|
77
|
+
data.styles.align || 'right',
|
|
78
|
+
);
|
|
79
|
+
return (
|
|
80
|
+
<div
|
|
81
|
+
className={cx('block teaser highlitedContent', className, {
|
|
82
|
+
'public-ui': isEditMode && content,
|
|
83
|
+
})}
|
|
84
|
+
style={style}
|
|
85
|
+
>
|
|
86
|
+
{!content && isEditMode && (
|
|
87
|
+
<Message>
|
|
88
|
+
<div className="teaser-item placeholder">
|
|
89
|
+
<img src={imageBlockSVG} alt="" />
|
|
90
|
+
<p>{intl.formatMessage(messages.PleaseChooseContent)}</p>
|
|
91
|
+
</div>
|
|
92
|
+
</Message>
|
|
93
|
+
)}
|
|
94
|
+
{content && (
|
|
95
|
+
<div className={`${data.bg_color ? 'bg-' + data.bg_color : ''} `}>
|
|
96
|
+
<Row>
|
|
97
|
+
{(content.hasPreviewImage || content.image_field || image) && (
|
|
98
|
+
<Col
|
|
99
|
+
lg={{
|
|
100
|
+
...imageAlignment,
|
|
101
|
+
}}
|
|
102
|
+
>
|
|
103
|
+
<Image
|
|
104
|
+
item={image || content}
|
|
105
|
+
imageField={image ? image.image_field : content.image_field}
|
|
106
|
+
className={cx('item-image', {
|
|
107
|
+
'natural-image-size': data.natural_image_size,
|
|
108
|
+
})}
|
|
109
|
+
alt=""
|
|
110
|
+
loading="lazy"
|
|
111
|
+
responsive={true}
|
|
112
|
+
role={null}
|
|
113
|
+
sizes="(max-width:768px) 90vw, (max-width:1024px) 450px, 560px"
|
|
114
|
+
/>
|
|
115
|
+
</Col>
|
|
116
|
+
)}
|
|
117
|
+
<Col
|
|
118
|
+
lg={{
|
|
119
|
+
...contentAlignment,
|
|
120
|
+
}}
|
|
121
|
+
>
|
|
122
|
+
<Card>
|
|
123
|
+
<CardBody className="pb-2">
|
|
124
|
+
<CardCategory
|
|
125
|
+
date={
|
|
126
|
+
content.effective &&
|
|
127
|
+
data.show_date !== false &&
|
|
128
|
+
viewDate(intl.locale, content.effective, 'll')
|
|
129
|
+
}
|
|
130
|
+
iconName={icon}
|
|
131
|
+
>
|
|
132
|
+
{category}
|
|
133
|
+
</CardCategory>
|
|
134
|
+
<CardTitle tag="h2">
|
|
135
|
+
<ConditionalLink
|
|
136
|
+
condition={!!content['@id']}
|
|
137
|
+
item={content}
|
|
138
|
+
>
|
|
139
|
+
{data.title || content.title}
|
|
140
|
+
</ConditionalLink>
|
|
141
|
+
</CardTitle>
|
|
142
|
+
{!data.hide_description && (
|
|
143
|
+
<CardText>{content.description}</CardText>
|
|
144
|
+
)}
|
|
145
|
+
<BlockExtraTags {...props} item={content} itemIndex={0} />
|
|
146
|
+
{content.tassonomia_argomenti &&
|
|
147
|
+
content.tassonomia_argomenti.length > 0 && (
|
|
148
|
+
<>
|
|
149
|
+
{content.tassonomia_argomenti.map((argomento, idx) => (
|
|
150
|
+
<Chip
|
|
151
|
+
simple
|
|
152
|
+
color="primary"
|
|
153
|
+
key={`${idx} ${argomento['@id']}`}
|
|
154
|
+
className="me-2"
|
|
155
|
+
>
|
|
156
|
+
<ConditionalLink
|
|
157
|
+
condition={!!argomento['@id']}
|
|
158
|
+
item={argomento}
|
|
159
|
+
className="chip-label text-decoration-none"
|
|
160
|
+
>
|
|
161
|
+
{argomento.title}
|
|
162
|
+
</ConditionalLink>
|
|
163
|
+
</Chip>
|
|
164
|
+
))}
|
|
165
|
+
</>
|
|
166
|
+
)}
|
|
167
|
+
{data.moreHref?.length > 0 && (
|
|
168
|
+
<CardReadMore
|
|
169
|
+
tag={UniversalLink}
|
|
170
|
+
iconName="it-arrow-right"
|
|
171
|
+
text={data.moreTitle || 'Vedi tutte le notizie'}
|
|
172
|
+
href={flattenToAppURL(data.moreHref[0]?.['@id'])}
|
|
173
|
+
/>
|
|
174
|
+
)}
|
|
175
|
+
</CardBody>
|
|
176
|
+
</Card>
|
|
177
|
+
</Col>
|
|
178
|
+
</Row>
|
|
179
|
+
</div>
|
|
180
|
+
)}
|
|
181
|
+
</div>
|
|
182
|
+
);
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
ItaliaTeaserBody.propTypes = {
|
|
186
|
+
data: PropTypes.objectOf(PropTypes.any).isRequired,
|
|
187
|
+
isEditMode: PropTypes.bool,
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
export default ItaliaTeaserBody;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl';
|
|
2
|
+
|
|
3
|
+
const messages = defineMessages({
|
|
4
|
+
News: {
|
|
5
|
+
id: 'Content in evidence',
|
|
6
|
+
defaultMessage: 'Contenuto in primo piano',
|
|
7
|
+
},
|
|
8
|
+
LinkToTitle: {
|
|
9
|
+
id: 'Linkto title',
|
|
10
|
+
defaultMessage: 'Testo per il link ad altro',
|
|
11
|
+
},
|
|
12
|
+
LinkMore: {
|
|
13
|
+
id: 'LinkMore',
|
|
14
|
+
defaultMessage: 'Link ad altro',
|
|
15
|
+
},
|
|
16
|
+
natural_image_size: {
|
|
17
|
+
id: 'natural_image_size',
|
|
18
|
+
defineMessages: "Non alterare le dimensioni naturali dell'immagine",
|
|
19
|
+
},
|
|
20
|
+
show_section: {
|
|
21
|
+
id: 'show_section',
|
|
22
|
+
defaultMessage: 'Mostra la sezione',
|
|
23
|
+
},
|
|
24
|
+
show_type: {
|
|
25
|
+
id: 'show_type',
|
|
26
|
+
defaultMessage: 'Mostra il tipo',
|
|
27
|
+
},
|
|
28
|
+
show_date: {
|
|
29
|
+
id: 'show_date',
|
|
30
|
+
defaultMessage: 'Mostra la data',
|
|
31
|
+
},
|
|
32
|
+
bg_color: {
|
|
33
|
+
id: 'bg_color',
|
|
34
|
+
defaultMessage: 'Colore di sfondo',
|
|
35
|
+
},
|
|
36
|
+
color_primary: {
|
|
37
|
+
id: 'color_primary',
|
|
38
|
+
defaultMessage: 'Primario',
|
|
39
|
+
},
|
|
40
|
+
color_secondary: {
|
|
41
|
+
id: 'color_primary',
|
|
42
|
+
defaultMessage: 'Primario',
|
|
43
|
+
},
|
|
44
|
+
color_transparent: {
|
|
45
|
+
id: 'color_transparent',
|
|
46
|
+
defaultMessage: 'Trasparente',
|
|
47
|
+
},
|
|
48
|
+
LinkTo: {
|
|
49
|
+
id: 'Link to',
|
|
50
|
+
defaultMessage: 'Link a',
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// Extra metadata for our Teaser block implementation
|
|
55
|
+
const ITALIA_TEASER_QUERY_METADATA = [
|
|
56
|
+
'effective',
|
|
57
|
+
'parent',
|
|
58
|
+
'design_italia_meta_type',
|
|
59
|
+
'icona',
|
|
60
|
+
'tassonomia_argomenti',
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
const italiaTeaserSchemaEnhancer = ({ schema, FormData, intl }) => {
|
|
64
|
+
schema.fieldsets = schema.fieldsets.reduce((acc, curr) => {
|
|
65
|
+
if (curr.id === 'styling')
|
|
66
|
+
return [
|
|
67
|
+
...acc,
|
|
68
|
+
{
|
|
69
|
+
...curr,
|
|
70
|
+
fields: [
|
|
71
|
+
...curr.fields,
|
|
72
|
+
'natural_image_size',
|
|
73
|
+
'bg_color',
|
|
74
|
+
'show_type',
|
|
75
|
+
'show_section',
|
|
76
|
+
'show_date',
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
];
|
|
80
|
+
else if (curr.id === 'default')
|
|
81
|
+
return [
|
|
82
|
+
...acc,
|
|
83
|
+
{
|
|
84
|
+
...curr,
|
|
85
|
+
fields: curr.fields.filter(
|
|
86
|
+
(f) => !['head_title', 'description'].includes(f),
|
|
87
|
+
),
|
|
88
|
+
},
|
|
89
|
+
];
|
|
90
|
+
return [...acc, curr];
|
|
91
|
+
}, []);
|
|
92
|
+
schema.fieldsets.push({
|
|
93
|
+
id: 'linkMore',
|
|
94
|
+
title: intl.formatMessage(messages.LinkMore),
|
|
95
|
+
fields: ['moreTitle', 'moreHref'],
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
schema.properties = {
|
|
99
|
+
...schema.properties,
|
|
100
|
+
href: {
|
|
101
|
+
...schema.properties.href,
|
|
102
|
+
selectedItemAttrs: [
|
|
103
|
+
// Teaser defaults
|
|
104
|
+
'Title',
|
|
105
|
+
'head_title',
|
|
106
|
+
'Description',
|
|
107
|
+
'hasPreviewImage',
|
|
108
|
+
'image_field',
|
|
109
|
+
'image_scales',
|
|
110
|
+
'@type',
|
|
111
|
+
...ITALIA_TEASER_QUERY_METADATA,
|
|
112
|
+
],
|
|
113
|
+
allowExternals: false,
|
|
114
|
+
widgetOptions: {
|
|
115
|
+
pattern_options: { maximumSelectionSize: 1 },
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
natural_image_size: {
|
|
119
|
+
id: 'natural_image_size',
|
|
120
|
+
title: intl.formatMessage(messages.natural_image_size),
|
|
121
|
+
type: 'boolean',
|
|
122
|
+
},
|
|
123
|
+
bg_color: {
|
|
124
|
+
title: intl.formatMessage(messages.bg_color),
|
|
125
|
+
widget: 'color_list',
|
|
126
|
+
id: 'bg_color',
|
|
127
|
+
colors: [
|
|
128
|
+
{
|
|
129
|
+
name: 'transparent',
|
|
130
|
+
label: intl.formatMessage(messages.color_transparent),
|
|
131
|
+
},
|
|
132
|
+
{ name: 'primary', label: intl.formatMessage(messages.color_primary) },
|
|
133
|
+
{
|
|
134
|
+
name: 'secondary',
|
|
135
|
+
label: intl.formatMessage(messages.color_secondary),
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
},
|
|
139
|
+
show_type: {
|
|
140
|
+
id: 'show_type',
|
|
141
|
+
title: intl.formatMessage(messages.show_type),
|
|
142
|
+
type: 'boolean',
|
|
143
|
+
},
|
|
144
|
+
show_section: {
|
|
145
|
+
id: 'show_section',
|
|
146
|
+
title: intl.formatMessage(messages.show_section),
|
|
147
|
+
type: 'boolean',
|
|
148
|
+
},
|
|
149
|
+
show_date: {
|
|
150
|
+
id: 'show_date',
|
|
151
|
+
title: intl.formatMessage(messages.show_date),
|
|
152
|
+
type: 'boolean',
|
|
153
|
+
},
|
|
154
|
+
moreTitle: {
|
|
155
|
+
id: 'moreTitle',
|
|
156
|
+
title: intl.formatMessage(messages.LinkToTitle),
|
|
157
|
+
},
|
|
158
|
+
moreHref: {
|
|
159
|
+
id: 'moreHref',
|
|
160
|
+
title: intl.formatMessage(messages.LinkTo),
|
|
161
|
+
widget: 'object_browser',
|
|
162
|
+
mode: 'link',
|
|
163
|
+
widgetOptions: {
|
|
164
|
+
pattern_options: { maximumSelectionSize: 1 },
|
|
165
|
+
},
|
|
166
|
+
selectedItemAttrs: [],
|
|
167
|
+
allowExternals: true,
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
schema.properties.styles.schema.properties.align = {
|
|
171
|
+
...schema.properties.styles.schema.properties.align,
|
|
172
|
+
actions: ['left', 'right'],
|
|
173
|
+
default: 'right',
|
|
174
|
+
};
|
|
175
|
+
delete schema.properties.head_title;
|
|
176
|
+
return schema;
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
export { italiaTeaserSchemaEnhancer };
|
|
@@ -162,6 +162,7 @@ const Body = ({ data, id, inEditMode, path, onChangeBlock }) => {
|
|
|
162
162
|
<>
|
|
163
163
|
{React.createElement(filterOne.widget.component, {
|
|
164
164
|
...filterOne.widget?.props,
|
|
165
|
+
blockID: id,
|
|
165
166
|
id: 'filterOne',
|
|
166
167
|
onChange: (filter, value) => {
|
|
167
168
|
dispatchFilter({
|
|
@@ -175,6 +176,7 @@ const Body = ({ data, id, inEditMode, path, onChangeBlock }) => {
|
|
|
175
176
|
{filterTwo &&
|
|
176
177
|
React.createElement(filterTwo.widget?.component, {
|
|
177
178
|
...filterTwo.widget?.props,
|
|
179
|
+
blockID: id,
|
|
178
180
|
id: 'filterTwo',
|
|
179
181
|
onChange: (filter, value) =>
|
|
180
182
|
dispatchFilter({
|
|
@@ -185,6 +187,7 @@ const Body = ({ data, id, inEditMode, path, onChangeBlock }) => {
|
|
|
185
187
|
{filterThree &&
|
|
186
188
|
React.createElement(filterThree.widget?.component, {
|
|
187
189
|
...filterThree.widget?.props,
|
|
190
|
+
blockID: id,
|
|
188
191
|
id: 'filterThree',
|
|
189
192
|
onChange: (filter, value) =>
|
|
190
193
|
dispatchFilter({
|
|
@@ -35,8 +35,16 @@ const BrandText = ({ mobile = false, subsite, getParent = false }) => {
|
|
|
35
35
|
</React.Fragment>
|
|
36
36
|
));
|
|
37
37
|
|
|
38
|
+
const hide_title = SiteProperty({
|
|
39
|
+
property: 'hide_title',
|
|
40
|
+
defaultValue: false,
|
|
41
|
+
getValue: true,
|
|
42
|
+
getParent: false,
|
|
43
|
+
});
|
|
44
|
+
const visuallyHidden = !subsite && hide_title;
|
|
45
|
+
|
|
38
46
|
return (
|
|
39
|
-
<div className=
|
|
47
|
+
<div className={cx('it-brand-text', { 'visually-hidden': visuallyHidden })}>
|
|
40
48
|
{title && <p className="no_toc h2">{title}</p>}
|
|
41
49
|
{description && (
|
|
42
50
|
<p className={cx('no_toc h3', { 'd-none d-md-block': !mobile })}>
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import getItemIcon_extend from 'design-comuni-plone-theme/components/ItaliaTheme/Icons/common/common_extend';
|
|
2
2
|
|
|
3
|
+
const type_icons = {
|
|
4
|
+
Servizio: 'it-settings',
|
|
5
|
+
UnitaOrganizzativa: 'it-pa',
|
|
6
|
+
Documento: 'it-file',
|
|
7
|
+
'News Item': 'it-note',
|
|
8
|
+
Event: 'it-calendar',
|
|
9
|
+
};
|
|
3
10
|
const getItemIcon = (item) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
UnitaOrganizzativa: 'it-pa',
|
|
7
|
-
Documento: 'it-file',
|
|
8
|
-
'News Item': 'it-note',
|
|
9
|
-
Event: 'it-calendar',
|
|
10
|
-
};
|
|
11
|
-
let icon = type_icons[item['@type']] || 'it-pa'; //default-icon
|
|
11
|
+
if (!item) return;
|
|
12
|
+
let icon = item['@type'] ? type_icons[item['@type']] || 'it-pa' : 'it-pa'; //default-icon
|
|
12
13
|
|
|
13
14
|
if (item['@type'] === 'Pagina Argomento') {
|
|
14
15
|
icon = item.icona ? item.icona : icon;
|
|
@@ -158,7 +158,7 @@ const messages = defineMessages({
|
|
|
158
158
|
|
|
159
159
|
const searchOrderDict = {
|
|
160
160
|
relevance: {},
|
|
161
|
-
|
|
161
|
+
Date: {
|
|
162
162
|
sort_on: 'Date',
|
|
163
163
|
},
|
|
164
164
|
sortable_title: {
|
|
@@ -188,7 +188,9 @@ const Search = () => {
|
|
|
188
188
|
|
|
189
189
|
const [customPath] = useState(qs.parse(location.search)?.custom_path ?? '');
|
|
190
190
|
|
|
191
|
-
const [sortOn, setSortOn] = useState(
|
|
191
|
+
const [sortOn, setSortOn] = useState(
|
|
192
|
+
qs.parse(location.search)?.sort_on ?? 'relevance',
|
|
193
|
+
);
|
|
192
194
|
const [currentPage, setCurrentPage] = useState(
|
|
193
195
|
qs.parse(location.search)?.b_start
|
|
194
196
|
? qs.parse(location.search).b_start / config.settings.defaultPageSize + 1
|
|
@@ -215,7 +217,7 @@ const Search = () => {
|
|
|
215
217
|
label: intl.formatMessage(messages.sort_on_relevance),
|
|
216
218
|
},
|
|
217
219
|
{
|
|
218
|
-
value: '
|
|
220
|
+
value: 'Date',
|
|
219
221
|
label: intl.formatMessage(messages.sort_on_date),
|
|
220
222
|
},
|
|
221
223
|
{
|
|
@@ -128,5 +128,15 @@ describe('FormValidation', () => {
|
|
|
128
128
|
}),
|
|
129
129
|
).toEqual({});
|
|
130
130
|
});
|
|
131
|
+
it('validates url with fragment containing a slash', () => {
|
|
132
|
+
formData.url = 'https://plone.org/Plone#fragment/more';
|
|
133
|
+
expect(
|
|
134
|
+
FormValidation.validateFieldsPerFieldset({
|
|
135
|
+
schema,
|
|
136
|
+
formData,
|
|
137
|
+
formatMessage,
|
|
138
|
+
}),
|
|
139
|
+
).toEqual({});
|
|
140
|
+
});
|
|
131
141
|
});
|
|
132
142
|
});
|
|
@@ -66,6 +66,7 @@ import CountDownBlockView from 'design-comuni-plone-theme/components/ItaliaTheme
|
|
|
66
66
|
import CountDownBlockEdit from 'design-comuni-plone-theme/components/ItaliaTheme/Blocks/CountDown/Edit';
|
|
67
67
|
|
|
68
68
|
import { cloneBlock } from 'design-comuni-plone-theme/config/Blocks/ListingOptions';
|
|
69
|
+
import { italiaTeaserSchemaEnhancer } from 'design-comuni-plone-theme/components/ItaliaTheme/Blocks/Teaser/schema';
|
|
69
70
|
|
|
70
71
|
const italiaBlocks = {
|
|
71
72
|
highlitedContent: {
|
|
@@ -75,8 +76,8 @@ const italiaBlocks = {
|
|
|
75
76
|
group: 'homePage',
|
|
76
77
|
view: HighlightedContentView,
|
|
77
78
|
edit: HighlightedContentEdit,
|
|
78
|
-
restricted:
|
|
79
|
-
mostUsed:
|
|
79
|
+
restricted: true,
|
|
80
|
+
mostUsed: false,
|
|
80
81
|
security: {
|
|
81
82
|
addPermission: [],
|
|
82
83
|
view: [],
|
|
@@ -363,11 +364,11 @@ const italiaBlocks = {
|
|
|
363
364
|
};
|
|
364
365
|
|
|
365
366
|
const getItaliaBlocks = (config) => {
|
|
366
|
-
delete config.blocks.blocksConfig.teaser;
|
|
367
367
|
config.blocks.blocksConfig.gridBlock.allowedBlocks =
|
|
368
368
|
config.blocks.blocksConfig.gridBlock.allowedBlocks
|
|
369
369
|
.filter((item) => !['slate', 'teaser'].includes(item))
|
|
370
370
|
.concat(['text']);
|
|
371
|
+
config.blocks.blocksConfig.teaser.schemaEnhancer = italiaTeaserSchemaEnhancer;
|
|
371
372
|
return italiaBlocks;
|
|
372
373
|
};
|
|
373
374
|
export default getItaliaBlocks;
|