The motivation is very similar to #2533840: Order rules by label instead of by id:
on large sites we have many rules, and these rules are printed in an order that is not really useful. Moreover we have set of rules that are about same contents-type (i.e. creating an event, modifying it, publishing it…) but they are printed together only if they were created together, which is not always the case.
On our site we have 12 content-types with set of rules, and as they were not created sequentially it is hard to have a good overview (or we need to use filtering, which implies making several actions before simply being able to see results).
Suggestion: adding a "group-by" field on rules, and display rules grouped by this field.
We made a PoC by modifying ui/ui.controller.inc, and using the 'tags' field rather than creating a new field: tags starting by '##' are treated as groups.
You can have a look at the snapshot.
Here a patch to implement this feature. Added code is not very nice and should be reworked.
Features:
- each rule with a tag '##GROUP-NAME' is displayed in the group 'GROUP-NAME'
- rules with no group-tag are displayed in 'Unsorted rules' group, which is always the 1st
- groups are sorted alphabetically (except 'Unsorted rules')
- a rule can have several groups, and will then be displayed in each of these groups
- each group starts by a separation line with the GROUP-NAME
- this also applies to 'inactive rules' part
Feedbacks welcome.
| Comment | File | Size | Author |
|---|---|---|---|
| patch-rules-ui-grouped.patch | 1.91 KB | yannick perret | |
| Screenshot-rules-sorted-by-group.png | 60.87 KB | yannick perret |
Comments
Comment #2
tr commentedThere a two or three other similar issues open, all centered around organizing, filtering, or sorting the list of rules using tags, labels, rule names, weight, etc. We probably should have a meta issue to collect the ideas, because they can't all be used at the same time. I don't have time to look it up now (I'll post a link later) but one idea I remember that probably scales better was vertical tabs for the rules.
Comment #3
yannick perretYes, having a global discussion about improving rules sorting can be a good idea.
Points that seem importants in our case are:
- being able to group/see-only sub-parts of rules (based on tags/groups/…) in an easy way (so more simple than using existing filtering system)
- scaling for 10th of groups/tags/… (we have 12 groups, each related to a content type)
- being able to have a same rule in several groups (i.e. rules related to a content-type, rules that send mail, rules that manage user/role ACL…)
I will wait for your feedback (whatever I'm in hollidays right now :)).
Comment #4
tr commentedComment #5
tr commentedAdded a related issue that has a patch and needs review.
Help would be appreciated...
Frankly, major changes in the Rules UI for D7 are unlikely at this late point in the Drupal 7 lifecycle. But we are actively exploring new ideas for the UI in Drupal 8. In particular, I question the usefulness of tags as they are currently designed. If tags are going to be something we continue to support, then they should be taxonomy terms so that they can be used by ANY Drupal module using standard Drupal APIs. For example, a taxonomy term tag could be used to create a hierarchical View of reaction rules. I don't see the point in creating our own system (prefix with ## etc.) to establish a hierarchy of terms when taxonomy could do a better job using only the core Drupal API. Likewise, tags are currently used only to help manage the list of reaction rules and components in the UI. In D8 this is already a much easier task (I think you can do everything you listed right now in D8, without tag groups), so I don't think tags in their current form really add any value. But I would be interested in hearing use cases which are not currently addressed so that I can make the UI better. A lot of this UI work is happening in https://www.drupal.org/project/issues/tr_rulez , so if you are interested in helping out please try that module and post suggestions/problems in that issue queue.
Comment #6
xaa commentedcould you consider to allow rules reordering by clicking the table headers? I don't know if it's complicated to implement but this could help a bit.
Comment #7
tr commentedSince there's so little interest in this and since D7 is nearing its end-of-life, I won't be making these changes to the UI in D7.
We are still interested in ideas for improving the D8 UI, but those should be discussed in other issues.
See #5.