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 2e092faddb..bdd11f7084 100644 --- a/src/openforms/js/components/admin/form_design/RegistrationFields.stories.js +++ b/src/openforms/js/components/admin/form_design/RegistrationFields.stories.js @@ -411,7 +411,7 @@ export default { title: 'Relative API endpoint', type: 'string', }, - formVariables: { + variables: { type: 'array', title: 'List of form variables', items: { @@ -770,7 +770,7 @@ export const ConfiguredBackends = { options: { service: 1, path: 'example/endpoint', - formVariables: [], + variables: [], }, }, ], @@ -1029,7 +1029,7 @@ export const JSONDump = { options: { service: 1, path: 'example/endpoint', - formVariables: [], + variables: [], }, }, ], diff --git a/src/openforms/js/components/admin/form_design/registrations/json_dump/JSONDumpOptionsForm.js b/src/openforms/js/components/admin/form_design/registrations/json_dump/JSONDumpOptionsForm.js index a23024e2ef..e27ca5fa5b 100644 --- a/src/openforms/js/components/admin/form_design/registrations/json_dump/JSONDumpOptionsForm.js +++ b/src/openforms/js/components/admin/form_design/registrations/json_dump/JSONDumpOptionsForm.js @@ -22,11 +22,11 @@ const JSONDumpOptionsForm = ({name, label, schema, formData, onChange}) => { const formContext = useContext(FormContext); const formVariables = formContext.formVariables ?? []; const staticVariables = formContext.staticVariables ?? []; - const allFormVariables = staticVariables.concat(formVariables); + const allVariables = staticVariables.concat(formVariables); - const formVariableOptions = []; - for (const formVariable of allFormVariables) { - formVariableOptions.push({value: formVariable.key, label: formVariable.name}); + const variableOptions = []; + for (const variable of allVariables) { + variableOptions.push({value: variable.key, label: variable.name}); } // Create service options @@ -49,7 +49,7 @@ const JSONDumpOptionsForm = ({name, label, schema, formData, onChange}) => { initialFormData={{ service: null, path: '', - formVariables: [], + variables: [], ...formData, }} onSubmit={values => onChange({formData: values})} @@ -59,7 +59,7 @@ const JSONDumpOptionsForm = ({name, label, schema, formData, onChange}) => {
@@ -80,9 +80,7 @@ JSONDumpOptionsForm.propTypes = { formData: PropTypes.shape({ service: PropTypes.number, path: PropTypes.string, - // TODO-4908: might need to rename this to selectedFormVariables to avoid confusion or even - // naming conflicts - formVariables: PropTypes.arrayOf(PropTypes.string), + variables: PropTypes.arrayOf(PropTypes.string), }), onChange: PropTypes.func.isRequired, }; diff --git a/src/openforms/js/components/admin/form_design/registrations/json_dump/JSONDumpSummaryHandler.js b/src/openforms/js/components/admin/form_design/registrations/json_dump/JSONDumpSummaryHandler.js index 4c971e5ce2..0c74f9e4d8 100644 --- a/src/openforms/js/components/admin/form_design/registrations/json_dump/JSONDumpSummaryHandler.js +++ b/src/openforms/js/components/admin/form_design/registrations/json_dump/JSONDumpSummaryHandler.js @@ -4,7 +4,7 @@ import React from 'react'; import {IconNo, IconYes} from 'components/admin/BooleanIcons'; const JSONDumpSummaryHandler = ({variable, backendOptions}) => { - const isIncluded = backendOptions.formVariables.includes(variable.key); + const isIncluded = backendOptions.variables.includes(variable.key); return isIncluded ?