Commit graph

1148 commits

Author SHA1 Message Date
Bartosz Dziewoński 1998c983f1 computeId() can't return null
It used to return null for headings, but now it doesn't. Simplify some
code checking for that.

Change-Id: I28131c4aee89b901879b4c49953d6b15ed91b5e7
2021-02-13 00:08:15 +01:00
Translation updater bot 0ac7cc7f33 Localisation updates from https://translatewiki.net.
Change-Id: I0e36e25db72a2099bf1e0263df88b3e2ae504b7d
2021-02-12 08:51:26 +01:00
Translation updater bot 859d68f56b Localisation updates from https://translatewiki.net.
Change-Id: I7e01a7ce5736080facac70c89babba0d15f1b87c
2021-02-11 08:38:32 +01:00
jenkins-bot f393fa5f03 Merge "Remove a TODO note about wrappers" 2021-02-11 00:09:50 +00:00
jenkins-bot d5b2389ffa Merge "Fix replying outside wrappers for partially indented comments" 2021-02-11 00:09:48 +00:00
Ed Sanders 361fd4c4a4 Add body class to enable reply links
Going forward this will allow us to remove the parser
cache split, and toggle features just using CSS.

The CSS will be modified in a later commit to give the
anon caches time to clear.

Bug: T273072
Change-Id: I83c84b8bc63e1881e07b49acd8499b811adfccd4
2021-02-10 15:40:34 +00:00
jenkins-bot 80b6896b8a Merge "Show relevant user in local suggestions on user talk pages" 2021-02-10 15:08:51 +00:00
Translation updater bot a78f328b33 Localisation updates from https://translatewiki.net.
Change-Id: Ib569e247b68a6a2f517044fe0ea1772a67573859
2021-02-10 08:38:21 +01:00
Ed Sanders b581883e7c Show relevant user in local suggestions on user talk pages
Bug: T273324
Change-Id: I60e550efbea3d9e250dcaf13080407094a23aad3
2021-02-09 21:51:28 +00:00
jenkins-bot 89dd44bb35 Merge "More test cases for comment wrappers (multiple siblings)" 2021-02-09 18:07:14 +00:00
Thiemo Kreuz 1e0d2d93b3 Add missing out-of-index guard to CommentUtils
I found this error in our logstash. I was not able to find an
existing Phabricator ticket.

Note how line #348 extracts the last element from the
$siblings array. It uses the function end() there, which
returns false in case the array is empty. $siblings[0] can't
do this but yields an error.

An alternative is to use reset(), which can return false as
well. But that's not really better. Especially not better
readable, I would argue.

Change-Id: Ic90cd2392ede15078ba0d5b4d67b8dc5d05f9bf7
2021-02-09 12:27:41 +01:00
Translation updater bot 7a93aeca7a Localisation updates from https://translatewiki.net.
Change-Id: I3dea088ec6c16b9590c1ac78c1a14bb52432a87e
2021-02-09 08:39:57 +01:00
Bartosz Dziewoński 3a1b8e09ea Remove a TODO note about wrappers
Yes, this is still needed, removing it causes failures in tests
(and the old outputs look better).

Change-Id: I5bcedb0295a1f0ac4f6e51eaa9a9e072d8236f3c
2021-02-08 22:23:54 +01:00
Bartosz Dziewoński 9d2b35828d Fix replying outside wrappers for partially indented comments
Top-level comments that start or end with a list (inconsistent
indentation) would not have triggered the logic for detecting
wrappers.

Bug: T273692
Change-Id: Idcb4eed73e391f5f86eca2eb05cb3cea0d86f30a
2021-02-08 22:18:37 +01:00
jenkins-bot 3da91953da Merge "Adjust new comment highlight timings" 2021-02-08 18:51:06 +00:00
Bartosz Dziewoński 3c7c9c6e3a Adjust new comment highlight timings
The new timing exactly matches MediaWiki's post-edit notification.

