Follow-up to #1828410: Provide a bulk_form element for actions
Problem
- The available actions in the views bulk operations select widget cannot be configured/limited.
Details
-
Experience with admin_views leads me to believe that this should have two essential configuration modes:
A) Inclusive selection
or
B) Exclusive selection -
That is, because the typical use-case of administration views is "I don't care, give me each and every available action from all modules that you have and the current user is allowed to perform, EXCEPT these." (whereas "these" would be e.g.,
ban_ip_action()
[whereas we just removed that particular example, but there are certainly more, such as "Show a message"... ;)])
Related issues
Comment | File | Size | Author |
---|---|---|---|
#46 | views-exclude-actions-1845836-46.patch | 6.91 KB | xjm |
#46 | interdiff-exclude-actions.txt | 2.98 KB | xjm |
#40 | Screen Shot 2013-04-10 at 9.46.09 AM.png | 20.53 KB | tim.plunkett |
#33 | configurable_actions.png | 41.15 KB | xjm |
#16 | 1845836-16.patch | 6.48 KB | damiankloip |
Comments
Comment #1
dawehnerOne possible UI would be to choose whether to include/exclude and a select element to choose which one to include/exclude?
At the moment VBO in d7 just supports including elements.
Comment #2
sunYeah, and that's a detail that admin_views module is actually struggling with, because it inherently means that the default views provided by admin_views will only ever expose the actions that have been explicitly included. And because core can only know about core, the only actions that can reasonably be included are the actions defined in core.
Thus, if you've installed 100 additional modules, of which 10 provide additional actions, then those won't be exposed - even though they exist in the system.
The only way to expose them is to override the entire default view — just to get all available actions into that bulk update select.
This reminds a lot of the considerations in #1823608: Admin views in core... Default configuration for views generally seems to cross the boundaries of what can reasonably be configuration and what cannot (because the behavior of individual views plugins needs to be dynamic enough to account for a modular system — whereas (default) configuration is always hard-coded and final).
Comment #3
dawehnerFirst version with a horrible UI and no tests.
Comment #5
dawehnerFixed the test errors (just a left over dsm) and provided actual tests for this new feature.
The current UI looks like that.
Comment #6
sunPerhaps silly question, but do we want to retain the ability to include all actions?
(Technically that's identical to choosing "exclude" and selecting no action to exclude, but that may not be clear to all users.)
Comment #7
dawehnerEven one radio + a list of checkboxes itself doesn't feel like the perfect UI,
so it seems to be that we should some feedback from the UX team for a proper way, first.
Comment #8
Bojhan CreditAttribution: Bojhan commentedThere is no UI to review? I dont see screens?
Comment #9
eaton CreditAttribution: eaton commentedPerhaps silly question, but do we want to retain the ability to include all actions?
(Technically that's identical to choosing "exclude" and selecting no action to exclude, but that may not be clear to all users.)
We can still have a two-option UI -- 'All actions, except the following:' and 'Only the following:' would make it clearer without having to provide an explicit third option.
Comment #10
dawehnerWell making screenshots is easy, but don't forget to upload them, that's hard ;)
Comment #11
sun1) "All actions, except selected"
2) "Only selected actions"
1) Let's remove the trailing dot in the second label.
2) Finding proper labels for such a compound/dependent UI widget is tough ;)
But perhaps, it might already make sense with aforementioned adjustment of the options, and with the additional step of renaming the second label to:
"Selected actions"
Thus, "Selected actions" works for both "All actions, except selected" as well as "Only selected actions".
Comment #12
podarokagreed tp #11
all other looks good for RTBC
Comment #13
sunI'm not sure whether this works, but here's a re-roll against HEAD + #11 + a few more adjustments.
Comment #14
podarok#13 works for me
Comment #16
damiankloip CreditAttribution: damiankloip commentedI think we needed a bit more logic to do the correct conditional filtering of the actions, as we were getting no actions for 'include'. I also changed the view field key to be 'action_bulk_form' and not just 'bulk_form', as that's what you would get if you actually just saved a view with this field.
Comment #17
dawehnerAwesome!
Comment #18
podarok+1RTBC
Comment #19
podarokBTW
this is not feature request, it looks like a real task to make actions much more configurable via views
Comment #20
xjm#16: 1845836-16.patch queued for re-testing.
Comment #22
xjm#16: 1845836-16.patch queued for re-testing.
Comment #24
dawehner#16: 1845836-16.patch queued for re-testing.
Comment #25
damiankloip CreditAttribution: damiankloip commentedThis one was already RTBC before the random test failure time loop.
Comment #26
yoroy CreditAttribution: yoroy commentedCongrats on this issue title by the way :-)
Comment #27
dawehnerWhat about "Allow to configure actions to expose in the views bulk operations field handler configuration modal" ^^
Comment #28
xjm"Allow to configure" isn't really idiomatic... is this what we're trying to say? ;)
Comment #29
xjm#16: 1845836-16.patch queued for re-testing.
Comment #30
xjmThis is pretty useful for #1851086: Replace admin/people with a View, which is major, so bumping the priority.
Comment #31
xjmAnd, never mind.
Comment #32
eaton CreditAttribution: eaton commentedI will give a bag of jellybeans to the person who commits this patch.
Comment #33
xjmHere's what this patch adds.
Comment #34
yoroy CreditAttribution: yoroy commentedThanks for the screenshot. Makes me wonder though: why the added complexity of 'All except selected' vs 'Selected'?
Is this list of options really that long that it's useful to add the 'all except selected' option? It reverses the meaning of what checking the box does.
It makes me think.
Don't make me think! :-)
Removing that bit can be a follow-up if need be, but if it is added with this patch, might as well remove it now.
Comment #35
damiankloip CreditAttribution: damiankloip commentedYoroy, see the comments above. There was a lot of talk about this before.
Comment #36
yoroy CreditAttribution: yoroy commentedThanks for the pointer. I don't understand wether/how the the issue discussed in #2 applies to how this ui is presented. The discussion after that is about wether select all is still needed, then usability feedback was requested. I gave some :-)
If there's a technical need to have both ways, I missed it. From a ux point of view this is featuritis that I think will slow people down instead of helpping them get the thing done.
Comment #37
damiankloip CreditAttribution: damiankloip commentedComment #38
yoroy CreditAttribution: yoroy commentedYes I read that. i don't understand how that makes it necessary to have the two ways to (not) select stuff.
Comment #39
damiankloip CreditAttribution: damiankloip commentedI don't understand why you wouldn't want this. It's not like it makes it ridiculously complex.
Some people might want to create a view that only exposes 1 operation. We want to ship with more for core, and not restrict other actions added by other modules. So I think it makes alot of sense to have the include/exclude logic for this.
Comment #40
tim.plunkettHere is the problem if we don't have this extra toggle.
You decide that you never want to expose sticky and promoted, because your site doesn't use them. You check all the other boxes, and save your view, and you have what you want. Maybe you do this in more than one view.
Then you download and enable a new module that provides new actions that you want to expose. You now have to go through EVERY view, to click those checkboxes.
Or, you have this toggle, you select "All except selected" and check off sticky/promoted, and everything works as you continue adding modules.
This exact pattern has existed in core for a long time:
Comment #41
eaton CreditAttribution: eaton commentedIn a nutshell, the previous Views Bulk Operations maintainers identified three basic ways that VBO views were being created:
It's very similar to the block visibility question -- "Appear everywhere, appear on select pages, appear on all BUT select pages." It's important to remember that the users of this feature will be site administrators who are themselves building administrative/management tools. VBO currently supports this distinction and it's used quite often; I'd hate to see it crippled in core.
Do you think there's a clearer or better way of capturing the distinction between these three selection approaches?
UPDATE: Ignore me, listen to Tim.
Comment #42
yoroy CreditAttribution: yoroy commentedThanks for the explanation! I did recognize it from blocks ui. It makes a bit more sense there because you're applying settings against dozens if not hundreds of pages.
Damiankloip: if ridiculously complex is the treshold then yes, almost anything goes. But Drupal UX suffers especially from the total of small issues like these. I wanted to understand why it is needed, now I do. I think it might be solved more elegantly, but sure, rtbc.
Comment #43
webchickI like jellybeans!
Reviewing this now.
Comment #44
yoroy CreditAttribution: yoroy commentedThanks eaton, that helps as well, it's good to point out that this is very much a site builder task. A better ui might well be possible. Lets not do that in here :-)
Comment #45
xjmWe reviewed this patch live with @WEBCHICK!!! and @MOSHE WEITZMAN!!! and @EFFULGENTSIA! and it looks great EXCEPT we found some pre-existing bugs in HEAD which I'll document shortly. For now though, some minor nitpicks that I'll clean up so we can get this one in:
Missing docblock.
This comment should probably be updated to reflect the extended logic.
"Set up" should be two words.
More soon! <3
Comment #46
xjmBack to @webchick.
Meanwhile, I'll file a couple followups for:
Comment #47
webchickSince this is just changing comments, I'm going to live dangerously and commit without waiting for testbot. ;)
Committed and pushed to 8.x. Thanks!
Comment #48
xjmFollowup ONE AH AH AH
#1967092: Reorder the frontpage view so that the page display is first
Comment #49
xjmOopsie.
Comment #50
xjmFollowup TWO, AH AH AH
#1967112: HTML 5 validation breaks the cancel button in Views UI dialogs
Comment #51
xjmFollowup THREE, AH AH AH.
#1967124: Bulk action views array to string conversion when there are no results
Comment #52
sunGlad to see this finally in. Thanks everyone for sticking with it! :)
@yoroy:
I agree that the exposure of these settings is probably not optimal. I think your concerns mainly revolved around:
That's a very legit UX concern, I think. Our existing controls and this new one in core aren't particularly good in presenting + clarifying the important relationship between the two (or possibly even more) controls. Thus, unless you read very carefully, there's a good chance for configuration mistakes and user confusion.
The "All except selected" option also does not account for the potential case of:
Alas, you still need to re-configure 273 views to not expose the new havoc action. :-/
The only hope right now is that it's actually only Drupal core that exposes nonsensical actions. (which is nonsensical on its own :P)
Ultimately, I can't see a solid long-term solution that wouldn't involve a full-blown module installation + site reconfiguration wizard, which would allow you to perform bulk configuration changes, as a "Post-installation Task Manager", if you will.