design-comuni-plone-theme 11.33.1 → 11.34.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 (52) hide show
  1. package/.yarn/cache/@tanstack-react-table-npm-8.21.2-f809795b71-3cda97794c.zip +0 -0
  2. package/.yarn/cache/@tanstack-table-core-npm-8.21.2-0f1fa83089-21573388b2.zip +0 -0
  3. package/.yarn/cache/{tar-fs-npm-2.1.3-32d6d6fb31-8dd66c2077.zip → tar-fs-npm-2.1.4-90a454735f-a9e18e2e61.zip} +0 -0
  4. package/.yarn/cache/volto-blocks-widget-npm-3.4.7-1bc2eeb4b5-4350a9c54b.zip +0 -0
  5. package/.yarn/cache/{volto-form-block-npm-3.12.0-0e050cb6bf-878c6f6af8.zip → volto-form-block-npm-3.13.0-f978a02e9c-0ce41843f5.zip} +0 -0
  6. package/.yarn/install-state.gz +0 -0
  7. package/CHANGELOG.md +38 -0
  8. package/RELEASE.md +26 -0
  9. package/locales/de/LC_MESSAGES/volto.po +82 -2
  10. package/locales/en/LC_MESSAGES/volto.po +84 -4
  11. package/locales/es/LC_MESSAGES/volto.po +82 -2
  12. package/locales/fr/LC_MESSAGES/volto.po +82 -2
  13. package/locales/it/LC_MESSAGES/volto.po +84 -4
  14. package/locales/volto.pot +83 -3
  15. package/package.json +3 -3
  16. package/publiccode.yml +2 -2
  17. package/src/actions/contacts.js +13 -0
  18. package/src/actions/index.js +3 -0
  19. package/src/components/ItaliaTheme/Blocks/Common/SearchFilters/DateFilter.jsx +50 -44
  20. package/src/components/ItaliaTheme/Blocks/Common/SearchFilters/SelectFilter.jsx +3 -2
  21. package/src/components/ItaliaTheme/Blocks/Common/SearchFilters/TextFilter.jsx +44 -16
  22. package/src/components/ItaliaTheme/Blocks/Listing/BandiInEvidenceTemplate.jsx +2 -0
  23. package/src/components/ItaliaTheme/Blocks/Listing/CardWithSlideUpTextTemplate.jsx +4 -1
  24. package/src/components/ItaliaTheme/Blocks/Listing/RibbonCardTemplate.jsx +1 -0
  25. package/src/components/ItaliaTheme/Blocks/Listing/SimpleCard/Card/SimpleCardDefault.jsx +1 -0
  26. package/src/components/ItaliaTheme/Blocks/Listing/TemplatesSkeletons/BandiInEvidenceTemplateSkeleton.jsx +2 -0
  27. package/src/components/ItaliaTheme/ContactsBlock/ContactsBlock.jsx +77 -0
  28. package/src/components/ItaliaTheme/View/Commons/PageHeader/PageHeaderTassonomiaArgomenti.jsx +2 -2
  29. package/src/components/ItaliaTheme/index.js +4 -0
  30. package/src/components/ItaliaTheme/manage/Widgets/ConditionallyRequiredDateWidget.jsx +25 -0
  31. package/src/components/ItaliaTheme/manage/Widgets/ContactsWidget/ContactsConfigForm.jsx +90 -0
  32. package/src/components/ItaliaTheme/manage/Widgets/ContactsWidget/ContactsConfigWidget.jsx +394 -0
  33. package/src/components/SelectInput/SelectInput.jsx +7 -2
  34. package/src/config/Widgets/widgets.js +11 -0
  35. package/src/config/italiaConfig.js +3 -1
  36. package/src/customizations/volto/components/manage/Widgets/FileWidget.jsx +1 -1
  37. package/src/customizations/volto/components/theme/Footer/Footer.jsx +8 -1
  38. package/src/customizations/volto-form-block/components/Edit.jsx +100 -49
  39. package/src/customizations/volto-form-block/components/Field.jsx +71 -62
  40. package/src/customizations/volto-form-block/components/FormResult.jsx +25 -18
  41. package/src/customizations/volto-form-block/components/FormView.jsx +192 -194
  42. package/src/customizations/volto-form-block/components/Sidebar.jsx +7 -172
  43. package/src/customizations/volto-form-block/components/View.jsx +9 -5
  44. package/src/overrideTranslations.jsx +7 -2
  45. package/src/reducers/contacts.js +38 -0
  46. package/src/reducers/index.js +2 -0
  47. package/src/theme/ItaliaTheme/Blocks/_form.scss +20 -1
  48. package/src/theme/ItaliaTheme/Blocks/common/_searchBlockFilters.scss +56 -0
  49. package/src/theme/ItaliaTheme/Components/_contactsBlock.scss +40 -0
  50. package/src/theme/ItaliaTheme/Widgets/_contactsConfigWidget.scss +39 -0
  51. package/src/theme/site.scss +2 -0
  52. package/.yarn/cache/volto-blocks-widget-npm-3.4.1-c4d451e2c2-4f5c183698.zip +0 -0
@@ -4,16 +4,13 @@
4
4
  *
5
5
  * CUSTOMIZATIONS:
6
6
  * - customized to use design-react-kit elements instead semantic-ui elements
7
+ * - renamed menu item "Data" to "Dati"
7
8
  */
8
9
 
9
10
  import React from 'react';
10
- // eslint-disable-next-line import/no-unresolved
11
- import EditBlock from 'volto-form-block/components/EditBlock';
12
- // eslint-disable-next-line import/no-unresolved
13
- import Sidebar from 'volto-form-block/components/Sidebar';
14
- import ValidateConfigForm from 'volto-form-block/components/ValidateConfigForm';
15
-
11
+ import { defineMessages } from 'react-intl';
16
12
  import { Card, CardBody, Button, Row, Col } from 'design-react-kit';
13
+ import { TabPane, Tab } from 'semantic-ui-react';
17
14
  import {
18
15
  withDNDContext,
19
16
  SubblocksEdit,
@@ -22,7 +19,10 @@ import {
22
19
 
23
20
  import { SidebarPortal } from '@plone/volto/components';
24
21
 
25
- import { defineMessages } from 'react-intl';
22
+ import EditBlock from 'volto-form-block/components/EditBlock';
23
+ import Sidebar from 'volto-form-block/components/Sidebar';
24
+ import DataTable from 'volto-form-block/components/DataTable';
25
+ import ValidateConfigForm from 'volto-form-block/components/ValidateConfigForm';
26
26
 
27
27
  const messages = defineMessages({
28
28
  addField: {
@@ -46,6 +46,11 @@ const messages = defineMessages({
46
46
  defaultMessage:
47
47
  'Inserire un campo di tipo "E-mail mittente". Se non è presente, oppure è presente ma non viene compilato dall\'utente, l\'indirizzo del mittente della mail sarà quello configurato dalla sidebar di destra.',
48
48
  },
49
+ warning_enable_save: {
50
+ id: 'warning_enable_save',
51
+ defaultMessage:
52
+ 'Selezionare la voce "Salva i dati compilati" nella barra laterale per abilitare il salvataggio e la visualizzazione dei dati',
53
+ },
49
54
  });
50
55
 
51
56
  /**
@@ -93,10 +98,20 @@ class Edit extends SubblocksEdit {
93
98
  {this.props.data.description}
94
99
  </div>
95
100
  )}
96
- <Card className="card-bg rounded py-3" noWrapper={false} tag="div">
97
- <CardBody tag="div">
98
- <SubblocksWrapper node={this.node}>
99
- {/*this.state.subblocks.filter((s) => s.field_type === 'from')
101
+ <Tab
102
+ panes={[
103
+ {
104
+ menuItem: 'Form',
105
+ render: () => (
106
+ <TabPane>
107
+ <Card
108
+ className="card-bg rounded py-3"
109
+ noWrapper={false}
110
+ tag="div"
111
+ >
112
+ <CardBody tag="div">
113
+ <SubblocksWrapper node={this.node}>
114
+ {/*this.state.subblocks.filter((s) => s.field_type === 'from')
100
115
  .length == 0 && (
101
116
  <Alert color="warning" fade isOpen tag="div">
102
117
  <h4>{this.props.intl.formatMessage(messages.warning)}</h4>
@@ -106,47 +121,78 @@ class Edit extends SubblocksEdit {
106
121
  </Alert>
107
122
  )*/}
108
123
 
109
- {this.state.subblocks.map((subblock, subindex) => (
110
- <div className="form-field" key={subblock.id}>
111
- <EditBlock
112
- data={subblock}
113
- index={subindex}
114
- selected={this.isSubblockSelected(subindex)}
115
- {...this.subblockProps}
116
- openObjectBrowser={this.props.openObjectBrowser}
117
- />
118
- </div>
119
- ))}
120
-
121
- {this.props.selected && (
122
- <div className="form-field">
123
- {this.renderAddBlockButton(
124
- this.props.intl.formatMessage(messages.addField),
125
- )}
126
- </div>
127
- )}
124
+ {this.state.subblocks.map((subblock, subindex) => (
125
+ <div className="form-field" key={subblock.id}>
126
+ <EditBlock
127
+ data={subblock}
128
+ index={subindex}
129
+ selected={this.isSubblockSelected(subindex)}
130
+ {...this.subblockProps}
131
+ openObjectBrowser={
132
+ this.props.openObjectBrowser
133
+ }
134
+ />
135
+ </div>
136
+ ))}
128
137
 
129
- <Row>
130
- <Col align="center">
131
- {this.props.data?.show_cancel && (
132
- <Button color="secondary" className="me-2">
133
- {this.props.data.cancel_label ||
134
- this.props.intl.formatMessage(
135
- messages.default_cancel_label,
138
+ {this.props.selected && (
139
+ <div className="form-field">
140
+ {this.renderAddBlockButton(
141
+ this.props.intl.formatMessage(
142
+ messages.addField,
143
+ ),
144
+ )}
145
+ </div>
136
146
  )}
137
- </Button>
138
- )}
139
- <Button color="primary">
140
- {this.props.data.submit_label ||
141
- this.props.intl.formatMessage(
142
- messages.default_submit_label,
147
+
148
+ <Row>
149
+ <Col align="center">
150
+ {this.props.data?.show_cancel && (
151
+ <Button color="secondary" className="me-2">
152
+ {this.props.data.cancel_label ||
153
+ this.props.intl.formatMessage(
154
+ messages.default_cancel_label,
155
+ )}
156
+ </Button>
157
+ )}
158
+ <Button color="primary">
159
+ {this.props.data.submit_label ||
160
+ this.props.intl.formatMessage(
161
+ messages.default_submit_label,
162
+ )}
163
+ </Button>
164
+ </Col>
165
+ </Row>
166
+ </SubblocksWrapper>
167
+ </CardBody>
168
+ </Card>
169
+ </TabPane>
170
+ ),
171
+ },
172
+ {
173
+ menuItem: 'Dati',
174
+ render: () => (
175
+ <TabPane className="container">
176
+ {this.props.data.store ? (
177
+ <DataTable
178
+ properties={this.props.properties}
179
+ blockId={this.props.block}
180
+ removeDataAfterDays={
181
+ this.props.data.remove_data_after_days
182
+ }
183
+ />
184
+ ) : (
185
+ <p>
186
+ {this.props.intl.formatMessage(
187
+ messages.warning_enable_save,
143
188
  )}
144
- </Button>
145
- </Col>
146
- </Row>
147
- </SubblocksWrapper>
148
- </CardBody>
149
- </Card>
189
+ </p>
190
+ )}
191
+ </TabPane>
192
+ ),
193
+ },
194
+ ]}
195
+ />
150
196
  </div>
151
197
  </ValidateConfigForm>
152
198
 
@@ -160,6 +206,11 @@ class Edit extends SubblocksEdit {
160
206
  selected={this.state.subIndexSelected}
161
207
  setSelected={this.onSubblockChangeFocus}
162
208
  openObjectBrowser={this.props.openObjectBrowser}
209
+ properties={
210
+ this.props.metadata?.['@id']
211
+ ? this.props.metadata
212
+ : this.props.properties
213
+ }
163
214
  />
164
215
  </SidebarPortal>
165
216
  </div>
@@ -132,15 +132,15 @@ const Field = ({
132
132
  isInvalid() ? 'is-invalid' : ''
133
133
  }`}
134
134
  >
135
- <label htmlFor={name}>{getLabel()}</label>
135
+ <label id={`${name}-label`} htmlFor={name}>
136
+ {getLabel()}
137
+ </label>
136
138
  <Select
137
139
  components={{
138
140
  IndicatorSeparator: null,
139
141
  DropdownIndicator,
140
142
  }}
141
- id={name}
142
- name={name}
143
- label={getLabel()}
143
+ inputId={name}
144
144
  isSearchable={true}
145
145
  onChange={(v) => {
146
146
  onChange(name, v.value);
@@ -148,9 +148,10 @@ const Field = ({
148
148
  options={[
149
149
  ...(input_values?.map((v) => ({ value: v, label: v })) ?? []),
150
150
  ]}
151
+ aria-live="polite"
151
152
  isDisabled={disabled}
152
153
  placeholder={intl.formatMessage(messages.select_a_value)}
153
- aria-label={intl.formatMessage(messages.select_a_value)}
154
+ aria-labelledby={`${name}-label`}
154
155
  classNamePrefix="react-select"
155
156
  className={isInvalid() ? 'is-invalid' : ''}
156
157
  value={value ? [{ value: value, label: value }] : []}
@@ -172,32 +173,36 @@ const Field = ({
172
173
  isInvalid() ? 'is-invalid' : ''
173
174
  }`}
174
175
  >
175
- <label className="active">{getLabel()}</label>
176
- {input_values?.map((v, index) => (
177
- <FormGroup check key={v + name + index}>
178
- <Input
179
- id={v + name}
180
- name={name}
181
- type="radio"
182
- disabled={disabled}
183
- readOnly={disabled}
184
- onChange={(e) => {
185
- onChange(name, v);
186
- }}
187
- addon // Needed to avoid application of form-control class as of kit v4.0.2
188
- checked={value === v}
189
- />
190
- <Label for={v + name} check>
191
- {v}
192
- </Label>
193
- </FormGroup>
194
- ))}
195
- {description && <small className="form-text">{description}</small>}
196
- {errorMessage && (
197
- <div className="invalid-feedback form-feedback just-validate-error-label form-text form-feedback just-validate-error-label">
198
- {errorMessage}
199
- </div>
200
- )}
176
+ <fieldset className="radio-group">
177
+ <legend>{getLabel()}</legend>
178
+ {input_values?.map((v, index) => (
179
+ <FormGroup check key={v + name + index}>
180
+ <Input
181
+ id={v + name}
182
+ name={name}
183
+ type="radio"
184
+ disabled={disabled}
185
+ readOnly={disabled}
186
+ onChange={(e) => {
187
+ onChange(name, v);
188
+ }}
189
+ addon // Needed to avoid application of form-control class as of kit v4.0.2
190
+ checked={value === v}
191
+ />
192
+ <Label for={v + name} check>
193
+ {v}
194
+ </Label>
195
+ </FormGroup>
196
+ ))}
197
+ {description && (
198
+ <small className="form-text">{description}</small>
199
+ )}
200
+ {errorMessage && (
201
+ <div className="invalid-feedback form-feedback just-validate-error-label form-text form-feedback just-validate-error-label">
202
+ {errorMessage}
203
+ </div>
204
+ )}
205
+ </fieldset>
201
206
  </div>
202
207
  </div>
203
208
  )}
@@ -208,37 +213,41 @@ const Field = ({
208
213
  isInvalid() ? 'is-invalid' : ''
209
214
  }`}
210
215
  >
211
- <label className="active">{getLabel()}</label>
212
- {input_values?.map((v, index) => (
213
- <FormGroup check key={v + name + index}>
214
- <Input
215
- id={v + name}
216
- name={name}
217
- type="checkbox"
218
- checked={value?.indexOf(v) > -1}
219
- onChange={(e) => {
220
- let values = JSON.parse(JSON.stringify(value ?? []));
221
- if (e.target.checked) {
222
- values.push(v);
223
- } else {
224
- values.splice(values.indexOf(v), 1);
225
- }
226
- onChange(name, values);
227
- }}
228
- invalid={isInvalid() ? 'true' : null}
229
- addon // Needed to avoid application of form-control class as of kit v4.0.2
230
- />
231
- <Label for={v + name} check>
232
- {v}
233
- </Label>
234
- </FormGroup>
235
- ))}
236
- {description && <small className="form-text">{description}</small>}
237
- {errorMessage && (
238
- <div className="invalid-feedback form-feedback just-validate-error-label form-text form-feedback just-validate-error-label">
239
- {errorMessage}
240
- </div>
241
- )}
216
+ <fieldset className="checkbox-group">
217
+ <legend>{getLabel()}</legend>
218
+ {input_values?.map((v, index) => (
219
+ <FormGroup check key={v + name + index}>
220
+ <Input
221
+ id={v + name}
222
+ name={name}
223
+ type="checkbox"
224
+ checked={value?.indexOf(v) > -1}
225
+ onChange={(e) => {
226
+ let values = JSON.parse(JSON.stringify(value ?? []));
227
+ if (e.target.checked) {
228
+ values.push(v);
229
+ } else {
230
+ values.splice(values.indexOf(v), 1);
231
+ }
232
+ onChange(name, values);
233
+ }}
234
+ invalid={isInvalid() ? 'true' : null}
235
+ addon // Needed to avoid application of form-control class as of kit v4.0.2
236
+ />
237
+ <Label for={v + name} check>
238
+ {v}
239
+ </Label>
240
+ </FormGroup>
241
+ ))}
242
+ {description && (
243
+ <small className="form-text">{description}</small>
244
+ )}
245
+ {errorMessage && (
246
+ <div className="invalid-feedback form-feedback just-validate-error-label form-text form-feedback just-validate-error-label">
247
+ {errorMessage}
248
+ </div>
249
+ )}
250
+ </fieldset>
242
251
  </div>
243
252
  </div>
244
253
  )}
@@ -7,6 +7,7 @@ import React from 'react';
7
7
  import { useIntl, defineMessages } from 'react-intl';
8
8
  import { Button, Alert } from 'design-react-kit';
9
9
  import { getFieldName } from 'volto-form-block/components/utils';
10
+ import config from '@plone/volto/registry';
10
11
 
11
12
  const messages = defineMessages({
12
13
  success: {
@@ -15,12 +16,12 @@ const messages = defineMessages({
15
16
  },
16
17
  success_warning: {
17
18
  id: 'form_submit_success_warning',
18
- defaultMessage: "You've been added to the waiting list",
19
+ defaultMessage: 'Your registration is on the waiting list.',
19
20
  },
20
21
  success_warning_description: {
21
22
  id: 'form_submit_success_warning_description',
22
23
  defaultMessage:
23
- "Your data has been submitted, but the subscription limit has been reached and you've been added to the waiting list.",
24
+ 'Your data has been submitted successfully. However, the maximum number of registrations has been reached: your request has been placed on the waiting list.',
24
25
  },
25
26
  reset: {
26
27
  id: 'form_reset',
@@ -56,6 +57,9 @@ const replaceMessage = (text, sent_data) => {
56
57
 
57
58
  const FormResult = ({ formState, data, resetFormState }) => {
58
59
  const intl = useIntl();
60
+ const displayThankYouInAlertMessageFormBlock =
61
+ config.settings.siteProperties.displayThankYouInAlertMessageFormBlock;
62
+
59
63
  return (
60
64
  <Alert
61
65
  color={!formState.warning ? 'success' : 'warning'}
@@ -70,26 +74,29 @@ const FormResult = ({ formState, data, resetFormState }) => {
70
74
  : intl.formatMessage(messages.success_warning)}
71
75
  </h4>
72
76
  <br />
73
- {/* Custom message */}
74
- {!formState.warning ? (
75
- data.send_message && (
76
- <>
77
- <p
78
- dangerouslySetInnerHTML={{
79
- __html: replaceMessage(
80
- data.send_message,
81
- formState.result.data,
82
- ),
83
- }}
84
- />
85
- <br />
86
- </>
87
- )
88
- ) : (
77
+ {/* Warning submit limit */}
78
+ {formState.warning && (
89
79
  <>
90
80
  <p>{intl.formatMessage(messages.success_warning_description)}</p>
91
81
  </>
92
82
  )}
83
+ {/* Custom message */}
84
+ {!formState.warning ||
85
+ (formState.warning &&
86
+ displayThankYouInAlertMessageFormBlock &&
87
+ data.send_message && (
88
+ <>
89
+ <p
90
+ dangerouslySetInnerHTML={{
91
+ __html: replaceMessage(
92
+ data.send_message,
93
+ formState.result.data,
94
+ ),
95
+ }}
96
+ />
97
+ <br />
98
+ </>
99
+ ))}
93
100
 
94
101
  <Button
95
102
  color="primary"