-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[UX][D8] VBO: Prevent validation errors when user fails to select items and/or action #4702
Comments
...besides, I personally never liked the "Execute" label for that button 😅 |
...perhaps we should also make it so that the select menu is disabled/locked until at least one checkbox is ticked 🤔 |
Hehe, I'm curious: why?
That's true. Wouldn't "Apply" be sufficient?
I have mixed feelings regarding that. It might (or might not) cause some head scratching as - to my knowledge - we don't do that elsewhere in Backdrop. Or do we? At least in views. |
Because execute also means "to kill": It's similar to the reason why we say "user accounts" instead of "users", and #4451 |
So we better use something like "Go", "Do", "Run", "Apply",... |
Yup, also:
Here's the UX issue here:
Here's what could be done better:
|
OK, here's what I have so far: backdrop/backdrop#3407 When a view with bulk operations loads, the "Apply" button is hidden, so to avoid accidental clicks caused by missing to select an action and/or items (which lead to errors anyway). At the top of the list/table below, there's a "You need to select at least one item..." prompt: Once at least one item is selected from the list, the "Apply" button is shown, but if no action was selected, it is disabled: The "You need to select at least one item..." prompt is now replaced with a "No action selected." message. If an action is selected, that message goes away, and the "Apply" button is now enabled: I think that this is overall better UX, as there are no errors and no useless page loads if a user has missed to select items/action. Notes:
|
BTW, I'd suggest to update the issue title and description. Its initial purpose was a change in wording, but the PR goes beyond that. |
I wonder if the states system allows to let a form item depend on the status of two or more other form items. (I don't think I ever did that.) The thing that baffled me was that I didn't see the Apply button. (I chose an action first.) If I could see it, but it's disabled until both choices are made (items and action), it wouldn't have caused head scratching. |
In my opinion, the phrase "You need to select at least one item before any action may be applied" is too demanding for people who don't try to use the actions but do other things on that page. If we need such a message, a more neutral statement like "No item selected" should be fine. And can we show always the button, disabling it instead of hiding it when the requirements aren't met? |
Yes it does, and that's what I'm doing in the PR 😉 ...here's one of my favorite articles that explains how multiple conditions (with AND/OR/XOR) work: https://www.lullabot.com/articles/form-api-states |
Thanks for testing and providing feedback @indigoxela and @olafgrabienski 🙏 ...I started typing the reasoning why I implemented things the way I did, but it turned out to be an essay on certain
In general, the issues here are:
(*) Sine you cannot control the label of buttons via |
See how I said:
|
...perhaps I can add |
...PR updated to hide the pseudo-buttons when no js. |
Cant we just use JQuery to change the labels and/or disable the button instead of states? |
Yes we can @docwilmot ...but I'm not good at it 😓 ...in the meantime, my PRs can serve as a way for people to compare the UX before/after. Once we have settled on the best approach, someone else with good JS skills may take over this issue and implement things in jQuery. |
I gave it another try - with and without Javascript. It works and the UI doesn't look cluttered anymore without JS. 👍 Remaining tasks:
|
I cant do a PR now, have to go proofread my wife's dissertation, which I should have been doing for the last hour instead of this, but here's some code that works:
I added that to Also need to add an ID to the submit button:
|
Thanks so much @docwilmot 🙏 ...it's easier for me to tweak js others write, than produce it myself from scratch 😅 I've got it to work:
It should. Otherwise this wouldn't work at all if Views UI got disabled (some site builders do that after they've built their views). I've put the code in a new
No need to wrap the path around PR updated and ready for review/testing: backdrop/backdrop#3413 |
This is related to #4701
Long-time Drupal/Backdrop users may be familiar with how bulk operations work, but for new users it is not immediately apparent that the "select action" select menu and the "Execute" button are to be used with the checkboxes to the left of each result in the listing (and the fact that there is no header in the checkbox column to explain what the checkboxes are for makes that worse).
I realize that "Apply to selected items" is way more wordy than "Execute", but it clearly conveys the message of "first select which items the action is to be performed on". Compare the above screenshot from Backdrop, to this from D8:
The text was updated successfully, but these errors were encountered: