Commit graph

122 commits

Author SHA1 Message Date
Umherirrender
4c2d2ec407 Improve docs about @param/@return object[] $row to stdClass[]
Change-Id: I4f85d90548caa1403e822ecb2333ab44787346f2
2020-11-13 23:38:06 +01:00
Thiemo Kreuz
b0130ca649 Update a lot of unspecific "array" types in PHPDocs
This includes fixing some mistakes, as well as removing
redundant text that doesn't add new information, either because
it literally repeats what the code already says, or is actually
duplicated.

Change-Id: I3a8dd8ce57192deda8916cc444c87d7ab1a36515
2020-10-28 11:01:33 +01:00
Sam Wilson
070ffce218 Add days left messages to changes-lists' clock icons
Add a new resource module for watchlist expiry behaviour in
changes lists, to add a message when the clock is clicked on
mobile.

Bug: T261415
Change-Id: I621b1571b57686beb9fb5802533b1e70d293bc2a
2020-09-16 12:00:32 +08:00
hmonroy
0c2cc49bdc Update language in watchlist expiry
Update watchlist expiry language indicators (dropdowns, tooltips, watch
via star, watch via edit):
 * Change "Permanently" to "Permanent"
 * Change "XX days left" and "Expires in X days" to "XX days left in
   watchlist"
 * Update the "Click.." sentence by star to "Click to remove it."
 * Change watch period for a page that is less than "1 day left" to "A
   few hours left"

Bug: T253135
Bug: T255632
Change-Id: I114c6f77e86ad81b1810fedcd49f52c88700ca16
2020-08-14 11:47:03 -07:00
Sam Wilson
cde153d25c Add watchlist clock icon to RecentChanges
Extend the watchlist expiry clock icon from Special:Watchlist to
also be displayed on Special:RecentChanges for expiring watchlist
items.

Bug: T258310
Change-Id: I254570addd1835119c863639111bd5394cb4b697
2020-07-28 15:30:18 +08:00
Sam Wilson
1342c90537 Fix watchlist query and filters for RecentChanges
This query was correctly excluding expired items from RC, but it
was failing to include them when the unwatched filter was set.

This is a follow-up to https://gerrit.wikimedia.org/r/c/mediawiki/core/+/602211

Bug: T252136
Change-Id: I5d43d746df21cc3674eb2e92c3f604b7c87b7d1a
2020-07-28 08:38:25 +08:00
jenkins-bot
da6f6a2aa8 Merge "Add clock icon to expiring items in Special:Watchlist" 2020-06-24 17:34:50 +00:00
Umherirrender
17a5d5a84b Fix combination of (int) and ??
(int) has higher precedence as ?? and that means the array key is always
casted first and the error suppression part of ?? cannot work

https://www.php.net/manual/en/language.operators.precedence.php

Change-Id: Iee7dc9297c0745ce48295f637a7591ce9385aa4d
2020-06-19 17:28:22 +02:00
Sam Wilson
93396e965e Add clock icon to expiring items in Special:Watchlist
If a changeslist item has an expiry date, add a grey clock icon
after the page title, with a tooltip indicating when the item
expires.

Bug: T250212
Change-Id: I38f8c85321cf257eeea8de5a3bd73bbc0b5ea393
2020-06-19 05:48:21 +08:00
Reedy
d53e91d272 Fix more PSR12.Properties.ConstantVisibility.NotFound
Change-Id: I94520b10d78a17ea8e965633dd475ea711f25c99
2020-05-15 00:33:32 +01:00
Tim Starling
28ae2a60e9 Introduce ProtectedHookAccessorTrait and pilot the Hooks::run() migration
* ProtectedHookAccessorTrait provides protected getHookContainer() and
  getHookRunner() methods, getting them from the global service
  container. The point of this is to ease migration to DI by ensuring
  that call sites ask their local friendly base class rather than
  getting a HookRunner from the service container directly.
* Migrate ChangesList and subclasses from Hooks::run() to the new system,
  as a pilot for full migration.

Change-Id: Ic2d408fdb108087d81d0981aa670b35e0a6bb0ce
2020-05-13 13:50:32 +10:00
DannyS712
3d4fb45f96 ChangesList::insertRollback - Force rc_this_oldid to integer before use
Same for the other fields that needed to be integers

