Opened 4 years ago

Closed 4 years ago

Show a TracError when 'Remove selected accounts' is submitted with no checkboxes selected

Reported by: Owned by: Ryan J Ollos Steffen Hoffmann normal AccountManagerPlugin normal web-UI

Following the common convention in Trac, show a TracError when Remove selected accounts is submitted with no checkboxes selected. Following the commit of the patch in #10745, this will only be useful when JavaScript is disabled, since the patch implements the behavior that the buttons are disabled until at least one checkbox is selected.

Originally mentioned in #10745.

comment:1 Changed 4 years ago by Ryan J Ollos

Description: modified (diff)

Changed 4 years ago by Ryan J Ollos

Patch against r12507 of the trunk.

comment:2 Changed 4 years ago by Ryan J Ollos

The code is patterned after admin.py in the Trac core. I considered having the text read No user(s) selected., but didn't want to make things too odd for translators.

comment:3 in reply to:  description ; follow-up:  4 Changed 4 years ago by Steffen Hoffmann

Following the common convention in Trac, show a TracError when Remove selected accounts is submitted with no checkboxes selected.

Hm, I think, this assertion is not quite right. At least Trac is inconsistently handling similar situations. Push 'Apply Changes' on the same panel - nothing happens. Same for the plugin admin panel. Doesn't feel similar enough? How about 'Remove selected items' in permission admin panel? While it certainly looks like a similar situation, with no selection on POST it does just nothing.

I always felt, not to jump at the user with an error in such non-fatal situations, was more of a feature. If it's possible to POST without selection, it should be treated rather gracefully, no? Different situation, if you disabled the button, and someone still manages to go around it and still POST without selection.

Although I would agree to add a warning on inappropriate actions. What do you think?

comment:4 in reply to:  3 Changed 4 years ago by Ryan J Ollos

Hm, I think, this assertion is not quite right. At least Trac is inconsistently handling similar situations. Push 'Apply Changes' on the same panel - nothing happens. Same for the plugin admin panel. Doesn't feel similar enough? How about 'Remove selected items' in permission admin panel? While it certainly looks like a similar situation, with no selection on POST it does just nothing.

Good points.

I always felt, not to jump at the user with an error in such non-fatal situations, was more of a feature. If it's possible to POST without selection, it should be treated rather gracefully, no? Different situation, if you disabled the button, and someone still manages to go around it and still POST without selection.

Although I would agree to add a warning on inappropriate actions. What do you think?

After reading what you've had to say on the issue, I tend to think #10745 is enough, and maybe there is nothing that needs to be done for this ticket.

comment:5 Changed 4 years ago by Steffen Hoffmann

If you continue to feel so tomorrow, I'd welcome you're closing this ticket yourself. And your hint on #10745 is certainly another good reason for doing so.

comment:6 Changed 4 years ago by Ryan J Ollos

Resolution: → wontfix new → closed

The positive reinforcement of a successful change provided by #10684 is further reason for closing this. Also, I don't like landing on a TracError page and having to click the back button.

Now that we've discussed, I'd almost rather favor changes to the Trac core for pages such as Admin > Components so that a TracError is not raised. There too though, that change would be less important following the addition of some JavaScript (t:#10994).

Modify Ticket

Action
as closed The owner will remain Steffen Hoffmann.
The resolution will be deleted. Next status will be 'reopened'.