Commit graph

17 commits

Author SHA1 Message Date
Ed Sanders 2fcc505d50 Parser: Store timestamp ranges
Change-Id: Ifcbe22011f11f4374f38b7aa346da5a96cac968c
2023-03-28 23:51:17 +00:00
Ed Sanders b82af45735 CommentParser: Output display name if different to username
The only normalisation we apply for comparison is lowercasing.

Change-Id: Id3d57c2066429fcedc7dcc091e74ed46e17060f1
2023-02-23 23:03:32 +00:00
Ed Sanders 2c160ddb72 CommentItem.js: Ensure timestamps are UTC
This will not be the case if we do a full parse in the
client on a non-UTC site.

Change-Id: I226c4f580e60114992bfc06896ef4868e6ea9124
2022-10-10 14:50:02 +01:00
Bartosz Dziewoński 2d3b497a21 Avoid localized digits in internal timestamps in JS
Unlike PHP DateTime, and unlike the .toISOString() method,
the Moment.js .format() method will output localized digits.

Bug: T312828
Change-Id: I49a250b1ad74d9395bf3f994379613cc121b5be4
2022-07-13 02:33:24 +02:00
Bartosz Dziewoński f51d26fd3a Parse 'DiscussionToolsTimestampFormatSwitchTime' config value as UTC
When the input to moment() doesn't define a timezone, it
defaults to the local timezone (as defined on the device,
not in user preferences).

Bug: T312828
Change-Id: I8d2e1c2f6feb5584af4bbf9fef39567eb87780ff
2022-07-12 14:10:09 +02:00
Bartosz Dziewoński 109a50cb34 Truncate timestamps in comment IDs / names
For comments posted on or after 2022-07-12 (configurable), use a
shorter format, identical to the timestamps MediaWiki uses in URLs.

Changing the format for already existing comments would involve
difficult migrations, therefore we elect not to do it.

Bug: T304595
Change-Id: I387051a6a3a1d84cfae45c3e1516db870cc8b977
2022-06-24 00:49:58 +02:00
Ed Sanders 579b8bb1d4 Implement getTimestampString on CommentItem
Change-Id: I1768e9993debe904d6a228942ad0188486d65c0b
2022-03-24 16:49:35 +00:00
Ed Sanders 6af617ef99 CommentItem: Fix typo in documentation
Change-Id: I95fc9f4ca904a9315fc665618085c6c250b21a2e
2022-01-31 17:01:03 +00:00
Ed Sanders be9a9aa2a9 Implement getSubscribableHeading/isSubscribable in JS and use
Bug: T298037
Change-Id: Ifbec49f6da51527f9634fda74b4fb4788a4a015e
2021-12-20 17:29:43 +00:00
Ed Sanders f4c12e120a Define documentable types in eslintrc instead of inline
These types can be passed a parameters to any file without
creating a dependency, so it makes more sense to allow
the globally.

Change-Id: I5504465fd997b46547642e7046993b370b85586e
2021-10-17 14:38:39 +01:00
Bartosz Dziewoński 31f6d44bf6 Move warnings stuff from CommentItem to ThreadItem
After recent changes allowing ThreadItems to have IDs, they can now
also have warnings about duplicate IDs.

Bug: T267035
Change-Id: If3edfe34e6e29741e29fac8946a3c88badc4ab7f
2020-11-02 20:07:23 +00:00
Bartosz Dziewoński 044bc50fb6 Fix some TODOs about test data
We avoided fixing these because it causes changes in just about all of
the test data, which is annoying when reviewing or blaming changes.

But the previous several commits also caused changes in just about all
of the test data, so we might as well do this too.

Change-Id: I83b64d83b6f12c04dc06c0cadff7cdd89417e137
2020-10-22 00:21:04 +00:00
Ed Sanders 5ced26b718 Add content getters to Thread/Comment items
Change-Id: I29cd36eb63bfa00e333efb3c6d7d7e1cdc58cf65
2020-09-12 13:19:36 +01:00
Ed Sanders d36ffeaa3d build: Update eslint-config-wikimedia to 0.17.0
Remove variable shadowing, and fix some documentation.

Change-Id: I08a7cbbdc0a1a409f9c4415b36c62c89535e12eb
2020-08-26 23:46:34 +01:00
Ed Sanders 94511c6bad Add getHeading method to CommentItem
Change-Id: I14ccdbb432e835fe74760a52f07de172df2aba27
2020-07-01 17:21:15 +01:00
Ed Sanders d5376e28fc Improve ThreadItem documentation
Change-Id: Ia266fc22b02af0edbb32f356b4e0d92fe3a4da5f
2020-06-26 14:56:19 +02:00
Ed Sanders 7be0cc3209 Create ThreadItem classes
Change-Id: Id2c5324d74eccb1209ccb76768c557722c6d9400
2020-06-12 20:35:59 +01:00