All functions in this module are action creators and the return value should be passed to the redux store dispatch() function
Methods
-
registerWizardForm(wizardName, steps)
-
Note: this action is used internally by enhanced-redux-form. You will probably not need this for general usage
Registers a new wizard form
Parameters:
Name Type Description wizardNamestring The name of the wizard
stepsArray.<Object> An array of steps in the wizard
steps[].pathstring The path of the route for this step
Returns:
The action
- Type
- object
-
submitWizardForm(wizardName, submitHandler [, transformApiFieldNames], generalErrorMessage, historyPush)
-
Note: this action is dispatched by the enhancedFormWizard() HOC. You probable won't need to call it yourself
Calls the given submit handler with the form values of the given wizard form. If submission errors occur during submit, it will persist these errors on the relevant form step and redirect to the first form step that contained any error.
Parameters:
Name Type Argument Description wizardNamestring The wizard name as passed to the
enhancedFormWizard functionsubmitHandlerfunction The handler that should be called to perform the submit. The handler will receive the following parameters:
- dispatch The redux dispatch function
- values An object containing all the values that have been submitted to individual form steps
transformApiFieldNamesfunction <optional>
A function that maps the field names in the validation errors returned by the API to field names in the actual form.
generalErrorMessagestring When the API call comes back with an error that doesn't have the default error response shape, this message will be shown instead.
historyPushfunction A function that performs a history.push. If the wizard form is mounted in QueryRouting, this can be a different history instance than the main browserHistory
-
wizardStepMount(form, wizardName)
-
Note: this action is used internally by enhanced-redux-form. You will probably not need this for general usage
Registers a mount of a form that is part of a wizard.
Parameters:
Name Type Description formstring The name of the form that is being mounted.
wizardNamestring The name of the wizard this form is part of. todo: updated param docs
-
wizardStepSubmit(wizardName, stepIndex, wizardRoutingAdapter, formValues)
-
Note: this action is used internally by enhanced-redux-form. You will probably not need this for general usage
Handles when a form step submission has been completed
Parameters:
Name Type Description wizardNamestring The name of the wizard
stepIndexnumber Index of the step that has been submitted in the steps array
wizardRoutingAdapterObject The routingAdapter passed to enhancedWizardForm config
formValuesObject The values submitted to the form