Skip to content

Commit 61e4a5a

Browse files
committed
Refactor automation rule forms to support nested conditions and update labels for clarity
1 parent 554415f commit 61e4a5a

6 files changed

Lines changed: 210 additions & 23 deletions

File tree

administrator/components/com_workflow/forms/automation_rule.xml

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@
7676
/>
7777

7878
<field
79-
name="filter_match"
79+
name="condition_match"
8080
type="list"
81-
label="COM_WORKFLOW_AUTOMATION_FILTER_MATCH_LABEL"
82-
description="COM_WORKFLOW_AUTOMATION_FILTER_MATCH_DESC"
81+
label="COM_WORKFLOW_AUTOMATION_TREE_MATCH_LABEL"
82+
description="COM_WORKFLOW_AUTOMATION_TREE_MATCH_DESC"
8383
validate="options"
8484
default="all"
8585
>
@@ -88,36 +88,24 @@
8888
</field>
8989

9090
<field
91-
name="filter"
91+
name="conditions"
9292
type="subform"
93-
label="COM_WORKFLOW_AUTOMATION_FILTER_LABEL"
94-
description="COM_WORKFLOW_AUTOMATION_FILTER_DESC"
93+
label="COM_WORKFLOW_AUTOMATION_TREE_CONDITIONS_LABEL"
94+
description="COM_WORKFLOW_AUTOMATION_TREE_CONDITIONS_DESC"
9595
multiple="true"
9696
layout="joomla.form.field.subform.repeatable"
97-
formsource="administrator/components/com_workflow/forms/condition_group.xml"
97+
formsource="administrator/components/com_workflow/forms/condition_leaf_simple.xml"
9898
min="0"
9999
/>
100100

