Commit graph

641 commits

Author SHA1 Message Date
Isabelle Hurbain-Palatin 5c48186329 Replace uses of deprecated ParserOutput::getText()
Bug: T293512
Change-Id: I32ffc6c0e36095fccddde0af988fc692ae530f01
2024-11-21 18:49:12 +01:00
Isabelle Hurbain-Palatin d3f85b16c5 Only display the first occurrence of an error
It can happen that an error is reported multiple times for a given
reference. In this case, we only display one.
We still display different errors if a reference contains multiple
different errors. This behaviour is differs from the legacy parser's
(so, in this case, we add the category
cite-tracking-category-cite-diffing-error), but not from the legacy
parser's desired behaviour, as hinted by the various comments and TODO
in this area.

Bug: T380153
Change-Id: I9b3d5cbd086fc72c66a2afbae8f92297681989ce
2024-11-18 13:54:56 +01:00
jenkins-bot aea41f900f Merge "backlinks.cy.js: Disable flaky test" 2024-11-15 21:20:04 +00:00
Kosta Harlan 724b367f86 backlinks.cy.js: Disable flaky test
Depends-On: I3bacc2aff3d36719133554a8f70d50a3790b84e4
Bug: T368267
Change-Id: I7344e51348f32b2fdf541e59df7e74af85425fa0
2024-11-15 19:24:16 +00:00
C. Scott Ananian 3b58123bfa Re-enable duplicated fragment parsoid tests after parsoid release
Follows-Up: Ibf8656ab344ed79b3740f3b98e96ff4353375b62
Depends-On: Ia201767111872158149ad805f415fe1fbe9fa70e
Depends-On: I3bacc2aff3d36719133554a8f70d50a3790b84e4
Change-Id: I67c84a8d02e0412f0dbb3f2fd37c1430dbf24246
2024-11-15 19:22:24 +00:00
Arlo Breault 396144b402 Update output for Parsoid change
Tests are disabled until the next Parsoid tag.

The rearranged failure looks like it started in
Ifeb3b216e898bec1c3eb5917262820c5809fda45

Needed-By: I9a2f75ea137a8a10842191ad0ea3e92eab41202c
Change-Id: Ibf8656ab344ed79b3740f3b98e96ff4353375b62
2024-11-12 18:20:07 -05:00
Isabelle Hurbain-Palatin dd6587c426 Display Cite error messages in Parsoid
Bug: T372709
Depends-On: Ieed7b5a18f5223c7b8a2918df88790d4dc305f9d
Change-Id: Ifeb3b216e898bec1c3eb5917262820c5809fda45
2024-11-07 13:42:55 +01:00
Arlo Breault 6b156870bd Update knownFailures after normalization in core
A result of I0d56b60abb78e37d539267f744afb52c092cb997

Change-Id: I4523811e0563922e3f2458f2843ba76bcb904390
2024-11-06 18:01:04 -05:00
Arlo Breault 123c6bee9d Re-enable tests after CI dance
"cite_references_link_many" message unconditionally includes an id
attribute, even if empty.

Follows-Up: Iec3c919ed1ea51acef9efabe979bd8d0feaf651a
Depends-On: I3c547f5524530e976eb7aa960751265c8383f7b4
Change-Id: I9d3f660788fab9af7bdc8c1fa093a9a7912da2ad
2024-11-01 15:35:01 -04:00
Arlo Breault 7fdeefede5 Temporarily disable some tests for CI dance
Re-enabled in I9d3f660788fab9af7bdc8c1fa093a9a7912da2ad

Needed-By: I3c547f5524530e976eb7aa960751265c8383f7b4
Change-Id: Iec3c919ed1ea51acef9efabe979bd8d0feaf651a
2024-11-01 15:34:25 -04:00
WMDE-Fisch 4a1e04e7c4 [cypress] Always wait for the Citoid inspector
The application logic is not quite ready even if the inspector is
shown. So we should always wait before clicking there.

Change-Id: If81dfb676b6a25c9eba0711e774ae45b3988bca2
2024-11-01 10:47:55 +01:00
jenkins-bot c9ab25159a Merge "[cypress] Re-enable flaky test" 2024-11-01 09:41:39 +00:00
Adam Wight e4e6b59306 No-op wiring to get ref "extends" into Parsoid
This doesn't change behavior yet, it's pure wiring to make the
attribute available to Parsoid logic.

Bug: T378567
Change-Id: I6182b601f6fee66a9c32d5006d0a36150eb47e7f
2024-10-31 13:20:02 +01:00
Adam Wight 373ed01123 Parsoid wiring for footnote mark formatting
After this patch, Parsoid-rendered pages will include the same
footnote markers as the legacy parser for custom group markers.

The divergent CSS implementation is left intact, for a soft migration.

