File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,8 @@ services:
132
132
public: true
133
133
arguments:
134
134
- '@workflow.registry'
135
- - workflow_name: pull_request
135
+ - render_actions: [show]
136
+ workflow_name: pull_request
136
137
no_transition_label: No transition for pull request
137
138
no_transition_icon: fa fa-times
138
139
dropdown_transitions_label: Pull request transitions
@@ -155,6 +156,7 @@ sonata_admin:
155
156
156
157
What are these options ?
157
158
159
+ - `render_actions` : Admin action names on which the extension should render its menu (defaults to `[show, edit]`)
158
160
- `workflow_name` : The name of the Workflow to handle (defaults to `null`)
159
161
- `no_transition_display` : Whether or not to display a button when no transition is enabled (defaults to `false`)
160
162
- `no_transition_label` : The button label when no transition is enabled (defaults to `workflow_transitions_empty`)
Original file line number Diff line number Diff line change @@ -72,6 +72,10 @@ public function configureSideMenu(
72
72
$ action ,
73
73
AdminInterface $ childAdmin = null
74
74
) {
75
+ if (!in_array ($ action , $ this ->options ['render_actions ' ], true )) {
76
+ return ;
77
+ }
78
+
75
79
$ subject = $ admin ->getSubject ();
76
80
if (null === $ subject ) {
77
81
return ;
@@ -111,6 +115,7 @@ protected function configureOptions(OptionsResolver $resolver)
111
115
{
112
116
$ resolver
113
117
->setDefaults ([
118
+ 'render_actions ' => ['edit ' , 'show ' ],
114
119
'workflow_name ' => null ,
115
120
'no_transition_display ' => false ,
116
121
'no_transition_label ' => 'workflow_transitions_empty ' ,
@@ -120,6 +125,7 @@ protected function configureOptions(OptionsResolver $resolver)
120
125
'transitions_default_icon ' => null ,
121
126
'transitions_icons ' => [],
122
127
])
128
+ ->setAllowedTypes ('render_actions ' , ['string[] ' ])
123
129
->setAllowedTypes ('workflow_name ' , ['string ' , 'null ' ])
124
130
->setAllowedTypes ('no_transition_display ' , ['bool ' ])
125
131
->setAllowedTypes ('no_transition_label ' , ['string ' ])
You can’t perform that action at this time.
0 commit comments