design-comuni-plone-theme 11.23.2 → 11.24.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 (35) hide show
  1. package/.github/workflows/main.yml +1 -1
  2. package/.github/workflows/npm.yml +1 -1
  3. package/.github/workflows/prs.yml +1 -1
  4. package/.github/workflows/release.yml +1 -1
  5. package/.yarn/cache/{volto-form-block-npm-3.9.2-cb78fb6cd0-a47c5241be.zip → volto-form-block-npm-3.10.0-8cd1c7a976-8ddce2c624.zip} +0 -0
  6. package/.yarn/install-state.gz +0 -0
  7. package/CHANGELOG.md +39 -0
  8. package/Makefile +1 -1
  9. package/RELEASE.md +15 -0
  10. package/locales/de/LC_MESSAGES/volto.po +5 -0
  11. package/locales/en/LC_MESSAGES/volto.po +5 -0
  12. package/locales/es/LC_MESSAGES/volto.po +5 -0
  13. package/locales/fr/LC_MESSAGES/volto.po +5 -0
  14. package/locales/it/LC_MESSAGES/volto.po +5 -0
  15. package/locales/volto.pot +6 -1
  16. package/package.json +3 -3
  17. package/publiccode.yml +2 -2
  18. package/src/components/ItaliaTheme/Blocks/Listing/SimpleCard/Card/SimpleCardDefault.jsx +5 -1
  19. package/src/components/ItaliaTheme/View/PersonaView/PersonaRuolo.jsx +11 -5
  20. package/src/config/italiaConfig.js +1 -0
  21. package/src/customizations/volto/components/manage/Controlpanels/Groups/GroupsControlpanel.jsx +709 -0
  22. package/src/customizations/volto/components/manage/Controlpanels/Groups/RenderGroups.jsx +122 -0
  23. package/src/customizations/volto/components/manage/Diff/DiffField.jsx +2 -3
  24. package/src/customizations/volto/components/manage/Widgets/RecurrenceWidget/EndField.jsx +18 -11
  25. package/src/customizations/volto/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.jsx +233 -116
  26. package/src/customizations/volto-form-block/components/FormView.jsx +44 -40
  27. package/src/customizations/volto-form-block/components/Sidebar.jsx +4 -1
  28. package/src/customizations/volto-form-block/components/View.jsx +9 -2
  29. package/src/customizations/volto-form-block/formSchema.js +18 -0
  30. package/src/theme/ItaliaTheme/Blocks/common/_searchBlockFilters.scss +10 -4
  31. package/src/theme/ItaliaTheme/Widgets/_reactSelect.scss +5 -2
  32. package/src/theme/ItaliaTheme/_common.scss +5 -3
  33. package/src/theme/_site-variables.scss +1 -1
  34. package/src/theme/bootstrap-override/bootstrap-italia/_focus.scss +5 -2
  35. package/src/theme/bootstrap-override/bootstrap-italia/_headercenter.scss +5 -2
@@ -209,47 +209,51 @@ const FormView = ({
209
209
  })}
210
210
 
211
211
  {/*OTP*/}
