@@ -24,11 +24,11 @@ This library add Symfony Workflow component integration within Sonata Admin.
24
24
25
25
### Code
26
26
27
- - a Sonata Admin [ Extension] ( https://sonata-project.org/bundles/admin/master/doc/reference/extensions.html ) :
27
+ - a Sonata Admin [ Extension] ( https://sonata-project.org/bundles/admin/master/doc/reference/extensions.html ) :
28
28
[ WorkflowExtension] ( src/Admin/Extension/WorkflowExtension.php )
29
- - a Controller trait :
29
+ - a Controller trait :
30
30
[ WorkflowControllerTrait] ( src/Controller/WorkflowControllerTrait.php )
31
- - a Controller :
31
+ - a Controller :
32
32
[ WorkflowController] ( src/Controller/WorkflowController.php )
33
33
34
34
@@ -44,6 +44,7 @@ Configuration
44
44
45
45
Let say that you have an entity named ` PullRequest ` that is under workflow and for which you have an admin.
46
46
47
+ #### symfony/workflow <4.3
47
48
``` yaml
48
49
# config/packages/workflow.yml
49
50
framework :
@@ -74,11 +75,42 @@ framework:
74
75
to : closed
75
76
` ` `
76
77
78
+ #### symfony/workflow ^4.3|^5.0
79
+ ` ` ` yaml
80
+ # config/packages/workflow.yml
81
+ framework :
82
+ workflows :
83
+ pull_request :
84
+ type : state_machine
85
+ marking_store :
86
+ type : state_machine
87
+ property : status
88
+ supports :
89
+ - App\Entity\PullRequest
90
+ places :
91
+ - opened
92
+ - pending_review
93
+ - merged
94
+ - closed
95
+ initial_marking :
96
+ - opened
97
+ transitions :
98
+ start_review :
99
+ from : opened
100
+ to : pending_review
101
+ merge :
102
+ from : pending_review
103
+ to : merged
104
+ close :
105
+ from : pending_review
106
+ to : closed
107
+ ` ` `
108
+
77
109
### One extension for everything
78
110
79
111
The extension is usable for many entities and with no configuration.
80
112
81
- You only need to create a service for it, configure the controller that will handle the transition action
113
+ You only need to create a service for it, configure the controller that will handle the transition action
82
114
and configure on which admin you want it available.
83
115
84
116
For instance :
@@ -108,7 +140,7 @@ sonata_admin:
108
140
- admin.pull_request
109
141
` ` `
110
142
111
- > **note**: You may noticed that we also registered the controller
143
+ > **note**: You may noticed that we also registered the controller
112
144
` Yokai\SonataWorkflow\Controller\WorkflowController` as a service.
113
145
It is important, because it needs the workflow registry service to work.
114
146
@@ -170,12 +202,12 @@ What are these options ?
170
202
Hook into the transition process
171
203
--------------------------------
172
204
173
- Let say that when you start a review for a pull request, as a user,
205
+ Let say that when you start a review for a pull request, as a user,
174
206
you will be asked to enter which users are involved in the review.
175
207
176
208
To achieve this, you will be asked to fill a dedicated form.
177
209
178
- You only need to create a custom controller for your entity admin :
210
+ You only need to create a custom controller for your entity admin :
179
211
180
212
` ` ` yaml
181
213
# config/packages/sonata_admin.yml
0 commit comments