@opuscapita/fsm-workflow-editor

3.0.1 • Public • Published

Usage

Editor demo (showroom) - see example schema in props

Actions & conditions paramsSchema definition and usage

i18n

UI labels for states, conditions, actions and params can be translated.

To add translations register an object of the following structure within i18nManager in context of your app:

de: { // locale
    fsmWorkflowEditor: {
      actions: { // here you define translations for actions
        testAction: { // action name like in workflow.actions
          label: 'Test Action', // this text is a UI label for this action
          params: {
            nickname: { // param name in this action's schema
              label: 'Nickname' // UI label for this param
            },
            fullName: {
              label: 'Full Name'
            }
          }
        },
        sendMail: {
          label: 'Send Email',
          params: {
            fromAddress: {
              label: "Sender' address"
            }
          }
        },
        ...
      },
      conditions: { // like in workflow.conditions
        userHasRoles: {
          label: 'User Has Roles',
          params: {
            restrictedRoles: {
              label: 'Only these roles are allowed'
            }
          }
        },
        ...
      },
      states: {
        approved: {
          label: 'Approved'
        },
        inspectionRequired: {
          label: "Inspection Required"
        },
        ...
      }
    }
  },
fi: {
  ...same structure
}

Plain objects are also ok:

de: {
  'fsmWorkflowEditor.states.approved.label': 'Approved',
  'fsmWorkflowEditor.actions.testAction.label': 'Test action',
  'fsmWorkflowEditor.actions.testAction.params.nickname.label': 'Nickname',
  ...
}

Package Sidebar

Install

npm i @opuscapita/fsm-workflow-editor

Weekly Downloads

1

Version

3.0.1

License

Apache-2.0

Unpacked Size

385 kB

Total Files

3

Last publish

Collaborators

  • ariusz
  • ilhamkadduri
  • smachnow
  • piotr.krzysztof.murdzia
  • kuos
  • elaczapiewska
  • janek.bug
  • ocmachineuser
  • ocautomation