Commit graph

963 commits

Author SHA1 Message Date
Ed Sanders d3205b877f Fix typo in API help message key
Change-Id: Idb4e973f4adb3affa857f99680707e35676810fa
2020-08-25 13:24:31 +01:00
jenkins-bot f83e2370c1 Merge "Skip to the end of the paragraph in the parser, not modifier" 2020-08-25 11:56:10 +00:00
jenkins-bot 4218d930a7 Merge "Fix error handling in controller#getPageData" 2020-08-25 11:11:39 +00:00
jenkins-bot 4be90d7494 Merge "Re-apply new reply API patches (again)" 2020-08-25 11:11:12 +00:00
Translation updater bot 44eb15f1d5 Localisation updates from https://translatewiki.net.
Change-Id: I2a2093e29a3ce5c4a22363f02faf80579e7a9946
2020-08-25 09:46:20 +02:00
Ed Sanders 17ba57edd6 Don't trust RESTBase to give us the correct revision
As we do in VE, extract the revid from the document.

Unlike in VE we don't need to throw an error if there is
a mis-match, as we will likely be able to make the edit anyway.
Just use the ID we got from the document.

Log a warning if there is ever an ID mis-match so we
can evaluate if this check is actually needed.

Change-Id: I94c37980524a9faabac49495903a5262387af562
2020-08-24 17:24:50 +01:00
Translation updater bot 4fc4286be3 Localisation updates from https://translatewiki.net.
Change-Id: Id340cda545bf9a906ef1cb8911ba7cb8e943e93e
2020-08-24 11:57:51 +02:00
Translation updater bot 711350c948 Localisation updates from https://translatewiki.net.
Change-Id: Ibd69a94b7a8fef87955564cd69c446404009e427
2020-08-21 08:40:46 +02:00
jenkins-bot e1eb983d51 Merge "parser: Code quality tweaks" 2020-08-20 20:01:03 +00:00
Bartosz Dziewoński e36dc8e78a Skip to the end of the paragraph in the parser, not modifier
When a comment ended before the end of a paragraph, the next
comment would begin right there in the middle of the paragraph.
This could result in the detected indentation level of that
comment being incorrect, and replies being inserted in wrong
places, as seen in the 'signatures-funny' test case.

The code moved to the parser was previously repeated twice in
addListItem() and addReplyLink(), which should have been a hint
that something isn't quite right.

Also, fix the code guarding against overlapping signatures,
now that signatures may not be at the end of a comment.

Bug: T260855
Change-Id: Ic26a87642f8a15d5de2f7073d4d8176b299c7f94
2020-08-20 19:35:55 +00:00
Bartosz Dziewoński 84cb9d1dca parser: Code quality tweaks
Do things in a more intuitive order, avoid some repetition,
rename a vaguely named variable.

Change-Id: Ic1a0bb54134682eaf126231e04eb67847d6a5da6
2020-08-20 20:52:42 +02:00
jenkins-bot 8dc5f0b7ba Merge "More test cases for multiple signatures in funny places" 2020-08-20 12:10:45 +00:00
jenkins-bot 5f8214a2e4 Merge "parser: Fix comment ranges when timestamp has entities" 2020-08-20 12:10:43 +00:00
Translation updater bot dddfbc99de Localisation updates from https://translatewiki.net.
Change-Id: I10af141bbea61b5c5995a6fdaeeecd7e804948eb
2020-08-20 08:26:49 +02:00
Bartosz Dziewoński 03539527b4 Fix error handling in controller#getPageData
We were accidentally resolving the promise with `undefined`, rather
than rejecting it. This later caused "TypeError: Cannot read property
'linterrors' of undefined" in controller#checkCommentOnPage.

Bug: T260294
Change-Id: I29418988023d86140cfa110c0c348059b293a716
2020-08-19 20:06:09 +00:00
Ed Sanders c32a8996c7 Fix reply widget documentation
Change-Id: I46d033595ecf6c226ae23aefb03884841a3299c7
2020-08-19 20:05:55 +00:00
Bartosz Dziewoński b706eac8bc Re-apply new reply API patches (again)
This reverts commit 4d7c98b97c.

Change-Id: I4100521efb687ec324d25e273a9c986fd5dac0d0
2020-08-19 20:05:42 +00:00
jenkins-bot 1159172e32 Merge "Fix crash when trying to mention invalid usernames" 2020-08-18 15:35:29 +00:00
jenkins-bot 470c630662 Merge "Revert new reply API (again)" 2020-08-17 20:22:58 +00:00
Translation updater bot a96dac0f8c Localisation updates from https://translatewiki.net.
Change-Id: I9ffe9aa99add61fda3ac1d5611139a830a2f0372
2020-08-17 08:42:24 +02:00
Bartosz Dziewoński e0312957e6 Fix crash when trying to mention invalid usernames
Change-Id: I1e7213c38067e3c3107752705c4d3e4ed64a9258
2020-08-16 22:50:32 +02:00
jenkins-bot b31c9ae7fb Merge "Allow the mention prefix to be configured via a message" 2020-08-16 19:17:13 +00:00
Translation updater bot b591c41c37 Localisation updates from https://translatewiki.net.
Change-Id: I86775068195c564452ad67dac669c25fbd3d0a0d
2020-08-14 08:37:42 +02:00
Bartosz Dziewoński 4d7c98b97c Revert new reply API (again)
Causes page corruption, in a new way we haven't seen before.

