Commit graph

5062 commits

Author SHA1 Message Date
jenkins-bot fc9a610c2f Merge "Streamline code dealing with (undeployed) extends attribute" 2024-05-24 10:57:03 +00:00
Subramanya Sastry 3151ad5bfa Match minerva base styles for Parsoid
* The Minerva repository has a ".mw-ref" style which is Cite-specific
  so that makes be wonder if the expectation is for this to be in
  that file instead. That would be a really simple fix and be attached
  to the rule for sup as an extra selector.

* But, it seems like Cite extension is the right place for this.

* Found while trying to test Cite rendering with MFE.

Notes:
* This mirrors the style added in
Ieb91c1251839ff4bb54451aae69af9fb88322219


Change-Id: Iae1d391ef11e53110bfb758d45a0fbdf2addf62e
2024-05-23 23:21:15 +00:00
Translation updater bot 59b733969b Localisation updates from https://translatewiki.net.
Change-Id: Iaac4b948ab0596347cba67c87b32cd32e794db84
2024-05-23 09:26:46 +02:00
Translation updater bot 43a4107713 Localisation updates from https://translatewiki.net.
Change-Id: I65a7865849be27a5834d89af41f9f6de3c416e5b
2024-05-22 09:20:06 +02:00
Translation updater bot 422bd03b74 Localisation updates from https://translatewiki.net.
Change-Id: I010fd555406fe85013cb0bc5d2b68bd88589a430
2024-05-21 09:27:42 +02:00
Translation updater bot 158d5de22a Localisation updates from https://translatewiki.net.
Change-Id: I3247ab4266fff82ce65afa2172445e4d35f52ab2
2024-05-20 09:24:45 +02:00
thiemowmde e4728d7d91 A few tiny code cleanups in the ReferenceStack class
Change-Id: I5feeba61da7e45dad1273cc9eb0b7674fa14e3f0
2024-05-16 14:39:03 +02:00
thiemowmde 5841e03e10 Add missing skip instructions to Gadget integration test
Also simplify the @covers annotations while we are here. The class
is really simple. There isn't much that can be covered acidentally.

Change-Id: I105f4ea6d6beb119d1557a32b691e9eda1b8085c
2024-05-16 14:35:53 +02:00
jenkins-bot 44f0010c07 Merge "Separate names for server-side vs. client-side feature flags" 2024-05-16 12:29:42 +00:00
jenkins-bot 41c6dc4a78 Merge "Remove separate private deferDoc property in ve.dm.MWReferenceModel" 2024-05-15 17:44:57 +00:00
Translation updater bot 6d371918ae Localisation updates from https://translatewiki.net.
Change-Id: Ibb9e3a916f9c0be0c6e3ce2c110a0fe4f16c4559
2024-05-14 09:25:37 +02:00
thiemowmde 6c5c2dc6cb Remove separate private deferDoc property in ve.dm.MWReferenceModel
This is a direct follow-up for what I started in I3c9b9bb. Again all
this does is moving existing code around. The separate this.deferDoc
property is never used anywhere:
https://codesearch.wmcloud.org/search/?q=deferDoc&files=%5C.js%24
Instead I store the deferred function directly in the target property
this.doc and resolve it when needed.

Note that the concept of a parentDoc still exists. I tried to make
this as obvious as possible via comments and by arranging the code
accordingly:
1. A lot of code calls setDocument which directly sets this.doc. The
   parentDoc is never used in this case.
2. The parentDoc is only needed to auto-generate the (empty) document
   for the reference when a new reference is created.

That's also why the existing code always calls the constructor with
the parentDoc, even if this ends being unused in many cases: It's a
simple fallback.

Bug: T363096
Change-Id: I7874f187b2b397ed511b695ca9ff95838fcff302
2024-05-13 22:25:06 +02:00
thiemowmde 81f774c789 Don't call things "attrs" that aren't mw.attrs
mw.attrs does have a special meaning in this code. Together with
mw.body it reflects 1:1 what was written in the original wikitext
in the <ref …> and <references …> tags. Let's avoid using the same
(or almost same) variable name for other kinds of attributes.

Bug: T363096
Change-Id: I3e599ab910b9639e121f9b9d532b0f57f08f1e73
2024-05-13 18:37:17 +02:00
jenkins-bot 0c846421b3 Merge "Consolidate duplicate "is reference list empty" code paths" 2024-05-13 13:28:20 +00:00
jenkins-bot f9ba47d7f0 Merge "Drop separate MWReferenceModel.parentDoc property" 2024-05-13 13:01:26 +00:00
Translation updater bot 7bdfae8d60 Localisation updates from https://translatewiki.net.
Change-Id: Ic3c99c584111742d5692b05575753fa929922677
2024-05-13 09:26:42 +02:00
Translation updater bot 06b4fe15ed Localisation updates from https://translatewiki.net.
Change-Id: I9027b5856d1ecc522919fafa355447d4dfb8d3d4
2024-05-10 09:28:23 +02:00
jenkins-bot 82f4a50031 Merge "Temporarily skip tests incompatible with Citoid" 2024-05-07 16:57:49 +00:00
thiemowmde c921c76dd2 Consolidate duplicate "is reference list empty" code paths
Introduce a static method so we don't need to copy paste code.

