Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 1 | ******************************************************************* |
| 2 | ******* Explanation about menu.json ******* |
| 3 | ******************************************************************* |
| 4 | |
| 5 | The menu.json defines the menu to show for each type of "roles": |
| 6 | |
| 7 | Supported roles: |
| 8 | ----------------------------- |
| 9 | ADMIN |
| 10 | DESIGNER |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 11 | TESTER |
| 12 | OPS |
| 13 | GOVERNOR |
| 14 | |
| 15 | The JSON is separated to roles, and for each role we define "states", |
| 16 | what menu to show the user for each state of the component: |
| 17 | |
| 18 | Supported states: |
| 19 | ----------------------------- |
| 20 | NOT_CERTIFIED_CHECKOUT |
| 21 | NOT_CERTIFIED_CHECKIN |
| 22 | READY_FOR_CERTIFICATION |
| 23 | CERTIFICATION_IN_PROGRESS |
| 24 | CERTIFIED |
| 25 | |
| 26 | For each state we can define the user that will see this menu, the available parameters are: |
| 27 | |
| 28 | Supported users: |
| 29 | ----------------------------- |
| 30 | ANY |
| 31 | NOT_OWNER |
| 32 | |
| 33 | Example: |
| 34 | For designer, if the component state is checkout and the component was created by other user, the NOT_OWNER will be used. |
| 35 | |
| 36 | "DESIGNER":{ |
| 37 | "states":{ |
| 38 | "NOT_CERTIFIED_CHECKOUT":{ |
| 39 | "ANY":[ |
| 40 | {"text":"Edit" ,"action":"goToEntity"}, |
| 41 | {"text":"Check in","action":"changeLifecycleState", "url":"lifecycleState/CHECKIN", "confirmationModal": "lifecycleState/CHECKIN"}, |
| 42 | {"text":"Submit for Testing","action":"changeLifecycleState", "url":"lifecycleState/certificationRequest", "emailModal": "lifecycleState/CERTIFICATIONREQUEST"}, |
| 43 | {"text":"View" ,"action":"openViewerModal"} |
| 44 | ], |
| 45 | "NOT_OWNER":[ |
| 46 | {"text":"View" ,"action":"openViewerModal"} |
| 47 | ] |
| 48 | }, |
| 49 | |
| 50 | |
| 51 | Definition of the menu item: |
| 52 | ----------------------------- |
| 53 | text - The text to show |
| 54 | action - Function that will be called when pressing on the menu item |
| 55 | 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. |
| 56 | confirmationModal - Open confirmation modal (user should select "OK" or "Cancel"), and continue with the action. |
| 57 | emailModal - Open email modal (user should fill email details), and continue with the action. |
| 58 | blockedForTypes - This item will not be shown for specific components types. |