Commit graph

1722 commits

Author SHA1 Message Date
jenkins-bot 2086851d44 Merge "Load styles in ParserOutput too" 2021-08-23 20:50:20 +00:00
Bartosz Dziewoński 6dd90eda4a Improve discussiontoolssubscribe API documentation
Bug: T280314
Change-Id: I0987faac2cd8c5276a37869212fa968f0d642c09
2021-08-23 18:40:00 +00:00
Bartosz Dziewoński bb5054435f ApiDiscussionToolsSubscribe: Remove redundant checks
$user is guaranteed to be a User object.

Also, while we're here:
* Remove an unnecessary TODO. There's no need for a more specific
  error message, this one is just fine, other extensions use it too.
* Replace isAnon() with !isRegistered(). It'll probably be deprecated
  soon, because the new UserIdentity interface doesn't include it.

Change-Id: Ifbe98f4eccef79deee6bdb54c1bccf49807a9563
2021-08-23 20:39:18 +02:00
Bartosz Dziewoński 781576fd7c Fix broken link in empty state on article talk pages
`[[:{{ARTICLESPACE}}:{{PAGENAME}}]]` results in `[[::Foo]]`, which
is not a valid link.

Luckily, there's a magic word `{{SUBJECTPAGENAME}}`, which is the same
as `{{ARTICLESPACE}}:{{PAGENAME}}`, but without pesky leading colons.

Follow-up to bb0b65dc0c.

Change-Id: I992bdb8807c665561cad58997017aab5a6c1d8e8
2021-08-23 17:36:13 +00:00
Translation updater bot 9018cc9997 Localisation updates from https://translatewiki.net.
Change-Id: Iaa5643ff5e3e46abf6aa821acea285ce26c6f037
2021-08-23 09:03:52 +02:00
Raymond bb0b65dc0c Add colon to avoid loading the file on file talk pages
example: https://commons.wikimedia.org/w/index.php?title=File_talk:Vorstellung_Projekt_MuLI,_KVB-Haltestelle_Bocklem%C3%BCnd-3380.jpg&action=edit&redlink=1
Change-Id: I9067390a7861cfb328fedfe6f5e56384ac141aeb
2021-08-20 22:49:03 +02:00
David Lynch 503d2f1f76 Enforce no text-indent on our reply button
Change-Id: Ie26d7632ec4845cc9048c0261b51ff2a1b6b51e2
2021-08-20 13:46:23 -05:00
Bartosz Dziewoński 3e19fce67a Load styles in ParserOutput too
We load them in OutputPage, because we need that to handle the
query parameter 'dtenable=1', but do it here as well just in case
the pages are somehow shown without involving OutputPage.

Per code review:
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/DiscussionTools/+/713681/1/includes/Hooks/ParserHooks.php#90

Change-Id: I3f287a9e146de7fd4d37c47dfa47eeb03eeb8cf1
2021-08-20 18:49:04 +02:00
Translation updater bot 39e9016b87 Localisation updates from https://translatewiki.net.
Change-Id: Iae1baaa0acea6b44067eb5c1d5ff15724d27e8fa
2021-08-20 08:24:00 +02:00
jenkins-bot ccd2769b17 Merge "Remove remnants of the cookie hack for loading unavailable tools" 2021-08-19 16:32:10 +00:00
jenkins-bot d77353d93e Merge "Remove unnecessary contentType: 'multipart/form-data' from an API query" 2021-08-19 16:32:08 +00:00
jenkins-bot 52ff6ef77e Merge "HookUtils: Simplify check for your own talk page" 2021-08-19 16:32:07 +00:00
jenkins-bot e2ef5764da Merge "Minor cleanups in topic subscription code" 2021-08-19 16:32:04 +00:00
jenkins-bot b7978be7ed Merge "Remove repetition in "Discussion pages" preferences" 2021-08-19 14:46:57 +00:00
Translation updater bot 92ae198a81 Localisation updates from https://translatewiki.net.
Change-Id: I8ba37de1e240352a1e5bcbcdc8797502abedec75
2021-08-19 08:13:22 +02:00
Bartosz Dziewoński c8fa10770a Remove remnants of the cookie hack for loading unavailable tools
Follow-up to ee524d6bd6.

Change-Id: I1b4dc587e6b629b05ca0581dcd384a2bc7f01d2a
2021-08-18 20:45:02 +02:00
Bartosz Dziewoński 75d63bb056 Remove repetition in "Discussion pages" preferences
Bug: T289187
Change-Id: Id6c90546e4b57754e13b55f7c61610b51de87966
2021-08-18 20:20:34 +02:00
Translation updater bot 232dc64246 Localisation updates from https://translatewiki.net.
Change-Id: Iedd5754ddb1619b34fc7cb66aa1d78a3d4ee04b5
2021-08-18 08:13:26 +02:00
Bartosz Dziewoński 4aca61990a HookUtils: Simplify check for your own talk page
This approach is used in our new topic tool empty state code and is
much nicer. Also fix typo in a comment nearby.

Change-Id: I80755ef0960a172b0f370c36c1979a86498d6fa9
2021-08-17 22:22:15 +02:00
Bartosz Dziewoński bcd92a5d33 Minor cleanups in topic subscription code
For automatic topic subscriptions, I plan to introduce a third
subscription state to indicate them. This patch includes minor tweaks
I wanted to add while working on that:

* Introduce constants instead of numbers
* Remove a TODO that doesn't seem like a good idea any more
* Remove a `"length": 1` on sub_state that did not do anything
  (but it might have been meant to indicate that it was supposed
  to be a boolean, which would be wrong)

Bug: T284836
Change-Id: I6e6096968ad38510102287bccd349090b6ca4280
2021-08-17 22:22:15 +02:00
jenkins-bot 359b80ed70 Merge "When opening new topic tool using any link, always activate the link in page tabs too" 2021-08-17 15:51:29 +00:00
Translation updater bot 7bcb5f195e Localisation updates from https://translatewiki.net.
Change-Id: Ie1e58b3aa4711b2d5039871beccac100e6183069
2021-08-17 08:19:16 +02:00
jenkins-bot 781992de2d Merge "Create a hidden revision tag for talk page comments" 2021-08-17 02:07:10 +00:00
jenkins-bot e090c455cc Merge "EventDispatcher: Fix ignoring level 3+ headings" 2021-08-16 22:08:42 +00:00
jenkins-bot 2cd97c4be5 Merge "Handle highlighting and scrolling to comments for bundled notifications" 2021-08-16 20:43:37 +00:00
Bartosz Dziewoński db28a3d3a7 Handle highlighting and scrolling to comments for bundled notifications
Notifications are bundled by section, so instead of linking to the
comment, link to the section.

Additionally, add a parameter to the URL listing all the comment IDs
from the bundle, and highlight them all and scroll to the topmost one.