Follow up to 71b64e46e4

Bug: T251386
Change-Id: Idf4cc7d3cc54a98e46619c0996f8109bc1e88620
2020-04-29 10:56:51 +00:00
DannyS712
71b64e46e4 ChangesList::insertRollback - remove internal use of Revision objects
Bug: T246284
Change-Id: I0f506e73eee994c1dd8610803f8ce1c53164ca59
2020-04-27 22:10:25 +00:00
DannyS712
af7f397ccc Pass RevisionRecord to Linker methods
Hard deprecation of passing Revision objects will follow soon,
but until that is ready core calls can be updated

There is some code cleanup that could be done around the calls, but
to simplify review no other changes are made.

Bug: T249561
Change-Id: Ifcfb3811650decffeaa87dc033c41fd1710b47a6
2020-04-18 01:24:54 +00:00
DannyS712
9e561b4e65 Use RevisionRecord in ChangesList::revDateLink
The change to ChangesList::revDateLink is not backwards compatible,
because the method was marked as @internal

Due to a breaking change in HistoryPager::revLink, and the fact that
it didn't have a visibility defined, it has been made private

Bug: T246284
Change-Id: I2f1309fda1c312a6cf634de48ad0bbcfcb2d83ae
2020-04-04 00:49:28 +00:00
DannyS712
78bc3ae255 Hard deprecate Revision::userCan
Replace remaining uses outside of tests, hide deprecated in tests

Bug: T247259
Change-Id: I91dfb46ed6864ee89d968aea8ec93b5ea2f8389e
2020-03-11 02:10:52 +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
jdlrobson
5128caa3e5 Remove extraneous semicolons in unintended places and DOCUMENT!
The contributions and history page was showing some semicolons in unexpected places.
These unwanted semicolons are now supressed by reverting to a new standalone element
in exactly the same place as the previous semicolon. This avoids the issue of
ordering that we hit before.

I have documented the behaviour of the semicolon separator in contribpager pages
My seemingly harmless change in Ic4508788299a13c4c830f447141d17d99ebe002e

For future generations I have encapsulated what I've learned in extensive
comments which seem important given the information I have acquired while
working on this patch.

Bug: T233649
Change-Id: I9723ead1815685a9cbcccf2c4e2f3ffff36dcee3
2019-11-12 09:24:47 -08:00
jdlrobson
30c98e2351 Semicolon separator for article title and timestamp is a pseudo element
This helps us avoid a stray semicolon in mobile mode.

Bug: T233649
Change-Id: Ic4508788299a13c4c830f447141d17d99ebe002e
2019-11-04 13:49:21 -08:00
Volker E
203f7aba8c Mark consistently with any edit summaries
Marking with `.comment` to be consistent with `Linker:commentBlock`.

Change-Id: Idba91bd3d1345aa18da6745ad86f1bac2628dae7
2019-09-19 18:06:48 -07:00
jenkins-bot
60882bb6b0 Merge "Log entries can be rendered with parentheses in HTML" 2019-09-20 00:22:16 +00:00
jdlrobson
432cc11fae Log entries can be rendered with parentheses in HTML
Entries such as "User creation log" on Special:RecentChanges can
be wrapped or not wrapped in parentheses

Bug: T219348
Change-Id: Ic764081497dbe8d6d9e5bff6f8a1ceeac4b306e2
2019-09-19 03:58:51 +00:00
Umherirrender
f74400487f phan: Disable enable_class_alias_support
It is enabled for b/c in extensions, but not needed in core

Change-Id: I51dca12be9c77049f77563d9bf0edd07928c2300
2019-09-15 08:26:52 +00:00
Daimona Eaytoy
b5cbb5ab3f Upgrade phan config to 0.7.1
This allows us to remove many suppressions for phan false positives.

Bug: T231636
Depends-On: I82a279e1f7b0fdefd3bb712e46c7d0665429d065
Change-Id: I5c251e9584a1ae9fb1577afcafb5001e0dcd41c7
2019-09-04 08:20:53 +00:00
Petr Pchelko
f1914810a7 Remove usages of Title::quickUserCan
Change-Id: Ifa53e0ec800e23dc4184d133a100fb9378dfee9e
2019-08-29 11:48:30 -07:00
Stephane Bisson
04f0b682a5 RCFilters: add namespace filters for all contents and all discussions
These filters provide a shortcut to see or highlight all entries associated
with a subject or a talk namespace.