Note that the static method still largely duplicates what the method
.buildIndex() will later do. Both loops iterate the reference groups
and the references in each group. The main difference is that the
"is empty" check stops extremely early the moment it finds any
non-empty group.

That's also why I'm convinced it's not worth caching the result.
I benchmarked it and it's nanoseconds. But there are more reasons:

The non-static .isIndexEmpty() method is currently only used when
Citoid is active the same time. Which means the cached result was
entirely unused on installations without Citoid.

Bug: T356871
Change-Id: Id5c4295086bc977ef52ad141be9962d2eecb1bcc
2024-05-07 15:51:12 +02:00
jenkins-bot 2349c3ceec Merge "Use OOUI's native "unselect all" feature" 2024-05-07 12:15:20 +00:00
Adam Wight 9699781545 Temporarily skip tests incompatible with Citoid
Cite tests are blocking Citoid patches, by failing in that
environment.

TODO: To be reverted once the incompatibility is resolved.

Bug: T364382
Change-Id: Ie8eeac79966ccb46389e4f9aaa4620e9bd75cc00
2024-05-07 13:37:25 +02:00
WMDE-Fisch 52b9521dc9 Add tracking for VE Cite re-use interaction
Includes a minor drive by cleanup for an obsolete JSDoc block.

Bug: T362347
Change-Id: Ie4a6ebc5a468c0419001b0170c9cc7e13de616ba
2024-05-07 12:47:37 +02:00
Translation updater bot e464b53470 Localisation updates from https://translatewiki.net.
Change-Id: I826992025a712a7e779f00e5d1c99bb333fa996a
2024-05-07 09:22:19 +02:00
Translation updater bot 48a4eb029e Localisation updates from https://translatewiki.net.
Change-Id: I0db6b2fce7293962a8f715ab746c3a8162a75cc1
2024-05-06 09:25:14 +02:00
Translation updater bot fd85662ab7 Localisation updates from https://translatewiki.net.
Change-Id: I80558444c309afb41efef8cbba144bbd16343a20
2024-05-03 09:28:19 +02:00
thiemowmde a531d4d82d Streamline code dealing with (undeployed) extends attribute
No need to create an expensive model here when all we need is a
single attribute.

Note this code is still behind a feature flag and not running
anywhere, except on the beta cluster.

Bug: T247922
Change-Id: Iea48837213b72a8d0f4b3cc9d9688d9a08315509
2024-05-02 17:13:24 +02:00
Translation updater bot 891a757336 Localisation updates from https://translatewiki.net.
Change-Id: Idc961d822a0c9400475c643c434e410e3af15f37
2024-05-01 09:21:53 +02:00
thiemowmde 790b46d41f Reduce minor code duplication in MWReferenceNode class
Parts of this was already done via I3edf0df.

Change-Id: Id71904ab9387c114b15757d35442e6e6632e87f2
2024-04-30 14:02:43 +02:00
thiemowmde e3fdee52aa Separate names for server-side vs. client-side feature flags
The two are different:

* CiteReferencePreviews as specified in extension.json is a feature
flag that allows us to disable the feature entirely. It could be
named "CiteReferencePreviewsFeature" or "CiteEnableReferencePreviews",
but renaming a feature flag that's already in use is hard.

* The client-side flag tells the JavaScript code "you know what, it
was kind of a mistake you got loaded, please stop". This is because
we can not make all decisions before we register the ResourceLoader
module, e.g. if the user has certain gadgets enabled.

Adding the word "Active" is not a huge improvement, but at least
makes the two different now. Suggestions welcome.

Bug: T362771
Change-Id: I0f6a911df8772616ac50c1301f402f77dbe32089
2024-04-30 11:57:47 +00:00
jenkins-bot 99cb10d28f Merge "[build] Update Cypress to v13.8.1" 2024-04-30 11:35:13 +00:00
WMDE-Fisch df288d828d [build] Update Cypress to v13.8.1
Fixes issues with Chromium browsers.

Change-Id: I7e3582fcafd382ba666241deb02021ad134721e1
2024-04-30 12:54:37 +02:00
jenkins-bot 29e8ba9ea0 Merge "Further delay search index build in ReferenceSearchWidget" 2024-04-30 10:49:17 +00:00
jenkins-bot 74b42ace80 Merge "Make ReferenceSearchWidget code a bit more functional" 2024-04-30 10:49:14 +00:00
jenkins-bot 18635f501d Merge "Unify and streamline code working with mw.attrs" 2024-04-30 10:39:01 +00:00
jenkins-bot a6405f230e Merge "Add safe-guard to ReferenceSearchWidget.buildIndex" 2024-04-30 10:38:09 +00:00
jenkins-bot d777be6c29 Merge "Don't load ReferencePreviews when not enabled in the config" 2024-04-30 10:27:39 +00:00
jenkins-bot 7d3fcb651d Merge "Drop unused setters from MWReferenceModel class" 2024-04-30 09:48:23 +00:00
jenkins-bot 829d68d1ec Merge "Mark private MWReferenceModel setters as such" 2024-04-30 09:21:23 +00:00
WMDE-Fisch f0d7406811 Don't load ReferencePreviews when not enabled in the config
Includes a test and some improvements to the CiteHooks tests.

