A function that accepts a config object and returns an instance of flow manager. The config object must contain at least the el property that points to a container DOM element where the flow manager will be rendered. el can either be a CSS selector or a reference to a DOM element.
config.options.menu
can optionally define the flow menu. For example:
{ options: { menu: [ { label: 'Rename', event: 'flow:rename' }, { label: 'Insights', event: 'flow:insights' }, { label: 'Clone', event: 'flow:clone' }, { label: 'Export to SVG', event: 'flow:export-svg' }, { label: 'Export to PNG', event: 'flow:export-png' }, { label: 'Print', event: 'flow:print' } ] }
defines a menu with 6 items. Note that each item can also optionally contain icon property (which we omitted from the example above to save space. The icon property is a URL of an image.
config.sharePermissions
can optionally define the sharing options for the flows. For example:
sharePermissions: [ { label: 'Read', value: 'read' }, { label: 'Start', value: 'start' }, { label: 'Stop', value: 'stop' } ]
Define a share dialog box that gives the user permission to share their flows for all the read/start/stop permissions. Additionally, you can also define the scope of the share with config.shareTypes
:
shareTypes: [ { label: 'Email', value: 'email', placeholder: 'Enter an email' }, { label: 'Scope', value: 'scope', placeholder: 'Enter a scope' }, { label: 'Domain', value: 'domain', placeholder: 'Enter a domain' }, ]
config.options.customFilter
is an optional object that can contain properties that we'd like to filter on. This is especially useful in connection with customFields metadata object as it allows you to display multiple different Flow Managers each listing a different category of flows. For example:
options: {
customFilter: {
'customFields.template': true
'customFields.category': 'healthcare'
}
}
config.options.layout.default
is an optional string that determines the default layout of the flow manager. Currently list and thumbnail are supported. If not specified, the default layout is thumbnail.
config.options.layout.table
is an optional object that allows customizing the list layout column headers and values displayed. For example:
options: {
layout: {
table: {
columns: [
{ property: 'name', label: 'Flow Name' },
{ property: 'status', label: 'Current Status' },
{ property: 'btime', label: 'Start Time' },
{ property: 'mtime', label: 'Last Updated' }
]
}
}
}
The label property makes reference to the label displayed on the column header, while property makes reference to the flow property value that will be displayed on that column.