212
- {data.subblocks
213
- .filter((subblock) => subblock.use_as_bcc)
214
- .map((subblock, index) => {
215
- const fieldName = getFieldName(
216
- subblock.label,
217
- subblock.id,
218
- );
219
- const name = fieldName + OTP_FIELDNAME_EXTENDER;
220
- const fieldValue = formData[fieldName]?.value;
221
- const value = formData[fieldName]?.otp;
222
- const fields_to_send_with_value =
223
- getFieldsToSendWithValue(subblock);
212
+ {data.email_otp_verification ? (
213
+ data.subblocks
214
+ .filter((subblock) => subblock.use_as_bcc)
215
+ .map((subblock, index) => {
216
+ const fieldName = getFieldName(
217
+ subblock.label,
218
+ subblock.id,
219
+ );
220
+ const name = fieldName + OTP_FIELDNAME_EXTENDER;
221
+ const fieldValue = formData[fieldName]?.value;
222
+ const value = formData[fieldName]?.otp;
223
+ const fields_to_send_with_value =
224
+ getFieldsToSendWithValue(subblock);
224
225
 
225
- return (
226
- <Row key={'row_otp' + index}>
227
- <Col className="py-2">
228
- <OTPWidget
229
- {...subblock}
230
- fieldValue={fieldValue}
231
- onChange={(field, value) => {
232
- onChangeFormData(
233
- subblock.id,
234
- fieldName,
235
- fieldValue,
236
- {
237
- ...fields_to_send_with_value,
238
- otp: value,
239
- },
240
- );
241
- }}
242
- value={value}
243
- valid={isValidField(name)}
244
- errorMessage={getErrorMessage(name)}
245
- formHasErrors={formErrors?.length > 0}
246
- path={path}
247
- block_id={block_id}
248
- />
249
- </Col>
250
- </Row>
251
- );
252
- })}
226
+ return (
227
+ <Row key={'row_otp' + index}>
228
+ <Col className="py-2">
229
+ <OTPWidget
230
+ {...subblock}
231
+ fieldValue={fieldValue}
232
+ onChange={(field, value) => {
233
+ onChangeFormData(
234
+ subblock.id,
235
+ fieldName,
236
+ fieldValue,
237
+ {
238
+ ...fields_to_send_with_value,
239
+ otp: value,
240
+ },
241
+ );
242
+ }}
243
+ value={value}
244
+ valid={isValidField(name)}
245
+ errorMessage={getErrorMessage(name)}
246
+ formHasErrors={formErrors?.length > 0}
247
+ path={path}
248
+ block_id={block_id}
249
+ />
250
+ </Col>
251
+ </Row>
252
+ );
253
+ })
254
+ ) : (
255
+ <></>
256
+ )}
253
257
 
254
258
  {enableCaptcha && <>{captcha.render()}</>}
255
259
 
