-
Notifications
You must be signed in to change notification settings - Fork 351
/
actions.yml
169 lines (166 loc) · 5.99 KB
/
actions.yml
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
operations:
CRUD_ACTION:
label: CRUD_ACTION
button_options:
template: '@OroAction/Operation/crud-button.html.twig'
preconditions:
'@and':
- '@not_blank': $.data
- '@or':
- '@blank': $.gridName # that operation should be displayed on single page, not on grid
- '@blank': $.requestRoute # for operation execute route
- '@and':
- '@not_blank': $.routes[name]
- '@eq': # $.routes[name] - index route, display CRUD operations in grid only for index route
- $.routes[name]
- $.requestRoute
preactions:
- '@tree':
conditions:
'@not_blank': $.data
actions:
- '@call_service_method':
service: oro_action.helper.default_operation_request
method: getRequestRoute
attribute: $.requestRoute
- '@call_service_method':
service: oro_entity_config.helper.entity_config
method: getRoutes
method_parameters: [$.data, ['name', 'update']]
attribute: $.routes
- '@call_service_method':
service: oro_entity_config.helper.entity_config
method: getConfigValue
method_parameters: [$.data, 'label', false]
attribute: $.entityLabel
- '@trans':
id: $.entityLabel
attribute: $.entityLabel
UPDATE:
extends: CRUD_ACTION
acl_resource: [EDIT, $.data]
order: 510
for_all_entities: true
for_all_datagrids: true
groups:
- view_navButtons
- datagridRowAction
preconditions:
'@and':
- '@not_blank': $.routes[update]
label: oro.action.edit
frontend_options:
title: oro.action.edit_entity
button_options:
icon: fa-pencil-square-o
actions:
- '@redirect':
route: $.routes[update]
route_parameters: {id: $id}
DELETE:
extends: CRUD_ACTION
acl_resource: [DELETE, $.data]
order: 520
for_all_entities: true
for_all_datagrids: true
groups:
- view_navButtons
- update_navButtons
- datagridRowAction
preconditions:
'@and':
- '@or':
- '@not_blank': $.routes[name]
- '@not_blank': $.gridName
label: oro.action.delete
frontend_options:
title: oro.action.delete_entity
options:
ariaLabel: oro.action.delete_entity.aria_label
confirmation:
title: oro.action.delete_entity
message: oro.action.delete_confirm
okText: oro.action.button.delete
component: oroui/js/delete-confirmation
message_parameters:
entityLabel: $.entityLabel
button_options:
icon: fa-trash-o
actions:
- '@run_action_group':
action_group: DELETE
parameters_mapping:
data: $.data
- '@flash_message':
message: oro.action.delete_message
type: 'success'
message_parameters:
entityLabel: $.entityLabel
- '@redirect':
conditions:
'@and':
- '@empty': $.gridName
- '@not_empty': $.routes[name]
parameters:
route: $.routes[name]
- '@refresh_grid':
conditions:
'@and':
- '@empty': $.routes[name]
- '@not_empty': $.gridName
parameters: [$.gridName]
CLONE:
extends: CRUD_ACTION
replace:
- preconditions
order: 30
groups:
- view_navButtons
- update_navButtons
- datagridRowAction
preactions:
- '@call_service_method':
service: oro_action.helper.default_operation_request
method: isExecutionRouteRequest
attribute: $.isExecutionRequest
- '@tree':
conditions:
'@and':
- '@not_blank': $.data
- '@eq': [$.requestRoute, 'oro_action_widget_form'] # display a form template ot dialog
actions:
- '@clone_object':
target: $.data
attribute: $.clone
- '@tree':
conditions:
'@and':
- '@not_blank': $.data
- '@eq': [$.isExecutionRequest, true] # no form or dialogue
- '@empty': $.clone
actions:
- '@clone_entity':
target: $.data
attribute: $.clone
flush: true
preconditions:
'@and':
- '@not_blank': $.data
- '@or':
- '@not_blank': $.routes[name]
- '@not_blank': $.gridName
label: oro.action.clone
frontend_options:
title: oro.action.clone_entity
button_options:
icon: fa-files-o
action_groups:
DELETE:
parameters:
data: ~
acl_resource: [DELETE, $.data]
actions:
- '@call_service_method':
service: oro_action.handler.delete
method: handleDelete
method_parameters: [$.data]