Commit graph

181 commits

Author SHA1 Message Date
jenkins-bot 78817be019 Merge "Fix cap for pattern search" 2018-04-04 02:17:38 +00:00
Daimona Eaytoy e830f31ccc Fix param documentation
I made a little misunderstanding with I243605b26fe310488dc7419edf31f652ccda0094

Change-Id: I43888278483646eeb1e9da5d44471838c20fc18b
2018-04-03 17:34:03 +02:00
Max Semenik a4ed4db34e Fix field visibility warnings
Yes, this is a sniff bug - however, ideally every variable should
be on its own line with documentation anyway.

Change-Id: Ic8a96d9ea4dd20d8f689aac0a7dece01a4208929
2018-04-03 02:16:41 +00:00
Max Semenik 5c89246fce Rename files to match class name
Change-Id: Ia19bfec6c2289912699b6c90261afda311afb56e
2018-04-02 22:08:13 -04:00
jenkins-bot 9cf6a4b407 Merge "Add missing comparisons to builderValues" 2018-04-02 21:34:32 +00:00
jenkins-bot 3ffa6f6c81 Merge "Add requirement for title and pattern fields" 2018-04-02 18:06:26 +00:00
jenkins-bot 846e9d095c Merge "Record stats only when the action is executed" 2018-04-02 18:01:32 +00:00
Daimona Eaytoy 17e444918b Fix cap for pattern search
Currently, due to a tiny math error, the cap is variable (although
limited). This way it's really fixed and produces uniform results.

Bug: T191222
Change-Id: I8102db7894e5481a77e1a5771d9981258000731e
2018-04-02 19:49:59 +02:00
Daimona Eaytoy fc5aeeaaeb Convert Special:AbuseLog/# to OOUI
Hopefully this is really the last one: the tiny form at the bottom of
Special:AbuseLog/# to access private details.

Bug: T132284
Change-Id: I3f91beb482b3b85e12b65464914b0ac57ec983df
2018-04-02 18:58:43 +02:00
Daimona Eaytoy fbde96cac6 Add missing comparisons to builderValues
Currently, strict comparisons aren't listed. This way they don't appear
in the dropdown and users may not be aware of their existence.

Change-Id: I93185781de3b698096130c673156a67823375c6b
2018-04-02 17:12:32 +02:00
Daimona Eaytoy e53811ecb3 Add requirement for title and pattern fields
Currently users can save filters without title or pattern. This
shouldn't be allowed since it leads to lack of clarity. The check is
only performed server-side, since when implementing Ace editor we won't
be able to (easily) add a pure HTML requirement for the pattern field.

Bug: T173947
Change-Id: I1a0418b87cdb1ff423238fcdf1c743930500e605
2018-04-02 16:37:51 +02:00
Daimona Eaytoy 6255b04eca Record stats only when the action is executed
Otherwise it will return wrong stats and waste resources. This seems to
fix the problem, while a more long-term solution isn't that clear. I
hope that this won't introduce regressions, which as far as I could see
shouldn't happen.

Bug: T191032
Change-Id: I243605b26fe310488dc7419edf31f652ccda0094
2018-04-02 16:21:43 +02:00
Daimona Eaytoy 7450fb1d62 Switch /test and /examine/# to OOUI
Standardized Special:AbuseFilter/test and /examine/# to OOUI. They need
to be updated together, since they share the same load filter button
(now centralized) which needs to be handled in a different way.

Bug: T132284
Bug: T58367
Bug: T58368
Depends-On: If3d6a994142e34686bb7fc9f09093f751b599485
Change-Id: Ib935e8c9706e987468e52ec2ad1c7219b35fb9d5
2018-03-30 13:12:36 -04:00
Daimona Eaytoy 520ebea2cb Switch footer of editor to OOUI
Conversion of the builder dropdown, the syntax checker button and also
the button for switching editor coming from ace.

Bug: T132284
Depends-On: If3d6a994142e34686bb7fc9f09093f751b599485
Change-Id: Ic7f17437f4f0dcc0ea0edbab24eb976e2f76bdbd
2018-03-30 12:58:45 -04:00
jenkins-bot c67ab4a061 Merge "Revert "Revert "Switch editor to Ace and provide syntax highlight""" 2018-03-30 15:29:01 +00:00
Daimona Eaytoy 3350183fe3 Revert "Revert "Switch editor to Ace and provide syntax highlight""
Make Ace use a fixed size in em.

This reverts commit 272775ff81.

Change-Id: I9b439b20df91eb367bcef4b6f33ff087aded0b62
2018-03-30 11:10:16 -04:00
jenkins-bot ef65bf62c9 Merge "Convert /revert to use OOUI" 2018-03-30 14:02:12 +00:00
Daimona Eaytoy 90436c9e59 Convert /revert to use OOUI
This one was left out, probably because it's not well documented.
Together with the simple conversion, I also added a cap to time
selectors (otherwise users may create huge breaking queries) and wrapped
in a class=success P the success message, like we do when saving
filters.

Bug: T132284
Change-Id: I2ba0a54e27608949cd28b9ac0447d1f2157b0ea2
2018-03-30 09:12:59 +02:00
jenkins-bot 899fd5783b Merge "Revert "Switch editor to Ace and provide syntax highlight"" 2018-03-30 02:14:15 +00:00
Huji 272775ff81 Revert "Switch editor to Ace and provide syntax highlight"
This reverts commit 89e6778793.

Change-Id: I41aee10fdd5633d56692334696fb750f41b15433
2018-03-30 02:07:00 +00:00
jenkins-bot f903aa92d4 Merge "Switch editor to Ace and provide syntax highlight" 2018-03-30 02:02:00 +00:00
jenkins-bot da3342e398 Merge "Add search for filter patterns" 2018-03-30 01:32:03 +00:00
jenkins-bot 17e56ff23a Merge "Convert Special:AbuseFilter to OOUI" 2018-03-30 01:16:16 +00:00
jenkins-bot baa0cd082a Merge "Always show abuse filter public comments as plain text" 2018-03-29 16:13:27 +00:00
jenkins-bot e268f6b3e1 Merge "Avoid calls to deprecated wfSetupSession, $_SESSION, and session_id" 2018-03-27 02:36:26 +00:00
Daimona Eaytoy 1de8740df7 Use integers when calculating edit_delta
Since it'll always be a subtraction of integer numbers. Otherwise, if
calculated as float, values won't triple-compare.

Bug: T190652
Change-Id: Ia58a4e3429a012a94a43ffadb190154fcdb9bcaa
2018-03-26 13:15:13 +02:00
Daimona Eaytoy 89e6778793 Switch editor to Ace and provide syntax highlight
Replace the conditions textarea with Ace editor for editing and testing
filter. This uses a soft dependency on CodeEditor; if the latter isn't
installed, the classic textarea is used. The user is still able to
switch between the editors on the go; the new buttons may look a bit
ugly now, but after switching to OOUI they should get much better.
Finally, added a custom syntax highlight for AbuseFilter rules.

Bug: T39192
Change-Id: If3d6a994142e34686bb7fc9f09093f751b599485
2018-03-23 12:39:22 +01:00
Daimona Eaytoy 3bc4bfc4d5 Add search for filter patterns
Adds an option for searching filters with a
specific pattern in the main page, together with already existing options.
Plain search and regex are available, only for users with the
view-private right. The search is performed directly on the database.
If the user actually searched for something, it is also added a column to
Special:AbuseFilter showing a snippet of the pattern from each filter, with the query match highlighted.

Depends on: I8144062b1f273d0d8932203ffcb7a71aca60bba9

Bug: T87455
Change-Id: Ibcd84ff84edca481328210ee857b0ab723028632
2018-03-17 14:54:48 +00:00
jenkins-bot 6d32b24d16 Merge "Update for the actor table change" 2018-03-17 09:36:59 +00:00
Matěj Suchánek e5db4b47f9 Use LIKE to filter AbuseLog by action taken
Bug: T187971
Change-Id: Id2a9feb395077c5391a4145284d667101dedfa7b
2018-03-16 15:03:38 +00:00
Matěj Suchánek 729ff73c10 Convert Special:AbuseFilter to OOUI
Bug: T132284
Change-Id: I8144062b1f273d0d8932203ffcb7a71aca60bba9
2018-03-16 14:57:52 +01:00
Daimona Eaytoy 981338ae45 Avoid double processing block actions
Otherwise it'll be logged twice, with some related malfunctioning.