Bug: T268994
Change-Id: I8233f56ad6e0d95285fee7f514fce914e7897905
2021-02-08 16:49:50 +01:00
jenkins-bot c0d4bd007a Merge "Truncate user generated part of IDs to 80 characters" 2021-02-08 14:47:38 +00:00
Translation updater bot fe6d1d0485 Localisation updates from https://translatewiki.net.
Change-Id: I30b78a0b4076357253fd3bbc9d8a3a8e7803e2cf
2021-02-08 08:40:25 +01:00
Bartosz Dziewoński 5a4ca05981 Adjust the edit summary interface message
Bug: T273944
Change-Id: Ibd23dc985e6fef7ab60d15bfb545c87b29af258c
2021-02-05 13:30:13 +01:00
Translation updater bot 02883977fe Localisation updates from https://translatewiki.net.
Change-Id: Iab4883e6e03abe1d3c5dcd9880d758993bca46e0
2021-02-05 08:46:50 +01:00
Translation updater bot 3bfc0b2a2a Localisation updates from https://translatewiki.net.
Change-Id: I2927d31711152829f61fa0e164b41fb3b106af5f
2021-02-04 08:39:18 +01:00
Ed Sanders d05109b24d Truncate user generated part of IDs to 80 characters
This ensures that IDs fit in a 255 character database field.

Bug: T273658
Change-Id: I3cfe4fce6a865b4343f0f01121cd696aa5f98b22
2021-02-03 15:04:58 +00:00
Translation updater bot 6124c1acf7 Localisation updates from https://translatewiki.net.
Change-Id: Ifb50676b19de745a0730915849d422c00a1ea245
2021-02-03 08:39:04 +01:00
Bartosz Dziewoński 0f4db60e72 More test cases for comment wrappers (multiple siblings)
For a moment I doubted if we handle this case correctly, but in fact
I didn't botch that code *this* badly.

Change-Id: I5a9d142e4bd97ac40aa388bb43b65ab1286e3f18
2021-02-03 00:26:52 +01:00
Bartosz Dziewoński 1c3fada1fb Make CommentUtilsTest a proper unit test
Documentation:
https://www.mediawiki.org/wiki/Manual:PHP_unit_testing/Writing_unit_tests_for_extensions#Two_types_of_tests

We can do this because the tested methods do not depend on any globals
or on MediaWiki being installed.

In addition to being the new hotness, MediaWikiUnitTestCase allows the
test classes that use it instead of MediaWikiTestCase to start up much
faster. In my testing, running this test case individually now takes
0.35s, compared to 1.1s before.

Try:
* With new code:
  time php tests/phpunit/phpunit.php extensions/DiscussionTools/tests/phpunit/unit/CommentUtilsTest.php
* With old code:
  time php tests/phpunit/phpunit.php extensions/DiscussionTools/tests/phpunit/CommentUtilsTest.php

Change-Id: I771b1f3d101a394ee869e42547d9ae7839397752
2021-02-02 15:37:17 +01:00
jenkins-bot 3a33cf81a8 Merge "Update localisation messages and their documentation for new discussion tool" 2021-02-02 12:12:45 +00:00
jenkins-bot 63a5916e53 Merge "Update warning about missing topic title immediately" 2021-02-02 12:11:21 +00:00
Bartosz Dziewoński 75beba2c15 Update localisation messages and their documentation for new discussion tool
Bug: T264220
Change-Id: I92f346f91cbd9bb7212d4c3389624e18fcb66255
2021-02-02 12:07:23 +00:00
Translation updater bot 7f202af4dd Localisation updates from https://translatewiki.net.
Change-Id: Ib615a44d65c0254d1a332f7d9b12f4f7ef60cb88
2021-02-02 08:38:59 +01:00
Ed Sanders 6c3dd3aaa9 Move Hooks to HookUtils
Now that all the real hooks have been separated out

Change-Id: Ibdb42f98614fc551068f8f8e5297dcc99251ab46
2021-02-01 22:35:11 +00:00
Ed Sanders 2908c2808d Move Hooks::addReplyLinks to CommentFormatter
Change-Id: I9f5483cd801f48efff22cba045ae6851da9719fd
2021-02-01 22:35:04 +00:00
Ed Sanders bf51f1f65c Use new HookHandler system and group hooks by purpose
Bug: T273303
Change-Id: I2d940e1944a9d7686bf7bc544a318c88c0b2afad
2021-02-01 22:34:57 +00:00
jenkins-bot fb415e374d Merge "Update 'save_failure_type' map for EditAttemptStep schema" 2021-02-01 18:28:13 +00:00
Translation updater bot c31fea1bd3 Localisation updates from https://translatewiki.net.
Change-Id: Ibe13425fbabf7daed46697f1d204a223ebfa6918
2021-02-01 08:47:31 +01:00
Bartosz Dziewoński 069050ad12 Update warning about missing topic title immediately
Since it's no longer tied to the "Reply" button, we can move the code
from ReplyWidget to NewTopicController, where it belongs.

Bug: T272543
Change-Id: I8c90ffb772573d22d26c608d45877ee948fd232d
2021-01-29 23:14:45 +01:00
jenkins-bot 39e45f5b61 Merge "build: Updating dependencies" 2021-01-29 10:04:37 +00:00
libraryupgrader 095622bf4d build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 34.0.0 → 35.0.0
* mediawiki/minus-x: 1.1.0 → 1.1.1

npm:
* eslint-config-wikimedia: 0.17.0 → 0.18.1

Additional changes:
* Added the "composer phan" command to conveniently run phan.

Change-Id: I271199abd055233f12f8a1c18ff414b06d1748ec
2021-01-29 09:54:58 +00:00
Translation updater bot 7ac5d8038a Localisation updates from https://translatewiki.net.
Change-Id: I909eb5059bffc36ade9ecd9b2aa24ef714545ddf
2021-01-29 08:37:33 +01:00
Translation updater bot 9e8feded69 Localisation updates from https://translatewiki.net.
Change-Id: I8fbd2fea9809f2c0dd74ea6946730832bbde1446
2021-01-28 08:35:41 +01:00
Bartosz Dziewoński f21e6dfc7c New error message when the page doesn't exist
The previous confusing error was coming from the getLatestRevision() call.

Bug: T273068
Change-Id: I5bb53c875bb08f6fb087875a6e55fb033d182056
2021-01-27 16:41:03 +01:00
Translation updater bot 20a9836c73 Localisation updates from https://translatewiki.net.
Change-Id: I51c139bfb963a790fb1a5eea35a5bd1189835285
2021-01-27 08:34:11 +01:00
Ed Sanders 47aea0b160 Use tabs for indentation in JSON test files
Change-Id: I1d8f8b33b19bcff249ad08dfe687f87f5e5bf9bf
2021-01-27 00:25:15 +00:00
jenkins-bot 50f749d676 Merge "Handle category links at ends of comments affecting indentation" 2021-01-26 17:21:34 +00:00
jenkins-bot 373282dfb4 Merge "Don't show error message popups when failing to restore auto-save" 2021-01-26 17:21:32 +00:00
jenkins-bot 1c373b386b Merge "Improve error message used when no changes are saved" 2021-01-26 17:21:31 +00:00
jenkins-bot 2b648dad64 Merge "CommentController: Even better handle clicking links while already commenting" 2021-01-26 17:04:04 +00:00
jenkins-bot 76da6af031 Merge "Move some setup code from CommentController to controller.js" 2021-01-26 17:02:22 +00:00
jenkins-bot 5bbc6d519c Merge "Fix cookie loading hack" 2021-01-26 17:02:20 +00:00
jenkins-bot 1b83e64440 Merge "Fix check for null edits" 2021-01-26 16:58:51 +00:00
Translation updater bot c5e9b3cefb Localisation updates from https://translatewiki.net.
Change-Id: I86eb898022f05479faadfe4bdb2e8ec123ef6305
2021-01-26 08:53:04 +01:00