Commit graph

16 commits

Author SHA1 Message Date
STran
c12af6e168 Normalize and de-dupe usernames in HTMLUsersMultiselectField
In no-js, there is no on the fly normalization of usernames in
HTMLUsersMultiselectField so both "User A" and "User_A" are
valid representations of "User A" (the canonical representation).

It's also possible to add the same user multiple times with no-js
and this will be considered valid and count toward the max limit.

These are not problems with js enabled since there will be an api
call for every new entry and that call both filters for selected users
and only returns canonical names.

This patchset reproduces that functionality in the PHP layer so that
no-js functions like the infused widget.

Bug: T274568
Change-Id: Ie78c8f37fa8a38b67eeaa6de098e41df2dac3e3e
2021-02-16 14:37:23 -08:00
Umherirrender
8de3b7d324 Use static closures where safe to use
This is micro-optimization of closure code to avoid binding the closure
to $this where it is not needed.

Created by I25a17fb22b6b669e817317a0f45051ae9c608208

Change-Id: I0ffc6200f6c6693d78a3151cb8cea7dce7c21653
2021-02-11 00:13:52 +00:00
Nikki Nikkhoui
6b0e9eafe1 HTML Classes stability annotations
Add stability annotations for HTML classes.

Bug: T247862
Change-Id: I4dad7b98213ceceb8c04b24e5d52e6fecadb3538
2020-07-13 14:54:28 +02:00
Thalia
fa0dfa9a0d HTMLUsersMultiselectField: Pass through config for widget's input
Bug: T245271
Change-Id: Icb449d4ea73c1513d6727d70ff3027c41e5ac059
2020-02-14 15:11:53 +00:00
James D. Forrester
0958a0bce4 Coding style: Auto-fix MediaWiki.Usage.IsNull.IsNull
Change-Id: I90cfe8366c0245c9c67e598d17800684897a4e27
2020-01-10 14:17:13 -08:00
Thalia
16555e6f65 Add option for showing valid IPs in UsersMultiselectWidget menu
Pass through config options from HTMLUserTextField that allow the
field to accept an IP address and/or range, and specify the maximum
allowed range size.

Bug: T238277
Change-Id: I0e0f6b6fd6801d5cd561def28917e81a81b3f7d4
2019-11-15 21:42:32 +00:00
Thalia
c0ce43bf5a Allow HTMLUsersMultiselectField to limit number of selected items
Bug: T238240
Change-Id: Ia2c046f3385ca0908f8c2756ba5f304ed8bed29d
2019-11-14 11:59:50 +00:00
Volker E
f4888e1442 Replace 'capsule' with appropriate 'tag'
UsersMultiselectWidget class extends OOUI's MenuTagMultiselectWidget,
not CapsuleMultiselectWidget any more.

Change-Id: Iea7450a371720bed392dfedb1032bc8c63c89fc4
2018-07-09 19:44:09 +02:00
David Barratt
b39ce8f791 Allow users to prevent new users from sending them email.
Users now have the option to prevent Newbie users from sending
them emails.

Bug: T138165
Change-Id: I5d5332e50971fbcd1fa630d6bd03bdf757a9d1f1
2017-12-11 22:04:18 -05:00
Roan Kattouw
4078bb6b52 HTMLUsersMultiSelectField: Don't use content language for placeholder message
No idea why this was using content language to begin with, but it seems
like it should clearly use the user language instead.

Bug: T171817
Change-Id: I1763ffd8ee037dbb5dd94c410cb6a82e0f6b27e9
2017-07-27 09:38:57 -07:00
Roan Kattouw
7c0a58393b HTMLUsersMultiselectField: Handle empty value properly
If the string value is '' (empty string), the array
value should be [] (empty array), not [''] (array of one element
which is an empty string).

Bug: T169384
Change-Id: I558f3890af05efb6eaa18403467c0a05f44af12a
2017-07-11 11:29:17 -07:00
jenkins-bot
5049af1048 Merge "Fix \n handling for HTMLUsersMultiselectField" 2017-06-30 02:21:13 +00:00
Matthew Flaschen
a3e2d832d7 Fix \n handling for HTMLUsersMultiselectField
Bug: T166836
Change-Id: I51b772946f1e50a21fb86cab969defb4647b820b
2017-06-29 19:02:46 -07:00
Umherirrender
be42e09aa8 build: Prepare for mediawiki/mediawiki-codesniffer to 0.9.0
The used phpcs has a bug, so the version 0.9.0 could not be enforced at the moment.
Will be fixed in next version, see T167168

Changed:
- Remove duplicate newline at end of file
- Add space between function and ( for closures
- and -> &&, or -> ||

Change-Id: I4172fb08861729bccd55aecbd07e029e2638d311
2017-06-26 17:14:31 +00:00
Bartosz Dziewoński
cf6e108a5c HTMLUsersMultiselectField: Make auto-infusable when used inside a legacy HTMLForm
Change-Id: I23b3a86f06a10b066e6671e398da37c62e3e61b1
2017-05-20 16:13:17 +02:00
Phantom42
c70f464c07 UsersMultiselect widget and form field.
New widget and html form field, which allows selecting multiple
users using convenient single-line input (CapsuleMultiselectWidget)

Bug: T131492
Change-Id: I7b6ffe7fb47e0a7083e2a956156ab0f142444398
2017-02-01 00:35:33 +02:00