design-comuni-plone-theme 11.6.2 → 11.7.0

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/.yarn/cache/volto-blocks-widget-npm-3.4.0-a61b810f4f-355675359c.zip +0 -0
  2. package/.yarn/cache/volto-editablefooter-npm-5.1.0-b288e1a1a8-2a13163440.zip +0 -0
  3. package/.yarn/cache/{volto-feedback-npm-0.2.0-dcf5397b38-ada1f08b98.zip → volto-feedback-npm-0.3.0-6f555b6437-5d4fe03279.zip} +0 -0
  4. package/.yarn/cache/{volto-form-block-npm-3.3.1-bbef28105f-8bd2232112.zip → volto-form-block-npm-3.5.0-409d15c307-9fc4b23423.zip} +0 -0
  5. package/.yarn/install-state.gz +0 -0
  6. package/CHANGELOG.md +32 -0
  7. package/RELEASE.md +18 -3
  8. package/jest-addon.config.js +2 -0
  9. package/package.json +5 -5
  10. package/publiccode.yml +2 -2
  11. package/src/components/ItaliaTheme/Blocks/Listing/CardWithImageTemplate.jsx +1 -1
  12. package/src/components/ItaliaTheme/CustomerSatisfaction/FeedbackForm.jsx +4 -8
  13. package/src/components/ItaliaTheme/CustomerSatisfaction/Steps/CommentsStep.jsx +1 -1
  14. package/src/components/ItaliaTheme/Footer/FooterMain.jsx +13 -5
  15. package/src/components/ItaliaTheme/View/Commons/RenderBlocks.jsx +3 -0
  16. package/src/components/ItaliaTheme/manage/Widgets/FileWidget.jsx +30 -4
  17. package/src/customizations/volto-form-block/components/Edit.jsx +51 -48
  18. package/src/customizations/volto-form-block/components/Field.jsx +42 -16
  19. package/src/customizations/volto-form-block/components/FormView.jsx +23 -8
  20. package/src/theme/ItaliaTheme/Blocks/_cardWithImageAndInEvidence.scss +2 -0
  21. package/src/theme/ItaliaTheme/Blocks/_ribbonCardTemplate.scss +1 -1
  22. package/src/theme/ItaliaTheme/Blocks/_simpleCardTemplate.scss +2 -2
  23. package/src/theme/ItaliaTheme/Blocks/_smallblockLinkstemplate.scss +0 -1
  24. package/src/theme/ItaliaTheme/Components/_card.scss +1 -1
  25. package/src/theme/ItaliaTheme/Subsites/ItaliaTheme/Views/_common.scss +13 -0
  26. package/src/theme/ItaliaTheme/Subsites/ItaliaTheme/Widgets/reactSelect.scss +1 -0
  27. package/src/theme/ItaliaTheme/Subsites/bootstrap-italia/custom/_navigation.scss +1 -1
  28. package/src/theme/ItaliaTheme/Views/_common.scss +29 -4
  29. package/src/theme/ItaliaTheme/_main.scss +30 -0
  30. package/src/theme/bootstrap-override/bootstrap-italia/_form.scss +5 -6
  31. package/.yarn/cache/volto-blocks-widget-npm-3.1.0-1c491dbc7f-91fc5fc102.zip +0 -0
  32. package/.yarn/cache/volto-editablefooter-npm-5.0.3-0d4dfeeb45-efbc8e7679.zip +0 -0
Binary file
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
 
2
2
 