They are defined as real filters on the client-side and are superset
of all other namespace filters.

They are expanded to the list of namespaces they represent on the server-side.

Bug: T201520
Change-Id: Id9e04a38c2d7c8165c27af98959aa5715225faa8
2019-08-15 13:57:02 -04:00
jenkins-bot
c698fe313e Merge "Clean up spacing of doc comments" 2019-08-05 22:51:10 +00:00
Umherirrender
2664eeb632 Clean up spacing of doc comments
Align the doc stars and normalize start and end tokens

Change-Id: Ib0d92e128e7b882bb5b838bd00c74fc16ef14303
2019-08-05 22:29:50 +00:00
jdlrobson
2336c51488 Improve log entries display in change lists
Log entries are wrapped with parenthesis - not hardcoded into HTML
causing stray brackets in Minerva where this element is floated.
Has no impact on other skins

In addition to this the entire log entry item is wrapped in a new
span mw-changeslist-log-entry to ensure the text is recognised
as a whole entity - on Minerva floats were leading to the action
and the action object being separated (e.g. uploaded and "File:Name
were separated

Bug: T229360
Change-Id: Idae997b15f68bb0dfcaa857f7458ba3497233d41
2019-08-05 12:23:39 -07:00
Derick Alangi
40c88a6ac9 changes: Avoid use of deprecated method Revision::userCanBitfield()
Revision::userCanBitfield() is deprecated and RevisionRecord should
be used instead.

Change-Id: I0d6ad6863be520d3264809be69532dfb2e3dab9a
2019-08-03 22:43:24 +00:00
jenkins-bot
d1f681a77d Merge "ChangesList: Add $groups parameter to FetchChangesList hook" 2019-07-22 21:45:41 +00:00
jdlrobson
d7f8c45856 ChangesList: Add $groups parameter to FetchChangesList hook
This parameter is needed for consumers trying to return a $list object.

Bug: T228280
Change-Id: Ib68ff8fa782ac12479ef02247cdf78e405b64bad
2019-07-22 21:31:40 +00:00
jenkins-bot
0854352fa7 Merge "Do not hardcode square brackets in "rollback link"" 2019-07-21 19:41:24 +00:00
Derick Alangi
c5b7101a15 Avoid usage of deprecated Revision::* constants
Change-Id: Ibb55d5a01f997f9c79bcf2f5e09d4f02d22152d2
2019-07-21 17:26:48 +01:00
Derick Alangi
339211a1ea Avoid usage of deprecated Revision::* constants, use RevisionRecord
Change-Id: I872fc89e5c02dd6a3ae9cd7e76640b95dc33f514
2019-07-21 15:03:03 +01:00
jdlrobson
aaea6a0fc0 Do not hardcode square brackets in "rollback link"
Additional change:
* standardize on "optional" lowercase in qqq messages

Bug: T219948
Change-Id: I7d79c0ca534bff7165975943d5fa22dfe0a616db
2019-07-18 14:30:23 -07:00
Umherirrender
8a14f73a64 Document $rows on hook ChangesListInitRows as IResultWrapper
Change-Id: I243b460c4788a2bee095cb76b76106577f06b96f
2019-06-03 21:35:51 +02:00
jenkins-bot
6071231e90 Merge "Make some array type hints more specific" 2019-05-22 14:18:31 +00:00
Thiemo Kreuz
f0d5dceb2c Make some array type hints more specific
Change-Id: Ia9ed6fa851316baa47e73d9a5988a863d15f298c
2019-05-22 13:37:12 +02:00
James D. Forrester
871d947ca4 i18n: Rename 11 messages for case-compliance
Can't yet enforce due to the API.

* allmessagesnotsupportedDB
* rcfilters-filtergroup-userExpLevel
* rcfilters-filtergroup-lastRevision
* number_of_watching_users_RCview
* apihelp-query+allfileusages-example-B
* apihelp-query+allimages-example-B
* apihelp-query+alllinks-example-B
* apihelp-query+allpages-example-B
* apihelp-query+allredirects-example-B
* apihelp-query+alltransclusions-example-B
* apihelp-query+allusers-example-Y
* apiwarn-wgDebugAPI

Change-Id: I95961dfeb43e9cfadc867a48866af6335022572a
2019-05-18 16:39:49 +02:00
James D. Forrester
460bcf81e7 build: Upgrade mediawiki/mediawiki-phan-config from 0.5.0 to 0.6.0 and make pass
Fix five instances of PhanPluginDuplicateConditionalNullCoalescing;
escape the rest for now.

Bug: T219114
Change-Id: Ic4bb30c43c5315ce6b878b37b432c6e219414f8b
2019-05-13 14:57:07 +00:00
jdlrobson
5040b3f680 RecentChanges updated to use pseudo elements for presentation
Bug: T219348
Change-Id: I6eeeaa3b58d37adb7fefb4cc6915022229b3b324
2019-04-02 14:52:50 -07:00
jdlrobson
ea0a8e4e5c DRY up rev link generation in History and Contributions
ContribsPager and HistoryPager both duplicate efforts.
Instead move this code into a new static function inside
ChangesList that is shared between the two.

Bug: T216420
Change-Id: I0025d2e515d086b60670bd3f37307caac8d662a2
2019-03-28 16:23:58 -07:00
jdlrobson
0e1edec723 Apply the pseudo-css selector rules to diff and changelist pages
The styles that we are applying on changelist pages should also
apply on diff pages. This generalises the rules into a new
module.

To avoid problems with cached HTML mediawiki.special.changeslist
temporarily loads resources/src/mediawiki.interface.helpers.styles.
This will be removed after the change has been in production for a
week.

Bug: T212613
Change-Id: I6aad563e48f41c783df8b176a4f437e60a1255cc
2019-02-21 15:54:46 -08:00
Derick Alangi
d4ad0cd865 Remove deprecated method insertArticleLink() from class ChangeList
This method was deprecated in MediaWiki 1.27 and in MW 1.26, an alternative
method was introduced (getArticleLink). Per the code search tool here:
https://codesearch.wmflabs.org/search/?q=insertArticleLink%5C(&i=nope&files=&repos=,
only SimpleChanges and RecentActivityFeed extensions still use this method and
patches have been made to stop the use of these deprecated methods, see;
~ Ia80496c02ee5d0cb7bf9bdb1b336ea2699325d4c (RecentActivityFeed extension)
~ I5a9359f107da6a92b5f52e58879b540480ed2443 (SimpleChanges extension)

Once the above patches are merged, this patch can be reviewed and merged
as there will no longer be any usage of the deprecated method per code search
tool.

Change-Id: I166a7e5af7d8d3df60208583b6ce002bf65305a6
2019-02-19 12:29:57 +00:00
jdlrobson
c6a96b4bd5 Separate content parts of mw-usertoollinks from presentation
Use the existing class mw-changeslist-links to visually separate
the user tools in CSS rather than in the HTML.

Bug: T205581
Change-Id: I024c8298ca5da753d96ec392be05d4530bb3ffa9
2019-01-09 00:56:40 +00:00
Thiemo Kreuz
8fb3666148 Remove comments documenting constructors as "constructors"
Such comments are cruft and do not add anything that's not already
obvious from the code.

Change-Id: I42068b0c6c904bc4ee38f1700e0ea14c3d659a25
2019-01-08 10:11:36 +00:00
jdlrobson
103581ec75 ChangesList separates content elements from presentation
Special:RecentChanges and Special:Watchlist benefit from this change

Bug: T205581
Change-Id: If46d9ed904fdc6f01decbfde12ade0c47e282171
2018-12-18 19:50:41 +00:00
jdlrobson
8a39fef52f Wrap the "bytes changed" indication on Special:Contributions with CSS
Rather than use actual text, move the parentheses that serve as
presentation into the CSS.

Bug: T205581
Change-Id: I4ae645ca0edf0001a20c228f90f8d43a10cfff71
2018-11-16 00:30:44 +00:00
jenkins-bot
7cd7c534f7 Merge "ChangesList: HTML escape the timestamp" 2018-08-02 10:22:22 +00:00