Bug: T377454
Change-Id: I576dfff4155fb8c2f91ef0d28a65b319aa5bbb07
2024-10-31 11:16:49 +00:00
Adam Wight 1af67c0416 Prematurely move References test to integration
This isn't needed until patch I576dfff415, but is split into a
predecessor to keep the test and logic changes obviously separate.

Bug: T377454
Change-Id: Iff4a96be77af53a71a1ebe179f31bcc214182bfe
2024-10-31 11:16:33 +00:00
Adam Wight 60fbb32c1a Split apart mark formatting into a simpler labeler
The new mark label renderer is a service and can be called from
Parsoid.

Bug: T377454
Change-Id: I6f4983c4288bf29954ad4e5fa3309f9bdf48215d
2024-10-31 11:16:13 +00:00
jenkins-bot 141b18277d Merge "Expose the footnote mark formatter label method" 2024-10-31 10:41:52 +00:00
WMDE-Fisch 442394cec9 [cypress] Re-enable flaky test
Issues should be solved.

Bug: T377666
Change-Id: If43635a7ff035c95394503e7a2da3d9d53aee2cd
2024-10-31 11:16:41 +01:00
WMDE-Fisch 58d1880ae8 [cypress] Streamline the WT2017 tests
Using a bit more methods from the utils to reduce duplication.

Bug: T373787
Change-Id: Iead8ac8ba18370414dda16270c9b26f9c15db743
2024-10-31 07:49:29 +00:00
WMDE-Fisch 5f6403b7bc [cypress] Focus the surface at least once before testing WT2017
Intended as workaround to make sure that the temp account notice is
closed before opening Citoid. But does not hurt in any case I guess.

Bug: T378537
Bug: T378417
Bug: T377666
Change-Id: I4c3bf156cbb7306eda924bcebc2fbed3b5864f8a
2024-10-31 07:49:09 +00:00
Kosta Harlan 5600b1fc47
wt2017Integration.cy.js: Disable flaky test
Bug: T377666
Change-Id: I34de82574e172359a334e8e8c4ef7382a92e5509
2024-10-30 20:05:39 +01:00
Adam Wight 87d1229bf2 Expose the footnote mark formatter label method
Behavior change: previously, an error would be rendered once the
custom markers run out. After this patch there is a graceful fallback
to default group rendering (eg. "lower-greek 1000").
This is a slight improvement, but is user-facing so should be
discussed before merging.

In future work we'll render custom marks programmatically so this edge
case would be unreachable, and since the error message only exists to
nudge editors to extend the custom group symbol sequence, this would
also become wasted effort.

This patch splits out a lower-level method which produces the bare
mark label, with no link or wikitext formatting.  The patch narrows
and simplifies the interface so that the method can be made available
to Parsoid, and will be converted to a service in a separate patch.

Bug: T377454
Change-Id: I719b60b46cdef0be7463d76e9125d75ab4f333ae
2024-10-30 12:14:10 +01:00
jenkins-bot 685fdefd4e Merge "Fix regression to auto-save" 2024-10-29 13:09:52 +00:00
Andre Klapper 41bafe6f2c Use explicit nullable type on parameter arguments (for PHP 8.4)
Implicitly marking parameter $... as nullable is deprecated in PHP
8.4. The explicit nullable type must be used instead.

Bug: T376276
Change-Id: I73a4ce1ecd9b4fe040e5bfd22889e783071fab0d
2024-10-26 14:56:31 +02:00
Adam Wight b3e8737829 Fix regression to auto-save
Cite's MWDocumentReferences included a Document, which caused
auto-save serialization to fail silently on the cyclical reference.

This patch moves the caching to per-instance scope, which was the
better choice to begin with.  The document refs are recalculated after
each change anyway, and caching is only necessary to work around an
awkward control flow in which each ReferenceNode is responsible for
its footnote number.

Bug: T377484
Change-Id: Iebe4befd603fe07d9da2a5bb6126228ec4d5dfea
2024-10-20 11:00:03 +02:00
Umherirrender 411ee7efad Use namespaced classes
Changes to the use statements done automatically via script

Change-Id: I0768f296b528c81edd6bd9ac7d76515b15f3da6f
2024-10-19 23:25:16 +02:00
jenkins-bot ebf38366e7 Merge "Rename internal BOOK_REF_ATTRIBUTE constant" 2024-10-07 12:02:13 +00:00
jenkins-bot 4ad9c4c8eb Merge "Use $this->getServiceContainer() in tests" 2024-10-04 21:54:44 +00:00
jenkins-bot 8f60a489bd Merge "Inject MainConfig services into Cite" 2024-10-04 19:34:11 +00:00
Fomafix 53d8aaa04a Use $this->getServiceContainer() in tests
Change-Id: I80a915e773a087a1fa663e0eebe9f0bab9be6d03
2024-10-04 07:40:44 +00:00
thiemowmde 0ed6cafb3b Use more narrow UserIdentity interface where possible
Change-Id: I766eaa904a9eaeb7ac2a32a98289a364b1c25355
2024-10-02 12:56:28 +02:00
WMDE-Fisch 73917d493b [refactor] Move result items rendering to ReferenceResultWidget
The exact rendering of each item should be part of the widget.
This also allows a better application of the sub-ref indent.

