Commit graph

366 commits

Author SHA1 Message Date
Ed Sanders 722a4e5198 Avoid splitting ParserCache on user language
Bug: T280295
Change-Id: I87eab83803d24c11db4d723377bf7b40390b2e70
2021-04-21 11:57:30 +00:00
Bartosz Dziewoński 0b82162149 CommentFormatter: Fix regexp in topic subscription postprocessing
The regexps needs to be non-greedy, otherwise it could swallow up a
large chunk of the page (up to the next comment).

I noticed this when adding tests for this code, in the 'unclosed-font'
test case (Ief9648b8805fadcc170c54b627eb669cc8b907b6).

Change-Id: I5f67a9599b0cb07bdd53abeebac9ada221181b66
2021-04-21 11:57:21 +00:00
Bartosz Dziewoński 228b81fab9 Move implementation of subscribe buttons to CommentFormatter
Change-Id: Iad59ea047ed12bb34b483a94f443b39de6985bd3
2021-04-21 11:57:17 +00:00
Bartosz Dziewoński 1957c340b9 Remove unused variable
Change-Id: Ia4ad464b765c67aea27092a161d28ad1d890e96a
2021-04-21 11:57:11 +00:00
jenkins-bot 69fc17db81 Merge "Rename CommentFormatter::addReplyLinks" 2021-04-21 11:50:42 +00:00
Bartosz Dziewoński f6b7c69736 modifier: Guard against infinite loop
If curLevel or desiredLevel are calculated incorrectly, this loop
could never end.

In JS, something would throw an exception before going infinite, but
PHP is happy to trot along despite accessing properties of null and
attaching multiple children to a document node.

Bug: T279445
Change-Id: I1784f550ec3a23dcded4f2b1def97e51cb414b7b
2021-04-21 13:43:45 +02:00
Bartosz Dziewoński 4bbfe6cb5d Rename CommentFormatter::addReplyLinks
Bug: T280351
Change-Id: I0d7627d63407e11cca6091f78e4d440eec6efa91
2021-04-21 11:24:03 +00:00
Bartosz Dziewoński dcd898ed6d CommentFormatter: Add 'ext-discussiontools-section' class instead of overwriting
Bug: T280433
Change-Id: I3746913b7212f252a1632db01e77e53038719cb5
2021-04-19 23:47:53 +02:00
Bartosz Dziewoński a3f665e816 Remove <header> tags around headings for compat with MobileFrontend
We added it because the initial designs for the subscribe action were
much easier to implement like this, and topic "containers" (T269950)
would have required it.

However, the latest design of the subscribe action will not need it
(T279149), and topic containers are still very far away, so let's
remove it for now.

Bug: T280433
Change-Id: I21a23e9bea43f24d265750926fbd62b99038d3f1
2021-04-19 17:47:43 +02:00
jenkins-bot 58fc1753fe Merge "Include comment names in 'transcludedfrom' API response" 2021-04-16 11:30:22 +00:00
jenkins-bot ef7073b8fd Merge "Simplify how warnings for IDs equal to legacy IDs are avoided" 2021-04-15 23:31:45 +00:00
Timo Tijhof 269514f533 Hooks: Use WebRequest::getRawVal where possible
The 'dtenable' does not appear to take user-provided content that
requires language normalization. In general getRawVal should be used,
or if it's user input that needs normalization, use getText(). Perhaps
one day we'll alias or deprecate getVal (which is currently an odd
mid-way hybrid, most closely to getText; originally created for
EditPage.php textareas).

Change-Id: I8364c84f8c4f700da6e208df2e87c29bf254d685
2021-04-15 02:30:12 +00:00
Bartosz Dziewoński 9420f22e9d Don't allow query and cookie hacks to enable topic subscriptions
We can't allow it, because the required database tables may not exist
yet (T280082).

This is meant to be temporary until we complete DBA review and the
tables are created.

