Skip to content

Commit 13e9c83

Browse files
vidarladriendupuisdabrt
authored
Workflows: Document how to set which user group can review (#2483)
--------- Co-authored-by: Adrien Dupuis <[email protected]> Co-authored-by: Tomasz Dąbrowski <[email protected]>
1 parent 9c2eee9 commit 13e9c83

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

code_samples/workflow/custom_workflow/config/packages/workflows.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ ibexa:
3030
icon: '/bundles/ibexaplatformicons/img/all-icons.svg#notice'
3131
reviewers:
3232
required: true
33+
user_group: 13
3334
actions:
3435
legal_transition_action:
3536
data:

docs/content_management/workflow/add_custom_workflow_action.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ The following example shows how to configure two custom actions that send custom
1616

1717
Configure the first custom action under the `ibexa.system.<scope>.workflows` [configuration key](configuration.md#configuration-files):
1818

19-
``` yaml hl_lines="15-18"
20-
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 0, 5) =]][[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 23, 36) =]]
19+
``` yaml hl_lines="16-19"
20+
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 0, 5) =]][[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 23, 37) =]]
2121
```
2222

2323
The configuration indicates the name of the custom action (`legal_transition_action`).
@@ -27,7 +27,7 @@ The configuration indicates the name of the custom action (`legal_transition_act
2727

2828
To define what the action does, create an event listener `src/EventListener/LegalTransitionListener.php`:
2929

30-
``` php hl_lines="27 36"
30+
``` php hl_lines="27 37"
3131
[[= include_file('code_samples/workflow/custom_workflow/src/EventListener/LegalTransitionListener.php') =]]
3232
```
3333

@@ -48,7 +48,7 @@ Line 36 in the listener above sets a custom result value for the transition.
4848
You can use this value in other stages and transitions for this content item, for example:
4949

5050
``` yaml hl_lines="10 11"
51-
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 42, 53) =]]
51+
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 43, 54) =]]
5252
```
5353

5454
The action indicated here is performed only if the result from the `legal_transition_action` is set to `true`.

docs/content_management/workflow/workflow.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The following example configuration defines a workflow where you can optionally
2222
![Diagram of custom workflow](workflow_custom_diagram.png)
2323

2424
``` yaml
25-
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 0, 32) =]][[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 37, 50) =]][[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 53, 61) =]]
25+
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 0, 33) =]][[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 38, 51) =]][[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 54, 62) =]]
2626
```
2727

2828
### Matchers
@@ -61,13 +61,14 @@ A transition must state between which stages it transitions (lines 3-4),
6161
or be `reverse` to a different transition (line 9).
6262

6363
``` yaml hl_lines="3 4 9"
64-
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 23, 30) =]][[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 37, 42) =]]
64+
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 23, 30) =]][[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 38, 43) =]]
6565
```
6666

6767
### Reviewers
6868

6969
When moving a content item through a transition, the user can select a reviewer.
7070
Assigning a reviewer is mandatory if you set `reviewers.required` to `true` for this transition.
71+
You can restrict who can review the content item by setting `reviewers.user_group` to a Location ID of the user group.
7172

7273
To be able to search for users for review, the user must have the content/read Policy without any Limitation,
7374
or with a Limitation that allows reading users.
@@ -107,7 +108,7 @@ You can automatically publish a content item once it goes through a specific tra
107108
To do so, configure the `publish` action for the transition:
108109

109110
``` yaml hl_lines="7 8"
110-
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 53, 61) =]]
111+
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 54, 62) =]]
111112
```
112113

113114
### Disable Quick Review
@@ -116,7 +117,7 @@ You can disable the default workflow, for example, if your project does not use
116117
workflows, or Quick Review entries clog your database:
117118

118119
``` yaml
119-
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 0, 4) =]][[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 62, 66) =]]
120+
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 0, 4) =]][[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 63, 67) =]]
120121
```
121122

122123
## Custom actions
@@ -181,8 +182,8 @@ To enable form validation in UI before sending it to the next stage of the workf
181182
add `validate: true` to the transitions of the stage.
182183
In the example below the form is validated in two stages:` to_legal` and `done`:
183184

184-
``` yaml hl_lines="14 27"
185-
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 23, 42) =]][[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 54, 62) =]]
185+
``` yaml hl_lines="15 28"
186+
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 23, 43) =]][[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 55, 63) =]]
186187
```
187188

188189
You can check validation for a particular stage of the workflow even if the stage doesn't have any actions.

0 commit comments

Comments
 (0)