* Revert "Move page updating logic to controller.js"
  This reverts commit 54fdc6de06.
* Revert "ReplyWidget: Move clear methods from #teardown to #clear"
  This reverts commit 9b811a94e0.
* Revert "ApiDiscussionToolsEdit: Do not pass 'basetimestamp'"
  This reverts commit 7de5938a6f.
* Revert "Use DOMCompat::getOuterHTML instead of doc->saveHTML()"
  This reverts commit 7b2448d2f0.
* Revert "CommentController: Remove remains of client-side edit conflict handling"
  This reverts commit 2d038af705.
* Revert "Restore error message for when comment is deleted while replying"
  This reverts commit 655c0526d6.
* Revert "Use transcluded from API to avoid ever fetching Parsoid DOM in client"
  This reverts commit 9d0fc184fe.
* Revert "Create a 'transcludedfrom' API endpoint"
  This reverts commit 5d8f3b9051.
* Revert "Edit API for replies"
  This reverts commit 8829a1a412.

Bug: T259855
Change-Id: I6419408c6194ec0afa6b8ee604b12c1a24c6ac7b
2020-08-13 20:19:29 +02:00
Ed Sanders 54fdc6de06 Move page updating logic to controller.js
Change-Id: I9cd11f49a9dd7bf9c6aa034359244c3a21f459e8
2020-08-13 11:59:41 +01:00
Ed Sanders 9b811a94e0 ReplyWidget: Move clear methods from #teardown to #clear
Change-Id: Ieb02f57d31579ac9c3ee2f20f07f9107e70348d4
2020-08-13 11:11:08 +01:00
Ed Sanders cc8b43b678 Allow the mention prefix to be configured via a message
Bug: T250332
Change-Id: I83c59fc665bbfe1027149bcb1cbce3f69d90c7ff
2020-08-12 18:45:25 +01:00
Translation updater bot 0adf9f3366 Localisation updates from https://translatewiki.net.
Change-Id: Idbed79c5c26f642a58b93408445376ba4aedf433
2020-08-12 08:19:12 +02:00
jenkins-bot 605b164616 Merge "tests: Fix some issues with overwriting outputs from PHP tests" 2020-08-11 21:19:12 +00:00
jenkins-bot 9602209ade Merge "Reindent CommentParser::findTimestamp()" 2020-08-11 21:18:09 +00:00
Bartosz Dziewoński 986840e7e8 More test cases for multiple signatures in funny places
Expand the 'signatures-funny' test case with more examples, which
don't behave correctly.

Follow-up commits I04a8ea09401e06f2d4bb1f226f17eb528b29ed95 and
Ic26a87642f8a15d5de2f7073d4d8176b299c7f94 fix them.

Bug: T255738
Change-Id: I0fdd8bdf11b497ffeed37c37953c5730f6e4f3b7
2020-08-11 20:41:32 +02:00
Bartosz Dziewoński 375bfe028e parser: Fix comment ranges when timestamp has entities
Previously, parser would output offsets that don't exist in their
containers, because we were pretending that entities are parts of
their neighboring text nodes.

Turns out it's much easier to do it right when going backwards.

Change-Id: I9bccca2d403f1a976ae517449989170cdd99721e
2020-08-11 20:41:06 +02:00
Translation updater bot bfca4bf0a0 Localisation updates from https://translatewiki.net.
Change-Id: Ie998bc7fb0ae5d0924f00ba58f9e41b582a8a3e3
2020-08-11 08:20:49 +02:00
Bartosz Dziewoński f0225243e0 tests: Fix some issues with overwriting outputs from PHP tests
Follow-up to ccd9e411d2.

* Fix variable name in CommentTestCase::overwriteHtmlFile()
* Overwrite before assertions, because they abort execution if they fail

Change-Id: I5bba016ba93f9dd1994325ae82c3105ba11cf033
2020-08-11 06:45:45 +02:00
Bartosz Dziewoński 7cd370615f Reindent CommentParser::findTimestamp()
Something terrible has happened to this function… It seems that I have
brutalized it when rebasing 092cfd6075.

Change-Id: I12d75c69d15645112563a7bc345209b23b54cb3e
2020-08-11 06:45:45 +02:00
jenkins-bot b681eec8e4 Merge "Allow reply widget header and footer to wrap when it's narrow" 2020-08-10 22:27:51 +00:00
jenkins-bot 4d4722a6ab Merge "Fix indentation level when replying to comments with mixed indentation" 2020-08-10 22:27:44 +00:00
jenkins-bot 7a18cc8902 Merge "Always use ':' (<dl><dd>) for indentation of replies" 2020-08-10 22:27:42 +00:00
Bartosz Dziewoński 7de5938a6f ApiDiscussionToolsEdit: Do not pass 'basetimestamp'
Only 'baserevid' should be required. That's what we used before commit
8829a1a412, since switching from
'basetimestamp' in commit 4e135c7f07 in
order to better handle edit conflicts with yourself. That fix seems to
have regressed, so let's try this and see if it helps.

Bug: T252558
Change-Id: Iff5911384f3320b6e7f97a1fa34e82ecd4b44fb3
2020-08-10 20:29:55 +02:00
Bartosz Dziewoński 2d038af705 CommentController: Remove remains of client-side edit conflict handling
In commit 8829a1a412 we kept this code
when adding the reply API, but on second thought it doesn't actually
make sense.

The reply API should never fail with an edit conflict normally, since
it makes the edit on the latest version of the page. If it does fail,
I think it's better to just show the error message. Current behavior
is to retry, and if that doesn't actually solve the problem, this ends
up in an infinite loop.

Bug: T252558
Change-Id: I5e0dcb2c42e5de4f18e99b8a761ca048a430b31e
2020-08-10 20:27:57 +02:00
jenkins-bot 9e7287d233 Merge "Do not include .dt-init-replylink-buttons in printouts" 2020-08-10 17:43:02 +00:00
Ed Sanders d43d66a5a4 Username suggestion header
Bug: T252084
Depends-On: Ie57dbe76725cc7d4c9a1c959623349ad707d0b88
Change-Id: I5e8b7582199d6b5674bdf8e9328c881a8c7c7673
2020-08-10 17:34:04 +00:00
Martin Urbanec deb3846281 Do not include .dt-init-replylink-buttons in printouts
Note: This patch was not tested.

Bug: T260071
Change-Id: I6bab50619cf6d2852e491877db95261982ff81a6
2020-08-10 17:55:08 +02:00
Translation updater bot f6a48a76d7 Localisation updates from https://translatewiki.net.
Change-Id: Ie5ffbe0435f92839d919b25b78896fa047b746d8
2020-08-10 09:00:48 +02:00
jenkins-bot 2727abd36a Merge "ThreadItem: Fix "Notice: Undefined index: href"" 2020-08-07 20:25:33 +00:00
Bartosz Dziewoński 74560f216e Allow reply widget header and footer to wrap when it's narrow
The footer was already laid out using flexbox and just required some
CSS tweaks to enable wrapping.

The header required some DOM changes, now also uses flexbox, and wraps
in a similar manner.

Bug: T259320
Change-Id: I6f6a86932a108037bf1d70f077c372654318be26
2020-08-07 20:25:23 +00:00
Ed Sanders 7b2448d2f0 Use DOMCompat::getOuterHTML instead of doc->saveHTML()
The latter results in lots of extra HTML entity encoding.

The former is built by the Parsing team and appears to result
in no unexpected changes elsewhere in the document.

As Parsoid's selser relies on HTML fragments being byte-for-byte
equal, these changes were resulting in wikitext normalisations
in untouched parts of the document ("dirty diffs").

Bug: T259855
Change-Id: Ib3cb605911e690ec3e8c2f9df25fd1a2e2849d7e
2020-08-07 21:31:38 +02:00
Esanders c26ca107db Re-apply new reply API patches
This reverts commit 96953647c3.

* Re-apply "Edit API for replies"
  This applies commit 8829a1a412.
* Re-apply "Create a 'transcludedfrom' API endpoint"
  This applies commit 5d8f3b9051.
* Re-apply "Use transcluded from API to avoid ever fetching Parsoid DOM in client"
  This applies commit 9d0fc184fe.
* Re-apply "Restore error message for when comment is deleted while replying"
  This applies commit 655c0526d6.

Change-Id: Id20d21899f87464636022aa0683f8c03e0060117
2020-08-07 21:31:38 +02:00
Bartosz Dziewoński 96953647c3 Revert new reply API
Causes page corruption.

* Revert "Restore error message for when comment is deleted while replying"
  This reverts commit 655c0526d6.
* Revert "Use transcluded from API to avoid ever fetching Parsoid DOM in client"
  This reverts commit 9d0fc184fe.
* Revert "Create a 'transcludedfrom' API endpoint"
  This reverts commit 5d8f3b9051.
* Revert "Edit API for replies"
  This reverts commit 8829a1a412.

Bug: T259855
Change-Id: I98036f14dd900b51f20e98696e31b9b618eceee1
2020-08-07 18:18:21 +02:00
Bartosz Dziewoński e7115b8b27 ThreadItem: Fix "Notice: Undefined index: href"
Bug: T259856
Change-Id: I10b16b7d79dc88d7259b64c7d5d7e4cc6860d0fc
2020-08-07 17:41:41 +02:00