Bug: T189857
Change-Id: Ie640793661d824a99fa726843245f99a2ff64f20
2018-03-16 10:01:33 +01:00
Melos 799a2fb1ed Always show abuse filter public comments as plain text
Public comments are parsed in some places and they are
shown as plain text in others. Always show them as
plain text instead of parse them.

Bug: T173249
Bug: T141670
Change-Id: I173ffab1a99c1536cca260b76be0d95a4966b139
2018-03-15 20:14:00 -04:00
Reedy 844af9b1ff Add missing global statements
Bug: T189827
Change-Id: Ib806ca14b84f8f8d2124580f80901e4ad10a67ba
2018-03-15 22:44:45 +00:00
Daimona Eaytoy 3b63127624 Fix messages displayed in history
With https://gerrit.wikimedia.org/r/#/c/412892/ I introduced an error
with action display in history: every action except for block would have
been displayed without parameters.

Change-Id: I273cd908b698c49056c176de9ead5a78d818c7be
2018-03-14 17:50:58 +01:00
Reedy 16d599c1b8 Merge "Add missing use in hooks" 2018-03-12 15:27:02 +00:00
WMDE-Fisch 9af25447a0 Add missing use in hooks
Change-Id: I8e6fa3211868b984248d9414bdbc6970392b2189
2018-03-12 15:00:58 +01:00
Matěj Suchánek 3a0f6a48ba Use OOUI datetime selectors on Special:AbuseFilter/examine
Bug: T58367
Bug: T58368
Change-Id: Ic7882e86c1cadd2501eca9a63623f0db3a0c614a
2018-03-10 10:39:43 +00:00
Daimona Eaytoy e0d7f6a388 Fix issue with custom blocks patch
I had unwillingly substed a variable with a string in the wrong case. It
needs to be fixed before .25 is deployed, otherwise in history there
might be actions != block which'll be displayed as 'block'.

Change-Id: I6d251fa011238509a8fdf264e865573140e7a20d
2018-03-10 10:02:11 +01:00
jenkins-bot 2fe3b18dea Merge "Convert Special:AbuseFilter/history and /examine to use OOUI" 2018-03-10 01:11:57 +00:00
Brad Jorsch 3014871cb5 Update for the actor table change
Core change I8d825eb0 begins the process of changing core database
tables from using xx_user and xx_user_text fields to using xx_actor.
This updates the extension to continue to function during and after the
transition.

Bug: T167246
Change-Id: I4065716022aa60c0fa1a258659db22be2b7f43de
2018-03-09 16:34:24 -05:00
Brad Jorsch 7399cd4348 Update CommentStore usage
CommentStore's calling conventions changed in I3abb62a5c.

Change-Id: I80012f82b39e5054ee40a44b5a8e92dec46c2962
2018-03-09 16:22:32 -05:00
jenkins-bot c02133ac08 Merge "Fix supposedly nullable argument" 2018-03-09 15:55:26 +00:00
Matěj Suchánek 5ae26bb5c6 Fix supposedly nullable argument
Change-Id: I81c467ce3483096c98041412a664b3a26735118a
2018-03-09 16:16:12 +01:00
jenkins-bot f86ef894b6 Merge "Fix typo in wgAbuseFilterActions" 2018-03-09 14:41:47 +00:00
Matěj Suchánek ff281fa2e3 Fix typo in wgAbuseFilterActions
Bug: T189299
Change-Id: Ie87d6f31e00408a2226547ee810cfbab27a439ed
2018-03-09 15:20:53 +01:00
jenkins-bot cd7e6541ac Merge "Fix Special:AbuseLog::getUserLinks call" 2018-03-09 14:19:25 +00:00
Matěj Suchánek 38f56d1dd2 Convert Special:AbuseFilter/history and /examine to use OOUI
Bug: T132284
Change-Id: Ib61e0ce8f3f8481cdaf9ee7f521f73f314fcded2
2018-03-09 11:35:47 +00:00
Matěj Suchánek 4637d19f69 Fix Special:AbuseLog::getUserLinks call
IP addresses have no user id, reusing af_user for them was a complete nonsense.

Change-Id: Iaebf5e57c445452896dce6b3edf0018ebbb6e3dc
2018-03-09 09:26:58 +01:00
jenkins-bot e24c025670 Merge "Allow customizing block durations for each filter" 2018-03-09 03:27:15 +00:00