design-comuni-plone-theme 11.21.1 → 11.22.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.
- package/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +23 -0
- package/RELEASE.md +18 -0
- package/locales/de/LC_MESSAGES/volto.po +40 -5
- package/locales/en/LC_MESSAGES/volto.po +40 -5
- package/locales/es/LC_MESSAGES/volto.po +40 -5
- package/locales/fr/LC_MESSAGES/volto.po +40 -5
- package/locales/it/LC_MESSAGES/volto.po +40 -5
- package/locales/volto.pot +41 -6
- package/package.json +1 -1
- package/publiccode.yml +2 -2
- package/src/components/ItaliaTheme/Blocks/EventSearch/DefaultFilters.js +1 -11
- package/src/components/ItaliaTheme/CustomerSatisfaction/FeedbackForm.jsx +3 -18
- package/src/components/ItaliaTheme/View/PersonaView/PersonaDocumenti.jsx +50 -0
- package/src/components/ItaliaTheme/View/UOView/UOMetadati.jsx +12 -0
- package/src/components/ItaliaTheme/View/UOView/UOView.jsx +3 -0
- package/src/components/ItaliaTheme/View/index.js +1 -0
- package/src/config/italiaConfig.js +1 -0
- package/src/customizations/volto/actions/vocabularies/vocabularies.js +2 -2
- package/src/customizations/volto/components/manage/Blocks/Search/SearchBlockView.jsx +35 -9
- package/src/customizations/volto/components/manage/Blocks/Search/components/SearchDetails.jsx +2 -3
- package/src/customizations/volto/components/manage/Blocks/Search/hocs/withSearch.jsx +6 -4
- package/src/customizations/volto/components/theme/Footer/Footer.jsx +7 -13
- package/src/customizations/volto-form-block/components/FormResult.jsx +39 -9
- package/src/customizations/volto-form-block/components/Sidebar.jsx +325 -0
- package/src/customizations/volto-form-block/components/View.jsx +390 -0
- package/src/customizations/volto-form-block/fieldSchema.js +174 -0
- package/src/customizations/volto-form-block/formSchema.js +237 -0
- package/src/overrideTranslations.jsx +26 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
// CUSTOMIZATION:
|
|
2
|
+
// - added unique parameter to fields to allow preventing users from using same value more than once in the same field e.g. submitting form with same email more than once
|
|
3
|
+
/* eslint-disable import/no-anonymous-default-export */
|
|
4
|
+
import config from '@plone/volto/registry';
|
|
5
|
+
import { defineMessages } from 'react-intl';
|
|
6
|
+
import { useIntl } from 'react-intl';
|
|
7
|
+
|
|
8
|
+
const messages = defineMessages({
|
|
9
|
+
field_label: {
|
|
10
|
+
id: 'form_field_label',
|
|
11
|
+
defaultMessage: 'Label',
|
|
12
|
+
},
|
|
13
|
+
field_description: {
|
|
14
|
+
id: 'form_field_description',
|
|
15
|
+
defaultMessage: 'Description',
|
|
16
|
+
},
|
|
17
|
+
field_required: {
|
|
18
|
+
id: 'form_field_required',
|
|
19
|
+
defaultMessage: 'Required',
|
|
20
|
+
},
|
|
21
|
+
field_type: {
|
|
22
|
+
id: 'form_field_type',
|
|
23
|
+
defaultMessage: 'Field type',
|
|
24
|
+
},
|
|
25
|
+
field_type_text: {
|
|
26
|
+
id: 'form_field_type_text',
|
|
27
|
+
defaultMessage: 'Text',
|
|
28
|
+
},
|
|
29
|
+
field_type_textarea: {
|
|
30
|
+
id: 'form_field_type_textarea',
|
|
31
|
+
defaultMessage: 'Textarea',
|
|
32
|
+
},
|
|
33
|
+
field_type_select: {
|
|
34
|
+
id: 'form_field_type_select',
|
|
35
|
+
defaultMessage: 'List',
|
|
36
|
+
},
|
|
37
|
+
field_type_single_choice: {
|
|
38
|
+
id: 'form_field_type_single_choice',
|
|
39
|
+
defaultMessage: 'Single choice',
|
|
40
|
+
},
|
|
41
|
+
field_type_multiple_choice: {
|
|
42
|
+
id: 'form_field_type_multiple_choice',
|
|
43
|
+
defaultMessage: 'Multiple choice',
|
|
44
|
+
},
|
|
45
|
+
field_type_checkbox: {
|
|
46
|
+
id: 'form_field_type_checkbox',
|
|
47
|
+
defaultMessage: 'Checkbox',
|
|
48
|
+
},
|
|
49
|
+
field_type_date: {
|
|
50
|
+
id: 'form_field_type_date',
|
|
51
|
+
defaultMessage: 'Date',
|
|
52
|
+
},
|
|
53
|
+
field_type_attachment: {
|
|
54
|
+
id: 'form_field_type_attachment',
|
|
55
|
+
defaultMessage: 'Attachment',
|
|
56
|
+
},
|
|
57
|
+
field_type_attachment_info_text: {
|
|
58
|
+
id: 'form_field_type_attachment_info_text',
|
|
59
|
+
defaultMessage: 'Any attachments can be emailed, but will not be saved.',
|
|
60
|
+
},
|
|
61
|
+
field_type_from: {
|
|
62
|
+
id: 'form_field_type_from',
|
|
63
|
+
defaultMessage: 'E-mail',
|
|
64
|
+
},
|
|
65
|
+
field_type_static_text: {
|
|
66
|
+
id: 'form_field_type_static_text',
|
|
67
|
+
defaultMessage: 'Static text',
|
|
68
|
+
},
|
|
69
|
+
field_type_hidden: {
|
|
70
|
+
id: 'form_field_type_hidden',
|
|
71
|
+
defaultMessage: 'Hidden',
|
|
72
|
+
},
|
|
73
|
+
field_unique_title: {
|
|
74
|
+
id: 'field_unique_title',
|
|
75
|
+
defaultMessage: 'Unique field',
|
|
76
|
+
},
|
|
77
|
+
field_unique_description: {
|
|
78
|
+
id: 'field_unique_description',
|
|
79
|
+
defaultMessage:
|
|
80
|
+
'Check this box if the value entered in this field can be used only once.',
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
export default (props) => {
|
|
85
|
+
var intl = useIntl();
|
|
86
|
+
const baseFieldTypeChoices = [
|
|
87
|
+
['text', intl.formatMessage(messages.field_type_text)],
|
|
88
|
+
['textarea', intl.formatMessage(messages.field_type_textarea)],
|
|
89
|
+
['select', intl.formatMessage(messages.field_type_select)],
|
|
90
|
+
['single_choice', intl.formatMessage(messages.field_type_single_choice)],
|
|
91
|
+
[
|
|
92
|
+
'multiple_choice',
|
|
93
|
+
intl.formatMessage(messages.field_type_multiple_choice),
|
|
94
|
+
],
|
|
95
|
+
['checkbox', intl.formatMessage(messages.field_type_checkbox)],
|
|
96
|
+
['date', intl.formatMessage(messages.field_type_date)],
|
|
97
|
+
['attachment', intl.formatMessage(messages.field_type_attachment)],
|
|
98
|
+
['from', intl.formatMessage(messages.field_type_from)],
|
|
99
|
+
['static_text', intl.formatMessage(messages.field_type_static_text)],
|
|
100
|
+
['hidden', intl.formatMessage(messages.field_type_hidden)],
|
|
101
|
+
];
|
|
102
|
+
var attachmentDescription =
|
|
103
|
+
props?.field_type === 'attachment'
|
|
104
|
+
? {
|
|
105
|
+
description: intl.formatMessage(
|
|
106
|
+
messages.field_type_attachment_info_text,
|
|
107
|
+
),
|
|
108
|
+
}
|
|
109
|
+
: {};
|
|
110
|
+
|
|
111
|
+
var schemaExtender =
|
|
112
|
+
config.blocks.blocksConfig.form.fieldTypeSchemaExtenders[props?.field_type];
|
|
113
|
+
const schemaExtenderValues = schemaExtender
|
|
114
|
+
? schemaExtender(intl)
|
|
115
|
+
: { properties: [], fields: [], required: [] };
|
|
116
|
+
|
|
117
|
+
return {
|
|
118
|
+
title: props?.label || '',
|
|
119
|
+
fieldsets: [
|
|
120
|
+
{
|
|
121
|
+
id: 'default',
|
|
122
|
+
title: 'Default',
|
|
123
|
+
fields: [
|
|
124
|
+
'label',
|
|
125
|
+
'description',
|
|
126
|
+
'field_type',
|
|
127
|
+
...schemaExtenderValues.fields,
|
|
128
|
+
...(props?.field_type === 'static_text' ? [] : ['required']),
|
|
129
|
+
'unique',
|
|
130
|
+
],
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
|
|
134
|
+
properties: {
|
|
135
|
+
label: {
|
|
136
|
+
title: intl.formatMessage(messages.field_label),
|
|
137
|
+
send_to_backend: true,
|
|
138
|
+
},
|
|
139
|
+
description: {
|
|
140
|
+
title: intl.formatMessage(messages.field_description),
|
|
141
|
+
},
|
|
142
|
+
field_type: {
|
|
143
|
+
title: intl.formatMessage(messages.field_type),
|
|
144
|
+
type: 'string',
|
|
145
|
+
choices: [
|
|
146
|
+
...baseFieldTypeChoices,
|
|
147
|
+
...(config.blocks.blocksConfig.form.additionalFields?.map(
|
|
148
|
+
(fieldType) => [fieldType.id, fieldType.label],
|
|
149
|
+
) ?? []),
|
|
150
|
+
],
|
|
151
|
+
...attachmentDescription,
|
|
152
|
+
},
|
|
153
|
+
required: {
|
|
154
|
+
title: intl.formatMessage(messages.field_required),
|
|
155
|
+
type: 'boolean',
|
|
156
|
+
default: false,
|
|
157
|
+
},
|
|
158
|
+
unique: {
|
|
159
|
+
title: intl.formatMessage(messages.field_unique_title),
|
|
160
|
+
description: intl.formatMessage(messages.field_unique_description),
|
|
161
|
+
type: 'boolean',
|
|
162
|
+
default: false,
|
|
163
|
+
send_to_backend: true,
|
|
164
|
+
},
|
|
165
|
+
...schemaExtenderValues.properties,
|
|
166
|
+
},
|
|
167
|
+
required: [
|
|
168
|
+
'label',
|
|
169
|
+
'field_type',
|
|
170
|
+
'input_values',
|
|
171
|
+
...schemaExtenderValues.required,
|
|
172
|
+
],
|
|
173
|
+
};
|
|
174
|
+
};
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
// CUSTOMIZATION:
|
|
2
|
+
// - added field to set a subscription limit
|
|
3
|
+
import { defineMessages } from 'react-intl';
|
|
4
|
+
import { useIntl } from 'react-intl';
|
|
5
|
+
|
|
6
|
+
const messages = defineMessages({
|
|
7
|
+
form: {
|
|
8
|
+
id: 'form',
|
|
9
|
+
defaultMessage: 'Form',
|
|
10
|
+
},
|
|
11
|
+
title: {
|
|
12
|
+
id: 'title',
|
|
13
|
+
defaultMessage: 'Title',
|
|
14
|
+
},
|
|
15
|
+
description: {
|
|
16
|
+
id: 'description',
|
|
17
|
+
defaultMessage: 'Description',
|
|
18
|
+
},
|
|
19
|
+
default_to: {
|
|
20
|
+
id: 'form_to',
|
|
21
|
+
defaultMessage: 'Recipients',
|
|
22
|
+
},
|
|
23
|
+
default_from: {
|
|
24
|
+
id: 'form_default_from',
|
|
25
|
+
defaultMessage: 'Default sender',
|
|
26
|
+
},
|
|
27
|
+
default_subject: {
|
|
28
|
+
id: 'form_default_subject',
|
|
29
|
+
defaultMessage: 'Mail subject',
|
|
30
|
+
},
|
|
31
|
+
default_subject_description: {
|
|
32
|
+
id: 'form_default_subject_description',
|
|
33
|
+
defaultMessage:
|
|
34
|
+
'Use the ${field_id} syntax to add a form value to the email subject',
|
|
35
|
+
},
|
|
36
|
+
submit_label: {
|
|
37
|
+
id: 'form_submit_label',
|
|
38
|
+
defaultMessage: 'Submit button label',
|
|
39
|
+
},
|
|
40
|
+
show_cancel: {
|
|
41
|
+
id: 'form_show_cancel',
|
|
42
|
+
defaultMessage: 'Show cancel button',
|
|
43
|
+
},
|
|
44
|
+
set_limit: {
|
|
45
|
+
id: 'form_set_limit',
|
|
46
|
+
defaultMessage: 'Set a submission limit',
|
|
47
|
+
},
|
|
48
|
+
limit: {
|
|
49
|
+
id: 'form_limit',
|
|
50
|
+
defaultMessage: 'Submission limit',
|
|
51
|
+
},
|
|
52
|
+
cancel_label: {
|
|
53
|
+
id: 'form_cancel_label',
|
|
54
|
+
defaultMessage: 'Cancel button label',
|
|
55
|
+
},
|
|
56
|
+
captcha: {
|
|
57
|
+
id: 'captcha',
|
|
58
|
+
defaultMessage: 'Captcha provider',
|
|
59
|
+
},
|
|
60
|
+
store: {
|
|
61
|
+
id: 'form_save_persistent_data',
|
|
62
|
+
defaultMessage: 'Store compiled data',
|
|
63
|
+
},
|
|
64
|
+
remove_data_after_days: {
|
|
65
|
+
id: 'form_remove_data_after_days',
|
|
66
|
+
defaultMessage: 'Data wipe',
|
|
67
|
+
},
|
|
68
|
+
remove_data_after_days_helptext: {
|
|
69
|
+
id: 'form_remove_data_after_days_helptext',
|
|
70
|
+
defaultMessage: 'Number of days after which, the data should be deleted',
|
|
71
|
+
},
|
|
72
|
+
attachmentSendEmail: {
|
|
73
|
+
id: 'form_attachment_send_email_info_text',
|
|
74
|
+
defaultMessage: 'Attached file will be sent via email, but not stored',
|
|
75
|
+
},
|
|
76
|
+
send: {
|
|
77
|
+
id: 'form_send_email',
|
|
78
|
+
defaultMessage: 'Send email to recipient',
|
|
79
|
+
},
|
|
80
|
+
send_message: {
|
|
81
|
+
id: 'form_send_message',
|
|
82
|
+
defaultMessage: 'Message of sending confirmed',
|
|
83
|
+
},
|
|
84
|
+
send_message_helptext: {
|
|
85
|
+
id: 'form_send_message_helptext',
|
|
86
|
+
defaultMessage:
|
|
87
|
+
'You can add the value of a filled field in the form by inserting its ID between curly brackets preceded by $, example: ${field_id}; you can add also html elements such as links <a>, new line <br />, bold <b> and italic <i> formatting.',
|
|
88
|
+
},
|
|
89
|
+
manage_data: {
|
|
90
|
+
id: 'form_manage_data',
|
|
91
|
+
defaultMessage: 'Manage data',
|
|
92
|
+
},
|
|
93
|
+
mail_header_label: {
|
|
94
|
+
id: 'mail_header_label',
|
|
95
|
+
defaultMessage: 'Text at the beginning of the email',
|
|
96
|
+
},
|
|
97
|
+
mail_header_footer_description: {
|
|
98
|
+
id: 'mail_header_description',
|
|
99
|
+
defaultMessage: "If field isn't filled in, a default text will be used",
|
|
100
|
+
},
|
|
101
|
+
mail_footer_label: {
|
|
102
|
+
id: 'mail_footer_label',
|
|
103
|
+
defaultMessage: 'Text at the end of the email',
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
const Schema = (data) => {
|
|
108
|
+
var intl = useIntl();
|
|
109
|
+
|
|
110
|
+
let conditional_required = [];
|
|
111
|
+
if (!data.store && !data.send) {
|
|
112
|
+
conditional_required.push('store');
|
|
113
|
+
conditional_required.push('send');
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return {
|
|
117
|
+
title: intl.formatMessage(messages.form),
|
|
118
|
+
fieldsets: [
|
|
119
|
+
{
|
|
120
|
+
id: 'default',
|
|
121
|
+
title: 'Default',
|
|
122
|
+
fields: [
|
|
123
|
+
'title',
|
|
124
|
+
'description',
|
|
125
|
+
'default_to',
|
|
126
|
+
'default_from',
|
|
127
|
+
'default_subject',
|
|
128
|
+
'submit_label',
|
|
129
|
+
'show_cancel',
|
|
130
|
+
...(data?.show_cancel ? ['cancel_label'] : []),
|
|
131
|
+
'set_limit',
|
|
132
|
+
...(data?.set_limit ? ['limit'] : []),
|
|
133
|
+
'mail_header',
|
|
134
|
+
'mail_footer',
|
|
135
|
+
'captcha',
|
|
136
|
+
],
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
id: 'manage_data',
|
|
140
|
+
title: intl.formatMessage(messages.manage_data),
|
|
141
|
+
fields: ['store', 'remove_data_after_days', 'send', 'send_message'],
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
properties: {
|
|
145
|
+
title: {
|
|
146
|
+
title: intl.formatMessage(messages.title),
|
|
147
|
+
},
|
|
148
|
+
description: {
|
|
149
|
+
title: intl.formatMessage(messages.description),
|
|
150
|
+
type: 'textarea',
|
|
151
|
+
},
|
|
152
|
+
default_to: {
|
|
153
|
+
title: intl.formatMessage(messages.default_to),
|
|
154
|
+
},
|
|
155
|
+
default_from: {
|
|
156
|
+
title: intl.formatMessage(messages.default_from),
|
|
157
|
+
},
|
|
158
|
+
default_subject: {
|
|
159
|
+
title: intl.formatMessage(messages.default_subject),
|
|
160
|
+
description: intl.formatMessage(messages.default_subject_description),
|
|
161
|
+
},
|
|
162
|
+
submit_label: {
|
|
163
|
+
title: intl.formatMessage(messages.submit_label),
|
|
164
|
+
},
|
|
165
|
+
show_cancel: {
|
|
166
|
+
type: 'boolean',
|
|
167
|
+
title: intl.formatMessage(messages.show_cancel),
|
|
168
|
+
default: false,
|
|
169
|
+
},
|
|
170
|
+
set_limit: {
|
|
171
|
+
type: 'boolean',
|
|
172
|
+
title: intl.formatMessage(messages.set_limit),
|
|
173
|
+
default: false,
|
|
174
|
+
},
|
|
175
|
+
limit: {
|
|
176
|
+
title: intl.formatMessage(messages.limit),
|
|
177
|
+
default: -1,
|
|
178
|
+
},
|
|
179
|
+
cancel_label: {
|
|
180
|
+
title: intl.formatMessage(messages.cancel_label),
|
|
181
|
+
},
|
|
182
|
+
mail_header: {
|
|
183
|
+
title: intl.formatMessage(messages.mail_header_label),
|
|
184
|
+
widget: 'richtext',
|
|
185
|
+
type: 'string',
|
|
186
|
+
description: intl.formatMessage(
|
|
187
|
+
messages.mail_header_footer_description,
|
|
188
|
+
),
|
|
189
|
+
},
|
|
190
|
+
mail_footer: {
|
|
191
|
+
title: intl.formatMessage(messages.mail_footer_label),
|
|
192
|
+
widget: 'richtext',
|
|
193
|
+
type: 'string',
|
|
194
|
+
description: intl.formatMessage(
|
|
195
|
+
messages.mail_header_footer_description,
|
|
196
|
+
),
|
|
197
|
+
},
|
|
198
|
+
captcha: {
|
|
199
|
+
title: intl.formatMessage(messages.captcha),
|
|
200
|
+
type: 'string',
|
|
201
|
+
vocabulary: {
|
|
202
|
+
'@id': 'collective.volto.formsupport.captcha.providers',
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
store: {
|
|
206
|
+
type: 'boolean',
|
|
207
|
+
title: intl.formatMessage(messages.store),
|
|
208
|
+
},
|
|
209
|
+
remove_data_after_days: {
|
|
210
|
+
type: 'integer',
|
|
211
|
+
title: intl.formatMessage(messages.remove_data_after_days),
|
|
212
|
+
description: intl.formatMessage(
|
|
213
|
+
messages.remove_data_after_days_helptext,
|
|
214
|
+
),
|
|
215
|
+
default: -1,
|
|
216
|
+
},
|
|
217
|
+
send: {
|
|
218
|
+
type: 'boolean',
|
|
219
|
+
title: intl.formatMessage(messages.send),
|
|
220
|
+
description: intl.formatMessage(messages.attachmentSendEmail),
|
|
221
|
+
},
|
|
222
|
+
send_message: {
|
|
223
|
+
title: intl.formatMessage(messages.send_message),
|
|
224
|
+
widget: 'textarea',
|
|
225
|
+
description: intl.formatMessage(messages.send_message_helptext),
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
required: [
|
|
229
|
+
'default_to',
|
|
230
|
+
'default_from',
|
|
231
|
+
'default_subject',
|
|
232
|
+
'captcha',
|
|
233
|
+
...conditional_required,
|
|
234
|
+
],
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
export default Schema;
|
|
@@ -68,4 +68,30 @@ defineMessages({
|
|
|
68
68
|
id: 'Clear dates',
|
|
69
69
|
defaultMessage: 'Pulisci i campi',
|
|
70
70
|
},
|
|
71
|
+
success_warning: {
|
|
72
|
+
id: 'form_submit_success_warning',
|
|
73
|
+
defaultMessage: "Sei stato inserito in lista d'attesa",
|
|
74
|
+
},
|
|
75
|
+
success_warning_description: {
|
|
76
|
+
id: 'form_submit_success_warning_description',
|
|
77
|
+
defaultMessage:
|
|
78
|
+
"I tuoi dati sono stati inviati, ma è già stato raggiunto il limite di iscrizioni, sei stato inserito in lista d'attesa.",
|
|
79
|
+
},
|
|
80
|
+
field_unique_title: {
|
|
81
|
+
id: 'field_unique_title',
|
|
82
|
+
defaultMessage: 'Unique field',
|
|
83
|
+
},
|
|
84
|
+
field_unique_description: {
|
|
85
|
+
id: 'field_unique_description',
|
|
86
|
+
defaultMessage:
|
|
87
|
+
'Check this box if the value entered in this field can be used only once.',
|
|
88
|
+
},
|
|
89
|
+
set_limit: {
|
|
90
|
+
id: 'form_set_limit',
|
|
91
|
+
defaultMessage: 'Set a submission limit',
|
|
92
|
+
},
|
|
93
|
+
limit: {
|
|
94
|
+
id: 'form_limit',
|
|
95
|
+
defaultMessage: 'Submission limit',
|
|
96
|
+
},
|
|
71
97
|
});
|