I will try to collect and list common usability issues in Rules here. Feel free to add your suggestions and hints that would make an enhancement to Rules.
* Unification of terminology (code, comments, documentation)
** a rule is evaluated
** a rule fires
** an event occurs
** an event triggers a rule
** a condition is evaluated
** an action is executed
** task = something scheduled (rule set)
** rule sets are invoked and evaluated
* Update rule sets description and help text on 'admin/rules/rule_sets'
* Update triggered rules page description
* Add a description for rule settings
* Show the event in the 'Rule elements' section of a rule
* Significant icons for actions/conditions (there should be an issue somewhere on drupal.org)
* Export: do not list rules within rule sets
* Adding a rule set: data type should be the first column for arguments
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | rules-533132.patch | 24.91 KB | klausi |
| #7 | action.png | 629 bytes | klausi |
| #7 | condition.png | 522 bytes | klausi |
| #7 | edit.png | 611 bytes | klausi |
| #7 | indent.png | 698 bytes | klausi |
Comments
Comment #1
klausiHere is patch that covers most of the issues from above.
Regarding the icons, I dug out the issue #399896: Improve UI icons and made some suggestions.
TODO:
* Search/grep the source code for terminology and correct it to the above guidelines.
Comment #2
fago>Rule sets are similar in concept to subroutines and can be executed as actions or manually by code or another module.
As you noted above, rule sets are invoked and evaluated. Thus the action executes and invokes the rule set. So I think the old wording is fine in that case.
@RULES_ADMIN_TRIGGER_PATH help:
hm, I must say again I prefer the old message. The rules are not all rules, they are just the triggered ones (compared to them in the sets that aren't listed here). Then the rule doesn't consist of the event, the event is assigned to the rule or the other way round. So I'd again just leave the old message. If they aren't really bad or wrong worded it's better to leave them anyway, as existing translations stay intact!
@rules_admin/rules_admin.sets.inc
all fine here :)
@rules_admin/rules_admin.export.inc
Not all rule sets start with 'rules_' - just the one created by the rules UI. So we have to test for 'event_' as else. Best I'd suggest to refactor that and finally add a small function that checks that for a given rule *or* event/setname to the rules.admin.inc file. Thus you can improve your code in export.inc and just use array_filter on the 'rule' items.
@event headline:
Hm, that way the headline is somehow lost. What about doing the change I already mentioned:
Use
ON
IF (instead "conditions")
....
DO (instead of "actions")
...
That way I think it makes sense. The only I thing I wonder then is what if there are no conditions. Then there is only "IF" and the add condition link. Perhaps we just shouldn't show the IF in that case?
Comment #3
klausiOK, I left the descriptions you mentioned alone.
Here is a patch that does "ON event IF ... DO ...", the IF is only shown when there is at least one condition. For rule sets: "IN rule set IF ... DO ...".
At first I was worried that the important keywords "condition" and "action" would be missing, but the are the "add condition/action" links, so it should be clear.
Comment #4
amitaibu> // filter out rules within rule sets, we only want event-triggered rules
I don't understand this part. Can you please give an exmaple of a non-event triggered rule? (Also comment should start with capital letter and end with a dot).
I think this can be shorter:
I think it's nicer if the
<h3 class="event">part would be in #prefix and #suffix.Comment #5
klausi> Can you please give an example of a non-event triggered rule?
A rule within a rule set, which has no event assigned to it, but the rule set.
> Also comment should start with capital letter and end with a dot
Fixed.
>I think this can be shorter
Fixed.
> I think it's nicer if the
<h3 class="event">part would be in #prefix and #suffix.Hm ok, I will discuss this with fago, as the other old code would also need changes to be consistent.
Comment #6
fago>+ if (isset($element['#conditions'][0])) {
While 0 is usually the key for UI created rules this has not to be so - they key might be anything. So best check whether element_children($element['#conditions']) is empty.
String change: Agreed that the change is good, but let's help our translators and search/replace this string also in the .po files. Thus the translation stays, which I think is better than loosing it.
@prefix, suffix: Hm, I'm fine with both ways. I agree that adding it via formapi keys is nice, but in the case of single html elements not really necessary and just makes the code longer.
Comment #7
klausi* Fixed condition if statement from above
* Re-generated translation template
* Changed rule set argument string in all translations
* Modified CSS for new icons (see also #399896: Improve UI icons)
* Selected new icons from the Tango set (no license, public domain)
Comment #8
fagothanks, committed. :)