Modules: enhanced-redux-form/actions/wizardFormActions

All functions in this module are action creators and the return value should be passed to the redux store dispatch() function

Source:

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
wizardName string

The name of the wizard

steps Array.<Object>

An array of steps in the wizard

steps[].path string

The path of the route for this step

Source:
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
wizardName string

The wizard name as passed to the enhancedFormWizard function

submitHandler function

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
transformApiFieldNames function <optional>

A function that maps the field names in the validation errors returned by the API to field names in the actual form.

generalErrorMessage string

When the API call comes back with an error that doesn't have the default error response shape, this message will be shown instead.

historyPush function

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

Source:

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
form string

The name of the form that is being mounted.

wizardName string

The name of the wizard this form is part of. todo: updated param docs

Source:

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
wizardName string

The name of the wizard

stepIndex number

Index of the step that has been submitted in the steps array

wizardRoutingAdapter Object

The routingAdapter passed to enhancedWizardForm config

formValues Object

The values submitted to the form

Source: