LogoLogo
v4.3
  • Docs
  • Connector Configuration
  • Knowledge Base
  • Changelog
v4.3
  • Introduction
  • Migration from 4.2
  • Overview
    • Introduction
    • Component
    • Flow
    • End User Guide
  • Component Definition
    • Basic Structure
    • Manifest
      • name
      • label
      • icon
      • marker
      • author
      • description
      • auth
      • authConfig
      • quota
      • properties
      • inPorts
      • outPorts
      • firePatterns
      • tick
      • private
      • webhook
      • state
      • localization
    • Behaviour
    • Dependencies
    • Authentication
    • Quotas & Limits
    • Configuration
    • Example Component
  • Customizing UI
    • Custom Inspector Fields
    • Custom Theme
    • Custom Strings
    • Custom API
    • Custom Component Strings
    • Custom Component Shapes
  • Appmixer hosted
    • Getting started
    • Creating Custom Components
    • Using Appmixer SDK
    • Using Appmixer API
    • Using Oauth applications
  • Appmixer Self-Managed
    • Installation
    • Getting Started
    • Custom Component: HelloAppmixer
    • Using Appmixer SDK
    • Using Appmixer API
    • Using OAuth applications
    • Installation GCP
    • System Webhooks
    • Configuration
    • Appmixer Architecture
    • Appmixer Deployment Models
  • API
    • ACL
    • Accounts
    • Apps
    • Authentication
    • Charts
    • Data Stores
    • Files
    • Flows
    • Insights
    • Modifiers
    • People Task
    • Service Configuration
    • Unprocessed Messages
  • Appmixer SDK
    • Getting Started
    • API Reference
      • Constructor
      • API
      • FlowManager
      • Designer
      • InsightsLogs
      • InsightsDashboard
      • InsightsChartEditor
      • Accounts
      • Storage
      • PeopleTasks
      • Components
      • Wizard
      • Integrations
    • Developer mode
  • Appmixer Backoffice
    • Getting Started
    • Services
  • Tutorials
    • Managing Authentication
    • Sharing Flows
    • Flows Metadata & Filtering
    • People Tasks
    • Customizing modifiers
    • Setting ACL
    • Integration Templates
  • Appmixer CLI
    • Appmixer CLI
  • App Registration
    • Azure Cognitive Services
    • Google
    • DeepAI
    • Highrise
    • Microsoft
    • Screenshot API
    • Slack
    • Trello
    • Typeform
    • Utilities
      • Email
      • Language
      • Tasks
      • Test
      • Weather
Powered by GitBook
On this page
  • appmixer.ui.Designer
  • Designer Events
  • Example

Was this helpful?

Export as PDF
  1. Appmixer SDK
  2. API Reference

Designer

PreviousFlowManagerNextInsightsLogs

Last updated 4 years ago

Was this helpful?

appmixer.ui.Designer

The appmixer.ui.Designer is a UI widget that displays the drag&drop Flow Designer.

Method

Description

appmixer.ui.Designer(config)

Constructor function that acceptsconfigobject. Theconfig object must contain at least the el property that points to a container DOM element where the Designer will be rendered. el can either be a CSS selector or a reference to a DOM element. Note that the recommended width of your container is at least 1200px for best Designer UI/UX. config.options.menu can optionally define the flow menu inside Designer. 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. It's important to note that the designer supports built-in events: "flow:rename", "flow:export-svg", "flow:export-png" and "flow:print". These events cannot be re-defined. These events trigger built-in UX for renaming, exporting to SVG and PNG, and printing flows. If you don't want to use this built-in behaviour, just redefine your menu with your own custom events. config.sharePermissions can optionally define the sharing options for the flow. 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 the flow 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' },

]

toolbar: [ ['undo', 'redo'], ['zoom-to-fit', 'zoom-in', 'zoom-out'], ['logs'], [{ tooltip: 'Lorem ipsum', widget: { template: 'My button' }, }], ]

set(property, value)

Set a property of the designer. Currently only "flowId" is supported. Use it to set the flow the designer should open for (set("flowId", "123abc456")). You can also call this to change the currently opened flow in the designer dynamically.

get(property)

Return a property value.

open()

Render the Designer inside its container.

close()

Close the designer.

on(event, handler)

React on events of the designer. See below for the list of events the designer supports.

off([event, handler])

Remove event listeners. If no arguments are provided, remove all event listeners. If only the event is provided, remove all listeners for that event. If both event and handler are given, remove the listener for that specific handler only.

state(name, value)

Change the state of the UI. Currently, only "loader" and "error" states are supported. For example, in order to show a loader in the flow manager UI, just call state("loader", true). If you want to display an error in the flow manager UI, call state("error", "Something went wrong.").

reload()

Re-render the designer. Call this when you changed flow's state (started/stopped) to make sure the state change is reflected.

Designer Events

Event

Callback

Triggered when...

flow:insights

function(flowId)

the user clicks the insights menu item.

flow:clone

function(flowId)

the user clicks the clone menu item.

Example

var designer = appmixer.ui.Designer({
    el: '#your-designer-div',
    options: {
        menu: [
            { label: 'Rename', event: 'flow:rename' },
            { label: 'Insights Logs', event: 'flow:insights-logs' },
            { label: 'Clone', event: 'flow:clone' },
            { label: 'Share', event: 'flow:share' },
            { label: 'Export to SVG', event: 'flow:export-svg' },
            { label: 'Export to PNG', event: 'flow:export-png' },
            { label: 'Print', event: 'flow:print' }
        ]
    }
});
appmixer.api.createFlow('New flow').then(function(flowId) {
    designer.set('flowId', flowId);
    designer.open();
}).catch(function(error) {
    console.log('Something went wrong creating a new flow.', error);
});

config.options.toolbarcan define buttons of the Designer toolbar which is empty by default. Use presets (all shown in the example below) or Vue Component options for custom buttons. The custom button definition is the same as for . Complete toolbar definition example:

Custom Inspector Fields