Commit graph

1132 commits

Author SHA1 Message Date
jenkins-bot d8da88055a Merge "Remove WMF-specific "discussiontools-autotopicsub" settings" 2024-06-16 09:32:41 +00:00
jenkins-bot 7c9450489d Merge "Use ConditionalUserOptions for "echo-subscriptions-email-dt-subscription"" 2024-06-16 09:32:34 +00:00
Bartosz Dziewoński 0f601b690a Remove WMF-specific "discussiontools-autotopicsub" settings
WMF config change should be deployed first: Ica7dba4f17eb3e57a1a2415cc970c54a67eac696

The default value for this preference was already '1', and this code
was a no-op unless it was overridden to '0' like it was in WMF config.

Bug: T357221
Change-Id: I6b09bbea9bfb7a8f8ed17114dc59e657c5b66e91
2024-06-15 13:05:07 +00:00
Bartosz Dziewoński 488e35d82e Use ConditionalUserOptions for "echo-subscriptions-email-dt-subscription"
WMF config change should be deployed first: Iaff2d5ffee78d6200e1fa971c5c62137a400005d

Bug: T357221
Change-Id: I2744d52c5ff8c89166c19ab0ff2b4a27bfbf7cd7
2024-06-15 13:04:58 +00:00
jenkins-bot a3adda8ed7 Merge "Remove jquery.makeCollapsible workarounds for mobile" 2024-06-10 19:29:49 +00:00
Umherirrender 3dc5e88842 Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: I492ddae3c3e9f81d551ea8b348b7148893f4f590
2024-06-09 00:02:35 +02:00
Bartosz Dziewoński 2c9264e412 Remove jquery.makeCollapsible workarounds for mobile
The module is now loaded normally by the Minerva skin (T111565).

Bug: T323639
Change-Id: I9121410c20fffd651c81c26b84b861ec9300881f
2024-06-04 00:56:58 +02:00
Umherirrender 8145e7ae74 Add caller when running query builder
Change-Id: Icc9f640ff8a67d582448e4f05a4456a54218b72d
2024-05-31 00:25:03 +02:00
Ed Sanders 6237d6068b Follow-up I80377881: Add missing Echo namespace
Change-Id: I3f94d8d91d78eba1eb16ac34b027cd2e9d66649d
2024-05-28 18:28:38 +01:00
Ed Sanders a86897f890 Comment thanking
Bug: T249893
Change-Id: I64f7abc26bfc3e7b226340934a637a555edf754f
2024-05-28 17:47:09 +02:00
Ed Sanders d1bffdee70 Use namespaced notification classes from Echo
Change-Id: I80377881e6aabf3014394c024fca6af50166aa1a
2024-05-28 15:48:56 +01:00
Ed Sanders ea5639b20b ESLint: Enforce prefer-const
Change-Id: I5985d1b532988bb3b71ff1aa24eae57ac2e1b9c5
2024-05-24 16:50:13 +01:00
Amir Sarabadani 320da37512 Fix static cache access
Currently, DT is making more than 30 exact queries back to back in every
request. It is clear the caching is completely broken.

It is because when the properties don't exist (majority of the cases),
it returns an empty array making the caching noop.

Tested in mwdebug1002 and it fixes the issue.

Bug: T364693
Change-Id: I182ae121999df1a04cfb7399bc49891587a37074
2024-05-12 18:23:41 +02:00
wfan 2b41719f96 Migrate MediaWiki.discussiontools.addReplyLinks to statslib
Bug: T359463
Change-Id: I93f7872818a27e5a5aac6ed4c44302bdc78b0613
2024-05-05 13:59:04 +00:00
jenkins-bot dcb8d7175b Merge "ApiDiscussionToolsCompare: Show nice error for deleted revisions" 2024-04-30 20:03:06 +00:00
jenkins-bot af74638d08 Merge "ApiDiscussionToolsCompare: Deduplicate 'from'/'to' param handling" 2024-04-30 20:02:59 +00:00
jenkins-bot 8b9a813b11 Merge "Clean up handling of <span class="mw-headline">" 2024-04-30 16:48:56 +00:00
jenkins-bot 9f7de3e917 Merge "Remove the "offset" from getHeadlineNodeAndOffset()" 2024-04-30 16:48:54 +00:00
Bartosz Dziewoński b8a28d6cfc ApiDiscussionToolsCompare: Show nice error for deleted revisions
Bug: T362814
Change-Id: Iecc3e3737fcc82a79e699fe0bc00f373ecabf0c2
2024-04-26 03:54:31 +02:00
Bartosz Dziewoński f3e96a72fa ApiDiscussionToolsCompare: Deduplicate 'from'/'to' param handling
Change-Id: I0351228f50e9ea5a599d11b37f684b8e66553a83
2024-04-26 03:54:05 +02:00
Bartosz Dziewoński 67bad433dc Fix signature check not to look at the content of previous section
It needs to only look at the end of the added comments, and ignore
whatever is going on at the beginning, since the only thing it really
cares about is a functioning "Reply" button at the end.

