Commit graph

26 commits

Author SHA1 Message Date
Thiemo Kreuz
e23b070b45 Make use of ?? and ?: operators where it makes sense
Change-Id: I1d9d62d80b17d1a05222c6e82f631cb801c311a8
2022-08-04 21:43:12 +02:00
Tim Starling
97b8262d1f Use UserRigorOptions directly
Conventionally, public constants are accessed via their declaring
class, except for self:: which is an acceptable shortcut.

Change-Id: If05eab72140267e6ef54736710d751d7f24a7860
2022-03-25 10:06:34 +11:00
Umherirrender
c259c37033 Add various null checks when null is not possible to use as argument
Also check for false if needed

Found by phan strict checks

Change-Id: I298204653dfb788515a87978dd8705b6e4f9c775
2022-03-14 17:17:17 +00:00
Bartosz Dziewoński
0feccb0cb1 Rename CSS class 'mw-htmlform-field-autoinfuse' to fit the convention
Rename to 'mw-htmlform-autoinfuse'. This avoids the 'mw-htmlform-field-'
prefix normally only used by HTMLFormField subclasses, and matches the
'mw-htmlform-autoinfuse-lazy' class used in related code.

Bug: T278036
Change-Id: I4a73ec6d5993a7e4f10ef8523eef594a70c9abcc
2021-06-19 15:57:43 +02:00
Vlad.shapik
9763c48d17 Reapply "Hard Deprecate User ::getCanonicalName, ::isUsableName, ::isCreatableName""
This reverts commit ecf826a2ee.

Reason for revert: need to edit the patch and then it will be GTG in order to finish hard deprecating of User ::getCanonicalName, ::isUsableName, ::isCreatableName

Change-Id: I2f57f56728fcbeada96dc2228f07dc8bcaa5d4f6
2021-05-31 16:01:36 +03:00
Ppchelko
ecf826a2ee Revert "Hard Deprecate User ::getCanonicalName, ::isUsableName, ::isCreatableName"
This reverts commit b491279268.

Reason for revert: caused CentralAuth tests to fail.

Change-Id: Icb3ed094578df427622e0da2a7462645adcc3d6f
2021-05-05 02:14:47 +00:00
vladshapik
b491279268 Hard Deprecate User ::getCanonicalName, ::isUsableName, ::isCreatableName
Bug: T275030
Change-Id: I60689ee6519c2dbd6d000afa8ac05c3e6b7895d2
2021-05-04 21:20:50 +03:00
tsepothoabala
4646731af6 De-duplicate equivalent IP ranges in HTMLUsersMultiselectField
Bug: T278338
Change-Id: I6143aecec51777e46ab9a8e80fd794c6433abe7c
2021-03-26 11:08:28 +02:00
tsepothoabala
e29a8f150d Normalise IP addresses in HTMLUsersMultiselectField
Normalise IP addresses in HTMLUsersMultiselectField, to avoid adding multiple equivalent IP addresses

Bug: T275394
Change-Id: I3cbc26cb7c98ddc94bc3effc6bd2ab7108e970f8
2021-03-17 15:37:27 +02:00
Thalia
505433c502 HTMLUsersMultiselectField: Keep IP addresses while normalizing
Fixes a bug introduced in c12af6e168
where invalid usernames are normalized out.

Nonexistent usernames will still fail the validation step, including
IP addresses if the field has been set up not to accept them.

Bug: T274568
Change-Id: I229afdfff2144fd4db8d49825262010f58f1fe54
2021-02-22 14:00:06 +00:00
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