Having to handle both URL fragments and URL query parameters makes
this code kind of a mess :(

Also, some unexpected changes became necessary:

* EventDispatcher.php: Store the section title in events using
  HeadingItem::getLinkableTitle() instead of ThreadItem::getText().
  The result is mostly the same, except in case of wacky markup like
  images or extension tags. We can more reliably use it to link to the
  section on the page, and we already use getLinkableTitle() when
  generating edit summaries in the reply tool for this reason.

* dt.init.less: Change the mix-blend-mode for the highlights from
  'multiply' to 'darken', so that multiple overlapping highlights do
  not look more opaque. This affects how the highlights look on
  non-white backgrounds and images (they're less blue, and on darker
  backgrounds entirely invisible), but it seems worth it.

Bug: T286620
Change-Id: I21bb5c003abc2747f0350d3f3af558dfb55693e9
2021-08-16 22:03:30 +02:00
Bartosz Dziewoński 76b2f5bcbc Clarify the references to talk pages in notification preferences
Bug: T286954
Change-Id: I3ba3b76a74f2673f790745f385963b868ca711f6
2021-08-16 21:58:53 +02:00
Bartosz Dziewoński a129899971 Remove unnecessary contentType: 'multipart/form-data' from an API query
This was copied from somewhere else (probably VisualEditor), but it is
not needed here.

Using the multipart/form-data encoding is beneficial when sending long
binary data (such as the compressed HTML VisualEditor sends), and is
also required when uploading files, but it is not helpful when sending
a short query like we do here.

Also rename a variable.

Change-Id: I9bcce2ce1ca7c218e4cd147960d1070dd23ea9fa
2021-08-16 21:33:59 +02:00
Bartosz Dziewoński ad04b24ffd Create a hidden revision tag for talk page comments
Bug: T262107
Depends-On: I21159d03eebaf46ad94f4273ba698a59b8019185
Change-Id: Iceddfaf6a4bcc5e8b5c85c8cd5638bf14aa7db03
2021-08-16 15:42:51 +00:00
Bartosz Dziewoński 47510a22f3 EventDispatcher: Fix ignoring level 3+ headings
The code (prior to d25825a754) assumed
that level 3+ headings would always follow a level 2 heading or the
placeholder heading, but we don't generate a placeholder heading if
there are no comments in section zero.

Add more tests to confirm that comments under level 3+ headings (that
are not sub-headings of level 2), and level 1 headings, are ignored
when generating notifications, and do not mess with normal headings.

Bug: T288775
Change-Id: Ic57b56752a4797cb01234f66e0ed7b849752bd70
2021-08-16 15:42:06 +00:00
Translation updater bot 4c103576e8 Localisation updates from https://translatewiki.net.
Change-Id: If470919a929b62537e563a33a3c88f70f429766f
2021-08-16 08:16:13 +02:00
Translation updater bot 98da78306a Localisation updates from https://translatewiki.net.
Change-Id: I2ecddb22f0abb9deb46e2d46c043894743a99d0f
2021-08-13 08:18:37 +02:00
Bartosz Dziewoński d25825a754 EventDispatcher: Remove failing invariant check
To be investigated in the future.

Bug: T288775
Change-Id: Ic27418a0ec976347be5fa586bbd32cc4a0d8d511
2021-08-12 22:37:51 +02:00
Translation updater bot 98f79545d6 Localisation updates from https://translatewiki.net.
Change-Id: I2d7c1927d1d917302951b26410f69665b5845e84
2021-08-12 08:09:30 +02:00
David Lynch 642fede864 Apply design tweaks to empty states
Bug: T274831
Bug: T274832
Bug: T277329
Change-Id: I0dcdb3479ba668b78cf247856a8ec00d5ea37ab4
2021-08-11 14:33:43 -05:00
libraryupgrader 912e9d874a build: Updating path-parse to 1.0.7
* https://npmjs.com/advisories/1773 (CVE-2021-23343)

Change-Id: Ia4f226e1704eaed9d482546e5e4826c43f5b939f
2021-08-11 17:38:12 +00:00
Translation updater bot f436692239 Localisation updates from https://translatewiki.net.
Change-Id: I9a5ea45cbe009337cd4725ac62ec5ac4b12e16fc
2021-08-11 08:19:13 +02:00
vladshapik 613b0a9b27 Avoid using deprecated ParserOptions::getUser
Bug: T287858
Change-Id: I13ef6ef128a8316f699c6e038adf82d18bf81b96
2021-08-10 16:43:11 +03:00
Translation updater bot 5cf1cee1e4 Localisation updates from https://translatewiki.net.
Change-Id: I6da7968f52ff25ff9d23f7c22f29d6190c3f2a49
2021-08-10 08:06:31 +02:00
DannyS712 88ba997bed Injected SubscriptionStore into UnsubscribeAction
Dependency injection is now available to actions,
extension already requires MW 1.37+

Bug: T253078
Change-Id: I473abac19ed5e6f3c6706797e91704ff635f64c6
2021-08-09 22:38:52 +00:00
Bartosz Dziewoński b46893eb7d Remove pointless uses of preserveWhiteSpace property
This DOMDocument property has no effect, because we do not use
DOMDocument methods for parsing HTML, but rather DOMUtils::parseHTML()
provided by Parsoid.

Change-Id: I1d9e73e53f2d44f41cf9dcda4f06ac8647671096
2021-08-09 23:45:48 +02:00
Translation updater bot a9abb268bb Localisation updates from https://translatewiki.net.
Change-Id: I55fa8bb02f396b304938a9a4da79b09de43f7d88
2021-08-09 08:23:53 +02:00
jenkins-bot dfa2646604 Merge "Only show the empty state on talk namespaces" 2021-08-07 16:19:16 +00:00
David Lynch 93f2e64f3f Only show the empty state on talk namespaces
This should only affect some edge cases like the project namespace (e.g.
Wikipedia:Village_pump isn't a talk page, but does get discussiontools.)

Bug: T288317
Change-Id: I509101063a1d64d09cff71a84bf48c69ab7a8c08
2021-08-06 16:04:23 -05:00
David Lynch 0cb756f248 Don't detach the reply widget when posting to an empty page
This will avoid a flash of the empty-state while we're reloading the
page to get new tabs.

Refactor out the new topic controller's clear behavior from its teardown
behavior, so we can still wipe out the storage when redirecting.

Bug: T288314
Bug: T288320
Change-Id: I6a5313b5e5b3bc9925e5cdaea04d8fbd3dc796af
2021-08-06 15:18:17 -05:00
Bartosz Dziewoński 076242e3b4 Revert "Silence JQMIGRATE warnings when running tests"
This reverts commit f075e37303.

No longer needed after Iaf786cd0f1d870cbcf0b968b7adce616c82df3d8
in MediaWiki core, and now causes exceptions because
UNSAFE_restoreLegacyHtmlPrefilter is undefined.

Bug: T280944
Change-Id: I0dbd6fcb5dce939de334815e9fe371425cf5641f
2021-08-06 18:19:42 +00:00
Translation updater bot 3150c533a6 Localisation updates from https://translatewiki.net.
Change-Id: Ib5325a1e137a46b011f52067d4c563958b67354a
2021-08-06 08:13:28 +02:00
jenkins-bot 10c23d0eb1 Merge "Deal with document body consistently" 2021-08-06 03:08:28 +00:00
jenkins-bot 02c09106ab Merge "Remove use of DOMXPath to remove Phan suppressions" 2021-08-06 03:05:13 +00:00
jenkins-bot 125cb495e2 Merge "ImmutableRange: Remove Phan suppression" 2021-08-06 02:47:07 +00:00