Bug: T280082
Change-Id: I8f947b779c6829763d3413931c6d354e6f7aee4d
2021-04-14 00:08:52 +02:00
Bartosz Dziewoński 3e319251f0 Fix check for your own talk page on subpages
Bug: T279604
Change-Id: I955a602ffb39f2443de9a3b165d8105ea3762058
2021-04-12 17:06:02 +02:00
Ed Sanders a555db7892 Topic subscriptions: Don't register notification type/group unless enabled
Bug: T279671
Change-Id: If3c46b992654c40daeeccaf8a3dcedde680c8404
2021-04-12 15:04:43 +00:00
Ed Sanders f3422f40a6 Disable topic subscriptions API when feature is unavailable
Bug: T279671
Change-Id: Ib5a233329e7e6697c198bc0ae10c770282fd9470
2021-04-12 15:04:07 +00:00
Ed Sanders f6c9508001 Create constants for feature strings
Change-Id: I2d7bf18faf6345a4816c2ebef9744c4e6f62cc40
2021-04-12 14:40:51 +00:00
Ed Sanders 23a490deca Topic subscriptions: Don't generate events when feature is unavailable
Bug: T279671
Change-Id: I8f57b2a1885619db868f25ea68208c2fad5fc040
2021-04-12 14:40:27 +00:00
Ed Sanders 6cafd7735d Topic subscriptions: Only check for events on talk pages
Change-Id: Ic2b7536baea58fb4868cec6f477e72bd8b717e3a
2021-04-12 14:40:13 +00:00
Bartosz Dziewoński bfe6a36514 Include comment names in 'transcludedfrom' API response
As of 7ad6328223, we also use this data
to check whether comments exist on the page, not only whether they're
transcluded.

Follow-up to 42ce942c86.

Bug: T275821
Bug: T273413
Change-Id: I95eb85354e7b84cc10ab703d28315d0667696f4c
2021-04-07 22:46:36 +02:00
Ed Sanders 0a39c11914 Echo wiring for topic subscriptions
Depends-On: I60818d57552946857077dee93b0adb036621b791
Change-Id: I7e0996843cdd70141e19d5c7ce66122204efa1b7
2021-04-06 23:28:28 +02:00
Ed Sanders eb7e682d2f Topic subscription front end
Bug: T276996
Change-Id: Ifb62c04c2a0ea8399749b22021d6a1c5a079bf94
2021-04-06 23:28:28 +02:00
Ed Sanders 0bf7539eb9 Topic subscription action API
Bug: T264885
Change-Id: Ie4ddbcef8769c124039a72f544702c9a88bc49eb
2021-04-06 21:25:24 +00:00
David Lynch 86be6f83da Service to interact with topic subscriptions
Bug: T264885
Change-Id: Ie9592de655f50e1d0cf02a7f795b5203398a9696
2021-04-06 21:25:13 +00:00
David Lynch 5b8646f73f Create table for topic subscriptions
Bug: T264885
Change-Id: I92d0362eac80ae1ae70839e26e2c084003862a5f
2021-04-06 21:24:53 +00:00
Ed Sanders 4c27187500 Make the source mode toolbar a user preference feature
Bug: T275950
Change-Id: I099af342f378215c68092d165dd88de1807d29d2
2021-03-31 22:40:53 +02:00
Bartosz Dziewoński 566d4d92db Trim wikitext for preview
And change some uses of trim() to htmlTrim() for consistency.

Bug: T276612
Change-Id: I1f55f4793af8f3dda597288c9e3427abe31c37c9
2021-03-24 18:53:41 +01:00
Bartosz Dziewoński 3ac540af95 modifier: Fix whitespace trim inconsistency
The JS and PHP trim() methods remove different characters.

