Fluent Commerce Logo
Docs
Sign In

UserAction button in OMX UI

Essential knowledge

Author:

Randy Chan

Changed on:

17 May 2024

Overview

This article gives a better understanding of how to configure and display user actions on the UI.

Key points

  • How to configure
    `userAction`
  • `userAction`
    Types
  • `userAction`
    display sequence (appearance)

Configure userAction

userAction is defined in the workflow. When the OMX is loading a page, it will check and see if there are any rulesets that contain userAction that satisfy the manifest module and trigger status criteria; if so, display the userAction button on the top right-hand corner of the page.


userAction Type

The userActionType is defined in the workflow context. There are two userAction types:

  • PRIMARY - The userAction button will be displayed in the top right-hand corner.
No alt provided
1{
2            "name": "AddNetworkToLocation",
3            "description": "Add network to a location",
4            "type": "LOCATION",
5            "subtype": "STORE",
6            "eventType": "NORMAL",
7            "rules": [
8                {
9                    "name": "{accountID}.locationupsert.AddNetworkToLocation",
10                    "props": null
11                }
12            ],
13            "triggers": [
14                {
15                    "status": "ACTIVE"
16                },
17                {
18                    "status": "INACTIVE"
19                },
20                {
21                    "status": "CREATED"
22                }
23            ],
24            "userActions": [
25                {
26                    "eventName": "AddNetworkToLocation",
27                    "context": [
28                        {
29                            "label": "Add Network",
30                            "type": "PRIMARY",
31                            "modules": [
32                                "adminconsole"
33                            ],
34                            "confirm": true
35                        }
36                    ],
37                    "attributes": [
38                        {
39                            "name": "ref",
40                            "label": "Network Ref",
41                            "type": "STRING",
42                            "source": "",
43                            "defaultValue": "",
44                            "mandatory": true
45                        }
46                    ]
47                }
48            ]
49        },

Language: json

Name: Example of userAction with type: PRIMARY

Description:

[Warning: empty required content area]


 

  • SECONDARY - The userAction button will be displayed inside the ellipsis icon (vertical three dots)
No alt providedNo alt provided
1{
2            "name": "DeactivateLocation",
3            "description": "Notification for a location status change",
4            "type": "LOCATION",
5            "subtype": "STORE",
6            "eventType": "NORMAL",
7            "rules": [
8                {
9                    "name": "{accountID}.core.setState",
10                    "props": {
11                        "status": "INACTIVE"
12                    }
13                },
14                {
15                    "name": "{accountID}.core.SendEvent",
16                    "props": {
17                        "eventName": "UpdateLocationStatus"
18                    }
19                }
20            ],
21            "triggers": [
22                {
23                    "status": "ACTIVE"
24                },
25                {
26                    "status": "CREATED"
27                }
28            ],
29            "userActions": [
30                {
31                    "eventName": "DeactivateLocation",
32                    "context": [
33                        {
34                            "label": "Deactivate",
35                            "type": "SECONDARY",
36                            "modules": [
37                                "adminconsole"
38                            ],
39                            "confirm": true
40                        }
41                    ],
42                    "attributes": []
43                }
44            ]
45        },

Language: json

Name: Example of userAction with type: SECONDARY

Description:

[Warning: empty required content area]



userAction display sequence (appearance)

In terms of the button appearance, the OMX will first look at the manifest->page Props actions section to retrieve all eligible userAction buttons to display. Then, it will check the userActions from the workflow. Therefore, if you have a specific display sequence for userAction buttons to display, use the manifest to arrange the display order.



Copyright © 2024 Fluent Retail Pty Ltd (trading as Fluent Commerce). All rights reserved. No materials on this docs.fluentcommerce.com site may be used in any way and/or for any purpose without prior written authorisation from Fluent Commerce. Current customers and partners shall use these materials strictly in accordance with the terms and conditions of their written agreements with Fluent Commerce or its affiliates.

Fluent Logo