diff --git a/src/openforms/js/compiled-lang/en.json b/src/openforms/js/compiled-lang/en.json
index f0fd88ca93..0ae70acf73 100644
--- a/src/openforms/js/compiled-lang/en.json
+++ b/src/openforms/js/compiled-lang/en.json
@@ -503,6 +503,12 @@
"value": "Toggle JSON Schema"
}
],
+ "3zaZWN": [
+ {
+ "type": 0,
+ "value": "Plugin configuration: demo"
+ }
+ ],
"4/cCvG": [
{
"type": 0,
@@ -1259,6 +1265,12 @@
"value": "'Remove row' text"
}
],
+ "B/A1Bk": [
+ {
+ "type": 0,
+ "value": "Which merchant should be used for payments related to this form."
+ }
+ ],
"B1ONuu": [
{
"type": 0,
@@ -1835,6 +1847,12 @@
"value": "Base"
}
],
+ "F2VuCs": [
+ {
+ "type": 0,
+ "value": "Merchant ID"
+ }
+ ],
"F9ew4C": [
{
"type": 0,
@@ -2413,6 +2431,12 @@
"value": "Something went wrong while rendering the registration options"
}
],
+ "LBEeSy": [
+ {
+ "type": 0,
+ "value": "Drive ID"
+ }
+ ],
"LD3weJ": [
{
"type": 0,
@@ -4077,6 +4101,12 @@
"value": "Incomplete Submissions Removal Limit"
}
],
+ "cEALcN": [
+ {
+ "type": 0,
+ "value": "Configure options"
+ }
+ ],
"cID9dz": [
{
"type": 0,
@@ -4965,6 +4995,12 @@
"value": "Session will expire"
}
],
+ "jpL29S": [
+ {
+ "type": 0,
+ "value": "Folder path"
+ }
+ ],
"jtWzSW": [
{
"type": 0,
@@ -5135,6 +5171,68 @@
"value": "Including today"
}
],
+ "lNBZdl": [
+ {
+ "type": 0,
+ "value": "The path of the folder where folders containing Open-Forms related documents will be created. You can use the expressions "
+ },
+ {
+ "children": [
+ {
+ "type": 0,
+ "value": "{{ year }}"
+ }
+ ],
+ "type": 8,
+ "value": "code"
+ },
+ {
+ "type": 0,
+ "value": ", "
+ },
+ {
+ "children": [
+ {
+ "type": 0,
+ "value": "{{ month }}"
+ }
+ ],
+ "type": 8,
+ "value": "code"
+ },
+ {
+ "type": 0,
+ "value": " and "
+ },
+ {
+ "children": [
+ {
+ "type": 0,
+ "value": "{{ day }}"
+ }
+ ],
+ "type": 8,
+ "value": "code"
+ },
+ {
+ "type": 0,
+ "value": ". The path must start with "
+ },
+ {
+ "children": [
+ {
+ "type": 0,
+ "value": "/"
+ }
+ ],
+ "type": 8,
+ "value": "code"
+ },
+ {
+ "type": 0,
+ "value": "."
+ }
+ ],
"lOSmt+": [
{
"type": 0,
@@ -5735,6 +5833,40 @@
"value": "Enable to attach file uploads to the registration email. If set, this overrides the global default. Form designers should take special care to ensure that the total file upload sizes do not exceed the email size limit."
}
],
+ "sQpH2P": [
+ {
+ "offset": 0,
+ "options": {
+ "one": {
+ "value": [
+ {
+ "type": 0,
+ "value": "There is a validation error."
+ }
+ ]
+ },
+ "other": {
+ "value": [
+ {
+ "type": 0,
+ "value": "There are "
+ },
+ {
+ "type": 1,
+ "value": "numErrors"
+ },
+ {
+ "type": 0,
+ "value": " validation errors."
+ }
+ ]
+ }
+ },
+ "pluralType": "cardinal",
+ "type": 6,
+ "value": "numErrors"
+ }
+ ],
"sR9GVQ": [
{
"type": 0,
@@ -6019,6 +6151,12 @@
"value": "After how many seconds should the cached response expire."
}
],
+ "wAQaa5": [
+ {
+ "type": 0,
+ "value": "Extra print statement"
+ }
+ ],
"wIaGgb": [
{
"type": 0,
@@ -6101,6 +6239,12 @@
"value": "Component where times for an appointment will be shown"
}
],
+ "wnTTZr": [
+ {
+ "type": 0,
+ "value": "ID of the drive to use. If left empty, the default drive will be used."
+ }
+ ],
"wnxKT/": [
{
"type": 0,
@@ -6375,6 +6519,12 @@
"value": "hasDescription"
}
],
+ "zYu3XI": [
+ {
+ "type": 0,
+ "value": "Plugin configuration: Ogone legacy"
+ }
+ ],
"zeXZzX": [
{
"type": 0,
diff --git a/src/openforms/js/compiled-lang/nl.json b/src/openforms/js/compiled-lang/nl.json
index b440c28c3a..b0baaa38ea 100644
--- a/src/openforms/js/compiled-lang/nl.json
+++ b/src/openforms/js/compiled-lang/nl.json
@@ -503,6 +503,12 @@
"value": "Toon/verberg JSON Schema"
}
],
+ "3zaZWN": [
+ {
+ "type": 0,
+ "value": "Plugin configuration: demo"
+ }
+ ],
"4/cCvG": [
{
"type": 0,
@@ -1263,6 +1269,12 @@
"value": "'Groep verwijderen'-tekst"
}
],
+ "B/A1Bk": [
+ {
+ "type": 0,
+ "value": "Which merchant should be used for payments related to this form."
+ }
+ ],
"B1ONuu": [
{
"type": 0,
@@ -1856,6 +1868,12 @@
"value": "Base"
}
],
+ "F2VuCs": [
+ {
+ "type": 0,
+ "value": "Merchant ID"
+ }
+ ],
"F9ew4C": [
{
"type": 0,
@@ -2434,6 +2452,12 @@
"value": "Er ging iets fout bij het weergeven van de registratie-opties."
}
],
+ "LBEeSy": [
+ {
+ "type": 0,
+ "value": "Drive ID"
+ }
+ ],
"LD3weJ": [
{
"type": 0,
@@ -4099,6 +4123,12 @@
"value": "bewaartermijn voor sessies"
}
],
+ "cEALcN": [
+ {
+ "type": 0,
+ "value": "Configure options"
+ }
+ ],
"cID9dz": [
{
"type": 0,
@@ -4987,6 +5017,12 @@
"value": "Sessie gaat vervallen"
}
],
+ "jpL29S": [
+ {
+ "type": 0,
+ "value": "Folder path"
+ }
+ ],
"jtWzSW": [
{
"type": 0,
@@ -5157,6 +5193,68 @@
"value": "Inclusief de 'huidige datum'"
}
],
+ "lNBZdl": [
+ {
+ "type": 0,
+ "value": "The path of the folder where folders containing Open-Forms related documents will be created. You can use the expressions "
+ },
+ {
+ "children": [
+ {
+ "type": 0,
+ "value": "{{ year }}"
+ }
+ ],
+ "type": 8,
+ "value": "code"
+ },
+ {
+ "type": 0,
+ "value": ", "
+ },
+ {
+ "children": [
+ {
+ "type": 0,
+ "value": "{{ month }}"
+ }
+ ],
+ "type": 8,
+ "value": "code"
+ },
+ {
+ "type": 0,
+ "value": " and "
+ },
+ {
+ "children": [
+ {
+ "type": 0,
+ "value": "{{ day }}"
+ }
+ ],
+ "type": 8,
+ "value": "code"
+ },
+ {
+ "type": 0,
+ "value": ". The path must start with "
+ },
+ {
+ "children": [
+ {
+ "type": 0,
+ "value": "/"
+ }
+ ],
+ "type": 8,
+ "value": "code"
+ },
+ {
+ "type": 0,
+ "value": "."
+ }
+ ],
"lOSmt+": [
{
"type": 0,
@@ -5757,6 +5855,40 @@
"value": "Enable to attach file uploads to the registration email. If set, this overrides the global default. Form designers should take special care to ensure that the total file upload sizes do not exceed the email size limit."
}
],
+ "sQpH2P": [
+ {
+ "offset": 0,
+ "options": {
+ "one": {
+ "value": [
+ {
+ "type": 0,
+ "value": "There is a validation error."
+ }
+ ]
+ },
+ "other": {
+ "value": [
+ {
+ "type": 0,
+ "value": "There are "
+ },
+ {
+ "type": 1,
+ "value": "numErrors"
+ },
+ {
+ "type": 0,
+ "value": " validation errors."
+ }
+ ]
+ }
+ },
+ "pluralType": "cardinal",
+ "type": 6,
+ "value": "numErrors"
+ }
+ ],
"sR9GVQ": [
{
"type": 0,
@@ -6041,6 +6173,12 @@
"value": "Na hoeveel seconden moeten gecachete resultaten vervallen."
}
],
+ "wAQaa5": [
+ {
+ "type": 0,
+ "value": "Extra print statement"
+ }
+ ],
"wIaGgb": [
{
"type": 0,
@@ -6123,6 +6261,12 @@
"value": "Veld waar beschikbare tijden voor een afspraak komen te staan"
}
],
+ "wnTTZr": [
+ {
+ "type": 0,
+ "value": "ID of the drive to use. If left empty, the default drive will be used."
+ }
+ ],
"wnxKT/": [
{
"type": 0,
@@ -6397,6 +6541,12 @@
"value": "hasDescription"
}
],
+ "zYu3XI": [
+ {
+ "type": 0,
+ "value": "Plugin configuration: Ogone legacy"
+ }
+ ],
"zeXZzX": [
{
"type": 0,
diff --git a/src/openforms/js/components/admin/RJSFWrapper.js b/src/openforms/js/components/admin/RJSFWrapper.js
index 39ff3f8c21..4ce66d021a 100644
--- a/src/openforms/js/components/admin/RJSFWrapper.js
+++ b/src/openforms/js/components/admin/RJSFWrapper.js
@@ -1,11 +1,6 @@
-import Form from '@rjsf/core';
-import Widgets from '@rjsf/core/lib/components/widgets';
-import {isSelect, optionsList} from '@rjsf/core/lib/utils';
-import isEmpty from 'lodash/isEmpty';
+import {isSelect} from '@rjsf/core/lib/utils';
import PropTypes from 'prop-types';
-import React from 'react';
-import Field from './forms/Field';
import {FAIcon} from './icons';
/*
@@ -70,137 +65,4 @@ CustomFieldTemplate.propTypes = {
schema: PropTypes.object.isRequired,
};
-/*
-Adapted from:
-https://github.com/rjsf-team/react-jsonschema-form/blob/master/packages/core/src/components/widgets/CheckboxWidget.js#L5
- */
-const CustomCheckboxWidget = ({
- schema,
- id,
- value,
- disabled,
- readonly,
- label,
- autofocus,
- onChange,
- ...props
-}) => {
- // if it's nullable, defer to a dropdown
- if (isSelect(schema)) {
- const enumOptions = optionsList(schema);
- for (let option of enumOptions) {
- option.value = JSON.stringify(option.value);
- }
- const stringValue = typeof value != 'string' ? JSON.stringify(value) : value;
- const _onChange = value => {
- onChange(JSON.parse(value));
- };
- return (
-
- );
- }
-
- // The CustomCheckboxWidget is rendered as a children of the CustomFieldTemplate, which makes styling a bit trickier
- return (
-
-
- onChange(event.target.checked)}
- />
-
- );
-};
-
-CustomCheckboxWidget.propTypes = {
- schema: PropTypes.object.isRequired,
- id: PropTypes.string.isRequired,
- value: PropTypes.any,
- required: PropTypes.bool,
- disabled: PropTypes.bool,
- readonly: PropTypes.bool,
- autofocus: PropTypes.bool,
- multiple: PropTypes.bool,
- onChange: PropTypes.func,
-};
-
-const FormRjsfWrapper = ({name, label, schema, uiSchema, formData, onChange, errors}) => {
- let extraErrors = {};
-
- /*
- add backend validation errors in the correct format. RJSF takes nested objects,
- even for array types, for example:
-
- const extraErrors = {
- 'toEmails': {
- 0: {__errors: ['error 1']},
- },
- };
-
- */
- for (const [key, msg] of errors) {
- if (key.includes('nonFieldErrors')) continue;
- const bits = key.split('.');
- // create the nested structure. we can't use lodash, since it creates arrays for
- // indices rather than nested objects.
- let errObj = extraErrors;
- for (const pathBit of bits) {
- if (pathBit === '__proto__' || pathBit === 'prototype')
- throw new Error('Prototype polution!');
- if (!errObj[pathBit]) errObj[pathBit] = {};
- errObj = errObj[pathBit];
- }
- if (!errObj.__errors) errObj.__errors = [];
- errObj.__errors.push(msg);
- }
-
- return (
-
-
-
- );
-};
-
-FormRjsfWrapper.propTypes = {
- name: PropTypes.string.isRequired,
- label: PropTypes.node.isRequired,
- schema: PropTypes.shape({
- type: PropTypes.oneOf(['object']), // it's the JSON schema root, it has to be
- properties: PropTypes.object,
- required: PropTypes.arrayOf(PropTypes.string),
- }),
- uiSchema: PropTypes.object,
- formData: PropTypes.object,
- onChange: PropTypes.func.isRequired,
- errors: PropTypes.array,
-};
-
export {CustomFieldTemplate};
-export default FormRjsfWrapper;
diff --git a/src/openforms/js/components/admin/form_design/PaymentFields.js b/src/openforms/js/components/admin/form_design/PaymentFields.js
index 8e9edf9774..feafc9aae2 100644
--- a/src/openforms/js/components/admin/form_design/PaymentFields.js
+++ b/src/openforms/js/components/admin/form_design/PaymentFields.js
@@ -2,17 +2,20 @@ import PropTypes from 'prop-types';
import React from 'react';
import {FormattedMessage} from 'react-intl';
-import FormRjsfWrapper from 'components/admin/RJSFWrapper';
import Field from 'components/admin/forms/Field';
import Fieldset from 'components/admin/forms/Fieldset';
import FormRow from 'components/admin/forms/FormRow';
import Select from 'components/admin/forms/Select';
+import {PAYMENT_OPTIONS_FORMS} from './payments';
+
const PaymentFields = ({backends = [], selectedBackend = '', backendOptions = {}, onChange}) => {
const backendChoices = backends.map(backend => [backend.id, backend.label]);
const backend = backends.find(backend => backend.id === selectedBackend);
const hasOptionsForm = Boolean(backend && Object.keys(backend.schema.properties).length);
+ const OptionsFormComponent = backend ? PAYMENT_OPTIONS_FORMS[backend.id] : null;
+
return (
- {hasOptionsForm ? (
+ {hasOptionsForm && (
-
- }
+
- onChange({target: {name: 'form.paymentBackendOptions', value: formData}})
+ onSubmit={values =>
+ onChange({target: {name: 'form.paymentBackendOptions', value: values}})
}
/>
- ) : null}
+ )}
);
};
diff --git a/src/openforms/js/components/admin/form_design/PaymentFields.stories.js b/src/openforms/js/components/admin/form_design/PaymentFields.stories.js
new file mode 100644
index 0000000000..1a3965b6ce
--- /dev/null
+++ b/src/openforms/js/components/admin/form_design/PaymentFields.stories.js
@@ -0,0 +1,57 @@
+import {fn} from '@storybook/test';
+
+import {
+ FormDecorator,
+ ValidationErrorsDecorator,
+} from 'components/admin/form_design/story-decorators';
+
+import PaymentFields from './PaymentFields';
+
+export default {
+ title: 'Form design / Payments / PaymentFields',
+ decorators: [ValidationErrorsDecorator, FormDecorator],
+ component: PaymentFields,
+ args: {
+ backends: [
+ {id: 'demo', label: 'Demo', schema: {type: 'object', properties: {}}},
+ {
+ id: 'ogone-legacy',
+ label: 'Ogone legacy',
+ schema: {
+ type: 'object',
+ properties: {
+ merchantId: {
+ type: 'integer',
+ enum: [1, 2],
+ enumNames: ['Merchant 1', 'Merchant 2'],
+ title: 'Merchant id',
+ description: 'Merchant to use',
+ },
+ },
+ required: ['merchantId'],
+ },
+ },
+ ],
+ selectedBackend: '',
+ backendOptions: {},
+ onChange: fn(),
+ },
+};
+
+export const NothingSelected = {};
+
+export const Demo = {
+ args: {
+ selectedBackend: 'demo',
+ },
+};
+
+export const OgoneLegacy = {
+ name: 'Ogone (legacy)',
+ args: {
+ selectedBackend: 'ogone-legacy',
+ backendOptions: {
+ merchantId: 2,
+ },
+ },
+};
diff --git a/src/openforms/js/components/admin/form_design/RegistrationFields.js b/src/openforms/js/components/admin/form_design/RegistrationFields.js
index 6e929dbaf9..d2aa9bcde5 100644
--- a/src/openforms/js/components/admin/form_design/RegistrationFields.js
+++ b/src/openforms/js/components/admin/form_design/RegistrationFields.js
@@ -2,7 +2,6 @@ import PropTypes from 'prop-types';
import React from 'react';
import {FormattedMessage, useIntl} from 'react-intl';
-import FormRjsfWrapper from 'components/admin/RJSFWrapper';
import ButtonContainer from 'components/admin/forms/ButtonContainer';
import Field from 'components/admin/forms/Field';
import Fieldset from 'components/admin/forms/Fieldset';
@@ -30,13 +29,18 @@ const backendKeyGenerator = (function* () {
const BackendOptionsFormRow = ({backendType = null, currentOptions = {}, onChange, index}) => {
if (!backendType) return null;
+ // if there's no configuration form, there's nothing to do
+ if (!Object.keys(backendType.schema.properties).length) return null;
- const hasOptionsForm = Boolean(backendType && Object.keys(backendType.schema.properties).length);
- // either use the custom backend-specific defined form, or fall back to the generic react-json-schema-form
- const OptionsFormComponent = BACKEND_OPTIONS_FORMS[backendType.id]?.form ?? FormRjsfWrapper;
- if (!hasOptionsForm && !BACKEND_OPTIONS_FORMS[backendType.id]) {
+ // Look up the configuration form from the registry
+ const OptionsFormComponent = BACKEND_OPTIONS_FORMS[backendType.id]?.form;
+ if (!OptionsFormComponent) {
+ console.debug(
+ `No configuration form known in the registry for plugin with ID '${backendType.id}'.`
+ );
return null;
}
+
return (
(
+
+ }
+ numErrors={numErrors}
+ modalTitle={modalTitle}
+ initialFormData={initialFormData}
+ onSubmit={onSubmit}
+ modalSize=""
+ children={children}
+ />
+);
+
+OptionsConfiguration.propTypes = {
+ modalTitle: PropTypes.node.isRequired,
+ numErrors: PropTypes.number.isRequired,
+ initialFormData: PropTypes.object.isRequired,
+ onSubmit: PropTypes.func.isRequired,
+};
+
+export default OptionsConfiguration;
diff --git a/src/openforms/js/components/admin/form_design/payments/index.js b/src/openforms/js/components/admin/form_design/payments/index.js
new file mode 100644
index 0000000000..e972084244
--- /dev/null
+++ b/src/openforms/js/components/admin/form_design/payments/index.js
@@ -0,0 +1,6 @@
+import OgoneLegacyOptionsForm from './ogone_legacy';
+
+export const PAYMENT_OPTIONS_FORMS = {
+ demo: null,
+ 'ogone-legacy': OgoneLegacyOptionsForm,
+};
diff --git a/src/openforms/js/components/admin/form_design/payments/ogone_legacy/OgoneLegacyOptionsForm.js b/src/openforms/js/components/admin/form_design/payments/ogone_legacy/OgoneLegacyOptionsForm.js
new file mode 100644
index 0000000000..7bc97308d0
--- /dev/null
+++ b/src/openforms/js/components/admin/form_design/payments/ogone_legacy/OgoneLegacyOptionsForm.js
@@ -0,0 +1,67 @@
+import PropTypes from 'prop-types';
+import {useContext} from 'react';
+import {FormattedMessage} from 'react-intl';
+
+import Fieldset from 'components/admin/forms/Fieldset';
+import {
+ ValidationErrorContext,
+ ValidationErrorsProvider,
+ filterErrors,
+} from 'components/admin/forms/ValidationErrors';
+import {getChoicesFromSchema} from 'utils/json-schema';
+
+import OptionsConfiguration from '../OptionsConfiguration';
+import {MerchantID} from './fields';
+
+const OgoneLegacyOptionsForm = ({schema, formData, onSubmit}) => {
+ const validationErrors = useContext(ValidationErrorContext);
+
+ const merchantChoices = getChoicesFromSchema(
+ schema.properties.merchantId.enum,
+ schema.properties.merchantId.enumNames
+ ).map(([value, label]) => ({value, label}));
+
+ const relevantErrors = filterErrors('form.paymentBackendOptions', validationErrors);
+
+ return (
+
+ }
+ initialFormData={{
+ merchantId: null,
+ ...formData,
+ }}
+ onSubmit={onSubmit}
+ >
+
+
+
+
+ );
+};
+
+OgoneLegacyOptionsForm.propTypes = {
+ onSubmit: PropTypes.func.isRequired,
+ schema: PropTypes.shape({
+ type: PropTypes.oneOf(['object']), // it's the JSON schema root, it has to be
+ properties: PropTypes.shape({
+ merchantId: PropTypes.shape({
+ enum: PropTypes.arrayOf(PropTypes.number),
+ enumNames: PropTypes.arrayOf(PropTypes.string),
+ }),
+ }),
+ required: PropTypes.arrayOf(PropTypes.string),
+ }).isRequired,
+ formData: PropTypes.shape({
+ merchantId: PropTypes.number,
+ }),
+};
+
+export default OgoneLegacyOptionsForm;
diff --git a/src/openforms/js/components/admin/form_design/payments/ogone_legacy/fields.js b/src/openforms/js/components/admin/form_design/payments/ogone_legacy/fields.js
new file mode 100644
index 0000000000..785817854b
--- /dev/null
+++ b/src/openforms/js/components/admin/form_design/payments/ogone_legacy/fields.js
@@ -0,0 +1,37 @@
+import PropTypes from 'prop-types';
+import {FormattedMessage} from 'react-intl';
+
+import Field from 'components/admin/forms/Field';
+import FormRow from 'components/admin/forms/FormRow';
+import ReactSelect from 'components/admin/forms/ReactSelect';
+
+export const MerchantID = ({options}) => (
+
+
+ }
+ helpText={
+
+ }
+ >
+
+
+
+);
+
+MerchantID.propTypes = {
+ options: PropTypes.arrayOf(
+ PropTypes.shape({
+ value: PropTypes.number,
+ label: PropTypes.node.isRequired,
+ })
+ ).isRequired,
+};
diff --git a/src/openforms/js/components/admin/form_design/payments/ogone_legacy/index.js b/src/openforms/js/components/admin/form_design/payments/ogone_legacy/index.js
new file mode 100644
index 0000000000..99d97e30a0
--- /dev/null
+++ b/src/openforms/js/components/admin/form_design/payments/ogone_legacy/index.js
@@ -0,0 +1,3 @@
+import OgoneLegacyOptionsForm from './OgoneLegacyOptionsForm';
+
+export default OgoneLegacyOptionsForm;
diff --git a/src/openforms/js/components/admin/form_design/registrations/demo/DemoOptionsForm.js b/src/openforms/js/components/admin/form_design/registrations/demo/DemoOptionsForm.js
new file mode 100644
index 0000000000..84b51e0400
--- /dev/null
+++ b/src/openforms/js/components/admin/form_design/registrations/demo/DemoOptionsForm.js
@@ -0,0 +1,72 @@
+import {useField} from 'formik';
+import PropTypes from 'prop-types';
+import React, {useContext} from 'react';
+import {FormattedMessage} from 'react-intl';
+
+import Field from 'components/admin/forms/Field';
+import Fieldset from 'components/admin/forms/Fieldset';
+import FormRow from 'components/admin/forms/FormRow';
+import {TextInput} from 'components/admin/forms/Inputs';
+import ModalOptionsConfiguration from 'components/admin/forms/ModalOptionsConfiguration';
+import {
+ ValidationErrorContext,
+ ValidationErrorsProvider,
+ filterErrors,
+} from 'components/admin/forms/ValidationErrors';
+
+const ExtraLine = () => {
+ const [fieldProps] = useField('extraLine');
+ return (
+
+
+ }
+ >
+
+
+
+ );
+};
+
+const DemoOptionsForm = ({name, label, formData, onChange}) => {
+ const validationErrors = useContext(ValidationErrorContext);
+ const relevantErrors = filterErrors(name, validationErrors);
+ return (
+
+ }
+ initialFormData={{extraLine: '', ...formData}}
+ onSubmit={values => onChange({formData: values})}
+ modalSize="small"
+ >
+
+
+
+
+ );
+};
+
+DemoOptionsForm.propTypes = {
+ name: PropTypes.string.isRequired,
+ label: PropTypes.node.isRequired,
+ formData: PropTypes.shape({
+ extraLine: PropTypes.string,
+ }),
+ onChange: PropTypes.func.isRequired,
+};
+
+export default DemoOptionsForm;
diff --git a/src/openforms/js/components/admin/form_design/registrations/demo/index.js b/src/openforms/js/components/admin/form_design/registrations/demo/index.js
new file mode 100644
index 0000000000..711ad84ab7
--- /dev/null
+++ b/src/openforms/js/components/admin/form_design/registrations/demo/index.js
@@ -0,0 +1,3 @@
+import DemoOptionsForm from './DemoOptionsForm';
+
+export default DemoOptionsForm;
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 5825843572..fb6a8d8608 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
@@ -2,9 +2,8 @@ import PropTypes from 'prop-types';
import React, {useContext} from 'react';
import {FormattedMessage} from 'react-intl';
-import OptionsConfiguration from 'components/admin/form_design/registrations/shared/OptionsConfiguration';
-import {filterErrors} from 'components/admin/form_design/registrations/shared/utils';
-import {ValidationErrorContext} from 'components/admin/forms/ValidationErrors';
+import ModalOptionsConfiguration from 'components/admin/forms/ModalOptionsConfiguration';
+import {ValidationErrorContext, filterErrors} from 'components/admin/forms/ValidationErrors';
import EmailOptionsFormFields from './EmailOptionsFormFields';
@@ -13,7 +12,7 @@ const EmailOptionsForm = ({name, label, schema, formData, onChange}) => {
const numErrors = filterErrors(name, validationErrors).length;
return (
- {
onSubmit={values => onChange({formData: values})}
>
-
+
);
};
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 40307acc0e..ae83aadfbd 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
@@ -2,15 +2,13 @@ import PropTypes from 'prop-types';
import {useContext} from 'react';
import {FormattedMessage} from 'react-intl';
-import {
- filterErrors,
- getChoicesFromSchema,
-} from 'components/admin/form_design/registrations/shared/utils';
import Fieldset from 'components/admin/forms/Fieldset';
import {
ValidationErrorContext,
ValidationErrorsProvider,
+ filterErrors,
} from 'components/admin/forms/ValidationErrors';
+import {getChoicesFromSchema} from 'utils/json-schema';
import EmailAttachmentFormatsSelect from './fields/EmailAttachmentFormatsSelect';
import EmailContentTemplateHTML from './fields/EmailContentTemplateHTML';
diff --git a/src/openforms/js/components/admin/form_design/registrations/index.js b/src/openforms/js/components/admin/form_design/registrations/index.js
index b5c8146bc6..82792783f8 100644
--- a/src/openforms/js/components/admin/form_design/registrations/index.js
+++ b/src/openforms/js/components/admin/form_design/registrations/index.js
@@ -1,5 +1,7 @@
import CamundaOptionsForm from './camunda';
+import DemoOptionsForm from './demo';
import EmailOptionsForm from './email';
+import MSGraphOptionsForm from './ms_graph';
import ObjectsApiOptionsForm from './objectsapi/ObjectsApiOptionsForm';
import ObjectsApiSummaryHandler from './objectsapi/ObjectsApiSummaryHandler';
import ObjectsApiVariableConfigurationEditor from './objectsapi/ObjectsApiVariableConfigurationEditor';
@@ -10,7 +12,7 @@ import ZGWOptionsForm from './zgw';
/**
* @typedef {{
- * form?: React.FC,
+ * form: React.FC,
* uiSchema?: Object,
* onStepEdit?: (...args: any) => Object | null,
* onUserDefinedVariableEdit?: (...args: any) => Object | null,
@@ -44,4 +46,9 @@ export const BACKEND_OPTIONS_FORMS = {
'stuf-zds-create-zaak': {
form: StufZDSOptionsForm,
},
+ 'microsoft-graph': {form: MSGraphOptionsForm},
+ // demo plugins
+ demo: {form: DemoOptionsForm},
+ 'failing-demo': {form: DemoOptionsForm},
+ 'exception-demo': {form: DemoOptionsForm},
};
diff --git a/src/openforms/js/components/admin/form_design/registrations/ms_graph/MSGraphOptionsForm.js b/src/openforms/js/components/admin/form_design/registrations/ms_graph/MSGraphOptionsForm.js
new file mode 100644
index 0000000000..c500360907
--- /dev/null
+++ b/src/openforms/js/components/admin/form_design/registrations/ms_graph/MSGraphOptionsForm.js
@@ -0,0 +1,53 @@
+import PropTypes from 'prop-types';
+import React, {useContext} from 'react';
+import {FormattedMessage} from 'react-intl';
+
+import Fieldset from 'components/admin/forms/Fieldset';
+import ModalOptionsConfiguration from 'components/admin/forms/ModalOptionsConfiguration';
+import {
+ ValidationErrorContext,
+ ValidationErrorsProvider,
+ filterErrors,
+} from 'components/admin/forms/ValidationErrors';
+
+import {DriveID, FolderPath} from './fields';
+
+const MSGraphOptionsForm = ({name, label, formData, onChange}) => {
+ const validationErrors = useContext(ValidationErrorContext);
+ const relevantErrors = filterErrors(name, validationErrors);
+ return (
+
+ }
+ initialFormData={{folderPath: '', driveId: '', ...formData}}
+ onSubmit={values => onChange({formData: values})}
+ modalSize=""
+ >
+
+
+
+
+ );
+};
+
+MSGraphOptionsForm.propTypes = {
+ name: PropTypes.string.isRequired,
+ label: PropTypes.node.isRequired,
+ formData: PropTypes.shape({
+ folderPath: PropTypes.string,
+ driveId: PropTypes.string,
+ }),
+ onChange: PropTypes.func.isRequired,
+};
+
+export default MSGraphOptionsForm;
diff --git a/src/openforms/js/components/admin/form_design/registrations/ms_graph/fields.js b/src/openforms/js/components/admin/form_design/registrations/ms_graph/fields.js
new file mode 100644
index 0000000000..0d1cc88b73
--- /dev/null
+++ b/src/openforms/js/components/admin/form_design/registrations/ms_graph/fields.js
@@ -0,0 +1,63 @@
+import {useField} from 'formik';
+import {FormattedMessage} from 'react-intl';
+
+import Field from 'components/admin/forms/Field';
+import FormRow from 'components/admin/forms/FormRow';
+import {TextInput} from 'components/admin/forms/Inputs';
+
+export const FolderPath = () => {
+ const [fieldProps] = useField('folderPath');
+ return (
+
+
+ }
+ helpText={
+ '{{' year '}}', '{{' month '}}'
and
+ '{{' day '}}'
. The path must start with /
.
+ `}
+ values={{
+ code: chunks => {chunks}
,
+ }}
+ />
+ }
+ >
+
+
+
+ );
+};
+
+export const DriveID = () => {
+ const [fieldProps] = useField('driveId');
+ return (
+
+
+ }
+ helpText={
+
+ }
+ >
+
+
+
+ );
+};
diff --git a/src/openforms/js/components/admin/form_design/registrations/ms_graph/index.js b/src/openforms/js/components/admin/form_design/registrations/ms_graph/index.js
new file mode 100644
index 0000000000..e60a77d8ad
--- /dev/null
+++ b/src/openforms/js/components/admin/form_design/registrations/ms_graph/index.js
@@ -0,0 +1,3 @@
+import MSGraphOptionsForm from './MSGraphOptionsForm';
+
+export default MSGraphOptionsForm;
diff --git a/src/openforms/js/components/admin/form_design/registrations/objectsapi/ObjectsApiOptionsForm.js b/src/openforms/js/components/admin/form_design/registrations/objectsapi/ObjectsApiOptionsForm.js
index f8e6f529c8..e68c0508a6 100644
--- a/src/openforms/js/components/admin/form_design/registrations/objectsapi/ObjectsApiOptionsForm.js
+++ b/src/openforms/js/components/admin/form_design/registrations/objectsapi/ObjectsApiOptionsForm.js
@@ -2,12 +2,9 @@ import PropTypes from 'prop-types';
import React, {useContext} from 'react';
import {FormattedMessage} from 'react-intl';
-import OptionsConfiguration from 'components/admin/form_design/registrations/shared/OptionsConfiguration';
-import {
- filterErrors,
- getChoicesFromSchema,
-} from 'components/admin/form_design/registrations/shared/utils';
-import {ValidationErrorContext} from 'components/admin/forms/ValidationErrors';
+import ModalOptionsConfiguration from 'components/admin/forms/ModalOptionsConfiguration';
+import {ValidationErrorContext, filterErrors} from 'components/admin/forms/ValidationErrors';
+import {getChoicesFromSchema} from 'utils/json-schema';
import ObjectsApiOptionsFormFields from './ObjectsApiOptionsFormFields';
@@ -19,7 +16,7 @@ const ObjectsApiOptionsForm = ({index, name, label, schema, formData, onChange})
const defaultGroup = apiGroupChoices.length === 1 ? apiGroupChoices[0][0] : undefined;
return (
- onChange({formData: values})}
>
-
+
);
};
diff --git a/src/openforms/js/components/admin/form_design/registrations/objectsapi/ObjectsApiOptionsFormFields.js b/src/openforms/js/components/admin/form_design/registrations/objectsapi/ObjectsApiOptionsFormFields.js
index 3483a8ae6a..58e45cbceb 100644
--- a/src/openforms/js/components/admin/form_design/registrations/objectsapi/ObjectsApiOptionsFormFields.js
+++ b/src/openforms/js/components/admin/form_design/registrations/objectsapi/ObjectsApiOptionsFormFields.js
@@ -5,10 +5,10 @@ import {FormattedMessage, useIntl} from 'react-intl';
import {TabList, TabPanel, Tabs} from 'react-tabs';
import Tab from 'components/admin/form_design/Tab';
-import {filterErrors} from 'components/admin/form_design/registrations/shared/utils';
import {
ValidationErrorContext,
ValidationErrorsProvider,
+ filterErrors,
} from 'components/admin/forms/ValidationErrors';
import LegacyConfigFields from './LegacyConfigFields';
diff --git a/src/openforms/js/components/admin/form_design/registrations/shared/utils.js b/src/openforms/js/components/admin/form_design/registrations/shared/utils.js
deleted file mode 100644
index e03ba951f6..0000000000
--- a/src/openforms/js/components/admin/form_design/registrations/shared/utils.js
+++ /dev/null
@@ -1,16 +0,0 @@
-const getChoicesFromSchema = (enums, enumNames) => {
- const finalChoices = [];
- Object.keys(enums).forEach(key => {
- finalChoices.push([enums[key], enumNames[key]]);
- });
-
- return finalChoices;
-};
-
-const filterErrors = (name, errors) => {
- return errors
- .filter(([key]) => key.startsWith(`${name}.`))
- .map(([key, msg]) => [key.slice(name.length + 1), msg]);
-};
-
-export {getChoicesFromSchema, filterErrors};
diff --git a/src/openforms/js/components/admin/form_design/registrations/stufzds/StufZDSOptionsForm.js b/src/openforms/js/components/admin/form_design/registrations/stufzds/StufZDSOptionsForm.js
index 7cb3f72542..7e0442a575 100644
--- a/src/openforms/js/components/admin/form_design/registrations/stufzds/StufZDSOptionsForm.js
+++ b/src/openforms/js/components/admin/form_design/registrations/stufzds/StufZDSOptionsForm.js
@@ -2,9 +2,8 @@ import PropTypes from 'prop-types';
import React, {useContext} from 'react';
import {FormattedMessage} from 'react-intl';
-import OptionsConfiguration from 'components/admin/form_design/registrations/shared/OptionsConfiguration';
-import {filterErrors} from 'components/admin/form_design/registrations/shared/utils';
-import {ValidationErrorContext} from 'components/admin/forms/ValidationErrors';
+import ModalOptionsConfiguration from 'components/admin/forms/ModalOptionsConfiguration';
+import {ValidationErrorContext, filterErrors} from 'components/admin/forms/ValidationErrors';
import StufZDSOptionsFormFields from './StufZDSOptionsFormFields';
@@ -34,7 +33,7 @@ const StufZDSOptionsForm = ({name, label, schema, formData, onChange}) => {
}
return (
- {
onSubmit={values => onChange({formData: values})}
>
-
+
);
};
diff --git a/src/openforms/js/components/admin/form_design/registrations/stufzds/StufZDSOptionsFormFields.js b/src/openforms/js/components/admin/form_design/registrations/stufzds/StufZDSOptionsFormFields.js
index 9cd51215b6..2af598758f 100644
--- a/src/openforms/js/components/admin/form_design/registrations/stufzds/StufZDSOptionsFormFields.js
+++ b/src/openforms/js/components/admin/form_design/registrations/stufzds/StufZDSOptionsFormFields.js
@@ -4,15 +4,13 @@ import {FormattedMessage} from 'react-intl';
import {TabList, TabPanel, Tabs} from 'react-tabs';
import Tab from 'components/admin/form_design/Tab';
-import {
- filterErrors,
- getChoicesFromSchema,
-} from 'components/admin/form_design/registrations/shared/utils';
import Fieldset from 'components/admin/forms/Fieldset';
import {
ValidationErrorContext,
ValidationErrorsProvider,
+ filterErrors,
} from 'components/admin/forms/ValidationErrors';
+import {getChoicesFromSchema} from 'utils/json-schema';
import CaseTypeCode from './fields/CaseTypeCode';
import CaseTypeDescription from './fields/CaseTypeDescription';
diff --git a/src/openforms/js/components/admin/form_design/registrations/zgw/ManageVariableToPropertyMappings.js b/src/openforms/js/components/admin/form_design/registrations/zgw/ManageVariableToPropertyMappings.js
index fed7389d08..3850c44a6d 100644
--- a/src/openforms/js/components/admin/form_design/registrations/zgw/ManageVariableToPropertyMappings.js
+++ b/src/openforms/js/components/admin/form_design/registrations/zgw/ManageVariableToPropertyMappings.js
@@ -5,13 +5,12 @@ import React, {useContext} from 'react';
import {FormattedMessage, useIntl} from 'react-intl';
import {FormContext} from 'components/admin/form_design/Context';
-import {filterErrors} from 'components/admin/form_design/registrations/shared/utils';
import {getComponentDatatype} from 'components/admin/form_design/variables/utils';
import ButtonContainer from 'components/admin/forms/ButtonContainer';
import ComponentSelection from 'components/admin/forms/ComponentSelection';
import Field from 'components/admin/forms/Field';
import {TextInput} from 'components/admin/forms/Inputs';
-import {ValidationErrorContext} from 'components/admin/forms/ValidationErrors';
+import {ValidationErrorContext, filterErrors} from 'components/admin/forms/ValidationErrors';
import {DeleteIcon} from 'components/admin/icons';
import {ChangelistTableWrapper, HeadColumn, TableRow} from 'components/admin/tables';
diff --git a/src/openforms/js/components/admin/form_design/registrations/zgw/ZGWOptionsForm.js b/src/openforms/js/components/admin/form_design/registrations/zgw/ZGWOptionsForm.js
index 1de4338332..e200b9fcea 100644
--- a/src/openforms/js/components/admin/form_design/registrations/zgw/ZGWOptionsForm.js
+++ b/src/openforms/js/components/admin/form_design/registrations/zgw/ZGWOptionsForm.js
@@ -2,12 +2,9 @@ import PropTypes from 'prop-types';
import React, {useContext} from 'react';
import {FormattedMessage} from 'react-intl';
-import OptionsConfiguration from 'components/admin/form_design/registrations/shared/OptionsConfiguration';
-import {
- filterErrors,
- getChoicesFromSchema,
-} from 'components/admin/form_design/registrations/shared/utils';
-import {ValidationErrorContext} from 'components/admin/forms/ValidationErrors';
+import ModalOptionsConfiguration from 'components/admin/forms/ModalOptionsConfiguration';
+import {ValidationErrorContext, filterErrors} from 'components/admin/forms/ValidationErrors';
+import {getChoicesFromSchema} from 'utils/json-schema';
import ZGWFormFields from './ZGWOptionsFormFields';
@@ -25,7 +22,7 @@ const ZGWOptionsForm = ({name, label, schema, formData, onChange}) => {
const defaultGroup = apiGroupChoices.length === 1 ? apiGroupChoices[0][0] : undefined;
return (
- {
apiGroupChoices={apiGroupChoices}
confidentialityLevelChoices={confidentialityLevelChoices}
/>
-
+
);
};
diff --git a/src/openforms/js/components/admin/form_design/registrations/zgw/ZGWOptionsFormFields.js b/src/openforms/js/components/admin/form_design/registrations/zgw/ZGWOptionsFormFields.js
index 438e6c616f..69a381bf16 100644
--- a/src/openforms/js/components/admin/form_design/registrations/zgw/ZGWOptionsFormFields.js
+++ b/src/openforms/js/components/admin/form_design/registrations/zgw/ZGWOptionsFormFields.js
@@ -6,11 +6,11 @@ import {TabList, TabPanel, Tabs} from 'react-tabs';
import Tab from 'components/admin/form_design/Tab';
import {ContentJSON} from 'components/admin/form_design/registrations/objectsapi/LegacyConfigFields';
-import {filterErrors} from 'components/admin/form_design/registrations/shared/utils';
import Fieldset from 'components/admin/forms/Fieldset';
import {
ValidationErrorContext,
ValidationErrorsProvider,
+ filterErrors,
} from 'components/admin/forms/ValidationErrors';
import BasicOptionsFieldset from './BasicOptionsFieldset';
diff --git a/src/openforms/js/components/admin/form_design/registrations/shared/OptionsConfiguration.js b/src/openforms/js/components/admin/forms/ModalOptionsConfiguration.js
similarity index 83%
rename from src/openforms/js/components/admin/form_design/registrations/shared/OptionsConfiguration.js
rename to src/openforms/js/components/admin/forms/ModalOptionsConfiguration.js
index 66211ac2ec..ccb22f553c 100644
--- a/src/openforms/js/components/admin/form_design/registrations/shared/OptionsConfiguration.js
+++ b/src/openforms/js/components/admin/forms/ModalOptionsConfiguration.js
@@ -9,13 +9,22 @@ import SubmitRow from 'components/admin/forms/SubmitRow';
import {ErrorIcon} from 'components/admin/icons';
import {FormModal} from 'components/admin/modals';
-const OptionsConfiguration = ({
+/**
+ * A generic container/wrapper for configuration options that display in a modal,
+ * after clicking the button to configure the options. Next to the button the number
+ * of validation errors is displayed.
+ *
+ * This relies on form state being managed with Formik. Pass the actual configuration
+ * fields as children.
+ */
+const ModalOptionsConfiguration = ({
name,
label,
numErrors,
modalTitle,
initialFormData,
onSubmit,
+ modalSize = 'large',
children,
}) => {
const intl = useIntl();
@@ -64,7 +73,7 @@ const OptionsConfiguration = ({
isOpen={modalOpen}
title={modalTitle}
closeModal={() => setModalOpen(false)}
- extraModifiers={['large']}
+ extraModifiers={modalSize ? [modalSize] : undefined}
>
{
+ return errors
+ .filter(([key]) => key.startsWith(`${name}.`))
+ .map(([key, msg]) => [key.slice(name.length + 1), msg]);
+};
+
+export {ValidationErrorsProvider, ValidationErrorContext, filterErrors};
export default ValidationErrorsProvider;
diff --git a/src/openforms/js/components/admin/modals/FormModal.js b/src/openforms/js/components/admin/modals/FormModal.js
index 09dd1d632d..7634100026 100644
--- a/src/openforms/js/components/admin/modals/FormModal.js
+++ b/src/openforms/js/components/admin/modals/FormModal.js
@@ -35,6 +35,7 @@ FormModal.propTypes = {
closeModal: PropTypes.func.isRequired,
onFormSubmit: PropTypes.func,
children: PropTypes.node,
+ extraModifiers: PropTypes.arrayOf(PropTypes.oneOf(['small', 'large'])),
};
export default FormModal;
diff --git a/src/openforms/js/lang/en.json b/src/openforms/js/lang/en.json
index d88e1efb15..ca43343f8f 100644
--- a/src/openforms/js/lang/en.json
+++ b/src/openforms/js/lang/en.json
@@ -219,6 +219,11 @@
"description": "Objects API variable configuration editor JSON Schema visibility toggle",
"originalDefault": "Toggle JSON Schema"
},
+ "3zaZWN": {
+ "defaultMessage": "Plugin configuration: demo",
+ "description": "Demo registration options modal title",
+ "originalDefault": "Plugin configuration: demo"
+ },
"4FQxD/": {
"defaultMessage": "Configure",
"description": "JSON editor: 'configure' header label",
@@ -539,6 +544,11 @@
"description": "Form definition select confirm button",
"originalDefault": "Confirm"
},
+ "B/A1Bk": {
+ "defaultMessage": "Which merchant should be used for payments related to this form.",
+ "description": "Ogone legacy payment options 'merchantId' help text",
+ "originalDefault": "Which merchant should be used for payments related to this form."
+ },
"B5RSyi": {
"defaultMessage": "Email payment subject",
"description": "Email registration options 'emailPaymentSubject' label",
@@ -764,6 +774,11 @@
"description": "StUF-ZDS registration backend options, 'base' tab label",
"originalDefault": "Base"
},
+ "F2VuCs": {
+ "defaultMessage": "Merchant ID",
+ "description": "Ogone legacy payment options 'merchantId' label",
+ "originalDefault": "Merchant ID"
+ },
"F9ew4C": {
"defaultMessage": "Version",
"description": "Objects API registration options 'objecttypeVersion' label",
@@ -1114,6 +1129,11 @@
"description": "Registration summary error message",
"originalDefault": "Something went wrong while rendering the registration options"
},
+ "LBEeSy": {
+ "defaultMessage": "Drive ID",
+ "description": "MS Graph registration options 'driveId' label",
+ "originalDefault": "Drive ID"
+ },
"LD3weJ": {
"defaultMessage": "Advanced configuration",
"description": "Advanced configuration tab title",
@@ -1879,6 +1899,11 @@
"description": "Incomplete Submissions Removal Limit field label",
"originalDefault": "Incomplete Submissions Removal Limit"
},
+ "cEALcN": {
+ "defaultMessage": "Configure options",
+ "description": "Link label to open payment provider options modal",
+ "originalDefault": "Configure options"
+ },
"cID9dz": {
"defaultMessage": "(complex value)",
"description": "JSON editor: complex value representation",
@@ -2294,6 +2319,11 @@
"description": "Model title session expiry warning",
"originalDefault": "Session will expire"
},
+ "jpL29S": {
+ "defaultMessage": "Folder path",
+ "description": "MS Graph registration options 'folderPath' label",
+ "originalDefault": "Folder path"
+ },
"jy1jTd": {
"defaultMessage": "{numErrors, plural, one {There is a validation error.} other {There are {numErrors} validation errors.} }",
"description": "Registration validation errors icon next to button to configure options",
@@ -2359,6 +2389,11 @@
"description": "Label for 'value' in MappingArrayInput table column",
"originalDefault": "Value"
},
+ "lNBZdl": {
+ "defaultMessage": "The path of the folder where folders containing Open-Forms related documents will be created. You can use the expressions '{{' year '}}'
, '{{' month '}}'
and '{{' day '}}'
. The path must start with /
.",
+ "description": "MS Graph registration options 'folderPath' help text",
+ "originalDefault": "The path of the folder where folders containing Open-Forms related documents will be created. You can use the expressions '{{' year '}}'
, '{{' month '}}'
and '{{' day '}}'
. The path must start with /
."
+ },
"lcR5L6": {
"defaultMessage": "Add item",
"description": "Add item to multi-input field",
@@ -2649,6 +2684,11 @@
"description": "Email registration options 'attachFilesToEmail' helpText",
"originalDefault": "Enable to attach file uploads to the registration email. If set, this overrides the global default. Form designers should take special care to ensure that the total file upload sizes do not exceed the email size limit."
},
+ "sQpH2P": {
+ "defaultMessage": "{numErrors, plural, one {There is a validation error.} other {There are {numErrors} validation errors.} }",
+ "description": "Payment provider validation errors icon next to button to configure options",
+ "originalDefault": "{numErrors, plural, one {There is a validation error.} other {There are {numErrors} validation errors.} }"
+ },
"sptpzv": {
"defaultMessage": "Switching to the new registration options will remove the existing JSON templates. You will also not be able to save the form until the variables are correctly mapped. Are you sure you want to continue?",
"description": "Objects API registration backend: v2 switch warning message",
@@ -2779,6 +2819,11 @@
"description": "Help text cache timeout",
"originalDefault": "After how many seconds should the cached response expire."
},
+ "wAQaa5": {
+ "defaultMessage": "Extra print statement",
+ "description": "Demo registration options 'extraLine' label",
+ "originalDefault": "Extra print statement"
+ },
"wIaGgb": {
"defaultMessage": "Errored Submissions Removal Method",
"description": "Errored Submissions Removal Method field label",
@@ -2804,6 +2849,11 @@
"description": "Times Component field help text",
"originalDefault": "Component where times for an appointment will be shown"
},
+ "wnTTZr": {
+ "defaultMessage": "ID of the drive to use. If left empty, the default drive will be used.",
+ "description": "MS Graph registration options 'driveId' help text",
+ "originalDefault": "ID of the drive to use. If left empty, the default drive will be used."
+ },
"wnxKT/": {
"defaultMessage": "Component where products for an appointment will be shown",
"description": "Products Component field help text",
@@ -2934,6 +2984,11 @@
"description": "JSON variable type \"object\" representation",
"originalDefault": "Object"
},
+ "zYu3XI": {
+ "defaultMessage": "Plugin configuration: Ogone legacy",
+ "description": "Ogone legacy options modal title",
+ "originalDefault": "Plugin configuration: Ogone legacy"
+ },
"zeXZzX": {
"defaultMessage": "Use logic rules to determine the price",
"description": "dynamic pricing mode label",
diff --git a/src/openforms/js/lang/nl.json b/src/openforms/js/lang/nl.json
index 0875de7a11..8da64ec41f 100644
--- a/src/openforms/js/lang/nl.json
+++ b/src/openforms/js/lang/nl.json
@@ -220,6 +220,11 @@
"description": "Objects API variable configuration editor JSON Schema visibility toggle",
"originalDefault": "Toggle JSON Schema"
},
+ "3zaZWN": {
+ "defaultMessage": "Plugin configuration: demo",
+ "description": "Demo registration options modal title",
+ "originalDefault": "Plugin configuration: demo"
+ },
"4FQxD/": {
"defaultMessage": "Configureren",
"description": "JSON editor: 'configure' header label",
@@ -543,6 +548,11 @@
"description": "Form definition select confirm button",
"originalDefault": "Confirm"
},
+ "B/A1Bk": {
+ "defaultMessage": "Which merchant should be used for payments related to this form.",
+ "description": "Ogone legacy payment options 'merchantId' help text",
+ "originalDefault": "Which merchant should be used for payments related to this form."
+ },
"B5RSyi": {
"defaultMessage": "Email payment subject",
"description": "Email registration options 'emailPaymentSubject' label",
@@ -771,6 +781,11 @@
"description": "StUF-ZDS registration backend options, 'base' tab label",
"originalDefault": "Base"
},
+ "F2VuCs": {
+ "defaultMessage": "Merchant ID",
+ "description": "Ogone legacy payment options 'merchantId' label",
+ "originalDefault": "Merchant ID"
+ },
"F9ew4C": {
"defaultMessage": "Versie",
"description": "Objects API registration options 'objecttypeVersion' label",
@@ -1121,6 +1136,11 @@
"description": "Registration summary error message",
"originalDefault": "Something went wrong while rendering the registration options"
},
+ "LBEeSy": {
+ "defaultMessage": "Drive ID",
+ "description": "MS Graph registration options 'driveId' label",
+ "originalDefault": "Drive ID"
+ },
"LD3weJ": {
"defaultMessage": "Geavanceerde instellingen",
"description": "Advanced configuration tab title",
@@ -1895,6 +1915,11 @@
"description": "Incomplete Submissions Removal Limit field label",
"originalDefault": "Incomplete Submissions Removal Limit"
},
+ "cEALcN": {
+ "defaultMessage": "Configure options",
+ "description": "Link label to open payment provider options modal",
+ "originalDefault": "Configure options"
+ },
"cID9dz": {
"defaultMessage": "(complexe waarde)",
"description": "JSON editor: complex value representation",
@@ -2312,6 +2337,11 @@
"description": "Model title session expiry warning",
"originalDefault": "Session will expire"
},
+ "jpL29S": {
+ "defaultMessage": "Folder path",
+ "description": "MS Graph registration options 'folderPath' label",
+ "originalDefault": "Folder path"
+ },
"jy1jTd": {
"defaultMessage": "{numErrors, plural, one {There is a validation error.} other {There are {numErrors} validation errors.} }",
"description": "Registration validation errors icon next to button to configure options",
@@ -2377,6 +2407,11 @@
"description": "Label for 'value' in MappingArrayInput table column",
"originalDefault": "Value"
},
+ "lNBZdl": {
+ "defaultMessage": "The path of the folder where folders containing Open-Forms related documents will be created. You can use the expressions '{{' year '}}'
, '{{' month '}}'
and '{{' day '}}'
. The path must start with /
.",
+ "description": "MS Graph registration options 'folderPath' help text",
+ "originalDefault": "The path of the folder where folders containing Open-Forms related documents will be created. You can use the expressions '{{' year '}}'
, '{{' month '}}'
and '{{' day '}}'
. The path must start with /
."
+ },
"lcR5L6": {
"defaultMessage": "Item toevoegen",
"description": "Add item to multi-input field",
@@ -2667,6 +2702,11 @@
"description": "Email registration options 'attachFilesToEmail' helpText",
"originalDefault": "Enable to attach file uploads to the registration email. If set, this overrides the global default. Form designers should take special care to ensure that the total file upload sizes do not exceed the email size limit."
},
+ "sQpH2P": {
+ "defaultMessage": "{numErrors, plural, one {There is a validation error.} other {There are {numErrors} validation errors.} }",
+ "description": "Payment provider validation errors icon next to button to configure options",
+ "originalDefault": "{numErrors, plural, one {There is a validation error.} other {There are {numErrors} validation errors.} }"
+ },
"sptpzv": {
"defaultMessage": "Let op! Migreren naar het nieuwe configuratieformaat maakt de bestaande JSON-sjablonen leeg. Daarnaast kan je het formulier pas opslaan als alle verplichte variabelen goed gekoppeld zijn. Ben je zeker dat je wil migreren?",
"description": "Objects API registration backend: v2 switch warning message",
@@ -2797,6 +2837,11 @@
"description": "Help text cache timeout",
"originalDefault": "After how many seconds should the cached response expire."
},
+ "wAQaa5": {
+ "defaultMessage": "Extra print statement",
+ "description": "Demo registration options 'extraLine' label",
+ "originalDefault": "Extra print statement"
+ },
"wIaGgb": {
"defaultMessage": "Opschoonmethode voor niet voltooide inzendingen",
"description": "Errored Submissions Removal Method field label",
@@ -2822,6 +2867,11 @@
"description": "Times Component field help text",
"originalDefault": "Component where times for an appointment will be shown"
},
+ "wnTTZr": {
+ "defaultMessage": "ID of the drive to use. If left empty, the default drive will be used.",
+ "description": "MS Graph registration options 'driveId' help text",
+ "originalDefault": "ID of the drive to use. If left empty, the default drive will be used."
+ },
"wnxKT/": {
"defaultMessage": "Veld waar beschikbare producten voor een afspraak komen te staan",
"description": "Products Component field help text",
@@ -2953,6 +3003,11 @@
"description": "JSON variable type \"object\" representation",
"originalDefault": "Object"
},
+ "zYu3XI": {
+ "defaultMessage": "Plugin configuration: Ogone legacy",
+ "description": "Ogone legacy options modal title",
+ "originalDefault": "Plugin configuration: Ogone legacy"
+ },
"zeXZzX": {
"defaultMessage": "Gebruik prijsregels om de prijs te bepalen",
"description": "dynamic pricing mode label",
diff --git a/src/openforms/js/utils/json-schema.js b/src/openforms/js/utils/json-schema.js
new file mode 100644
index 0000000000..016520f505
--- /dev/null
+++ b/src/openforms/js/utils/json-schema.js
@@ -0,0 +1,8 @@
+export const getChoicesFromSchema = (enums, enumNames) => {
+ const finalChoices = [];
+ Object.keys(enums).forEach(key => {
+ finalChoices.push([enums[key], enumNames[key]]);
+ });
+
+ return finalChoices;
+};