diff --git a/src/openforms/js/components/admin/form_design/RegistrationFields.stories.js b/src/openforms/js/components/admin/form_design/RegistrationFields.stories.js index a35a3378e5..86fbd85795 100644 --- a/src/openforms/js/components/admin/form_design/RegistrationFields.stories.js +++ b/src/openforms/js/components/admin/form_design/RegistrationFields.stories.js @@ -403,6 +403,73 @@ export default { label: 'textfield2', }, }, + availableFormVariables: [ + { + dataFormat: '', + dataType: 'string', + form: 'http://localhost:8000/api/v2/forms/ae26e20c-f059-4fdf-bb82-afc377869bb5', + formDefinition: null, + initialValue: '', + isSensitiveData: false, + key: 'textField1', + name: 'textfield1', + prefillAttribute: '', + prefillPlugin: '', + source: 'component', + }, + { + dataFormat: '', + dataType: 'string', + form: 'http://localhost:8000/api/v2/forms/ae26e20c-f059-4fdf-bb82-afc377869bb5', + formDefinition: null, + initialValue: '', + isSensitiveData: false, + key: 'textField2', + name: 'textfield2', + prefillAttribute: '', + prefillPlugin: '', + source: 'component', + }, + { + dataFormat: '', + dataType: 'string', + form: 'http://localhost:8000/api/v2/forms/ae26e20c-f059-4fdf-bb82-afc377869bb5', + formDefinition: null, + initialValue: '', + isSensitiveData: false, + key: 'userDefinedVar1', + name: 'User defined string', + prefillAttribute: '', + prefillPlugin: '', + source: 'user_defined', + }, + { + dataFormat: '', + dataType: 'array', + form: 'http://localhost:8000/api/v2/forms/ae26e20c-f059-4fdf-bb82-afc377869bb5', + formDefinition: null, + initialValue: [], + isSensitiveData: false, + key: 'userDefinedVar2', + name: 'User defined array', + prefillAttribute: '', + prefillPlugin: '', + source: 'user_defined', + }, + { + dataFormat: '', + dataType: 'float', + form: 'http://localhost:8000/api/v2/forms/ae26e20c-f059-4fdf-bb82-afc377869bb5', + formDefinition: null, + initialValue: null, + isSensitiveData: false, + key: 'userDefinedVar3', + name: 'User defined float', + prefillAttribute: '', + prefillPlugin: '', + source: 'user_defined', + }, + ], registrationPluginsVariables: [ { pluginIdentifier: 'stuf-zds-create-zaak', diff --git a/src/openforms/js/components/admin/form_design/registrations/email/EmailOptionsForm.js b/src/openforms/js/components/admin/form_design/registrations/email/EmailOptionsForm.js index 3871a0c8d8..ae75d34e5b 100644 --- a/src/openforms/js/components/admin/form_design/registrations/email/EmailOptionsForm.js +++ b/src/openforms/js/components/admin/form_design/registrations/email/EmailOptionsForm.js @@ -23,6 +23,7 @@ const EmailOptionsForm = ({name, label, schema, formData, onChange}) => { /> } initialFormData={{ + toEmailsFromVariable: '', // ensure an initial value is provided ...formData, // ensure we have a blank row initially toEmails: formData.toEmails?.length ? formData.toEmails : [''], diff --git a/src/openforms/js/components/admin/form_design/registrations/email/EmailOptionsFormFields.js b/src/openforms/js/components/admin/form_design/registrations/email/EmailOptionsFormFields.js index d6692f05b3..19c7bcae38 100644 --- a/src/openforms/js/components/admin/form_design/registrations/email/EmailOptionsFormFields.js +++ b/src/openforms/js/components/admin/form_design/registrations/email/EmailOptionsFormFields.js @@ -36,9 +36,26 @@ const EmailOptionsFormFields = ({name, schema}) => { const relevantErrors = filterErrors(name, validationErrors); return ( -
+
+ } + > +
+ +
+ } + > diff --git a/src/openforms/js/components/admin/form_design/registrations/email/fields/EmailRecipients.js b/src/openforms/js/components/admin/form_design/registrations/email/fields/EmailRecipients.js index 7c2ad6c6cf..ff7fcc77ee 100644 --- a/src/openforms/js/components/admin/form_design/registrations/email/fields/EmailRecipients.js +++ b/src/openforms/js/components/admin/form_design/registrations/email/fields/EmailRecipients.js @@ -19,6 +19,7 @@ const EmailRecipients = () => { defaultMessage="The email addresses to which the submission details will be sent" /> } + required > { - const [fieldProps, , fieldHelpers] = useField('toEmailsFromVariable'); - const {setValue} = fieldHelpers; + const [fieldProps, , {setValue}] = useField('toEmailsFromVariable'); return ( { label={ } helpText={ } > { - setValue(event.target.value); + const newValue = event.target.value; + setValue(newValue == null ? '' : newValue); }} + filter={variable => ['string', 'array'].includes(variable.dataType)} /> diff --git a/src/openforms/js/lang/nl.json b/src/openforms/js/lang/nl.json index 697caa3cfe..823026b105 100644 --- a/src/openforms/js/lang/nl.json +++ b/src/openforms/js/lang/nl.json @@ -1229,7 +1229,7 @@ "originalDefault": "Something went wrong while retrieving the available products defined in the selected case. Please check that the services in the selected API group are configured correctly." }, "LeVpdf": { - "defaultMessage": "Plugin-insellingen: e-mail", + "defaultMessage": "Plugin-instellingen: e-mail", "description": "Email registration options modal title", "originalDefault": "Plugin configuration: Email" },