101101
<field
102-
name="condition_match"
103-
type="list"
104-
label="COM_WORKFLOW_AUTOMATION_CONDITION_MATCH_LABEL"
105-
description="COM_WORKFLOW_AUTOMATION_CONDITION_MATCH_DESC"
106-
validate="options"
107-
default="all"
108-
>
109-
<option value="all">COM_WORKFLOW_AUTOMATION_MATCH_ALL</option>
110-
<option value="any">COM_WORKFLOW_AUTOMATION_MATCH_ANY</option>
111-
</field>
112-
113-
<field
114-
name="condition"
102+
name="groups"
115103
type="subform"
116-
label="COM_WORKFLOW_AUTOMATION_CONDITION_LABEL"
117-
description="COM_WORKFLOW_AUTOMATION_CONDITION_DESC"
104+
label="COM_WORKFLOW_AUTOMATION_TREE_GROUPS_LABEL"
105+
description="COM_WORKFLOW_AUTOMATION_TREE_GROUPS_DESC"
118106
multiple="true"
119107
layout="joomla.form.field.subform.repeatable"
120-
formsource="administrator/components/com_workflow/forms/condition_group.xml"
108+
formsource="administrator/components/com_workflow/forms/condition_group_l1.xml"
121109
min="0"
122110
/>
123111
</form>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<form>
3+
<config>
4+
<inlinehelp button="show" />
5+
</config>
6+
<field
7+
name="group_match"
8+
type="list"
9+
label="COM_WORKFLOW_AUTOMATION_GROUP_MATCH_LABEL"
10+
description="COM_WORKFLOW_AUTOMATION_GROUP_MATCH_DESC"
11+
default="all"
12+
validate="options"
13+
>
14+
<option value="all">COM_WORKFLOW_AUTOMATION_MATCH_ALL</option>
15+
<option value="any">COM_WORKFLOW_AUTOMATION_MATCH_ANY</option>
16+
</field>
17+
18+
<field
19+
name="negate"
20+
type="radio"
21+
layout="joomla.form.field.radio.switcher"
22+
label="COM_WORKFLOW_AUTOMATION_GROUP_NEGATE_LABEL"
23+
description="COM_WORKFLOW_AUTOMATION_GROUP_NEGATE_DESC"
24+
default="0"
25+
>
26+
<option value="0">JNO</option>
27+
<option value="1">JYES</option>
28+
</field>
29+
30+
<field
31+
name="conditions"
32+
type="subform"
33+
label="COM_WORKFLOW_AUTOMATION_GROUP_CONDITIONS_LABEL"
34+
description="COM_WORKFLOW_AUTOMATION_GROUP_CONDITIONS_DESC"
35+
multiple="true"
36+
layout="joomla.form.field.subform.repeatable"
37+
formsource="administrator/components/com_workflow/forms/condition_leaf_simple.xml"
38+
min="0"
39+
/>
40+
41+
<field
42+
name="groups"
43+
type="subform"
44+
label="COM_WORKFLOW_AUTOMATION_GROUP_NESTED_LABEL"
45+
description="COM_WORKFLOW_AUTOMATION_GROUP_NESTED_DESC"
46+
multiple="true"
47+
layout="joomla.form.field.subform.repeatable"
48+
formsource="administrator/components/com_workflow/forms/condition_group_l2.xml"
49+
min="0"
50+
/>
51+
</form>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<form>
3+
<config>
4+
<inlinehelp button="show" />
5+
</config>
6+
<field
7+
name="group_match"
8+
type="list"
9+
label="COM_WORKFLOW_AUTOMATION_GROUP_MATCH_LABEL"
10+
description="COM_WORKFLOW_AUTOMATION_GROUP_MATCH_DESC"
11+
default="all"
12+
validate="options"
13+
>
14+
<option value="all">COM_WORKFLOW_AUTOMATION_MATCH_ALL</option>
15+
<option value="any">COM_WORKFLOW_AUTOMATION_MATCH_ANY</option>
16+
</field>
17+
18+
<field
19+
name="negate"
20+
type="radio"
21+
layout="joomla.form.field.radio.switcher"
22+
label="COM_WORKFLOW_AUTOMATION_GROUP_NEGATE_LABEL"
23+
description="COM_WORKFLOW_AUTOMATION_GROUP_NEGATE_DESC"
24+
default="0"
25+
>
26+
<option value="0">JNO</option>
27+
<option value="1">JYES</option>
28+
</field>
29+
30+
<field
31+
name="conditions"
32+
type="subform"
33+
label="COM_WORKFLOW_AUTOMATION_GROUP_CONDITIONS_LABEL"
34+
description="COM_WORKFLOW_AUTOMATION_GROUP_CONDITIONS_DESC"
35+
multiple="true"
36+
layout="joomla.form.field.subform.repeatable"
37+
formsource="administrator/components/com_workflow/forms/condition_leaf_simple.xml"
38+
min="0"
39+
/>
40+
41+
<field
42+
name="groups"
43+
type="subform"
44+
label="COM_WORKFLOW_AUTOMATION_GROUP_NESTED_LABEL"
45+
description="COM_WORKFLOW_AUTOMATION_GROUP_NESTED_DESC"
46+
multiple="true"
47+
layout="joomla.form.field.subform.repeatable"
48+
formsource="administrator/components/com_workflow/forms/condition_group_l3.xml"
49+
min="0"
50+
/>
51+
</form>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<form>
3+
<config>
4+
<inlinehelp button="show" />
5+
</config>
6+
<field
7+
name="group_match"
8+
type="list"
9+
label="COM_WORKFLOW_AUTOMATION_GROUP_MATCH_LABEL"
10+
description="COM_WORKFLOW_AUTOMATION_GROUP_MATCH_DESC"
11+
default="all"
12+
validate="options"
13+
>
14+
<option value="all">COM_WORKFLOW_AUTOMATION_MATCH_ALL</option>
15+
<option value="any">COM_WORKFLOW_AUTOMATION_MATCH_ANY</option>
16+
</field>
17+
18+
<field
19+
name="negate"
20+
type="radio"
21+
layout="joomla.form.field.radio.switcher"
22+
label="COM_WORKFLOW_AUTOMATION_GROUP_NEGATE_LABEL"
23+
description="COM_WORKFLOW_AUTOMATION_GROUP_NEGATE_DESC"
24+
default="0"
25+
>
26+
<option value="0">JNO</option>
27+
<option value="1">JYES</option>
28+
</field>
29+
30+
<field
31+
name="conditions"
32+
type="subform"
33+
label="COM_WORKFLOW_AUTOMATION_GROUP_CONDITIONS_LABEL"
34+
description="COM_WORKFLOW_AUTOMATION_GROUP_CONDITIONS_DESC"
35+
multiple="true"
36+
layout="joomla.form.field.subform.repeatable"
37+
formsource="administrator/components/com_workflow/forms/condition_leaf_simple.xml"
38+
min="0"
39+
/>
40+
</form>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<form>
3+
<config>
4+
<inlinehelp button="show" />
5+
</config>
6+
<field
7+
name="field"
8+
type="list"
9+
label="COM_WORKFLOW_AUTOMATION_LEAF_FIELD_LABEL"
10+
description="COM_WORKFLOW_AUTOMATION_LEAF_FIELD_DESC"
11+
default="tag"
12+
validate="options"
13+
>
14+
<option value="day_of_week">COM_WORKFLOW_AUTOMATION_FIELD_DAY_OF_WEEK</option>
15+
<option value="date">COM_WORKFLOW_AUTOMATION_FIELD_DATE</option>
16+
<option value="tag">COM_WORKFLOW_AUTOMATION_FIELD_TAG</option>
17+
<option value="category">COM_WORKFLOW_AUTOMATION_FIELD_CATEGORY</option>
18+
<option value="author_group">COM_WORKFLOW_AUTOMATION_FIELD_AUTHOR_GROUP</option>
19+
</field>
20+
21+
<field
22+
name="operator"
23+
type="list"
24+
label="COM_WORKFLOW_AUTOMATION_LEAF_OPERATOR_LABEL"
25+
description="COM_WORKFLOW_AUTOMATION_LEAF_OPERATOR_DESC"
26+
default="is"
27+
validate="options"
28+
>
29+
<option value="is">COM_WORKFLOW_AUTOMATION_OP_IS</option>
30+
<option value="is not">COM_WORKFLOW_AUTOMATION_OP_IS_NOT</option>
31+
<option value="in">COM_WORKFLOW_AUTOMATION_OP_IN</option>
32+
<option value="not in">COM_WORKFLOW_AUTOMATION_OP_NOT_IN</option>
33+
<option value="has">COM_WORKFLOW_AUTOMATION_OP_HAS</option>
34+
<option value="not has">COM_WORKFLOW_AUTOMATION_OP_NOT_HAS</option>
35+
<option value="before">COM_WORKFLOW_AUTOMATION_OP_BEFORE</option>
36+
<option value="after">COM_WORKFLOW_AUTOMATION_OP_AFTER</option>
37+
<option value="on">COM_WORKFLOW_AUTOMATION_OP_ON</option>
38+
<option value="not on">COM_WORKFLOW_AUTOMATION_OP_NOT_ON</option>
39+
</field>
40+
41+
<field
42+
name="value"
43+
type="text"
44+
label="COM_WORKFLOW_AUTOMATION_LEAF_VALUE_LABEL"
45+
description="COM_WORKFLOW_AUTOMATION_LEAF_VALUE_DESC"
46+
/>
47+
</form>