Change-Id: I0e9108d0d429ed9b7467f993441eefc2557c8e6f
2024-04-30 11:10:22 +02:00
Translation updater bot 1d20ba24f2 Localisation updates from https://translatewiki.net.
Change-Id: Ibc3fabee8b9be9335ea61cf7c03e75c4c4d32097
2024-04-29 09:22:58 +02:00
libraryupgrader 8e8dae4100 build: Updating dependencies
composer:
* php-parallel-lint/php-parallel-lint: 1.3.2 → 1.4.0

npm:
* eslint-config-wikimedia: 0.26.0 → 0.27.0

Change-Id: Icf14934fe507d9e8147657f38fc441c577d6e09b
2024-04-26 11:10:51 -07:00
jenkins-bot a004fbb2f7 Merge "Streamline ReferencePreviewsGadgetsIntegrationTest" 2024-04-26 11:01:40 +00:00
WMDE-Fisch 963933ed33 Streamline ReferencePreviewsGadgetsIntegrationTest
Change-Id: If285c1f6fd8abc95e2f3ad393b443b8e8a5f4837
2024-04-26 12:38:18 +02:00
Translation updater bot b66e355680 Localisation updates from https://translatewiki.net.
Change-Id: Ia236ba4b316761c7e7f485a7352db240571c83d5
2024-04-26 09:47:48 +02:00
WMDE-Fisch 179d402344 Add ReferencePreviews config checks to Cite extension
PHP classes and test are somewhat copies from the Popups codebase.
Some refactoring was applied. More could be done. Not to sure if
this should happen more in follow ups though.

Could also reduce the complexity of checks on the JS side. Most of
these things can only change on page load. The only dynamic part
left is the anon user setting managed by the Popups extension.

Note, that I needed to add a new PHP config for here although the
other still exists and is needed in the Popups extension. This
will change, when the user settings code also moves.

I guess it's okay for now though. Both settings default to true
and are not overridden in the config repos.

Also needed to add the Gadget extension as phan dependency.

Bug: T362771
Depends-On: Ia028c41f8aaa1c522dfc7c372e1ce51e40933a5e
Change-Id: Ie6e8bc706235724494036c7f0d873f5c996c46e6
2024-04-25 12:50:27 +02:00
thiemowmde f61b840dc8 Drop separate MWReferenceModel.parentDoc property
We can re-use the existing this.deferDoc property to achieve the
same. There is apparently no need for a separate "parentDoc"
property for anything else but what can be seen in this patch.

https://codesearch.wmcloud.org/search/?q=%5CbparentDoc%5Cb

And no need to keep neither the parentDoc reference nor deferDoc
callback indefinitely. We can drop it after it got resolved.

This really just moves existing code around without changing
anything.

Bug: T363096
Change-Id: I3c9b9bbdff29a3f35d5a0710b48ca59bf592c6ab
2024-04-24 14:49:05 +02:00
thiemowmde 1391f43d03 Drop unused setters from MWReferenceModel class
These aren't used anywhere:
https://codesearch.wmcloud.org/search/?q=%5Cbset%28ExtendsRef%7CList%28Key%7CGroup%7CIndex%29%29%5Cb
These setters are reaching into internal details that currently
aren't ever modified from outside of the class, and shouldn't.
If it turns out we ever need to modify one of these we can easily
re-introduce setter functions, but probably give them more
meaningful names.

Bug: T363096
Change-Id: I2c9efc114bdc110a29b8d7fb48ea8c1814cdeb21
2024-04-24 14:17:49 +02:00
thiemowmde 14fe315c62 Mark private MWReferenceModel setters as such
This just documents the current status quo. These methods are not
used anywhere, and probably shouldn't:
https://codesearch.wmcloud.org/search/?q=%5Cbset%28ExtendsRef%7CList%28Key%7CGroup%7CIndex%29%29%5Cb
The only place these should ever be called from is from
newFromReferenceNode in the same class.

Bug: T363096
Change-Id: Ic28dbb5cbb2beb98c9fe6d283ed87d879728da0f
2024-04-24 14:16:52 +02:00
Translation updater bot 646f167a2b Localisation updates from https://translatewiki.net.
Change-Id: I26b18de92fee9da0ee746078a90468ffa3b4e0b5
2024-04-24 07:43:01 +00:00
jenkins-bot ca629c3dd1 Merge "Internal config variables renamed from Popups to Cite" 2024-04-22 16:01:31 +00:00