summaryrefslogtreecommitdiffstats
path: root/catalog-ui/configurations/MenuReadMe.txt
blob: 248898df4cd5d174ff4162c2217d956fe6889dd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
*******************************************************************
*******             Explanation about menu.json             *******
*******************************************************************

The menu.json defines the menu to show for each type of "roles":

Supported roles:
-----------------------------
ADMIN
DESIGNER

The JSON is separated to roles, and for each role we define "states",
what menu to show the user for each state of the component:

Supported states:
-----------------------------
NOT_CERTIFIED_CHECKOUT
NOT_CERTIFIED_CHECKIN
CERTIFIED

For each state we can define the user that will see this menu, the available parameters are:

Supported users:
-----------------------------
ANY
NOT_OWNER

Example:
For designer, if the component state is checkout and the component was created by other user, the NOT_OWNER will be used.

"DESIGNER":{
            "states":{
                "NOT_CERTIFIED_CHECKOUT":{
                    "ANY":[
                        {"text":"Edit"    ,"action":"goToEntity"},
                        {"text":"Check in","action":"changeLifecycleState", "url":"lifecycleState/CHECKIN", "confirmationModal": "lifecycleState/CHECKIN"},
                        {"text":"View"    ,"action":"openViewerModal"}
                    ],
                    "NOT_OWNER":[
                        {"text":"View"    ,"action":"openViewerModal"}
                    ]
                },


Definition of the menu item:
-----------------------------
text                - The text to show
action              - Function that will be called when pressing on the menu item
url                 - Data added to menu item, in case the function need to use it, example: for function "changeLifecycleState", I need to pass also the url "lifecycleState/CHECKOUT" that I want the state to change to.
confirmationModal   - Open confirmation modal (user should select "OK" or "Cancel"), and continue with the action.
blockedForTypes     - This item will not be shown for specific components types.