3
+ ## [11.7.0](https://github.com/redturtle/design-comuni-plone-theme/compare/v11.6.2...v11.7.0) (2024-03-15)
4
+
5
+
6
+ ### Features
7
+
8
+ * editable footer top ([#528](https://github.com/redturtle/design-comuni-plone-theme/issues/528)) ([542e2ec](https://github.com/redturtle/design-comuni-plone-theme/commit/542e2ecc95be9b182f7d9f6b45ef893852587022))
9
+ * update volto-feedback 0.3.0 ([3d9dfbe](https://github.com/redturtle/design-comuni-plone-theme/commit/3d9dfbe16111065ec04924430a6d3487ab6d1b05))
10
+ * updated volto-form-block to fix multiple form in same page and added schema field custom validator ([#586](https://github.com/redturtle/design-comuni-plone-theme/issues/586)) ([407ae18](https://github.com/redturtle/design-comuni-plone-theme/commit/407ae18d876f6d5ada3095a2990ccbe3727ba06e))
11
+ * view error for each form field, validate form config ([#578](https://github.com/redturtle/design-comuni-plone-theme/issues/578)) ([45e2f72](https://github.com/redturtle/design-comuni-plone-theme/commit/45e2f727ac6ea5f23f57661a1acef83f94b19a2e))
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * added condition for focus when going back within feedback form ([#588](https://github.com/redturtle/design-comuni-plone-theme/issues/588)) ([7911d89](https://github.com/redturtle/design-comuni-plone-theme/commit/7911d892e04fcb5584ba52d180f8bb79768d5c28))
17
+ * button clear in form block ([68c8bf8](https://github.com/redturtle/design-comuni-plone-theme/commit/68c8bf85183edfeb53cd5525327d6210fae18df3))
18
+ * button type of cancel button in form block ([9a10ff8](https://github.com/redturtle/design-comuni-plone-theme/commit/9a10ff8f40b20753c9400ceb6909e3ff5a543805))
19
+ * default value for show_type in card-with-image-template ([#579](https://github.com/redturtle/design-comuni-plone-theme/issues/579)) ([fe95462](https://github.com/redturtle/design-comuni-plone-theme/commit/fe95462a49e99c5a442023d727676b485ab8edfe))
20
+ * imaged full width view in edit mode ([#570](https://github.com/redturtle/design-comuni-plone-theme/issues/570)) ([053183b](https://github.com/redturtle/design-comuni-plone-theme/commit/053183baea2ce3e11b365bf29559ea532af33fc1))
21
+ * restored right border in listing block small links template ([#582](https://github.com/redturtle/design-comuni-plone-theme/issues/582)) ([beb07ad](https://github.com/redturtle/design-comuni-plone-theme/commit/beb07ad251cb5e5b96c67c6a64ac01ea3f229526))
22
+ * update volto-form-block for subdomain mail validation ([#584](https://github.com/redturtle/design-comuni-plone-theme/issues/584)) ([92939a2](https://github.com/redturtle/design-comuni-plone-theme/commit/92939a28e59d829e05423f83dc0564b9c008692e))
23
+
24
+
25
+ ### Maintenance
26
+
27
+ * Update RELEASE.md ([f308e6b](https://github.com/redturtle/design-comuni-plone-theme/commit/f308e6bf000ca0d41ccfd63557f73b1372ab8faa))
28
+
29
+
30
+ ### Documentation
31
+
32
+ * fix merge mistake in the release docs ([232af7a](https://github.com/redturtle/design-comuni-plone-theme/commit/232af7a1624724e60722c346533223bea95fd8be))
33
+ * updated publiccode and release log ([3e48692](https://github.com/redturtle/design-comuni-plone-theme/commit/3e48692faa06bf6fff7ee16a06032e1b1e7dd782))
34
+
3
35
  ## [11.6.2](https://github.com/redturtle/design-comuni-plone-theme/compare/v11.6.1...v11.6.2) (2024-03-08)
4
36
 
5
37
 
package/RELEASE.md CHANGED
@@ -41,17 +41,32 @@
41
41
  - ...
42
42
  -->
43
43
 
44
- ## Versione 11.6.1 (06/03/2024)
44
+ ## Versione 11.7.0 (15/03/2024)
45
+
46
+ ### Novità
47
+
48
+ - Ora la fascia del footer contenente il logo e il nome del sito è configurabile da pannello di controllo.
49
+ - Nel pannello di controllo dei Feedback, ora gli utenti con permesso di eliminare elementi da questa sezione, possono eliminare i feedback.
50
+
51
+ ### Migliorie
52
+
53
+ - Nel blocco form, se in fase di compilazione ci sono degli errori, viene mostrato un messaggio di errore specifico per ogni campo con errori.
45
54
 
46
55
  ### Fix
47
56
 
48
- - Quando si imposta una ricorrenza per giorni feriali negli Eventi, viene visualizzato il testo corretto "ogni giorno feriale".
57
+ - Il bordo destro della variazione Link solo immagine del blocco Elenco è stato ripristinato.
58
+ - Se si mettono due blocchi Form nella stessa pagina, ora funzionano correttamente.
59
+ - Aggiustato il modulo di Feedback quando si cambia valutazione dopo averne già selezionata un'altra.
49
60
 
50
- ## Versione 11.6.0 (05/03/2024)
61
+ ## Versione 11.6.1 (06/03/2024)
51
62
 
52
63
  ### Fix
53
64
 
65
+ - Quando si imposta una ricorrenza per giorni feriali negli Eventi, viene visualizzato il testo corretto "ogni giorno feriale".
54
66
  - Le icone social nel menu laterale mobile sono tutte dello stesso colore.
67
+
68
+ ## Versione 11.6.0 (05/03/2024)
69
+
55
70
  ### Migliorie
56
71
 
57
72
  - Nel blocco form è stata aggiunta una legenda per i campi obbligatori.
@@ -39,6 +39,8 @@ module.exports = {
39
39
  '^volto-dropdownmenu/(.*)$':
40
40
  '<rootDir>/node_modules/volto-dropdownmenu/src/$1',
41
41
  '^volto-feedback/(.*)$': '<rootDir>/node_modules/volto-feedback/src/$1',
42
+ '^volto-blocks-widget/(.*)$':
43
+ '<rootDir>/node_modules/volto-blocks-widget/src/$1',
42
44
  },
43
45
  collectCoverage: false,
44
46
  collectCoverageFrom: [
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": "11.6.2",
5
+ "version": "11.7.0",
6
6
  "main": "src/index.js",
7
7
  "keywords": [
8
8
  "volto-addon",
@@ -141,12 +141,12 @@
141
141
  "typeface-lora": "0.0.72",
142
142
  "typeface-roboto-mono": "0.0.75",
143
143
  "typeface-titillium-web": "0.0.72",
144
- "volto-blocks-widget": "3.1.0",
144
+ "volto-blocks-widget": "3.4.0",
145
145
  "volto-data-grid-widget": "2.3.1",
146
146
  "volto-dropdownmenu": "4.1.1",
147
- "volto-editablefooter": "5.0.3",
148
- "volto-feedback": "0.2.0",
149
- "volto-form-block": "3.3.1",
147
+ "volto-editablefooter": "5.1.0",
148
+ "volto-feedback": "0.3.0",
149
+ "volto-form-block": "3.5.0",
150
150
  "volto-gdpr-privacy": "2.1.1",
151
151
  "volto-google-analytics": "2.0.0",
152
152
  "volto-multilingual-widget": "3.0.0",
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: '2024-03-08'
230
+ releaseDate: '2024-03-15'
231
231
  softwareType: standalone/web
232
- softwareVersion: 11.6.2
232
+ softwareVersion: 11.7.0
233
233
  url: 'https://github.com/italia/design-comuni-plone-theme'
234
234
  usedBy:
235
235
  - ASP Comuni Modenesi Area Nord
@@ -50,7 +50,7 @@ const CardWithImageTemplate = (props) => {
50
50
  show_block_bg = false,
51
51
  always_show_image = false,
52
52
  set_four_columns = false,
53
- show_type = true,
53
+ show_type = false,
54
54
  show_section,
55
55
  show_icon = true,
56
56
  show_description = true,
@@ -1,10 +1,4 @@
1
- import React, {
2
- useState,
3
- useEffect,
4
- useLayoutEffect,
5
- useCallback,
6
- useMemo,
7
- } from 'react';
1
+ import React, { useState, useEffect, useCallback } from 'react';
8
2
  import { useSelector, useDispatch } from 'react-redux';
9
3
  import { useLocation } from 'react-router-dom';
10
4
  import { useIntl, defineMessages } from 'react-intl';
@@ -215,7 +209,9 @@ const FeedbackForm = ({ contentType, pathname }) => {
215
209
  satisfaction > threshold ? 'positive' : 'negative'
216
210
  }-${getFormFieldValue('answer')}`,
217
211
  );
218
- selectedAnswer.focus();
212
+ if (selectedAnswer) {
213
+ selectedAnswer.focus();
214
+ }
219
215
  }
220
216
  // eslint-disable-next-line react-hooks/exhaustive-deps
221
217
  }, [step]);
@@ -1,4 +1,4 @@
1
- import React, { useRef, useEffect } from 'react';
1
+ import React from 'react';
2
2
  import { TextArea, Form, FormGroup } from 'design-react-kit';
3
3
  import { defineMessages } from 'react-intl';
4
4
  import { FormHeader } from 'volto-feedback';
@@ -15,12 +15,16 @@ import {
15
15
  FooterPNRRLogo,
16
16
  } from 'design-comuni-plone-theme/components/ItaliaTheme/';
17
17
 
18
+ import { FooterTop } from 'volto-editablefooter';
19
+
18
20
  /**
19
21
  * FooterMain component class.
20
22
  * @class FooterMain
21
23
  * @extends Component
22
24
  */
23
25
  const FooterMain = () => {
26
+ const footerTopContent = FooterTop();
27
+
24
28
  return (
25
29
  <div className="it-footer-main">
26
30
  <Container tag="div">
@@ -28,11 +32,15 @@ const FooterMain = () => {
28
32
  <Row className="clearfix" tag="div">
29
33
  <Col sm={12} tag="div" widths={['xs', 'sm', 'md', 'lg', 'xl']}>
30
34
  <div className="it-brand-wrapper">
31
- <FooterPNRRLogo />
32
- <UniversalLink href="/">
33
- <LogoFooter />
34
- <BrandTextFooter />
35
- </UniversalLink>
35
+ {footerTopContent ?? (
36
+ <>
37
+ <FooterPNRRLogo />
38
+ <UniversalLink href="/">
39
+ <LogoFooter />
40
+ <BrandTextFooter />
41
+ </UniversalLink>
42
+ </>
43
+ )}
36
44
  </div>
37
45
  </Col>
38
46
  </Row>
@@ -48,6 +48,9 @@ const RenderBlocks = ({
48
48
  if (block['@type'] === 'text' && !block.text) {
49
49
  return null;
50
50
  }
51
+ if (block['@type'] === 'slate' && block.plaintext?.length === 0) {
52
+ return null;
53
+ }
51
54
  }
52
55
  return items?.length > 0 ? (
53
56
  <>
@@ -5,6 +5,7 @@
5
5
 
6
6
  import React from 'react';
7
7
  import PropTypes from 'prop-types';
8
+ import cx from 'classnames';
8
9
  import { Dimmer, Button } from 'design-react-kit';
9
10
  import { readAsDataURL } from 'promise-file-reader';
10
11
  import { injectIntl, defineMessages, useIntl } from 'react-intl';
@@ -56,14 +57,25 @@ const messages = defineMessages({
56
57
  * @returns {string} Markup of the component.
57
58
  */
58
59
  const FileWidget = (props) => {
59
- const { id, value, onChange, label, onEdit, infoText, required, invalid } =
60
- props;
60
+ const {
61
+ id,
62
+ value,
63
+ onChange,
64
+ label,
65
+ onEdit,
66
+ infoText,
67
+ required,
68
+ invalid,
69
+ validationText,
70
+ } = props;
61
71
  const [isImage, setIsImage] = React.useState(false);
62
72
  const intl = useIntl();
63
73
 
64
74
  React.useEffect(() => {
65
75
  if (value && imageMimetypes.includes(value['content-type'])) {
66
76
  setIsImage(true);
77
+ } else {
78
+ setIsImage(false);
67
79
  }
68
80
  }, [value]);
69
81
 
@@ -150,7 +162,7 @@ const FileWidget = (props) => {
150
162
  </div>
151
163
  )}
152
164
 
153
- <small className="form-text text-muted">
165
+ <small className="form-text">
154
166
  {value
155
167
  ? intl.formatMessage(messages.replaceFile)
156
168
  : intl.formatMessage(messages.addNewFile)}
@@ -171,7 +183,16 @@ const FileWidget = (props) => {
171
183
  </div>
172
184
  )}
173
185
  </Dropzone>
174
- {infoText && <small className="form-text text-muted">{infoText}</small>}
186
+ {infoText && (
187
+ <small
188
+ className={cx('form-text', {
189
+ 'invalid-feedback form-feedback just-validate-error-label form-feedback just-validate-error-label':
190
+ invalid,
191
+ })}
192
+ >
193
+ {infoText}
194
+ </small>
195
+ )}
175
196
  {value && (
176
197
  <div className="field-file-name">
177
198
  {value.filename}
@@ -189,6 +210,11 @@ const FileWidget = (props) => {
189
210
  </div>
190
211
  )}
191
212
  </div>
213
+ {validationText && (
214
+ <div className="invalid-feedback form-feedback just-validate-error-label form-text form-feedback just-validate-error-label">
215
+ {validationText}
216
+ </div>
217
+ )}
192
218
  </div>
193
219
  );
194
220
  };
@@ -11,6 +11,7 @@ import React from 'react';
11
11
  import EditBlock from 'volto-form-block/components/EditBlock';
12
12
  // eslint-disable-next-line import/no-unresolved
13
13
  import Sidebar from 'volto-form-block/components/Sidebar';
14
+ import ValidateConfigForm from 'volto-form-block/components/ValidateConfigForm';
14
15
 
15
16
  import { Card, CardBody, Button, Row, Col } from 'design-react-kit';
16
17
  import {
@@ -78,17 +79,18 @@ class Edit extends SubblocksEdit {
78
79
 
79
80
  return (
80
81
  <div className="public-ui">
81
- <div className="px-4 py-5">
82
- {this.props?.data?.title && <h2>{this.props.data.title}</h2>}
83
- {this.props?.data?.description && (
84
- <div className="block-description">
85
- {this.props.data.description}
86
- </div>
87
- )}
88
- <Card className="card-bg rounded py-3" noWrapper={false} tag="div">
89
- <CardBody tag="div">
90
- <SubblocksWrapper node={this.node}>
91
- {/*this.state.subblocks.filter((s) => s.field_type === 'from')
82
+ <ValidateConfigForm data={this.props.data} onEdit={true}>
83
+ <div className="px-4 py-5">
84
+ {this.props?.data?.title && <h2>{this.props.data.title}</h2>}
85
+ {this.props?.data?.description && (
86
+ <div className="block-description">
87
+ {this.props.data.description}
88
+ </div>
89
+ )}
90
+ <Card className="card-bg rounded py-3" noWrapper={false} tag="div">
91
+ <CardBody tag="div">
92
+ <SubblocksWrapper node={this.node}>
93
+ {/*this.state.subblocks.filter((s) => s.field_type === 'from')
92
94
  .length == 0 && (
93
95
  <Alert color="warning" fade isOpen tag="div">
94
96
  <h4>{this.props.intl.formatMessage(messages.warning)}</h4>
@@ -98,48 +100,49 @@ class Edit extends SubblocksEdit {
98
100
  </Alert>
99
101
  )*/}
100
102
 
101
- {this.state.subblocks.map((subblock, subindex) => (
102
- <div className="form-field" key={subblock.id}>
103
- <EditBlock
104
- data={subblock}
105
- index={subindex}
106
- selected={this.isSubblockSelected(subindex)}
107
- {...this.subblockProps}
108
- openObjectBrowser={this.props.openObjectBrowser}
109
- />
110
- </div>
111
- ))}
103
+ {this.state.subblocks.map((subblock, subindex) => (
104
+ <div className="form-field" key={subblock.id}>
105
+ <EditBlock
106
+ data={subblock}
107
+ index={subindex}
108
+ selected={this.isSubblockSelected(subindex)}
109
+ {...this.subblockProps}
110
+ openObjectBrowser={this.props.openObjectBrowser}
111
+ />
112
+ </div>
113
+ ))}
112
114
 
113
- {this.props.selected && (
114
- <div className="form-field">
115
- {this.renderAddBlockButton(
116
- this.props.intl.formatMessage(messages.addField),
117
- )}
118
- </div>
119
- )}
115
+ {this.props.selected && (
116
+ <div className="form-field">
117
+ {this.renderAddBlockButton(
118
+ this.props.intl.formatMessage(messages.addField),
119
+ )}
120
+ </div>
121
+ )}
120
122
 
121
- <Row>
122
- <Col align="center">
123
- {this.props.data?.show_cancel && (
124
- <Button color="secondary" className="me-2">
125
- {this.props.data.cancel_label ||
123
+ <Row>
124
+ <Col align="center">
125
+ {this.props.data?.show_cancel && (
126
+ <Button color="secondary" className="me-2">
127
+ {this.props.data.cancel_label ||
128
+ this.props.intl.formatMessage(
129
+ messages.default_cancel_label,
130
+ )}
131
+ </Button>
132
+ )}
133
+ <Button color="primary">
134
+ {this.props.data.submit_label ||
126
135
  this.props.intl.formatMessage(
127
- messages.default_cancel_label,
136
+ messages.default_submit_label,
128
137
  )}
129
138
  </Button>
130
- )}
131
- <Button color="primary">
132
- {this.props.data.submit_label ||
133
- this.props.intl.formatMessage(
134
- messages.default_submit_label,
135
- )}
136
- </Button>
137
- </Col>
138
- </Row>
139
- </SubblocksWrapper>
140
- </CardBody>
141
- </Card>
142
- </div>
139
+ </Col>
140
+ </Row>
141
+ </SubblocksWrapper>
142
+ </CardBody>
143
+ </Card>
144
+ </div>
145
+ </ValidateConfigForm>
143
146
 
144
147
  <SidebarPortal selected={this.props.selected || false}>
145
148
  <Sidebar
@@ -42,6 +42,7 @@ const Field = ({
42
42
  valid,
43
43
  disabled = false,
44
44
  formHasErrors = false,
45
+ errorMessage,
45
46
  id,
46
47
  reactSelect,
47
48
  }) => {
@@ -56,6 +57,15 @@ const Field = ({
56
57
  return !isOnEdit && !valid;
57
58
  };
58
59
 
60
+ const infoText = errorMessage ? (
61
+ <>
62
+ <div className="form-text">{description}</div>
63
+ {errorMessage}
64
+ </>
65
+ ) : (
66
+ description
67
+ );
68
+
59
69
  return (
60
70
  <div className="field">
61
71
  {field_type === 'text' && (
@@ -65,7 +75,7 @@ const Field = ({
65
75
  label={getLabel()}
66
76
  type="text"
67
77
  required={required}
68
- infoText={description}
78
+ infoText={infoText}
69
79
  disabled={disabled}
70
80
  readOnly={disabled}
71
81
  invalid={isInvalid() ? 'true' : null}
@@ -83,14 +93,14 @@ const Field = ({
83
93
  tag="textarea"
84
94
  rows={10}
85
95
  required={required}
86
- infoText={description}
96
+ infoText={infoText}
87
97
  disabled={disabled}
88
98
  readOnly={disabled}
89
99
  invalid={isInvalid() ? 'true' : null}
90
100
  onChange={(e) => {
91
101
  onChange(name, e.target.value);
92
102
  }}
93
- {...(value ? { value } : {})}
103
+ value={value ?? undefined}
94
104
  />
95
105
  )}
96
106
  {field_type === 'select' && (
@@ -120,9 +130,13 @@ const Field = ({
120
130
  aria-label={intl.formatMessage(messages.select_a_value)}
121
131
  classNamePrefix="react-select"
122
132
  className={isInvalid() ? 'is-invalid' : ''}
133
+ value={value ? [{ value: value, label: value }] : []}
123
134
  />
124
- {description && (
125
- <small className="form-text text-muted">{description}</small>
135
+ {description && <small className="form-text">{description}</small>}
136
+ {errorMessage && (
137
+ <div className="invalid-feedback form-feedback just-validate-error-label form-text form-feedback just-validate-error-label">
138
+ {errorMessage}
139
+ </div>
126
140
  )}
127
141
  </div>
128
142
  </div>
@@ -146,16 +160,19 @@ const Field = ({
146
160
  onChange={(e) => {
147
161
  onChange(name, v);
148
162
  }}
149
- invalid={isInvalid() ? 'true' : null}
150
163
  addon // Needed to avoid application of form-control class as of kit v4.0.2
164
+ checked={value === v}
151
165
  />
152
166
  <Label for={v + name} check>
153
167
  {v}
154
168
  </Label>
155
169
  </FormGroup>
156
170
  ))}
157
- {description && (
158
- <small className="form-text text-muted">{description}</small>
171
+ {description && <small className="form-text">{description}</small>}
172
+ {errorMessage && (
173
+ <div className="invalid-feedback form-feedback just-validate-error-label form-text form-feedback just-validate-error-label">
174
+ {errorMessage}
175
+ </div>
159
176
  )}
160
177
  </div>
161
178
  </div>
@@ -192,8 +209,11 @@ const Field = ({
192
209
  </Label>
193
210
  </FormGroup>
194
211
  ))}
195
- {description && (
196
- <small className="form-text text-muted">{description}</small>
212
+ {description && <small className="form-text">{description}</small>}
213
+ {errorMessage && (
214
+ <div className="invalid-feedback form-feedback just-validate-error-label form-text form-feedback just-validate-error-label">
215
+ {errorMessage}
216
+ </div>
197
217
  )}
198
218
  </div>
199
219
  </div>
@@ -222,8 +242,11 @@ const Field = ({
222
242
  {getLabel()}
223
243
  </Label>
224
244
  </FormGroup>
225
- {description && (
226
- <small className="form-text text-muted">{description}</small>
245
+ {description && <small className="form-text">{description}</small>}
246
+ {errorMessage && (
247
+ <div className="invalid-feedback form-feedback just-validate-error-label form-text form-feedback just-validate-error-label">
248
+ {errorMessage}
249
+ </div>
227
250
  )}
228
251
  </div>
229
252
  </div>
@@ -235,13 +258,14 @@ const Field = ({
235
258
  label={getLabel()}
236
259
  type="date"
237
260
  required={required}
238
- infoText={description}
261
+ infoText={infoText}
239
262
  disabled={disabled}
240
263
  readOnly={disabled}
241
264
  invalid={isInvalid() ? 'true' : null}
242
265
  onChange={(e) => {
243
266
  onChange(name, e.target.value);
244
267
  }}
268
+ value={value ?? ''}
245
269
  />
246
270
  )}
247
271
  {field_type === 'attachment' && (
@@ -251,7 +275,7 @@ const Field = ({
251
275
  label={getLabel()}
252
276
  type="file"
253
277
  required={required}
254
- infoText={description}
278
+ infoText={infoText}
255
279
  disabled={disabled}
256
280
  readOnly={disabled}
257
281
  invalid={isInvalid() ? 'true' : null}
@@ -267,14 +291,15 @@ const Field = ({
267
291
  label={getLabel()}
268
292
  type="email"
269
293
  required={true}
270
- infoText={description}
294
+ infoText={infoText}
271
295
  disabled={disabled}
272
296
  readOnly={disabled}
273
297
  invalid={isInvalid() ? 'true' : null}
298
+ validationText={errorMessage}
274
299
  onChange={(e) => {
275
300
  onChange(name, e.target.value);
276
301
  }}
277
- {...(value ? { value } : {})}
302
+ value={value ?? ''}
278
303
  />
279
304
  )}
280
305
  {field_type === 'static_text' &&
@@ -305,6 +330,7 @@ const Field = ({
305
330
  name={name}
306
331
  title={label}
307
332
  description={description}
333
+ infoText={infoText}
308
334
  required={required}
309
335
  onChange={onChange}
310
336
  value={value}
@@ -38,9 +38,9 @@ const messages = defineMessages({
38
38
  id: 'Email Success',
39
39
  defaultMessage: 'Form inviato correttamente',
40
40
  },
41
- empty_values: {
42
- id: 'form_empty_values_validation',
43
- defaultMessage: 'Compila i campi richiesti',
41
+ form_errors: {
42
+ id: 'form_errors_validation',
43
+ defaultMessage: 'Attenzione! Alcuni campi inseriti sono da controllare.',
44
44
  },
45
45
  reset: {
46
46
  id: 'form_reset',
@@ -62,6 +62,8 @@ const FormView = ({
62
62
  resetFormState,
63
63
  resetFormOnError,
64
64
  captcha,
65
+ id,
66
+ getErrorMessage,
65
67
  }) => {
66
68
  const intl = useIntl();
67
69
  const alertTransition = {
@@ -81,7 +83,7 @@ const FormView = ({
81
83
  config.settings.siteProperties.enableVoltoFormBlockCaptcha;
82
84
 
83
85
  const isValidField = (field) => {
84
- return formErrors?.indexOf(field) < 0;
86
+ return formErrors?.filter((e) => e.field === field).length === 0;
85
87
  };
86
88
 
87
89
  /* Function that replaces variables from the user customized message */
@@ -146,7 +148,15 @@ const FormView = ({
146
148
  <br />
147
149
  </>
148
150
  )}
149
- <Button color="primary" outline onClick={resetFormState}>
151
+ <Button
152
+ color="primary"
153
+ outline
154
+ onClick={(e) => {
155
+ e.preventDefault();
156
+ e.stopPropagation();
157
+ resetFormState();
158
+ }}
159
+ >
150
160
  {intl.formatMessage(messages.reset)}
151
161
  </Button>
152
162
  </Alert>
@@ -220,6 +230,7 @@ const FormView = ({
220
230
  : formData[name]?.value
221
231
  }
222
232
  valid={isValidField(name)}
233
+ errorMessage={getErrorMessage(name)}
223
234
  formHasErrors={formErrors.length > 0}
224
235
  />
225
236
  </Col>
@@ -238,7 +249,7 @@ const FormView = ({
238
249
  transition={alertTransition}
239
250
  >
240
251
  <h4>{intl.formatMessage(messages.error)}</h4>
241
- <p>{intl.formatMessage(messages.empty_values)}</p>
252
+ <p>{intl.formatMessage(messages.form_errors)}</p>
242
253
  </Alert>
243
254
  )}
244
255
  {formState.error && (
@@ -259,8 +270,12 @@ const FormView = ({
259
270
  {data?.show_cancel && (
260
271
  <Button
261
272
  color="secondary"
262
- type="clear"
263
- onClick={resetFormState}
273
+ type="button"
274
+ onClick={(e) => {
275
+ e.preventDefault();
276
+ e.stopPropagation();
277
+ resetFormState();
278
+ }}
264
279
  className="me-2"
265
280
  >
266
281
  {data.cancel_label ||
@@ -107,8 +107,10 @@
107
107
  font-weight: 400;
108
108
  letter-spacing: 1.1px;
109
109
  }
110
+
110
111
  &.wrap-dates-four-columns {
111
112
  flex-wrap: wrap;
113
+
112
114
  .data {
113
115
  margin-top: 0.5rem;
114
116
  }
@@ -25,8 +25,8 @@
25
25
  line-height: 1.44444rem;
26
26
 
27
27
  a {
28
- text-decoration: none;
29
28
  display: inline-block; //per avere il bordo tutto unito al focus di un link, ad esempio nelle card
29
+ text-decoration: none;
30
30
 
31
31
  &:hover {
32
32
  text-decoration: underline;
@@ -54,8 +54,8 @@
54
54
  a {
55
55
  @include rem-size(font-size, 24);
56
56
  @include rem-size(line-height, 26);
57
- font-weight: 700;
58
57
  display: inline-block; //per avere il bordo tutto unito al focus di un link, ad esempio nelle card
58
+ font-weight: 700;
59
59
 
60
60
  &:hover,
61
61
  &:active {
@@ -128,9 +128,9 @@
128
128
  a {
129
129
  @include rem-size(font-size, 32);
130
130
  @include rem-size(line-height, 32);
131
+ display: inline-block; //per avere il bordo tutto unito al focus di un link, ad esempio nelle card
131
132
  font-weight: 700;
132
133
  text-decoration: none;
133
- display: inline-block; //per avere il bordo tutto unito al focus di un link, ad esempio nelle card
134
134
 
135
135
  &:hover,
136
136
  &:active {
@@ -13,7 +13,6 @@
13
13
  align-items: center;
14
14
  justify-content: center;
15
15
  border: 8px solid $white;
16
- border-right: none;
17
16
  background: $white;
18
17
  box-shadow: 0 2px 20px 0 rgba(0, 0, 0, 0.1);
19
18
 
@@ -150,9 +150,9 @@
150
150
  a {
151
151
  @include rem-size(font-size, 18);
152
152
  @include rem-size(line-height, 24);
153
+ display: inline-block; //per avere il bordo tutto unito al focus di un link, ad esempio nelle card
153
154
  font-weight: 600;
154
155
  text-decoration: none;
155
- display: inline-block; //per avere il bordo tutto unito al focus di un link, ad esempio nelle card
156
156
  }
157
157
 
158
158
  a:hover {
@@ -13,6 +13,7 @@
13
13
  .progress {
14
14
  background-color: $subsite-primary-a0;
15
15
  }
16
+
16
17
  .progress-bar {
17
18
  @if $subsite-light-theme {
18
19
  background-color: $subsite-link-color;
@@ -39,6 +40,7 @@
39
40
  border-left: 2px solid $subsite-primary;
40
41
  }
41
42
  }
43
+
42
44
  .nav-link {
43
45
  // evita che il bordo a sinistra mostri il primary nel momento in cui si scorre
44
46
  @if $subsite-light-theme {
@@ -54,6 +56,7 @@
54
56
  h5 {
55
57
  color: $subsite-primary-text;
56
58
  }
59
+
57
60
  .chip {
58
61
  @if $subsite-light-theme {
59
62
  border-color: $subsite-link-color;
@@ -61,16 +64,20 @@
61
64
  .chip-label {
62
65
  color: $subsite-link-color;
63
66
  }
67
+
64
68
  &:hover {
65
69
  background-color: #fff;
66
70
  }
67
71
  } @else {
68
72
  border-color: $subsite-primary-text;
73
+
69
74
  .chip-label {
70
75
  color: $subsite-primary-text;
71
76
  }
77
+
72
78
  &:hover {
73
79
  background-color: #fff;
80
+
74
81
  .chip-label {
75
82
  color: $subsite-primary;
76
83
  }
@@ -118,6 +125,7 @@
118
125
  .draftjs-buttons a {
119
126
  background-color: $subsite-secondary !important;
120
127
  color: $subsite-secondary-text !important;
128
+
121
129
  &:hover {
122
130
  background-color: darken($subsite-secondary, 5%) !important;
123
131
  }
@@ -138,6 +146,7 @@
138
146
  &:before {
139
147
  background-color: $subsite-link-color;
140
148
  }
149
+
141
150
  &:after {
142
151
  background-color: $subsite-link-color;
143
152
  }
@@ -145,11 +154,13 @@
145
154
  &:before {
146
155
  background-color: $subsite-primary;
147
156
  }
157
+
148
158
  &:after {
149
159
  background-color: $subsite-primary;
150
160
  }
151
161
  }
152
162
  }
163
+
153
164
  .calendar-date-description .calendar-date-description-content {
154
165
  border-left: 8px solid $subsite-primary-a0;
155
166
  }
@@ -160,11 +171,13 @@
160
171
  .point-list-wrapper .point-list .point-list-aside.point-list-warning {
161
172
  @if $subsite-light-theme {
162
173
  color: $subsite-link-color;
174
+
163
175
  &:after {
164
176
  background-color: $subsite-link-color;
165
177
  }
166
178
  } @else {
167
179
  color: $subsite-primary;
180
+
168
181
  &:after {
169
182
  background-color: $subsite-primary;
170
183
  }
@@ -9,6 +9,7 @@
9
9
  background-color: $subsite-primary-a0;
10
10
  color: color-contrast($subsite-primary-a0);
11
11
  }
12
+
12
13
  &.react-select__option--is-focused.react-select__option--is-selected,
13
14
  &.react-select__option--is-selected {
14
15
  background-color: $subsite-secondary;
@@ -131,8 +131,8 @@
131
131
  .navbar-collapsable {
132
132
  .navbar-nav {
133
133
  li a.nav-link {
134
- font-size: 16px;
135
134
  color: $subsite-link-color;
135
+ font-size: 16px;
136
136
 
137
137
  &.active {
138
138
  border-left-color: $subsite-link-color;
@@ -68,14 +68,39 @@ picture.volto-image.responsive img.full-width,
68
68
  margin-left: -50vw !important;
69
69
  object-fit: cover;
70
70
 
71
+ $toolbar-width: 80px;
72
+ $toolbar-collapsed-width: 20px;
73
+ $sidebar-width: 375px;
74
+ $sidebar-collapsed-width: 20px;
75
+
71
76
  .has-toolbar & {
72
- left: calc(50% + 40px);
73
- width: calc(100vw - 80px) !important;
77
+ left: calc(50% + calc($toolbar-width / 2));
78
+ width: calc(100vw - $toolbar-width) !important;
79
+ }
80
+ .has-toolbar.has-sidebar & {
81
+ $toolbars-width: calc($toolbar-width + $sidebar-width);
82
+ left: calc(50% + calc($toolbars-width / 2));
83
+ width: calc(100vw - $toolbars-width) !important;
84
+ }
85
+ .has-toolbar.has-sidebar-collapsed & {
86
+ $toolbars-width: calc($toolbar-width + $sidebar-collapsed-width);
87
+ left: calc(50% + calc($toolbars-width / 2));
88
+ width: calc(100vw - $toolbars-width) !important;
74
89
  }
75
90
 
76
91
  .has-toolbar-collapsed & {
77
- left: calc(50% + 10px);
78
- width: calc(100vw - 20px) !important;
92
+ left: calc(50% + calc($toolbar-collapsed-width / 2));
93
+ width: calc(100vw - $toolbar-collapsed-width) !important;
94
+ }
95
+ .has-toolbar-collapsed.has-sidebar & {
96
+ $toolbars-width: calc($toolbar-collapsed-width + $sidebar-width);
97
+ left: calc(50% + calc($toolbars-width / 2));
98
+ width: calc(100vw - $toolbars-width) !important;
99
+ }
100
+ .has-toolbar-collapsed.has-sidebar-collapsed & {
101
+ $toolbars-width: calc($toolbar-collapsed-width + $sidebar-collapsed-width);
102
+ left: calc(50% + calc($toolbars-width / 2));
103
+ width: calc(100vw - $toolbars-width) !important;
79
104
  }
80
105
  }
81
106
 
@@ -328,6 +328,36 @@ iframe {
328
328
  }
329
329
  }
330
330
 
331
+ //fix footer styles for volto-editablefooter footerTop field
332
+ .it-footer .it-footer-main .it-brand-wrapper .footerTop,
333
+ .footer-configuration-widget .footer-top-segment .block.gridBlock .grid-items {
334
+ h2 {
335
+ margin-bottom: 0;
336
+ font-size: 1.777778rem;
337
+ font-weight: 600;
338
+ letter-spacing: unset;
339
+ line-height: 1.1;
340
+ }
341
+
342
+ h3 {
343
+ font-weight: 600;
344
+ }
345
+
346
+ .block.image img {
347
+ width: auto;
348
+ height: 75px;
349
+ }
350
+
351
+ .block.gridBlock {
352
+ .col {
353
+ &:has(.block.image) {
354
+ width: auto;
355
+ flex: 0 0 auto;
356
+ }
357
+ }
358
+ }
359
+ }
360
+
331
361
  .bg-light {
332
362
  --bs-light-rgb: #{red($primary-a0)}, #{green($primary-a0)},
333
363
  #{blue($primary-a0)};
@@ -5,12 +5,6 @@
5
5
 
6
6
  &.is-invalid {
7
7
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23f73e5a' viewBox='0 0 384 512'%3E%3Cpath d='M231.6 256l130.1-130.1c4.7-4.7 4.7-12.3 0-17l-22.6-22.6c-4.7-4.7-12.3-4.7-17 0L192 216.4 61.9 86.3c-4.7-4.7-12.3-4.7-17 0l-22.6 22.6c-4.7 4.7-4.7 12.3 0 17L152.4 256 22.3 386.1c-4.7 4.7-4.7 12.3 0 17l22.6 22.6c4.7 4.7 12.3 4.7 17 0L192 295.6l130.1 130.1c4.7 4.7 12.3 4.7 17 0l22.6-22.6c4.7-4.7 4.7-12.3 0-17L231.6 256z'/%3E%3C/svg%3E");
8
-
9
- small,
10
- small.text-muted,
11
- small.form-feedback.just-validate-error-label {
12
- color: $danger !important;
13
- }
14
8
  }
15
9
 
16
10
  .was-validated &:valid,
@@ -50,3 +44,8 @@
50
44
  }
51
45
  }
52
46
  }
47
+
48
+ .invalid-feedback {
49
+ //nella versione vecchia di bootstrap-italia che usiamo (2.3.4) questa regola non c'è e serve.
50
+ display: block;
51
+ }