@@ -294,7 +294,10 @@ const Sidebar = ({
294
294
  <BlockDataForm
295
295
  schema={FieldSchema(subblock)}
296
296
  onChangeField={(name, value) => {
297
- var update_values = {};
297
+ const update_values = {};
298
+ if (subblock.field_type === 'static_text') {
299
+ update_values.required = false;
300
+ }
298
301
 
299
302
  onChangeSubBlock(index, {
300
303
  ...subblock,
@@ -5,7 +5,7 @@ import React, { useState, useEffect, useReducer, useRef } from 'react';
5
5
  import { useSelector, useDispatch } from 'react-redux';
6
6
  import PropTypes from 'prop-types';
7
7
  import { useIntl, defineMessages } from 'react-intl';
8
- import { submitForm } from 'volto-form-block/actions';
8
+ import { submitForm, resetOTP } from 'volto-form-block/actions';
9
9
  import { getFieldName } from 'volto-form-block/components/utils';
10
10
  import FormView from 'volto-form-block/components/FormView';
11
11
  import { formatDate } from '@plone/volto/helpers/Utils/Date';
@@ -127,6 +127,9 @@ const View = ({ data, id, path }) => {
127
127
 
128
128
  const [formData, setFormData] = useReducer((state, action) => {
129
129
  if (action.reset) {
130
+ if (data.email_otp_verification) {
131
+ dispatch(resetOTP(id));
132
+ }
130
133
  return getInitialData(data);
131
134
  }
132
135
 
@@ -209,7 +212,11 @@ const View = ({ data, id, path }) => {
209
212
  field: name,
210
213
  message: intl.formatMessage(messages.invalidEmailMessage),
211
214
  });
212
- } else if (isBCC && !formData[name].otp) {
215
+ } else if (
216
+ data.email_otp_verification &&
217
+ isBCC &&
218
+ !formData[name].otp
219
+ ) {
213
220
  v.push({
214
221
  field: name + OTP_FIELDNAME_EXTENDER,
215
222
  message: intl.formatMessage(messages.insertOtp),
@@ -102,6 +102,15 @@ const messages = defineMessages({
102
102
  id: 'mail_footer_label',
103
103
  defaultMessage: 'Text at the end of the email',
104
104
  },
105
+ email_otp_verification: {
106
+ id: 'form_email_otp_verification',
107
+ defaultMessage: 'Validate BCC emails with OTP verification',
108
+ },
109
+ email_otp_verification_description: {
110
+ id: 'form_email_otp_verification_description',
111
+ defaultMessage:
112
+ "Prevent spam from your website. By enabling this option, you do not allow malicious users to send emails to other email addresses through your website. The OTP will be requested for all email-type fields for which the 'Send a copy of the email to this address' option is checked.",
113
+ },
105
114
  });
106
115
 
107
116
  const Schema = (data) => {
@@ -130,6 +139,7 @@ const Schema = (data) => {
130
139
  ...(data?.show_cancel ? ['cancel_label'] : []),
131
140
  'set_limit',
132
141
  ...(data?.set_limit ? ['limit'] : []),
142
+ 'email_otp_verification',
133
143
  'mail_header',
134
144
  'mail_footer',
135
145
  'captcha',
@@ -202,6 +212,14 @@ const Schema = (data) => {
202
212
  '@id': 'collective.volto.formsupport.captcha.providers',
203
213
  },
204
214
  },
215
+ email_otp_verification: {
216
+ type: 'boolean',
217
+ title: intl.formatMessage(messages.email_otp_verification),
218
+ description: intl.formatMessage(
219
+ messages.email_otp_verification_description,
220
+ ),
221
+ default: false,
222
+ },
205
223
  store: {
206
224
  type: 'boolean',
207
225
  title: intl.formatMessage(messages.store),
@@ -15,8 +15,11 @@
15
15
  min-width: 150px;
16
16
 
17
17
  &:focus-within {
18
- border: 2px solid $inner-focus-border !important;
19
- box-shadow: 0 0 0 2px $outer-focus-outline !important;
18
+ outline: 2px solid $outer-focus-outline !important;
19
+ outline-offset: 2px;
20
+
21
+ border: none !important;
22
+ box-shadow: 0 0 0 2px $inner-focus-shadow !important;
20
23
  }
21
24
 
22
25
  .react-select__control {
@@ -58,8 +61,11 @@
58
61
  }
59
62
 
60
63
  &.DateInput_input__focused {
61
- border: 2px solid $inner-focus-border !important;
62
- box-shadow: 0 0 0 2px $outer-focus-outline !important;
64
+ outline: 2px solid $outer-focus-outline !important;
65
+ outline-offset: 2px;
66
+
67
+ border: none !important;
68
+ box-shadow: 0 0 0 2px $inner-focus-shadow !important;
63
69
  }
64
70
  }
65
71
 
@@ -20,7 +20,10 @@
20
20
  .react-select__control,
21
21
  .react-select__control:hover {
22
22
  &.react-select__control--is-focused {
23
- border: 2px solid $inner-focus-border !important;
24
- box-shadow: 0 0 0 2px $outer-focus-outline !important;
23
+ outline: 2px solid $outer-focus-outline !important;
24
+ outline-offset: 2px;
25
+
26
+ border: none !important;
27
+ box-shadow: 0 0 0 2px $inner-focus-shadow !important;
25
28
  }
26
29
  }
@@ -7,9 +7,11 @@
7
7
  button.btn,
8
8
  button.rounded-right {
9
9
  &:focus {
10
- border: 2px solid $inner-focus-border !important;
11
- box-shadow: 0 0 0 2px $outer-focus-outline !important;
12
- outline: none;
10
+ outline: 2px solid $outer-focus-outline !important;
11
+ outline-offset: 2px;
12
+
13
+ border: none !important;
14
+ box-shadow: 0 0 0 2px $inner-focus-shadow !important;
13
15
  }
14
16
  }
15
17
 
@@ -61,4 +61,4 @@ $ribbon-width: calc($spacer * 2);
61
61
 
62
62
  // accessible focus colors
63
63
  $outer-focus-outline: #000 !default;
64
- $inner-focus-border: #fff !default;
64
+ $inner-focus-shadow: #fff !default;
@@ -1,7 +1,10 @@
1
1
  :focus:not(.focus--mouse),
2
2
  %focus {
3
- box-shadow: 0 0 0 2px $outer-focus-outline !important;
4
- border: 2px solid $inner-focus-border !important;
3
+ outline: 2px solid $outer-focus-outline !important;
4
+ outline-offset: 2px;
5
+
6
+ border: none !important;
7
+ box-shadow: 0 0 0 2px $inner-focus-shadow !important;
5
8
  }
6
9
 
7
10
  .skiplinks a:focus:not(.focus--mouse) {
@@ -18,8 +18,11 @@
18
18
  border: $header-center-bg-color 2px solid !important;
19
19
 
20
20
  &:focus {
21
- outline: 2.5px solid $inner-focus-border !important;
22
- box-shadow: 0 0 0 5px $outer-focus-outline !important;
21
+ outline: 2px solid $outer-focus-outline !important;
22
+ outline-offset: 2px;
23
+
24
+ border: none !important;
25
+ box-shadow: 0 0 0 2px $inner-focus-shadow !important;
23
26
  }
24
27
  }
25
28
  }