Page MenuHomePhabricator

SecurePoll: "For wiki" label not greyed out when editing a running election
Closed, ResolvedPublic2 Estimated Story PointsBUG REPORT

Description

What is the problem?

When an election is currently running, most of the labels and input fields are disabled and "greyed out".

The "For wiki" label is not, even though the associated dropdown is disabled.

Steps to reproduce problem
  1. Create an election, set the start time to today
  2. Edit the election you just created

Expected behavior: "For wiki" is greyed out
Observed behavior: "For wiki" is the same colour as usual

Environment

Browser: Firefox 78, Chromium 87
Wiki(s): https://vote.wikimedia.beta.wmflabs.org SecurePoll 2.0.0 (0ef20d9) 07:52, 12 February 2021.

Screenshots (if applicable):

for_wiki_not_grey.png (1×844 px, 76 KB)

Event Timeline

Niharika triaged this task as Medium priority.Feb 17 2021, 4:58 PM

This only occurs if the "more than 10 wikis are known about" case is hit, and is because in an autocompleteselect widget is used. This is one of the rare widgets which never got ported to OOUI exactly as-is, probably because it's not used anywhere in core. Codesearch turns up precisely one other use of it anywhere, in the ViewProtect extension where it's used only as a fallback if the combobox type doesn't exist.

The right thing to do here is probably to port it to combobox, or maybe just to merge it into the existing select case.

Change 665065 had a related patch set uploaded (by DLynch; owner: DLynch):
[mediawiki/extensions/SecurePoll@master] Use a combobox for the "for wiki" field instead of autocompleteselect

https://gerrit.wikimedia.org/r/665065

Thanks @DLynch. Taking a look at the patch with the combobox, I'm wondering if it might be confusing to the user that the input is populated with the data once an option is selected:

image.png (239×728 px, 8 KB)
image.png (214×724 px, 7 KB)

Merging it into the existing select case sounds reasonable to me, since it handles searching by typing anyway. What do you think?

@Tchanders I'm fine with that, and will update the patch.

Change 665065 merged by jenkins-bot:
[mediawiki/extensions/SecurePoll@master] Don't use autocompleteselect for large numbers of wiki names

https://gerrit.wikimedia.org/r/665065

The "For wiki" input is now just one big dropdown with all the options.

for_wiki_new_dropdown.png (971×809 px, 86 KB)

I tested creating and editing elections, making sure that the appropriate values go into the database.

Test Environments: