design-comuni-plone-theme 8.7.8 → 8.7.9

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 (32) hide show
  1. package/.gitattributes +1 -0
  2. package/CHANGELOG.md +28 -0
  3. package/RELEASE.md +30 -0
  4. package/locales/de/LC_MESSAGES/volto.po +5 -0
  5. package/locales/en/LC_MESSAGES/volto.po +5 -0
  6. package/locales/es/LC_MESSAGES/volto.po +5 -0
  7. package/locales/fr/LC_MESSAGES/volto.po +5 -0
  8. package/locales/it/LC_MESSAGES/volto.po +5 -0
  9. package/locales/volto.pot +6 -1
  10. package/package.json +1 -1
  11. package/publiccode.yml +2 -2
  12. package/src/components/ItaliaTheme/Blocks/Listing/CompleteBlockLinksTemplate.jsx +1 -1
  13. package/src/components/ItaliaTheme/Blocks/NumbersBlock/Sidebar.jsx +56 -51
  14. package/src/components/ItaliaTheme/Footer/FooterSmall.jsx +0 -3
  15. package/src/components/ItaliaTheme/Footer/SubsiteFooter.jsx +2 -2
  16. package/src/components/ItaliaTheme/View/CartellaModulisticaView/DocRow.jsx +5 -1
  17. package/src/config/italiaConfig.js +1 -1
  18. package/src/customizations/volto/components/manage/Blocks/Listing/ListingBody.jsx +1 -1
  19. package/src/customizations/volto/components/manage/Sidebar/ObjectBrowserBody.jsx +27 -10
  20. package/src/customizations/volto/components/manage/UniversalLink/UniversalLink.jsx +1 -1
  21. package/src/customizations/volto/components/manage/Widgets/ObjectBrowserWidget.jsx +9 -2
  22. package/src/customizations/volto/helpers/FormValidation/FormValidation.js +21 -2
  23. package/src/helpers/FormValidation/DataGridFormValidationHelpers.js +38 -0
  24. package/src/helpers/IconWidget/IconAliasHelper.js +1 -1
  25. package/src/helpers/IconWidget/IconWidgetHelper.js +1 -1
  26. package/src/helpers/index.js +5 -0
  27. package/src/theme/ItaliaTheme/Blocks/_ctaBlock.scss +11 -0
  28. package/src/theme/ItaliaTheme/Components/_pageHeader.scss +0 -1
  29. package/src/theme/ItaliaTheme/Subsites/bootstrap-italia/custom/_headercenter.scss +4 -0
  30. package/src/theme/ItaliaTheme/Views/_cartellaModulistica.scss +41 -11
  31. package/src/theme/ItaliaTheme/_common.scss +3 -0
  32. package/src/theme/_cms-ui.scss +3 -0
package/.gitattributes ADDED
@@ -0,0 +1 @@
1
+ RELEASE.md merge=union
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
 
2
2
 
3
+ ## [8.7.9](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v8.7.8...v8.7.9) (2023-10-18)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * add pluggable custom validation for all datagrid fields, not just required ones and applied new validation to timeline_tempi_scadenze ([#357](https://github.com/RedTurtle/design-comuni-plone-theme/issues/357)) ([9c6f55c](https://github.com/RedTurtle/design-comuni-plone-theme/commit/9c6f55c7f72a0210b18c2ef3d25d078056fc8b9d))
9
+ * do not show subsite footer banner when field is empty ([#356](https://github.com/RedTurtle/design-comuni-plone-theme/issues/356)) ([3d7bb92](https://github.com/RedTurtle/design-comuni-plone-theme/commit/3d7bb923b056620ec499c2f235bd2c64aaf13279))
10
+ * icona link esterni in linea con il testo ([#355](https://github.com/RedTurtle/design-comuni-plone-theme/issues/355)) ([33635ec](https://github.com/RedTurtle/design-comuni-plone-theme/commit/33635ecc80256051a597eacce87f047942781585))
11
+ * object browser limit is now respected, add logic for deselection and conditional closing of ob in some cases ([#363](https://github.com/RedTurtle/design-comuni-plone-theme/issues/363)) ([f6e9c35](https://github.com/RedTurtle/design-comuni-plone-theme/commit/f6e9c3565518914731b55543a0c2bc622b53f0d9))
12
+ * outline color of search icon in header for subsites ([#358](https://github.com/RedTurtle/design-comuni-plone-theme/issues/358)) ([4fea6cd](https://github.com/RedTurtle/design-comuni-plone-theme/commit/4fea6cdab31d46e4d3c3386024a17067a8e8b94d))
13
+ * overflow of vertical images in page view ([#364](https://github.com/RedTurtle/design-comuni-plone-theme/issues/364)) ([e584f63](https://github.com/RedTurtle/design-comuni-plone-theme/commit/e584f6397d251b86fb5cc7ed27f4a22710052ffe))
14
+ * overflowing help text in Numbers block sidebar ([#367](https://github.com/RedTurtle/design-comuni-plone-theme/issues/367)) ([ab68178](https://github.com/RedTurtle/design-comuni-plone-theme/commit/ab68178ee9646cb7f6f36cdc0b32ebbd167565cc))
15
+ * regression for default classes in SearchBlock view that were overflowing content into columns ([#369](https://github.com/RedTurtle/design-comuni-plone-theme/issues/369)) ([c82f886](https://github.com/RedTurtle/design-comuni-plone-theme/commit/c82f8867508a978a4f6d69df452e68b05101a8ff))
16
+ * removed unnecessary h3 in footer ([#360](https://github.com/RedTurtle/design-comuni-plone-theme/issues/360)) ([de2a9c1](https://github.com/RedTurtle/design-comuni-plone-theme/commit/de2a9c1ac3820eac65279cce3041d370add12fee))
17
+ * restore missing IconWidget and FontawesomeIcons ([#365](https://github.com/RedTurtle/design-comuni-plone-theme/issues/365)) ([fcd942c](https://github.com/RedTurtle/design-comuni-plone-theme/commit/fcd942cbfdaaef6dd2255f478a18c58a2f52c8cd))
18
+ * rimuovere blocco maps da servizi ([#368](https://github.com/RedTurtle/design-comuni-plone-theme/issues/368)) ([b3ec883](https://github.com/RedTurtle/design-comuni-plone-theme/commit/b3ec883b827b4b0b6c26bdd14e5e9609c8b21685))
19
+ * styling and visual issues in CartellaModulisticaView on desktop and mobile ([#366](https://github.com/RedTurtle/design-comuni-plone-theme/issues/366)) ([5206265](https://github.com/RedTurtle/design-comuni-plone-theme/commit/520626517ffbd52ce88b65f13fe2768ce7381fd2))
20
+
21
+
22
+ ### Maintenance
23
+
24
+ * update git merge strategy for RELEASE.md ([e4d1db1](https://github.com/RedTurtle/design-comuni-plone-theme/commit/e4d1db1519746819aedab28a210ffe6f7fda332f))
25
+
26
+
27
+ ### Documentation
28
+
29
+ * updated publiccode and release log ([310fb87](https://github.com/RedTurtle/design-comuni-plone-theme/commit/310fb87f4809ee920387e15b4fbb455ff2bd256b))
30
+
3
31
  ## [8.7.8](https://github.com/redturtle/design-comuni-plone-theme/compare/v8.7.7...v8.7.8) (2023-10-12)
4
32
 
5
33
 
package/RELEASE.md CHANGED
@@ -6,12 +6,19 @@
6
6
  <!--- -----------------------------------------------------------------
7
7
  Esempio:
8
8
  ---------------------------------------------------------------------
9
+
9
10
  ## Versione 7.10.9 (12/09/2023)
11
+
10
12
  ### Migliorie
13
+
11
14
  - Fissato il layout di stampa per pagine con Accordion
15
+
12
16
  ### Novità
17
+
13
18
  - Nuovo blocco "Informazioni" [`Istruzioni`](https://docs.google.com/document/d/1SThuxa_ah0BuNXukWs564kKPfprK41WLQE8Mome-0xg/edit#heading=h.7ty110jumgmd)
19
+
14
20
  ### Fix
21
+
15
22
  - il numero di telefono dentro card ufficio adesso è visibile anche senza indirizzo
16
23
  -->
17
24
 
@@ -20,16 +27,37 @@
20
27
  ----------------------------------------------------------------------
21
28
 
22
29
  ## Versione X.X.X (dd/mm/yyyy)
30
+
23
31
  ### Migliorie
32
+
24
33
  - ...
25
34
 
26
35
  ### Novità
36
+
27
37
  - ... [`Istruzioni`](url della documentazione relativa alla novità)
28
38
 
29
39
  ### Fix
40
+
30
41
  - ...
31
42
  -->
32
43
 
44
+ ## Versione 8.7.9 (18/10/2023)
45
+
46
+ ### Migliorie
47
+
48
+ - Migliorato il comportamento alla selezione/deselezione degli elementi multipli nel menù laterale a scomparsa
49
+
50
+ ### Fix
51
+
52
+ - Eliminata la sovrapposizione tra immagine e testo nel tipo documento Pagina quando l'immagine è verticale
53
+ - Cambiato il colore del bordo dell'icona Ricerca nell'header dei sottositi per garantire il contrasto per accessibilità
54
+ - Non mostrare la fascia colorata del footer di un sottosito quando questo non è compilato
55
+ - Risolto un bug nel selettore dei link nel menù laterale a scomparsa, che permetteva di selezionare più elementi di quelli consentiti
56
+ - Alcune icone mancanti nel widget di selezione delle icone di fontawesome sono state rese nuovamente visibili
57
+ - Sistemate inconsistenze nella visualizzazione di alcuni tipi di elementi della lista degli allegati in Cartella Modulistica
58
+ - Visualizzazione sidebar in edit del blocco Numeri: sistemato overflowing del testo di aiuto
59
+ - Sistemate le dimensioni dei risultati del blocco search con colonne laterali, rimosso overflow
60
+
33
61
  ## Versione 8.7.8 (12/10/2023)
34
62
 
35
63
  ### Fix
@@ -42,6 +70,8 @@
42
70
 
43
71
  - Aggiornata nuova icona di Twitter
44
72
 
73
+ ## Versione 8.7.6 (06/10/2023)
74
+
45
75
  ### Fix
46
76
 
47
77
  - Uniformato e impostato a sinistra l'allineamento del testo nel blocco Elenco nella variazione Quadratoni con immagine
@@ -3748,6 +3748,11 @@ msgstr ""
3748
3748
  msgid "text_filter_placeholder"
3749
3749
  msgstr ""
3750
3750
 
3751
+ #: helpers/FormValidation/DataGridFormValidationHelpers
3752
+ # defaultMessage: Impossibile aggiungere un elemento alla timeline senza aver compilato il campo "Titolo"
3753
+ msgid "timeline_tempi_scadenze_validation_error"
3754
+ msgstr ""
3755
+
3751
3756
  #: components/ItaliaTheme/View/BandoView/BandoText
3752
3757
  # defaultMessage: Tipologia del bando
3753
3758
  msgid "tipologia_bando"
@@ -3733,6 +3733,11 @@ msgstr ""
3733
3733
  msgid "text_filter_placeholder"
3734
3734
  msgstr "Insert a value"
3735
3735
 
3736
+ #: helpers/FormValidation/DataGridFormValidationHelpers
3737
+ # defaultMessage: Impossibile aggiungere un elemento alla timeline senza aver compilato il campo "Titolo"
3738
+ msgid "timeline_tempi_scadenze_validation_error"
3739
+ msgstr ""
3740
+
3736
3741
  #: components/ItaliaTheme/View/BandoView/BandoText
3737
3742
  # defaultMessage: Tipologia del bando
3738
3743
  msgid "tipologia_bando"
@@ -3742,6 +3742,11 @@ msgstr ""
3742
3742
  msgid "text_filter_placeholder"
3743
3743
  msgstr "Insertar un valor"
3744
3744
 
3745
+ #: helpers/FormValidation/DataGridFormValidationHelpers
3746
+ # defaultMessage: Impossibile aggiungere un elemento alla timeline senza aver compilato il campo "Titolo"
3747
+ msgid "timeline_tempi_scadenze_validation_error"
3748
+ msgstr ""
3749
+
3745
3750
  #: components/ItaliaTheme/View/BandoView/BandoText
3746
3751
  # defaultMessage: Tipologia del bando
3747
3752
  msgid "tipologia_bando"
@@ -3750,6 +3750,11 @@ msgstr ""
3750
3750
  msgid "text_filter_placeholder"
3751
3751
  msgstr "Entrez du texte"
3752
3752
 
3753
+ #: helpers/FormValidation/DataGridFormValidationHelpers
3754
+ # defaultMessage: Impossibile aggiungere un elemento alla timeline senza aver compilato il campo "Titolo"
3755
+ msgid "timeline_tempi_scadenze_validation_error"
3756
+ msgstr ""
3757
+
3753
3758
  #: components/ItaliaTheme/View/BandoView/BandoText
3754
3759
  # defaultMessage: Tipologia del bando
3755
3760
  msgid "tipologia_bando"
@@ -3733,6 +3733,11 @@ msgstr ""
3733
3733
  msgid "text_filter_placeholder"
3734
3734
  msgstr "Inserisci un valore"
3735
3735
 
3736
+ #: helpers/FormValidation/DataGridFormValidationHelpers
3737
+ # defaultMessage: Impossibile aggiungere un elemento alla timeline senza aver compilato il campo "Titolo"
3738
+ msgid "timeline_tempi_scadenze_validation_error"
3739
+ msgstr ""
3740
+
3736
3741
  #: components/ItaliaTheme/View/BandoView/BandoText
3737
3742
  # defaultMessage: Tipologia del bando
3738
3743
  msgid "tipologia_bando"
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: 2023-09-20T11:30:56.175Z\n"
4
+ "POT-Creation-Date: 2023-10-10T15:52:06.253Z\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"
@@ -3735,6 +3735,11 @@ msgstr ""
3735
3735
  msgid "text_filter_placeholder"
3736
3736
  msgstr ""
3737
3737
 
3738
+ #: helpers/FormValidation/DataGridFormValidationHelpers
3739
+ # defaultMessage: Impossibile aggiungere un elemento alla timeline senza aver compilato il campo "Titolo"
3740
+ msgid "timeline_tempi_scadenze_validation_error"
3741
+ msgstr ""
3742
+
3738
3743
  #: components/ItaliaTheme/View/BandoView/BandoText
3739
3744
  # defaultMessage: Tipologia del bando
3740
3745
  msgid "tipologia_bando"
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": "8.7.8",
5
+ "version": "8.7.9",
6
6
  "main": "src/index.js",
7
7
  "keywords": [
8
8
  "volto-addon",
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: '2023-10-12'
230
+ releaseDate: '2023-10-18'
231
231
  softwareType: standalone/web
232
- softwareVersion: 8.7.8
232
+ softwareVersion: 8.7.9
233
233
  url: 'https://github.com/italia/design-comuni-plone-theme'
234
234
  usedBy:
235
235
  - ASP Comuni Modenesi Area Nord
@@ -83,7 +83,7 @@ const CompleteBlockLinksTemplate = ({
83
83
  icon="it-external-link"
84
84
  title={title}
85
85
  size="xs"
86
- className="align-top ms-1 external-link"
86
+ className="ms-1 align-sub external-link"
87
87
  />
88
88
  )}
89
89
  </CardTitle>
@@ -35,58 +35,63 @@ const Sidebar = ({
35
35
  const intl = useIntl();
36
36
 
37
37
  return (
38
- <Segment.Group raised>
39
- <header className="header pulled">
40
- <h2>
41
- <FormattedMessage id="numbers_block" defaultMessage="Blocco numeri" />
42
- </h2>
43
- </header>
44
- <Accordion className="form">
45
- <Accordion.Content active={true}>
46
- <ObjectBrowserWidget
47
- id="background"
48
- title={intl.formatMessage(messages.backgroundImage)}
49
- description=""
50
- required={false}
51
- widgetOptions={{
52
- pattern_options: {
53
- selectableTypes: ['Image'],
54
- maximumSelectionSize: 1,
55
- },
56
- }}
57
- value={data.background ?? []}
58
- onChange={(id, value) =>
59
- onChangeBlock(block, { ...data, [id]: value })
60
- }
61
- />
38
+ <div className="numbers-block-sidebar-form-container">
39
+ <Segment.Group raised>
40
+ <header className="header pulled">
41
+ <h2>
42
+ <FormattedMessage
43
+ id="numbers_block"
44
+ defaultMessage="Blocco numeri"
45
+ />
46
+ </h2>
47
+ </header>
48
+ <Accordion className="form">
49
+ <Accordion.Content active={true}>
50
+ <ObjectBrowserWidget
51
+ id="background"
52
+ title={intl.formatMessage(messages.backgroundImage)}
53
+ description=""
54
+ required={false}
55
+ widgetOptions={{
56
+ pattern_options: {
57
+ selectableTypes: ['Image'],
58
+ maximumSelectionSize: 1,
59
+ },
60
+ }}
61
+ value={data.background ?? []}
62
+ onChange={(id, value) =>
63
+ onChangeBlock(block, { ...data, [id]: value })
64
+ }
65
+ />
62
66
 
63
- <IconWidget
64
- id="icon1"
65
- value={data.icon1 ?? ''}
66
- defaultOptions={defaultIconWidgetOptions}
67
- onChange={(name, value) => {
68
- onChangeBlock(block, { ...data, [name]: value });
69
- }}
70
- />
71
- <IconWidget
72
- id="icon2"
73
- value={data.icon2 ?? ''}
74
- defaultOptions={defaultIconWidgetOptions}
75
- onChange={(name, value) => {
76
- onChangeBlock(block, { ...data, [name]: value });
77
- }}
78
- />
79
- <IconWidget
80
- id="icon3"
81
- value={data.icon3 ?? ''}
82
- defaultOptions={defaultIconWidgetOptions}
83
- onChange={(name, value) => {
84
- onChangeBlock(block, { ...data, [name]: value });
85
- }}
86
- />
87
- </Accordion.Content>
88
- </Accordion>
89
- </Segment.Group>
67
+ <IconWidget
68
+ id="icon1"
69
+ value={data.icon1 ?? ''}
70
+ defaultOptions={defaultIconWidgetOptions}
71
+ onChange={(name, value) => {
72
+ onChangeBlock(block, { ...data, [name]: value });
73
+ }}
74
+ />
75
+ <IconWidget
76
+ id="icon2"
77
+ value={data.icon2 ?? ''}
78
+ defaultOptions={defaultIconWidgetOptions}
79
+ onChange={(name, value) => {
80
+ onChangeBlock(block, { ...data, [name]: value });
81
+ }}
82
+ />
83
+ <IconWidget
84
+ id="icon3"
85
+ value={data.icon3 ?? ''}
86
+ defaultOptions={defaultIconWidgetOptions}
87
+ onChange={(name, value) => {
88
+ onChangeBlock(block, { ...data, [name]: value });
89
+ }}
90
+ />
91
+ </Accordion.Content>
92
+ </Accordion>
93
+ </Segment.Group>
94
+ </div>
90
95
  );
91
96
  };
92
97
 
@@ -50,9 +50,6 @@ const FooterSmall = () => {
50
50
  return subFooterItems?.length > 0 || links.length > 0 || true ? (
51
51
  <div className="it-footer-small-prints clearfix">
52
52
  <Container tag="div">
53
- <h3 className="visually-hidden">
54
- {intl.formatMessage(messages.goToPage)}
55
- </h3>
56
53
  <ul className="it-footer-small-prints-list list-inline mb-0 d-flex flex-column flex-md-row">
57
54
  {subFooterItems?.length > 0 &&
58
55
  subFooterItems.map((item, index) => {
@@ -7,13 +7,13 @@ import React from 'react';
7
7
  import { useSelector } from 'react-redux';
8
8
  import { useLocation } from 'react-router-dom';
9
9
  import { flattenHTMLToAppURL, isCmsUi } from '@plone/volto/helpers';
10
+ import { richTextHasContent } from 'design-comuni-plone-theme/components/ItaliaTheme/View';
10
11
 
11
12
  const SubsiteFooter = () => {
12
13
  const location = useLocation();
13
14
  const isCmsUI = isCmsUi(location.pathname);
14
15
  const subsite = useSelector((state) => state.subsite?.data);
15
-
16
- return subsite?.subsite_footer?.data ? (
16
+ return richTextHasContent(subsite?.subsite_footer) ? (
17
17
  <div className={`subsite-footer ${isCmsUI ? 'public-ui' : ''}`}>
18
18
  <div className="text">
19
19
  <div className="container px-md-4">
@@ -81,7 +81,11 @@ const DocRow = ({ doc }) => {
81
81
 
82
82
  {/*Single file*/}
83
83
  {doc.items?.length === 1 && (
84
- <div className="doc">
84
+ <div
85
+ className={cx('doc', {
86
+ 'link-to-doc': doc.items[0]?.['@type'] === 'Link',
87
+ })}
88
+ >
85
89
  {titleWrapper}
86
90
  {doc.items?.length === 1 && (
87
91
  <Downloads item={doc.items[0]} titleDoc={doc.title} />
@@ -281,7 +281,7 @@ export default function applyConfig(voltoConfig) {
281
281
  'volto-blocks-widget': {
282
282
  allowedBlocks: [
283
283
  ...(config.settings['volto-blocks-widget']?.allowedBlocks ?? []).filter(
284
- (block) => block.id !== 'maps',
284
+ (block) => block !== 'maps',
285
285
  ),
286
286
  'break',
287
287
  'testo_riquadro_semplice',
@@ -66,7 +66,7 @@ const ListingBody = React.memo(
66
66
  const isSearchBlockResults = variation?.['@type'] === 'search';
67
67
  const block = isSearchBlockResults ? variation : data;
68
68
 
69
- if (!block?.show_block_bg) return 'full-width';
69
+ if (!block?.show_block_bg && !isSearchBlockResults) return 'full-width';
70
70
 
71
71
  let bg_color = data.bg_color ? `bg-${data.bg_color}` : '';
72
72
 
@@ -247,7 +247,6 @@ class ObjectBrowserBody extends Component {
247
247
  onSelectItem = (item) => {
248
248
  const url = item['@id'];
249
249
  const { block, data, mode, dataName, onChangeBlock } = this.props;
250
-
251
250
  const updateState = (mode) => {
252
251
  switch (mode) {
253
252
  case 'image':
@@ -312,8 +311,18 @@ class ObjectBrowserBody extends Component {
312
311
  };
313
312
 
314
313
  isSelectable = (item) => {
315
- return this.props.selectableTypes.length > 0
316
- ? this.props.selectableTypes.indexOf(item['@type']) >= 0
314
+ const { maximumSelectionSize, data, mode, selectableTypes } = this.props;
315
+ if (
316
+ maximumSelectionSize &&
317
+ data &&
318
+ mode === 'multiple' &&
319
+ maximumSelectionSize <= data.length
320
+ )
321
+ return data.some(
322
+ (d) => flattenToAppURL(d['@id']) === flattenToAppURL(item['@id']),
323
+ );
324
+ return selectableTypes.length > 0
325
+ ? selectableTypes.indexOf(item['@type']) >= 0
317
326
  : true;
318
327
  };
319
328
 
@@ -331,16 +340,24 @@ class ObjectBrowserBody extends Component {
331
340
  !this.props.maximumSelectionSize ||
332
341
  this.props.mode === 'multiple' ||
333
342
  !this.props.data ||
334
- this.props.data.length < this.props.maximumSelectionSize
343
+ this.props.data.length <= this.props.maximumSelectionSize
335
344
  ) {
345
+ let isDeselecting;
346
+ if (this.props.mode === 'multiple' && Array.isArray(this.props.data))
347
+ isDeselecting = this.props.data.some(
348
+ (d) => flattenToAppURL(d['@id']) === flattenToAppURL(item['@id']),
349
+ );
336
350
  this.onSelectItem(item);
337
351
  let length = this.props.data ? this.props.data.length : 0;
338
-
339
- let stopSelecting =
340
- this.props.mode !== 'multiple' ||
341
- (this.props.maximumSelectionSize > 0 &&
342
- length + 1 >= this.props.maximumSelectionSize);
343
-
352
+ let stopSelecting = this.props.mode !== 'multiple';
353
+ if (isDeselecting && !stopSelecting)
354
+ stopSelecting =
355
+ this.props.maximumSelectionSize > 0 &&
356
+ length - 1 >= this.props.maximumSelectionSize;
357
+ else
358
+ stopSelecting =
359
+ this.props.maximumSelectionSize > 0 &&
360
+ length + 1 >= this.props.maximumSelectionSize;
344
361
  if (stopSelecting) {
345
362
  this.props.closeObjectBrowser();
346
363
  }
@@ -123,7 +123,7 @@ const UniversalLink = ({
123
123
  icon="it-external-link"
124
124
  title={title}
125
125
  size="xs"
126
- className="align-top ms-1 external-link"
126
+ className="ms-1 align-sub external-link"
127
127
  />
128
128
  )}
129
129
  </a>
@@ -321,8 +321,15 @@ export class ObjectBrowserWidgetComponent extends Component {
321
321
  * @returns {string} Markup for the component.
322
322
  */
323
323
  render() {
324
- const { id, description, fieldSet, value, mode, onChange, isDisabled } =
325
- this.props;
324
+ const {
325
+ id,
326
+ description,
327
+ fieldSet,
328
+ value,
329
+ mode,
330
+ onChange,
331
+ isDisabled,
332
+ } = this.props;
326
333
 
327
334
  let items = compact(!isArray(value) && value ? [value] : value || []);
328
335
 
@@ -4,6 +4,21 @@
4
4
  * - gestione motivo dello stato di servizio che è required solo se il servizio non è fruibile
5
5
  * - gestione campi tipo dataGridField
6
6
  * - gestione timeline_tempi_scadenze nel servizio che ha solo un campo richiesto su 5
7
+ * - aggiunta la possibilita' di avere validazioni pluggable per ogni campo con widget data_grid,
8
+ * aggiungi i tuoi dgfield e le funzioni di validazione sotto CUSTOM_DGFIELD_VALIDATION.
9
+ * Rispettare la convenzione con l'id del campo proveniente dallo schema del CT, ie:
10
+ * export const CUSTOM_DGFIELD_VALIDATION = {
11
+ timeline_tempi_scadenze: {
12
+ isValid: (value, itemObj, intlFunc) => {
13
+ const isValid = value.every((val, i) => val.title);
14
+ return !isValid
15
+ ? intlFunc(
16
+ dgfieldValidationMessages.timeline_tempi_scadenze_validation_error,
17
+ )
18
+ : null;
19
+ },
20
+ },
21
+ };
7
22
  */
8
23
  import { map, uniq, keys, intersection, isEmpty } from 'lodash';
9
24
  import { messages } from '@plone/volto/helpers/MessageLabels/MessageLabels';
@@ -13,6 +28,9 @@ import {
13
28
  serviceFormValidationHelper,
14
29
  eventFormValidationHelper,
15
30
  getRealEmptyField,
31
+ getSpecificDataGridFieldValidation,
32
+ realWidgetType,
33
+ CUSTOM_DGFIELD_VALIDATION,
16
34
  } from 'design-comuni-plone-theme/helpers';
17
35
  import config from '@plone/volto/registry';
18
36
 
@@ -162,6 +180,7 @@ const widgetValidation = {
162
180
  maximum: (value, itemObj, intlFunc) =>
163
181
  isMaxPropertyValid(value, itemObj.maximum, 'maximum', intlFunc),
164
182
  },
183
+ ...CUSTOM_DGFIELD_VALIDATION,
165
184
  };
166
185
 
167
186
  /**
@@ -288,10 +307,10 @@ const validateFieldsPerFieldset = (
288
307
  );
289
308
 
290
309
  map(schema.properties, (field, fieldId) => {
291
- const fieldWidgetType = field.widget || field.type;
310
+ const fieldWidgetType = realWidgetType(field, fieldId);
292
311
  const widgetValidationCriteria = widgetValidation[fieldWidgetType]
293
312
  ? Object.keys(widgetValidation[fieldWidgetType])
294
- : [];
313
+ : getSpecificDataGridFieldValidation(fieldId);
295
314
  let fieldData = formData[fieldId];
296
315
  // test each criterion ex maximum, isEmail, isUrl, maxLength etc
297
316
  const fieldErrors = widgetValidationCriteria
@@ -0,0 +1,38 @@
1
+ import { defineMessages } from 'react-intl';
2
+
3
+ const dgfieldValidationMessages = defineMessages({
4
+ timeline_tempi_scadenze_validation_error: {
5
+ id: 'timeline_tempi_scadenze_validation_error',
6
+ defaultMessage:
7
+ 'Impossibile aggiungere un elemento alla timeline senza aver compilato il campo "Titolo"',
8
+ },
9
+ });
10
+
11
+ export const CUSTOM_DGFIELD_VALIDATION = {
12
+ timeline_tempi_scadenze: {
13
+ isValid: (value, itemObj, intlFunc) => {
14
+ const isValid = value.every((val, i) => val.title);
15
+ return !isValid
16
+ ? intlFunc(
17
+ dgfieldValidationMessages.timeline_tempi_scadenze_validation_error,
18
+ )
19
+ : null;
20
+ },
21
+ },
22
+ };
23
+
24
+ // Obbligati a far cosi' perche' il backend non è abbastanza furbo da definire
25
+ // una specifica factory non innestata o field.widget ofield.type per dgf e
26
+ // invece fornisce solo un generico "List" o "array", che avrebbe
27
+ // un'altra validazione in Volto.
28
+ export const realWidgetType = (field, fieldId) => {
29
+ return field?.widgetOptions?.frontendOptions?.widget === 'data_grid'
30
+ ? fieldId
31
+ : field.widget || field.type;
32
+ };
33
+
34
+ export const getSpecificDataGridFieldValidation = (fieldId) => {
35
+ return fieldId && CUSTOM_DGFIELD_VALIDATION.hasOwnProperty(fieldId)
36
+ ? Object.keys(CUSTOM_DGFIELD_VALIDATION[fieldId])
37
+ : [];
38
+ };
@@ -417,7 +417,7 @@ export const fontAwesomeAliases = {
417
417
  'pencil-paintbrush': 'pen-paintbrush',
418
418
  'pencil-ruler': 'pen-ruler',
419
419
  pennant: 'flag-pennant',
420
- 'people-arrows': 'people-arrows-left-right',
420
+ 'people-arrows': 'people-arrows',
421
421
  'people-carry': 'people-carry-box',
422
422
  percentage: 'percent',
423
423
  'person-carry': 'person-carry-box',
@@ -20,7 +20,7 @@ export const defaultIconWidgetOptions = [
20
20
  ['bus', 'Trasporto'],
21
21
  ['heart', 'Matrimonio'],
22
22
  ['person-booth', 'Procedura elettorale e voto'],
23
- ['masks-theater ', 'Tempo libero'],
23
+ ['masks-theater', 'Tempo libero'],
24
24
  ['book', 'Cultura'],
25
25
  ['passport', 'Immigrazione'],
26
26
  ['smog', 'Inquinamento'],
@@ -43,5 +43,10 @@ export {
43
43
  getRealEmptyField,
44
44
  eventFormValidationHelper,
45
45
  } from 'design-comuni-plone-theme/helpers/FormValidation/FormValidationHelpers';
46
+ export {
47
+ getSpecificDataGridFieldValidation,
48
+ realWidgetType,
49
+ CUSTOM_DGFIELD_VALIDATION,
50
+ } from 'design-comuni-plone-theme/helpers/FormValidation/DataGridFormValidationHelpers';
46
51
 
47
52
  export { commonSearchBlockMessages } from 'design-comuni-plone-theme/helpers/Translations/searchBlockExtendedTranslations';
@@ -36,6 +36,7 @@
36
36
  color: $secondary-text;
37
37
  font-size: 0.9rem;
38
38
  text-transform: uppercase;
39
+ position: relative;
39
40
 
40
41
  &:hover,
41
42
  &:focus {
@@ -47,6 +48,9 @@
47
48
  }
48
49
  .external-link {
49
50
  fill: $external-link-fill-buttons !important;
51
+ position: absolute;
52
+ top: 3px;
53
+ right: 3px;
50
54
  }
51
55
  }
52
56
 
@@ -121,6 +125,13 @@
121
125
  padding: 18px 60px;
122
126
  font-weight: bold;
123
127
  font-size: 1rem;
128
+ position: relative;
129
+
130
+ .external-link {
131
+ position: absolute;
132
+ top: 3px;
133
+ right: 3px;
134
+ }
124
135
 
125
136
  &:hover,
126
137
  &:focus {
@@ -7,7 +7,6 @@
7
7
 
8
8
  .header-image {
9
9
  max-width: 16em;
10
- max-height: 8em;
11
10
  }
12
11
 
13
12
  .link-list-wrapper .link-list {
@@ -42,6 +42,10 @@
42
42
 
43
43
  .it-search-wrapper {
44
44
  a {
45
+ &.search-link {
46
+ outline: $subsite-primary 2px solid !important;
47
+ }
48
+
45
49
  &.rounded-icon {
46
50
  svg {
47
51
  @if $subsite-light-theme {
@@ -46,13 +46,10 @@ $docs-section-margin: 3em;
46
46
  align-items: center;
47
47
  justify-content: space-between;
48
48
  padding: 0.4em 0;
49
-
49
+ gap: 4rem;
50
50
  .title-wrap {
51
51
  flex: 1;
52
52
 
53
- &.single-row {
54
- max-width: 70%;
55
- }
56
53
  .title {
57
54
  font-size: 1.2em;
58
55
  font-weight: 500;
@@ -88,13 +85,25 @@ $docs-section-margin: 3em;
88
85
 
89
86
  a.modulistica-link {
90
87
  display: flex;
91
- width: 100%;
88
+ position: relative;
92
89
  align-items: center;
93
90
  justify-content: space-between;
94
-
95
- svg {
96
- width: 2em;
97
- font-size: 1.2em;
91
+ height: fit-content;
92
+ flex-shrink: 0;
93
+
94
+ svg.icon.fa-icon {
95
+ width: 1.6rem;
96
+ height: 1.6rem;
97
+ font-size: 1.3rem;
98
+ order: 2;
99
+ margin-right: 1.15rem;
100
+ margin-left: 0.25rem;
101
+ }
102
+ svg.external-link {
103
+ order: 1;
104
+ right: 0;
105
+ top: -2px;
106
+ position: absolute;
98
107
  }
99
108
  }
100
109
  }
@@ -169,16 +178,37 @@ $docs-section-margin: 3em;
169
178
  .doc-row {
170
179
  .doc {
171
180
  flex-wrap: wrap;
172
- align-items: unset;
181
+ align-items: center;
173
182
  justify-content: unset;
183
+ gap: 2rem;
184
+ &.link-to-doc {
185
+ align-items: unset;
186
+ gap: 0.5rem;
187
+ .title-wrap,
188
+ a.modulistica-link {
189
+ flex-basis: 100%;
190
+ svg.icon.fa-icon {
191
+ margin-left: 0;
192
+ margin-right: 1.25rem;
193
+ }
194
+ }
195
+ }
174
196
  .title-wrap {
175
197
  &.single-row {
176
198
  max-width: none;
177
199
  }
178
200
  }
201
+
202
+ &.modulo {
203
+ justify-content: space-between;
204
+ .title,
205
+ .downloads {
206
+ flex-basis: unset;
207
+ }
208
+ }
179
209
  .title,
180
210
  .downloads {
181
- flex: 1 1 100%;
211
+ flex: 1 1 unset;
182
212
  justify-content: flex-end;
183
213
 
184
214
  a {
@@ -72,6 +72,9 @@
72
72
 
73
73
  .external-link {
74
74
  fill: $link-color !important;
75
+ &.align-sub {
76
+ vertical-align: sub;
77
+ }
75
78
 
76
79
  &:hover {
77
80
  fill: #004080 !important;
@@ -268,6 +268,9 @@ body.cms-ui {
268
268
  }
269
269
  }
270
270
  .sidebar-container {
271
+ .numbers-block-sidebar-form-container {
272
+ padding-bottom: 1rem;
273
+ }
271
274
  .breadcrumbs {
272
275
  .breadcrumb {
273
276
  flex-wrap: wrap;