Bug: T363285
Change-Id: Ia337be754deda741617d1343972f3e0a21c41b05
2024-04-25 23:15:18 +02:00
Bartosz Dziewoński 3cffe1190e Clean up handling of <span class="mw-headline">
The PHP code should never see a `<span class="mw-headline">` node
since MediaWiki change If04d72f427ec3c3730e757cbb3ade8840c09f7d3,
but we have to support it for our old integration tests (T363031).

Improve code comments to explain this and move the handling to
one place, so that it can be deleted more easily in the future.

Follow-up to 08f61b2609.

Change-Id: I5ab9d3373a6911c1456c30d844b66576b278a1b5
2024-04-20 00:16:45 +00:00
Bartosz Dziewoński 7445294b3b Remove the "offset" from getHeadlineNodeAndOffset()
Since c6cd20f682 the offset is always 0.

Change-Id: I9c1c8230f897d8bb287ca47056f5fa9fb187d060
2024-04-20 00:34:32 +02:00
jenkins-bot 56b21c9032 Merge "Remove workaround for T357812" 2024-04-17 15:22:35 +00:00
jenkins-bot 03a3c4b42c Merge "Remove DTSUBSCRIBELINK cached HTML compat" 2024-04-17 15:22:33 +00:00
Bartosz Dziewoński cf792094bb TopicSubscriptionsPager: Fix exception when no subscriptions
Bug: T362507
Change-Id: I569fb2ae017edc9d8e49910faff85e8c9301077d
2024-04-15 21:03:55 +02:00
Bartosz Dziewoński 52ae0f3152 Special:TopicSubscriptions: Use permalinks when available
When permalink data is available, display a permalink using
the current page title, instead of a plain link to the section
at the time of subscription.

Consolidate and clean up some existing permalink code.

Bug: T306373
Change-Id: Ie2f63cbfdbfa703530205201dfcfb0e5ad053b35
2024-04-04 13:44:06 +00:00
Dringsim afff10a932
Replace deprecated ChangeTags method calls with ChangeTagsStore
Bug: T360664
Change-Id: I14b676e74b277dfea62109fcca6881fea3763997
2024-04-01 09:00:39 +08:00
jenkins-bot f3df3dfa0a Merge "Setup grunt-tyops and fix" 2024-03-28 13:35:23 +00:00
Ed Sanders a70f411ee1 Setup grunt-tyops and fix
Change-Id: I372c3cc5bedaf800716bff68cadb2846a399a42a
2024-03-27 14:01:18 +00:00
Bartosz Dziewoński c44313a867 Fix autosubscribe on new pages with $wgDiscussionToolsAutoTopicSubEditor = 'discussiontoolsapi'
Broken by the introduction of 'nocontent' parameter in
6bf6105d2a.

Bug: T359751
Change-Id: I60d9a6f51e897ecdc68525151990212ecc171548
2024-03-27 00:51:14 +01:00
Bartosz Dziewoński e2309342ce Remove DTSUBSCRIBELINK cached HTML compat
Follow-up to Ie3348671c486de5bbd9f286772a8d145e3609bd5.

Change-Id: Ia4cd4f5d26e95b3557cae6f80f49fa5da138890f
2024-03-26 23:39:53 +01:00
Bartosz Dziewoński dacef1a97a Clean up subscribe links/buttons
* Don't generate `<!--__DTSUBSCRIBELINK__...-->` placeholder comments
  (follow-up to Idb23b0f5e438d35ed74569ff50302c7fad5ba688)
* Remove unused method parameter
* Remove unnecessary pass-by-reference (only $tocInfo needs it)

Change-Id: Ie3348671c486de5bbd9f286772a8d145e3609bd5
2024-03-25 01:13:59 +01:00
jenkins-bot f22dabfb80 Merge "Move some doc comments to real type hints" 2024-03-23 01:36:33 +00:00
Umherirrender 6c005d293f Add explicit parentheses around mixed boolean operator
Mixing different binary boolean operators within an expression
without using parentheses to clarify precedence is not allowed (T358966)

Change-Id: I9e9c9531ab0fa373606b19a5865cec748a3f36ff
2024-03-23 00:52:30 +01:00
Bartosz Dziewoński cc9524e268 Remove workaround for T357812
Change-Id: I1aa3172c5656a79171351d0122f83b680adea739
2024-03-16 19:57:19 +00:00
jenkins-bot bd09ad6801 Merge "Move [subscribe] links outside of <h2> tags" 2024-03-11 17:07:14 +00:00
Bartosz Dziewoński d2d2d914ce Move some doc comments to real type hints
Change-Id: I64e3f7123c803ae2576c8b05824698d78a691018
2024-03-11 14:13:17 +01:00
Bartosz Dziewoński 69e8e948b2 Remove now redundant PHPDoc blocks
MediaWiki's PHPCS plugin requires documentation comments on all
methods, unless those methods are fully typed (all parameters and
return value).

