Wizard

Manage a flow that is used as an integration instance.

Configuration

Set up a new instance with config parameters and set/get methods:

const wizard = appmixer.ui.Wizard(config)

wizard.set(key, value)
wizard.get(key)

config.el ...

Learn about widgetconfig here.

config.flowId

Type: String | Default: null

The ID of a flow that is opened in the wizard.

Instance

Learn about widget instance here.

State

wizard.state(name, value)

loader

Type: Boolean | Default: null

Toggle a custom loading state.

error

Type: String | Default: null

Toggle a custom error message.

Events

wizard.on(event, handler)

flow:start

wizard.on('flow:start', flowId => {/* ... */})

Submit the form and start the flow.

flow:validation

wizard.on('flow:validation', errors => {/* ... */})

Flow validation errors changed.

cancel

wizard.on('cancel', () => {/* ... */})

Click a button to close the form.

close

wizard.on('close', () => {/* ... */})

Submit the form and wait for the flow to start.

Example

const wizard = appmixer.ui.Wizard({
    el: '#wizard',
    flowId: 'your-integration-id'
})

wizard.on('flow:start', async flowId => {
    await appmixer.api.startFlow(flowId)
    wizard.close()
})

wizard.open()

Last updated