design-comuni-plone-theme 12.0.0 → 12.1.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.
Files changed (28) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/CHANGELOG.md +36 -0
  3. package/RELEASE.md +25 -1
  4. package/locales/de/LC_MESSAGES/volto.po +21 -0
  5. package/locales/en/LC_MESSAGES/volto.po +21 -0
  6. package/locales/es/LC_MESSAGES/volto.po +21 -0
  7. package/locales/fr/LC_MESSAGES/volto.po +21 -0
  8. package/locales/it/LC_MESSAGES/volto.po +21 -0
  9. package/locales/volto.pot +22 -1
  10. package/package.json +1 -1
  11. package/publiccode.yml +2 -2
  12. package/src/components/ItaliaTheme/Blocks/Common/SearchFilters/TextFilter.jsx +6 -1
  13. package/src/components/ItaliaTheme/Blocks/Teaser/ItaliaTeaserBody.jsx +190 -0
  14. package/src/components/ItaliaTheme/Blocks/Teaser/schema.js +179 -0
  15. package/src/components/ItaliaTheme/Blocks/UOSearch/Body.jsx +3 -0
  16. package/src/components/ItaliaTheme/BrandText/BrandText.jsx +10 -2
  17. package/src/components/ItaliaTheme/Icons/common/common.js +9 -8
  18. package/src/components/ItaliaTheme/Search/Search.jsx +5 -3
  19. package/src/components/__tests__/FormValidation.test.js +10 -0
  20. package/src/config/Blocks/blocks.js +4 -3
  21. package/src/config/italiaConfig.js +4 -0
  22. package/src/customizations/volto/components/manage/Blocks/Teaser/Body.jsx +30 -0
  23. package/src/customizations/volto/components/manage/Widgets/ObjectBrowserWidget.jsx +1 -1
  24. package/src/customizations/volto/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.jsx +3 -1
  25. package/src/customizations/volto/helpers/FormValidation/FormValidation.js +1 -1
  26. package/src/helpers/EnhanceLink.js +7 -2
  27. package/src/helpers/files.js +2 -2
  28. 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-03-11T16:06:49.599Z\n"
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"
@@ -179,6 +179,7 @@ msgid "Content"
179
179
  msgstr ""
180
180
 
181
181
  #: components/ItaliaTheme/Blocks/HighlightedContent/Sidebar
182
+ #: components/ItaliaTheme/Blocks/Teaser/schema
182
183
  # defaultMessage: Contenuto in primo piano
183
184
  msgid "Content in evidence"
184
185
  msgstr ""
@@ -375,6 +376,7 @@ msgstr ""
375
376
  msgid "Link more"
376
377
  msgstr ""
377
378
 
379
+ #: components/ItaliaTheme/Blocks/Teaser/schema
378
380
  #: components/ItaliaTheme/manage/Widgets/LinkToWidget
379
381
  # defaultMessage: Link a
380
382
  msgid "Link to"
@@ -382,12 +384,14 @@ msgstr ""
382
384
 
383
385
  #: components/ItaliaTheme/Blocks/HeroImageLeft/HeroSidebar
384
386
  #: components/ItaliaTheme/Blocks/HighlightedContent/Sidebar
387
+ #: components/ItaliaTheme/Blocks/Teaser/schema
385
388
  # defaultMessage: Link ad altro
386
389
  msgid "LinkMore"
387
390
  msgstr ""
388
391
 
389
392
  #: components/ItaliaTheme/Blocks/HeroImageLeft/HeroSidebar
390
393
  #: components/ItaliaTheme/Blocks/HighlightedContent/Sidebar
394
+ #: components/ItaliaTheme/Blocks/Teaser/schema
391
395
  # defaultMessage: Testo per il link ad altro
392
396
  msgid "Linkto title"
393
397
  msgstr ""
@@ -525,6 +529,11 @@ msgstr ""
525
529
  msgid "Play slider"
526
530
  msgstr ""
527
531
 
532
+ #: components/ItaliaTheme/Blocks/Teaser/ItaliaTeaserBody
533
+ # defaultMessage: Please choose an existing content as source for this element
534
+ msgid "Please choose an existing content as source for this element"
535
+ msgstr ""
536
+
528
537
  #: components/ItaliaTheme/Pagination/PaginationItem
529
538
  # defaultMessage: Pagina precedente
530
539
  msgid "Previous page"
@@ -632,6 +641,11 @@ msgstr ""
632
641
  msgid "Table color inverted"
633
642
  msgstr ""
634
643
 
644
+ #: overrideTranslations
645
+ # defaultMessage: Teaser
646
+ msgid "Teaser"
647
+ msgstr ""
648
+
635
649
  #: components/ItaliaTheme/Blocks/Accordion/Block/EditBlock
636
650
  #: components/ItaliaTheme/Blocks/ContactsBlock/Block/EditBlock
637
651
  #: components/ItaliaTheme/Blocks/IconBlocks/Block/EditBlock
@@ -1181,6 +1195,7 @@ msgstr ""
1181
1195
 
1182
1196
  #: components/ItaliaTheme/Blocks/ContactsBlock/Sidebar
1183
1197
  #: components/ItaliaTheme/Blocks/HighlightedContent/Sidebar
1198
+ #: components/ItaliaTheme/Blocks/Teaser/schema
1184
1199
  # defaultMessage: Colore di sfondo
1185
1200
  msgid "bg_color"
1186
1201
  msgstr ""
@@ -1392,6 +1407,7 @@ msgstr ""
1392
1407
 
1393
1408
  #: components/ItaliaTheme/Blocks/ContactsBlock/Sidebar
1394
1409
  #: components/ItaliaTheme/Blocks/HighlightedContent/Sidebar
1410
+ #: components/ItaliaTheme/Blocks/Teaser/schema
1395
1411
  # defaultMessage: Primario
1396
1412
  msgid "color_primary"
1397
1413
  msgstr ""
@@ -1402,6 +1418,7 @@ msgid "color_success"
1402
1418
  msgstr ""
1403
1419
 
1404
1420
  #: components/ItaliaTheme/Blocks/HighlightedContent/Sidebar
1421
+ #: components/ItaliaTheme/Blocks/Teaser/schema
1405
1422
  # defaultMessage: Trasparente
1406
1423
  msgid "color_transparent"
1407
1424
  msgstr ""
@@ -2814,6 +2831,7 @@ msgid "modulo_formati_alternativi"
2814
2831
  msgstr ""
2815
2832
 
2816
2833
  #: components/ItaliaTheme/Blocks/HighlightedContent/Sidebar
2834
+ #: components/ItaliaTheme/Blocks/Teaser/schema
2817
2835
  #: components/ItaliaTheme/Blocks/TextCard/CardWithImage/Sidebar
2818
2836
  #: config/Blocks/ListingOptions/cardWithImageTemplate
2819
2837
  # defaultMessage: undefined
@@ -3821,6 +3839,7 @@ msgid "share"
3821
3839
  msgstr ""
3822
3840
 
3823
3841
  #: components/ItaliaTheme/Blocks/HighlightedContent/Sidebar
3842
+ #: components/ItaliaTheme/Blocks/Teaser/schema
3824
3843
  # defaultMessage: Mostra la data
3825
3844
  msgid "show_date"
3826
3845
  msgstr ""
@@ -3892,6 +3911,7 @@ msgid "show_pointer_list"
3892
3911
  msgstr ""
3893
3912
 
3894
3913
  #: components/ItaliaTheme/Blocks/HighlightedContent/Sidebar
3914
+ #: components/ItaliaTheme/Blocks/Teaser/schema
3895
3915
  #: config/Blocks/ListingOptions/utils
3896
3916
  # defaultMessage: Mostra la sezione
3897
3917
  msgid "show_section"
@@ -3909,6 +3929,7 @@ msgid "show_topics"
3909
3929
  msgstr ""
3910
3930
 
3911
3931
  #: components/ItaliaTheme/Blocks/HighlightedContent/Sidebar
3932
+ #: components/ItaliaTheme/Blocks/Teaser/schema
3912
3933
  #: config/Blocks/ListingOptions/utils
3913
3934
  # defaultMessage: Mostra il tipo
3914
3935
  msgid "show_type"
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": "12.0.0",
5
+ "version": "12.1.1",
6
6
  "main": "src/index.js",
7
7
  "repository": {
8
8
  "type": "git",
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-03-31'
230
+ releaseDate: '2025-04-14'
231
231
  softwareType: standalone/web
232
- softwareVersion: 12.0.0
232
+ softwareVersion: 12.1.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({
@@ -4,7 +4,7 @@ import { useIntl } from 'react-intl';
4
4
  import { SiteProperty } from 'volto-site-settings';
5
5
  import { getSiteProperty } from 'design-comuni-plone-theme/helpers';
6
6
 
7
- const BrandText = ({ mobile = false }) => {
7
+ const BrandText = ({ mobile = false, subsite }) => {
8
8
  const intl = useIntl();
9
9
  let title = SiteProperty({
10
10
  property: 'site_title',
@@ -27,8 +27,16 @@ const BrandText = ({ mobile = false }) => {
27
27
  </React.Fragment>
28
28
  ));
29
29
 
30
+ const hide_title = SiteProperty({
31
+ property: 'hide_title',
32
+ defaultValue: false,
33
+ getValue: true,
34
+ getParent: false,
35
+ });
36
+ const visuallyHidden = !subsite && hide_title;
37
+
30
38
  return (
31
- <div className="it-brand-text">
39
+ <div className={cx('it-brand-text', { 'visually-hidden': visuallyHidden })}>
32
40
  {title && <div className="it-brand-title">{title}</div>}
33
41
  {description && (
34
42
  <div
@@ -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
- const type_icons = {
5
- Servizio: 'it-settings',
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
- date: {
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('relevance');
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: 'date',
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
  });
@@ -70,6 +70,7 @@ import CalloutView from 'design-comuni-plone-theme/components/ItaliaTheme/Blocks
70
70
  import CalloutEdit from 'design-comuni-plone-theme/components/ItaliaTheme/Blocks/Callout/Edit';
71
71
 
72
72
  import { cloneBlock } from 'design-comuni-plone-theme/helpers/blocks';
73
+ import { italiaTeaserSchemaEnhancer } from 'design-comuni-plone-theme/components/ItaliaTheme/Blocks/Teaser/schema';
73
74
 
74
75
  const italiaBlocks = {
75
76
  highlitedContent: {
@@ -79,8 +80,8 @@ const italiaBlocks = {
79
80
  group: 'homePage',
80
81
  view: HighlightedContentView,
81
82
  edit: HighlightedContentEdit,
82
- restricted: false,
83
- mostUsed: true,
83
+ restricted: true,
84
+ mostUsed: false,
84
85
  security: {
85
86
  addPermission: [],
86
87
  view: [],
@@ -384,11 +385,11 @@ const italiaBlocks = {
384
385
  };
385
386
 
386
387
  const getItaliaBlocks = (config) => {
387
- delete config.blocks.blocksConfig.teaser;
388
388
  config.blocks.blocksConfig.gridBlock.allowedBlocks =
389
389
  config.blocks.blocksConfig.gridBlock.allowedBlocks.filter(
390
390
  (item) => !['teaser'].includes(item),
391
391
  );
392
+ config.blocks.blocksConfig.teaser.schemaEnhancer = italiaTeaserSchemaEnhancer;
392
393
  return italiaBlocks;
393
394
  };
394
395
  export default getItaliaBlocks;