administrator/language/en-GB/com_workflow.ini

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ COM_WORKFLOW_AUTOMATION_GROUP_CONDITIONS_DESC="The individual checks in this gro
2929
COM_WORKFLOW_AUTOMATION_GROUP_CONDITIONS_LABEL="Conditions"
3030
COM_WORKFLOW_AUTOMATION_GROUP_MATCH_DESC="Whether every check inside this group must be true, or just any one of them."
3131
COM_WORKFLOW_AUTOMATION_GROUP_MATCH_LABEL="Match within group"
32+
COM_WORKFLOW_AUTOMATION_GROUP_NEGATE_DESC="When on, the group matches only when its contents do NOT match."
33+
COM_WORKFLOW_AUTOMATION_GROUP_NEGATE_LABEL="Negate (NOT)"
34+
COM_WORKFLOW_AUTOMATION_GROUP_NESTED_DESC="Groups nested inside this one, for building deeper AND/OR combinations."
35+
COM_WORKFLOW_AUTOMATION_GROUP_NESTED_LABEL="Nested groups"
3236
COM_WORKFLOW_AUTOMATION_INTERVAL_UNIT_DESC="The unit for the interval above, for example 3 Days."
3337
COM_WORKFLOW_AUTOMATION_INTERVAL_UNIT_LABEL="Interval Unit"
3438
COM_WORKFLOW_AUTOMATION_INTERVAL_VALUE_DESC="How long an item waits in the current stage before this transition runs."
@@ -63,6 +67,12 @@ COM_WORKFLOW_AUTOMATION_RULE_TYPE_INTERVAL="Interval"
6367
COM_WORKFLOW_AUTOMATION_RULE_TYPE_LABEL="Rule Type"
6468
COM_WORKFLOW_AUTOMATION_RUN_AS_DESC="The user identity the automated transition executes as. Permissions are checked against this user."
6569
COM_WORKFLOW_AUTOMATION_RUN_AS_LABEL="Run As User"
70+
COM_WORKFLOW_AUTOMATION_TREE_CONDITIONS_DESC="Conditions checked at the top level of this rule."
71+
COM_WORKFLOW_AUTOMATION_TREE_CONDITIONS_LABEL="Conditions"
72+
COM_WORKFLOW_AUTOMATION_TREE_GROUPS_DESC="Grouped conditions. Use groups to combine AND and OR, e.g. A AND (B OR C)."
73+
COM_WORKFLOW_AUTOMATION_TREE_GROUPS_LABEL="Condition groups"
74+
COM_WORKFLOW_AUTOMATION_TREE_MATCH_DESC="Whether all top-level conditions and groups must match, or just any one of them."
75+
COM_WORKFLOW_AUTOMATION_TREE_MATCH_LABEL="Match"
6676
COM_WORKFLOW_AUTOMATION_UNIT_DAYS="Days"
6777
COM_WORKFLOW_AUTOMATION_UNIT_HOURS="Hours"
6878
COM_WORKFLOW_AUTOMATION_UNIT_MINUTES="Minutes"

0 commit comments

Comments
 (0)