Bug: T375841
Change-Id: Ic2c24f40d59f41b316c6d6f362726c1ee68f2102
2024-09-29 20:06:02 +02:00
Fomafix 521f44ede5 Inject MainConfig services into Cite
Change-Id: I24cc3e4965d4a9fe41dcd799dac4cbce762fb068
2024-09-28 22:01:09 +00:00
jenkins-bot 1fea584fc2 Merge "Cypress: Add test for WT2017 integration" 2024-09-27 08:16:47 +00:00
jenkins-bot 3b197da578 Merge "Use dependency injection for References/RefProcessor" 2024-09-25 17:18:42 +00:00
mareikeheuer 326abf110d Cypress: Add test for WT2017 integration
Add e2e test to verify adding a basic ref and a VE-Cite tool template works with the WT2017 editor

TODO: In follow-up work, streamline Cite and Citoid initialization so
that we don't have to `wait` for partially-wired elements to get
their full behavior.

Bug: T373787
Change-Id: Iea41ce8b71e61d2c9868e50ba680d9c9245bb906
2024-09-24 10:19:50 +02:00
jenkins-bot 3beada9643 Merge "Move Reference Previews user preference into the Cite extension" 2024-09-23 10:47:16 +00:00
C. Scott Ananian 7df30e0651 Use dependency injection for References/RefProcessor
This avoids the use of Parsoid's SiteConfig::getMWConfigValue() method,
which is unnecessary when the extension has direct access to MediaWiki
services itself.

This also fixes the omission of CiteResponsiveReferencesThreshold from
the extension.json.

Change-Id: I01b43136b0827f185523f1318253372b09750de4
2024-09-12 11:57:28 -04:00
Adam Wight c7b60735fe Move Reference Previews user preference into the Cite extension
This seems to play well with Popups with and without
Ie8fa1672b9fd .  However, it's not clear to me why this still works
and even gives priority to the Popups implementation when present,
regardless of the order the extensions are loaded in.  Happily, this
is the desired behavior.

Bug: T363162
Change-Id: Ic479c0a381ee16d1abcecfdd5ee48f0afccc1d3f
2024-09-10 15:33:50 +02:00
Adam Wight 6ea3a8c696 Try to always limit our document references to the current fragment
Reverses the previous logic which traversed up from a fragment to get
the full document's refs.  Much other code in VE isn't ready for this
behavior, for example we can see list-defined refs but not inline refs
defined outside of the fragment.

This patch will ensure that we're only looking at refs accessible from
the current fragment, and prevents caching on fragments because the
cache uses `persistentStorage`, which is shared between fragments and
their parent document.

Bug: T374068
Change-Id: Ia38098f8b3e5a9d24c2206e11edab37d60209225
2024-09-10 12:26:32 +02:00
jenkins-bot e26e726cb0 Merge "[refactor] Rewrite context as service" 2024-09-10 08:27:05 +00:00
jenkins-bot 6203ab3d13 Merge "VE include subref count in warning message" 2024-09-09 12:09:26 +00:00
jenkins-bot 25b71720a4 Merge "[refactor] Renaming some fields in SearchWidget for clarity" 2024-09-09 07:26:57 +00:00
mareikeheuer bdcbcc08f8 VE include subref count in warning message
Include subref count in warning messages in VE editPanel dialog and contextItem

Bug: T373023
Change-Id: Ie7d162c4a2291db441846ec338159e8955c206c2
2024-09-09 09:21:06 +02:00
WMDE-Fisch b5a41a62de [refactor] Renaming some fields in SearchWidget for clarity
Should be a no-op. I checked CodeSearch for other usages but seems
safe so far.

Bug: T370875
Change-Id: I4969e93308735f06be3e344616341c1284157c19
2024-09-09 09:03:11 +02:00
Adam Wight 8e4c83bfc6 [refactor] Rewrite context as service
Puts the ReferencePreviewsContext behind a service to improve
testability.

Bug: T363162
Change-Id: I63aa4144081a2625da1b89f4d56adb612741c8fc
2024-09-06 16:26:20 +02:00
jenkins-bot 2890772a9f Merge "Adding some QUnit tests for MWGroupReferences" 2024-09-04 11:46:11 +00:00
WMDE-Fisch f133ad3ead Adding some QUnit tests for MWGroupReferences
Bug: T373854
Change-Id: Ie1ea1016e6e67429b109989bc7995b6dd532f314
2024-09-03 17:00:01 +02:00
jenkins-bot 52dc522cca Merge "Streamlining the MWReferenceEditPanel QUnit test" 2024-09-03 13:19:54 +00:00
jenkins-bot 0f72ad8b05 Merge "[refactor] Finish decoupling search widget from InternalList" 2024-09-03 12:52:26 +00:00