Page MenuHomePhabricator

Convert DropdownInputWidget of Special:ActiveUsers to a multi-select widget
Closed, DuplicatePublic

Assigned To
None
Authored By
Florian
May 15 2016, 4:19 PM
Referenced Files
F4019430: pasted_file
May 16 2016, 2:42 PM
F4019449: pasted_file
May 16 2016, 2:42 PM
F4019435: pasted_file
May 16 2016, 2:42 PM
F4019453: pasted_file
May 16 2016, 2:42 PM

Description

The two checkboxes of Special:Activeusers were converted to a dropdowninput widget as a result of T116354: Special:ActiveUsers' user interface is awkward (can't filter to arbitrary user groups). However, there are legitimate use cases where a user may wish to select multiple user groups (e.g. sysop and stewards or some other combination). This is currently not possible.

This task should work out a way how this could be implemented, e.g. by using one of the (not yet created) multi-select widgets of OOJsUI:

Event Timeline

What you want already exists in HTMLForm (although not in its OOUI version). Just use a HTMLMultiSelectField and add 'cssclass' => 'mw-chosen' to it. This will magically turn the usual checkboxes into a Chosen selector (which is pretty much the same thing as OOjs UI's CapsuleMultiSelectWidget). It's used in the OpenStackManager extension, for example on Special:NovaServiceGroup (no uses in core right now, though).

No JS:

pasted_file (177×425 px, 6 KB)

With JS enabled:

pasted_file (177×425 px, 7 KB)
pasted_file (177×425 px, 9 KB)
pasted_file (177×425 px, 8 KB)

I see one problem with that JS option: you need to know what you are looking for before typing. :)

I think it will actually show the whole list of available options when
you click the field (like HTML <select> dropdown boxes).

Yep, it should show the whole list when clicking into the input and filter it when typing :)

I implemented this in the last patchset of https://gerrit.wikimedia.org/r/#/c/288197/. Let's merge this back into the original task.