It turns out that almost all of our methods are fully typed already.

Procedure:

1. Find: \*(\s*\*\s*(@param \??[\w\\]+(\|null)? &?\$\w+|@return \??[\w\\]+(\|null)?)\n)+\s*\*/
   Replace with: */
   This deletes type annotations, except those not representable
   as PHP type hints such as union types `a|b` or typed arrays `a[]`,
   or those with documentation beyond type hints, or those on
   functions with any other annotations.

2. Find: /\*\*/\n\s*
   Replace with nothing
   This deletes the remaining comments on methods that had no prose
   documentation.

3. Undo all changes that PHPCS complains about (those comments
   were not redundant)

4. Review the diff carefully, these regexps are imprecise :)

Change-Id: Ic82e8b23f2996f44951208dbd9cfb4c8e0738dac
2024-03-10 23:53:04 +00:00
Bartosz Dziewoński b16dd9dd96 Update PHPCS overrides
There's now a different rule for the same thing in
mediawiki/mediawiki-codesniffer v43.0.0. Also document the reason for
the override. Follow-up to 8b00546749.

Change-Id: I392ee10639ffda6de55b091555e8c3cadd2af485
2024-03-10 22:59:05 +01:00
Umherirrender 8b00546749 build: Upgrade mediawiki/mediawiki-codesniffer to v43.0.0
Change-Id: I889efe00ac06fa857fc3ae063193368927bcff7a
2024-03-10 17:36:18 +01:00
Bartosz Dziewoński 9c9512ecf5 Move [subscribe] links outside of <h2> tags
Place the "[subscribe]" links used when the 'VISUALENHANCEMENTS'
feature is disabled in the same DOM position as the "🔔 Subscribe"
buttons used when it is enabled.

Recent changes in MediaWiki core caused them to move inside the
`<span class="mw-headline">`, breaking some gadgets (T13555#9615648).
Moving them all the way outside should avoid problems.

I don't remember why we placed them inside the `<h2>` tags, but there
doesn't seem to be any reason to do it now. It must have been easier
that way before we introduced the `<div class="mw-heading">` wrappers.

Note that I'm keeping the `<!--__DTSUBSCRIBELINK__...-->` placeholder
comments in case it turns out there is a reason, and we need to revert
this change. If everything goes well, they can be cleaned up in change
Ie3348671c486de5bbd9f286772a8d145e3609bd5 later.

Bug: T13555
Change-Id: Idb23b0f5e438d35ed74569ff50302c7fad5ba688
2024-03-08 21:18:53 +01:00
Bartosz Dziewoński 4958416caf Only include one set of DiscussionTools buttons in the page HTML
We no longer need to support toggling visual enhancements without
reloading the page, so we can remove the extraneous set of buttons
to reduce HTML size.

Bug: T322457
Change-Id: I54e57c754c54b7e611069f9832d1ebabf141a396
2024-03-01 16:51:17 +00:00
jenkins-bot eeeb6e7eab Merge "Fix PHP getTitleFromUrl() when $wgArticlePath is '/$1'" 2024-02-29 17:53:16 +00:00
jenkins-bot c3ca1ef3c8 Merge "Remove TemporaryParsoidHandlerParserCacheWriteRatio hack" 2024-02-28 17:20:38 +00:00
Bartosz Dziewoński 6419c19d1e Fix PHP getTitleFromUrl() when $wgArticlePath is '/$1'
In this case, the generated regexp would match the '/local' part in
the generated URL. Prefixing 'https://local' is no longer necessary
since 10899af666.

Add tests for this, and some tests to cover T261711 as well.

Bug: T358321
Change-Id: Idf54deba13f30b799b7b8d17de1897bc90f95701
2024-02-24 02:03:17 +01:00
jenkins-bot 402f5de391 Merge "Support for core section heading formatting in post-cache transform" 2024-02-23 05:01:19 +00:00
Ed Sanders bf7dc0d983 ThreadItemStore: Only pass *Content*ThreadItemSet to insertThreadItems
We never a DatabaseThreadItem back into the database. If someone
wants to do this in the future they should be thinking very
hard about it first.

Change-Id: Ie073c030905e31d81cb75bc9c46d5bb7c5d85b04
2024-02-21 16:10:25 +00:00
Ed Sanders b4e4f30234 ThreadItemStore: Remove "ButTryHarder" from method name
This appears to reference the retry that happens due to
REPEATABLE_READ, but that seems like an implementation
detail so not really useful to have in in the function
name, nor does it disambiguate it from another function.

Change-Id: Iacc95b74f25c166545734818efb1b30e18a1754e
2024-02-21 15:56:32 +00:00
Ed Sanders 5ba0bfa026 Remove temporary newsectionlink_enable config
This was intended as a temporary config to facilitate a
staged rollout (T331635) which has now completed.

Change-Id: I432ec0a24b8e8c12b62556ff6703abff32a2fced
2024-02-19 17:34:23 +00:00