Change-Id: I8ae5526ea5033e345b6a6b63ea447c394956d988
2021-03-24 18:53:21 +01:00
Bartosz Dziewoński 42ce942c86 Introduce comment "names" to identify comments across revisions/pages
The existing comment IDs can't be used to find the same comment on
a different revision or page (when it's transcluded), because they
depend on the comment's parent and its position on the page.

Comment names depend only on the author and timestamp. The trade-off
is that they can't distinguish comments posted within the same minute,
or in the same edit, so we will still need the IDs sometimes.

Prefer using comment names when replying, if they're not ambiguous.
This fixes T273413 and T275821.

Heading names depend on the author and timestamp of the oldest comment.
This way we don't have to detect changes to the heading text, but we
can't distinguish headings without any comments.

Bug: T274685
Bug: T273413
Bug: T275821
Change-Id: Id85c50ba38d1e532cec106708c077b908a3fcd49
2021-03-23 16:08:42 +00:00
Bartosz Dziewoński b28290fa62 Simplify how warnings for IDs equal to legacy IDs are avoided
I don't like the extra parameter.

Follow-up to d05109b24d.

Change-Id: Ic0f403a816fd3182982002da326bb32d591ebcf7
2021-03-22 20:15:07 +00:00
Ed Sanders c4de603ef9 Give comments IDs so they can be scrolled to with hash links
Bug: T265268
Change-Id: Idb985ed38bdb74e23cb7840899a61dc919f05f6f
2021-03-20 15:43:23 +00:00
Ed Sanders 4a0802065c Make IDs (to be used as URL hashes) wikitext safe
* Use hyphens instead of pipes a separators
* Use underscores for spaces in usernames

Change-Id: I6efd9739fc73e45002e50e64c43ce0de1c2f1239
2021-03-18 20:45:21 +01:00
Bartosz Dziewoński a103abb8ae Ignore warnings about legacy IDs in tests
Change-Id: I3c74b4e65aac9b84494917547cce7eb6a75995b4
2021-03-18 20:42:03 +01:00
Ed Sanders ece8ff69ff Change dt- class prefix to ext-discussiontools-
Longer, but follows the style guide and less likely to conflict.

We need to account for init classes in the cache being around for
a while.

Change-Id: I738bc93393850db320fdbda2b003ca8ac40556da
2021-03-13 14:42:39 +00:00
jenkins-bot 72f1ff092f Merge "Allow users to continue using reply tool after disabling A/B test" 2021-03-10 06:40:58 +00:00
Bartosz Dziewoński 68ad48f56f Allow users to continue using reply tool after disabling A/B test
Bug: T276967
Change-Id: I1fa120ded9ac3673fd3e5005618b3312ffd0aaf5
2021-03-09 22:20:03 +01:00
Bartosz Dziewoński 44f2209abf Trim signatures when added in an empty existing node, too
Add unit tests for appendSignature().

Bug: T276612
Change-Id: Ic44c52f4d54492e092f9396c626380e2637b6f0f
2021-03-08 23:38:46 +00:00
Ed Sanders ccc19d8df2 Add 'href' to reply links for better compatibility with skins
Change-Id: Id948d576bbe5a6d43c4f8a06cdb2cd8ad19be193
2021-03-09 00:04:53 +01:00
Ed Sanders 6224c11ff1 Always load init CSS when tools are available for a title
Also, make init CSS available on mobile.

Bug: T274311
Change-Id: I8f63fdb249cdd8ccdc6d1c4944d2622ac7d668cc
2021-03-06 12:08:50 +00:00
Ed Sanders 45cda20cf3 Don't attempt to put comment markers in <noscript> tags
Bug: T276455
Change-Id: Ia427d97528b137111145ac79680972a660f28e37
2021-03-04 22:24:04 +01:00
Bartosz Dziewoński f5059e6ea6 Don't detect comments within 'cite' elements too
Follow-up to 024a978ffd.

Bug: T275881
Change-Id: I53448ad22cd0531e7fd4aa0ea5d15782879cce14
2021-03-01 21:40:43 +01:00
jenkins-bot 0eb37a87df Merge "Don't detect comments within quotes" 2021-02-28 22:56:20 +00:00
Bartosz Dziewoński 024a978ffd Don't detect comments within quotes
Bug: T275881
Change-Id: I8f7a4279837bd95ebf5b604ff350c0a3f29c2c05
2021-02-28 22:49:48 +00:00
jenkins-bot 8bb5eea999 Merge "Improve signature detection to handle formatting on the timestamp" 2021-02-27 22:54:50 +00:00
jenkins-bot c5874422df Merge "CommentUtils: Fix edge case bug in getCoveredSiblings()" 2021-02-27 22:54:46 +00:00
jenkins-bot 49938a88dc Merge "Improve merging multiple comments on one paragraph" 2021-02-27 22:54:43 +00:00
Daimona Eaytoy 67096cb431 Stop using deprecated Language methods
Change-Id: I7cf21365df355a4a62f9e353be61aaa03ed58b9d
2021-02-27 14:48:49 +00:00
Bartosz Dziewoński efe95494a8 Improve signature detection to handle formatting on the timestamp
Now it detect signatures generated by en.wp's {{Undated}} template,
and signatures of people who do weird stuff to the timestamps.

Bug: T275938
Change-Id: I27b07f6786ca5433a3c02a5fe68e4716d41401bb
2021-02-27 02:33:30 +01:00
Bartosz Dziewoński e767ee1741 CommentUtils: Fix edge case bug in getCoveredSiblings()
In some cases it would return the parent node, instead of the siblings
it should return.

It's a private method only called by getFullyCoveredSiblings(), and
that method had a bug that cancelled out this one, so everything
worked correctly. But I want to use it elsewhere now and ran into it.

Change-Id: Ic12f007d57a8502a1bea5f0af17b29e9d59093d6
2021-02-27 02:26:42 +01:00
Bartosz Dziewoński af082908a5 Improve merging multiple comments on one paragraph
The horrendous 11-line if() condition did not correctly handle
signatures wrapped in inline formatting markup, like <small>.

Instead, implement this logic in the code for skipping to the end
of a paragraph, which didn't exist yet when that condition was
added, but seems like a much better place to check this now.

Bug: T275934
Change-Id: I5cccff889b5e15b5f8fde0538bf4bccb22e762cf
2021-02-27 02:21:36 +01:00
Ed Sanders 8a322a28a6 Return transcludedFrom data for headings as well as comments
We may need this for topic subscriptions, and it seems
generally useful to include in the API response anyway.

Change-Id: If9522dc0c79a9a9ffb3a80f83fb17bf3c9399d6d
2021-02-25 23:07:42 +01:00
jenkins-bot 13d50c7e55 Merge "CommentFormatter: Fix inserting placeholder heading marker" 2021-02-24 20:50:51 +00:00
Bartosz Dziewoński 5b26e9664b CommentFormatter: Fix inserting placeholder heading marker
This code expected $container->firstChild to be a
<div class="mw-parser-output">, but that element is not present
when we're running on HTML to be saved in parser cache.

We ended up inserting the marker inside whatever node was the
first on the page, and if it was a <style> element, both our
marker and the styles would be lost when serializing, like in
6c7a0ca9a2.

When we're running on final HTML, the marker will now be outside
of <div class="mw-parser-output">, but that seems to be fine. Only
early versions of I4e60fdbc098c1a74757d6e60fec6bcf8e5db37c1 had
problems with that (see comments on patchset 41), but it works now.

The added test case also covers the fix for T274709.

Bug: T275440
Change-Id: I38d45dd8686919be51e1d307ded12b0afe185eb5
2021-02-24 20:32:48 +01:00
Bartosz Dziewoński 35738b1f9b CommentParser: Replace getThreadStartTimestamp with getThreadStartComment
Change-Id: Ia8d878594306b5ce4039ca06d6dcec753e5dea28
2021-02-24 12:26:58 +00:00
Ed Sanders 794332c1a1 Add stripTrailingSeparator to getBodyText as well as getBodyHTML
Change-Id: I33163bb291b4ee5bb6a1d602e518796057983d55
2021-02-23 23:09:17 +00:00
Ed Sanders fa484e0c4a Don't allow CommentItem author to be null
Change-Id: Idb12bfa62e42bff521e872ab358b5ba9a8d24089
2021-02-22 20:55:35 +00:00
Ed Sanders bb8d2b691e Define sub-features in arrays and use where possible
* HookUtils:FEATURES lists all features
* CommentFormatter::USE_WITH_FEATURES are all features
  which require the comment formatter

Change-Id: Idbbe8bdd910b9c7b23c7fee76af7bb7ee13c2759
2021-02-22 20:55:35 +00:00
jenkins-bot a0d97212cd Merge "Improve API parameter documentation" 2021-02-13 22:15:16 +00:00
jenkins-bot 5a9a4dc525 Merge "computeId() can't return null" 2021-02-13 22:14:02 +00:00
Bartosz Dziewoński 6659bb3f00 CommentFormatter: Fix problems with editsection and quotes
Bug: T274709
Change-Id: I918fdd97064186381b65ab1567d02abf6f944b8f
2021-02-13 20:01:58 +01:00
Bartosz Dziewoński 03f22c538e Improve API parameter documentation
These messages are used on Special:ApiSandbox.

Change-Id: I07809d3f9402d30c5d2d364e0634bd020f86f64f
2021-02-13 00:08:31 +01:00
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
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
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
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
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
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
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
jenkins-bot 50f749d676 Merge "Handle category links at ends of comments affecting indentation" 2021-01-26 17:21:34 +00:00
Bartosz Dziewoński c781b127c9 Handle category links at ends of comments affecting indentation
* Ignore rendering-transparent nodes between discussion comments.
* Improve isRenderingTransparentNode() so that <link> nodes
  representing TemplateStyles are not considered transparent,
  otherwise this would undo ae920b831f.
  Using a regexp from Parsoid.

Bug: T272746
Change-Id: I0b3c3251156ba6c4826abf5ba44ea93f80ebc01d
2021-01-26 04:55:03 +01:00
Bartosz Dziewoński ca9db69b40 Fix check for null edits
Yet again, the CAPTCHA being neither an error nor a success bites us.

Bug: T272922
Change-Id: I5ef85df452638ad3208e7a1cadad44c83237dbfe
2021-01-26 01:06:31 +01:00
David Lynch 15c4052168 A/B test output when a specific feature is being tested
Bug: T268191
Change-Id: Ib4fb59e4dc28aebc45854c293cb25bb3006267c3
2021-01-21 15:46:05 -06:00
jenkins-bot 994abdac39 Merge "Store reply links in the parser cache" 2021-01-19 21:35:36 +00:00
Ed Sanders 32789a9a55 Store reply links in the parser cache
Splits the cache on the reply links feature being enabled
for a particular user and title.

An additional check is done after parsing in case the user
has the feature enabled via query string or cookie.

Bug: T267404
Depends-On: I883a37fd67108243e7a20683b1a5d59fd0f6e39f
Change-Id: I3bc06ca7d4aea7f0fe39eef0e77ad88d1f9c1043
2021-01-19 17:01:53 +00:00
jenkins-bot e17467b09c Merge "Fix exception when trying to use non-existent 'typeof' attribute" 2021-01-18 18:58:35 +00:00
Bartosz Dziewoński 8f42c74985 Fix skipping to the end of paragraph, now it considers nested tags
Add yet another tree walking utility: CommentUtils::linearWalk().
Unlike TreeWalker, it allows handling the beginnings and ends of nodes
separately – kind of like parsing a XML token stream, or kind of like
VisualEditor's linear model.

(Add unit tests for this utility. The simple.html test case is copied
from [VisualEditor/VisualEditor]/demos/ve/pages/simple.html.)

Use this utility to stop skipping when we reach either a closing or
opening block node tag. Previously we'd skip over such tags inside
nested "transparent" nodes (like <a>, <del>, or apparently <font>).

Bug: T271385
Change-Id: I201a942eb3a56335e84d94e150ec2c33f8b4f4e0
2021-01-18 18:20:20 +00:00
Ed Sanders 1c741d3450 Preserve a user's beta preference when not in beta
The tool may go in and out of beta as new features
are release/graduated to opt-out. Users should only
need to opt in to the beta feature once to get all
future sub-features.

Bug: T272071
Change-Id: If6834b7fc07fc7e84757dc5fdcea814cd0d65936
2021-01-14 23:46:47 +00:00
Bartosz Dziewoński c20e7765ea Fix exception when trying to use non-existent 'typeof' attribute
Bug: T272090
Change-Id: I4d1e7457441f28d789dec8b7fd2dc3ba10fd995e
2021-01-14 22:11:32 +01:00
Ed Sanders c42e86f0f6 Config: Explicitly check feature availability in the client
Don't assume a feature is available because the code has
loaded and the user option is set. Export the logic from
Hooks.php to the client.

Change-Id: Ica0e58de7ed0d59e3b09645193eb2b691ae41c39
2021-01-14 19:04:18 +00:00
jenkins-bot 99acd2a925 Merge "A/B test bucketing for beta enrollment" 2021-01-14 12:49:05 +00:00
Ed Sanders f6fe40b500 Fix check for feature availability
If asking if any feature is available, also check if
any feature has been set to 'available'.

Change-Id: I417f8756d91c5d3abab8b24109320737b8b86509
2021-01-13 19:35:42 +00:00
David Lynch 27a995d5a2 A/B test bucketing for beta enrollment
If DiscussionToolsABTest is enabled (set to `all` or a feature), logged
in users who have never used the tool before will be assigned to an a/b
test bucket. If they're in the test bucket, they get the feature
enabled.

If they manually set their beta feature preference, we don't override
that but do maintain their bucket for logging purposes.

Bug: T268191
Change-Id: I9c4d60e9f9aaef11afa7f8661b9c49130dde3ffa
2021-01-13 10:32:00 -06:00
Ed Sanders 706f4438fc Add "new topic" user preference
Bug: T270119
Change-Id: Ie27ea645602f7533610826cbc0cc422e3682d863
2021-01-12 20:15:46 +00:00
Bartosz Dziewoński d76143bc08 Ability to add new discussion sections
1. Extend the JS modifier to allow adding top-level comments
   (that is, replies to headings). PHP modifier doesn't do this
   because we'll save the changes using paction=addtopic instead.

2. Subclass CommentController to allow adding a new heading and a
   top-level comment underneath it at the same time.

3. A lot of ugly code in ReplyWidget to customize the interface
   for this case. Much of it should probably be moved to
   CommentController/NewTopicController.

Bug: T267595
Change-Id: I9c707bb7f7aae1b92c72fb4dee436490f8c8409b
2021-01-12 20:15:28 +00:00
jenkins-bot 81cb4e8fe8 Merge "Load site config data in CommentFormatter tests" 2021-01-09 15:39:52 +00:00
Ed Sanders 8b71a2b5dc Load site config data in CommentFormatter tests
This fixes missing reply links in arwiki test output.

Change-Id: I24d3b8371a8343c4445c716fadf0692be0924eed
2021-01-08 23:03:33 +00:00
jenkins-bot 3625f2d8f6 Merge "Catch when no changes are actually saved when posting a comment" 2021-01-08 22:46:14 +00:00
Bartosz Dziewoński 1c8ca53c92 Catch when no changes are actually saved when posting a comment
Bug: T268069
Change-Id: Ib9c136d846668335884a242322d5b0d4e038c6b1
2021-01-08 22:39:18 +00:00
Ed Sanders 9ba6c3d159 CommentItem/HeadingItem: Make more constructor args required
This ensures the getters always return the promised types.

Change-Id: I1a3c909f5395463ef7a89d896ead1520b2a17509
2021-01-08 20:45:29 +00:00
Ed Sanders 0d2d3b16b8 Pass interface language object to addReplyLinks
Change-Id: I8a5562e11df3ad6430db48020d6005d0c4fd6834
2021-01-08 21:43:21 +01:00
jenkins-bot 4b1fe2d3b8 Merge "Refactor availability checks" 2021-01-05 19:04:29 +00:00
Ed Sanders dcc23f1108 Refactor availability checks
Allows for multiple features in the near future.

Separate availability and enabled.

Separate User/Title/Output checks.

Change-Id: I454bd8407675749d93ff3d2b4c5d624b433204db
2021-01-05 19:42:37 +01:00
jenkins-bot 8a6bb8efd0 Merge "Ignore outdent templates at the beginning of comments" 2021-01-04 21:48:27 +00:00
jenkins-bot fa9d729728 Merge "Change which nodes are ignored at the beginning of comments again" 2021-01-04 21:47:40 +00:00
Bartosz Dziewoński 6e37a172ae Fix detecting decorative comment frames with whitespace
As a result of 0fc71f60cd, "empty" text
nodes (containing only whitespace) at the end of the comment may be
inside the comment's range, and trying to ignore them caused the
ranges not to match and the frame not to be detected.

Now the code works whether they're inside the comment's range or not.

Add a test case for wrapped discussion comments with HTML comments and
with whitespace.

Bug: T250126
Bug: T268407
Change-Id: I2217ff5a635fd1c9c9e803f46795b1bfb3d17535
2021-01-04 20:31:33 +01:00