Commit graph

554 commits

Author SHA1 Message Date
thiemowmde fb8494b4dd Relax support for error/warning message keys with dashes
This is a direct follow up for I6f05842 where we already started
supporting dashes, but converted them to underscores. The only change
in this patch is that the CSS class will use the message key as it
is, without the dashes being converted to underscores. I added a test
case specifically for this.

Bug: T352676
Change-Id: Ic22e897c27b8371e3b1ed63932b619e7af71bd5c
2024-08-09 12:29:34 +00:00
Adam Wight 4328a8c9bd Test orphaned subrefs
Change-Id: If3091b5a7e1ac382d95691bade0cfff2d418d270
2024-08-02 08:18:33 +02:00
jenkins-bot 6c508d0c95 Merge "Reading mode square brackets become customizable through CSS" 2024-08-01 12:37:52 +00:00
jenkins-bot 8ef86b2f0f Merge "Rename function to getIndexLabel to clarify that it's presentation" 2024-08-01 06:33:30 +00:00
jenkins-bot a9b8380bcb Merge "Helper function getAllGroupNames" 2024-07-30 12:30:14 +00:00
Adam Wight baedd6c44c Rename function to getIndexLabel to clarify that it's presentation
Bug: T370874
Change-Id: I2e00aca86d2a97f8dff11b742e010ef117b5522a
2024-07-30 12:05:25 +00:00
Adam Wight 06e7dda6a3 Helper function getAllGroupNames
Bug: T370874
Change-Id: I8d61b1ab428ab30e250c8dad05d1b97e15905ed5
2024-07-30 00:00:50 +02:00
jenkins-bot caee02b888 Merge "References always deal with original document" 2024-07-29 21:29:30 +00:00
jenkins-bot 014b0bcffb Merge "Test MWDocumentReferences on subref doc" 2024-07-29 21:29:29 +00:00
jenkins-bot 35b104e292 Merge "Move more editing methods to the EditPanel" 2024-07-29 13:52:07 +00:00
Adam Wight 3e2d060037 References always deal with original document
Singleton always steps up to the original document from fragments, to
give absolute numbering.

Bug: T370874
Change-Id: I0353649289f6c8fe26fa6bdff5d2367b7b575bac
2024-07-29 11:45:24 +02:00
Adam Wight c54000ed86 Test MWDocumentReferences on subref doc
Change-Id: I8fb9bee9f0f1447b38d6d67033c42c05934d1e12
2024-07-29 11:45:24 +02:00
WMDE-Fisch f9b9c7aa9b Add basic QUnit test for MWDocumentReferences
Change-Id: I40a62ceecc4ab5d0b4b6154bd934ccf4ae6a2774
2024-07-29 09:33:23 +02:00
WMDE-Fisch 8b60ead109 Move more editing methods to the EditPanel
Mainly leaving out the event handling for the change detection to
still keep it simple.

Also the data flow back for editing the content is still somewhat
opaque because the relevant data is passed by reference. I might
change that in follow up patches so it's more clear.

Bug: T369005
Change-Id: I93b62791ef10bf318697905af8a0c5b5d438fdb5
2024-07-26 17:45:23 +00:00
Adam Wight 257b3f3816 Switch reuse dialog to use shared numbering mechanism
This patch gives us the same number as will appear in the document,
even when subrefs are present.

Tests could be improved using sinon to check some call assertions
but should be fine for now.

Removed the test for placeholders, because these should be filtered
in MWDocumentReferences.getGroupRefsByParents()

Bug: T370874
Change-Id: I7543a6593308c529bcfbeb0835a7c0882cbf8621
2024-07-26 09:44:36 +02:00
Adam Wight 8aa889dbe6 VE square brackets appear in a span
Some wikis such as eswiki and frwiki prefer to hide the square
brackets by default.  Adding a selector-friendly DOM element around
the brackets supports this customization.

This makes it possible to hide the brackets with CSS:

  .cite-bracket {
    display: none;
  }

And it also becomes possible to hide the brackets but make them
appear in copy-pasted article content:

  .cite-bracket {
    font-size: 0;
  }

Bug: T370512
Depends-On: I56b52c399d2c76689fdcb0bc7fd50a8c0ced28fd
Change-Id: Id8684ccee2e6725af2c861da20fc31af1067e614
2024-07-24 12:31:00 +02:00
Adam Wight 525b7ab876 Reading mode square brackets become customizable through CSS
Now the brackets can be hidden with `display: none;` or made
invisible but appear in copy-pasted content with `font-size: 0;`.

Bug: T370512
Change-Id: I21accb6bf9cdd7f96144cc9a762ff889e48efca4
2024-07-24 12:14:07 +02:00
jenkins-bot e5b4d9edfb Merge "Introduce MWReferenceEditPanel to extract editing UI" 2024-07-22 10:08:34 +00:00
jenkins-bot 033045c99b Merge "Drop redundant fallbacks from parsoid-styles directory" 2024-07-22 09:59:49 +00:00
Umherirrender f58114be65 tests: Use LanguageFactory to create qqx language
Bug: T343771
Change-Id: Ib7ec113a21fd36a82c0345ffb98ed8692d82155d
2024-07-20 21:40:18 +02:00
thiemowmde 5ef0ccdaa6 Drop redundant fallbacks from parsoid-styles directory
These .less files are pointless because these languages have
fallbacks, and the .less file for the fallback is identical. The
behavior on the cluster will not change when we remove these
files. Another file with the same rules will be loaded instead.

I made this patch algorithmically by writing a piece of code that
iterates all existing .less files, checks if the language does
have fallbacks, and if one of the fallback .less files is
identical.

I also updated the existing test case to reflect what's going on.

Change-Id: Iab647956f7bf45e59da1af33ff2b3e81ad016b4c
2024-07-19 15:00:01 +02:00
WMDE-Fisch 36d9270c1c Introduce MWReferenceEditPanel to extract editing UI
First step to move the UI parts that are relevant for creating,
editing (and extending) a reference to it's own class.

There remains some duplication because of the sub-referencing in
Citoid currently depending on the static properties to build its
own editing interface.

More patches follow, I just wanted to keep it small for reviewers.

Bug: T369005
Change-Id: I8588cde1a54cd505a57a36ed97fc591653c9fb6f
2024-07-18 14:46:23 +02:00
jenkins-bot 9d4050b1e0 Merge "Use MainConfigNames constants in tests where possible" 2024-07-18 12:16:12 +00:00
jenkins-bot ae776a32ce Merge "Rename ReferencePreviews i18n keys from Popups" 2024-07-18 12:16:10 +00:00
jenkins-bot 66603a01df Merge "Rename all remaining .css files to .less" 2024-07-18 12:09:10 +00:00
WMDE-Fisch c87e6046ff Rename ReferencePreviews i18n keys from Popups
Final step to get the i18n key names align with this extension.

Note that the few community overrides should have a copy of the
keys we're changing here in place so the overrides work for both
variants as long as the deployment is not finished.

Bug: T363156
Change-Id: Idf098d2cb04e8f02247b78e6b4866338eaf02b44
2024-07-18 11:47:14 +00:00
WMDE-Fisch c732ee1e96 Cypress: selecting the reuse tab is fragile
Similar to Ie79be1dbc1b7469cffc380478cf2d24bbe06f470

Change-Id: I8ea8951629ec7545261752a4e5f4f4db2ae60b41
2024-07-16 15:02:29 +02:00
thiemowmde 6dc56deebd Rename all remaining .css files to .less
Change-Id: Ib41cad1e14243577c0a78becb2bc5cb6a50afa5d
2024-07-15 21:59:02 +02:00
Adam Wight 5b2cbc48bd Wire subref counting into the numbering renderer
Significant change is that footnote marker numbers are changed from
being a CSS-rendered marker to using the rendered "fallback" text.
This could be avoided using the same trick as is implemented for the
reflist: send an inline style variable with the marker content; but
let's only do this if really necessary for user experience.

Template-produced refs are still wrong, but this patch continues to
render them as they come from Parsoid, in the content script.

TODO in later patches:
* reuse of a subref is rendered as '3.2.1' in reader view but '3.0'
and '3.1' in the editor.
* subref numbering is backwards in RTL languages

Bug: T247921
Change-Id: Ieff73769f8ebbc3724f6a9b498487c4e7d09aa2e
2024-07-15 07:08:06 +00:00
David Lynch 68a3eb496e Cypress: selecting the manual tab is fragile
A change to the citoid error message referencing the manual tab is
breaking this test.

Bug: T364595
Change-Id: Ie79be1dbc1b7469cffc380478cf2d24bbe06f470
2024-07-11 11:59:39 -05:00
thiemowmde 4d8ec5ebc5 Use MainConfigNames constants in tests where possible
I believe this makes the code less brittle, and also makes it a bit
more obvious what these strings are meant to represent.

Change-Id: I0c5cdaa0b94b525ad3e65278ca9bf088f480df40
2024-07-10 12:44:36 +02:00
Arlo Breault c44eaf6f96 Re-enable linting tests post-sync
Depends-On: Ibc421e4c2e339133f5f8879517cc22c8ce58c502
Change-Id: Ibaac02cc51787ae3b26a2be23c7d00bcf38ecf5f
2024-07-05 12:58:09 -04:00
Arlo Breault d9351bc0f4 Disable linting tests temporarily for cross repo sync
Change-Id: Ibaef82dc9c72d290c2f92f03cf518b413a77f8ad
2024-07-05 12:55:29 -04:00
thiemowmde 1aeac001fe Additional parser test cases for delayed extends usage
We want it to be possible to turn a <ref> into an extended one after
it was re-used for the first time, not knowing if it later turns out
to be an extended ref.

This should work: <ref name=x/> is a short re-use of a ref that later
turns out to be a <ref extends=… name=x>…</ref>.

<ref name=x></ref> is just another syntax that should behave
identical.

However, it should probably not be possible to turn
<ref name=x>foo</ref> into a subref later because it really, really
looks like a normal ref. Even if the content matches with a later
<ref extends=… name=x>foo</ref> and we usually ignore identical
content, I suggest to block this with a dedicated error message. But
this is for a later patch. This patch here just documents the status
quo.

This patch also contains minor code cleanups that will be useful in
Ia752a7d.

Bug: T367749
Change-Id: Ie38769b36e5c476b96e7af7f03b0fc800b32ba97
2024-07-05 13:08:23 +02:00
jenkins-bot 8a6993ccd9 Merge "Use slightly narrower interfaces in a few places" 2024-07-05 10:58:42 +00:00
jenkins-bot 1f4175593b Merge "Display extends warning message when editing a reference" 2024-07-05 10:55:58 +00:00
jenkins-bot 0122adb8ba Merge "Extract some methods around the reference insert/update workflow" 2024-07-05 10:55:57 +00:00
jenkins-bot c5a9012b67 Merge "Replace "shield" hack in MWReferenceResultWidget with CSS" 2024-07-04 07:38:00 +00:00
mareikeheuer 2ffbf1fa66 Display extends warning message when editing a reference
MVP implementation for adding a warning when editing a reference
that's the extension of another. In the current approach we're
just using the elements .text() like we do when you create an
extended reference.

Bug: T247922
Change-Id: I2fc574152059937b4aa3fc25ee486d363cc809d5
2024-07-03 07:18:35 +02:00
WMDE-Fisch b483c829ab Extract some methods around the reference insert/update workflow
Includes renaming the method so it's more clear what it's doing.

As preparation for adding the extends warning to the edit pane and
to allow easier identification of parts belonging to the edit
workflow.

Change-Id: If84c5dbdee19c0ebc0a28b50dda93fef3f558c6e
2024-07-02 12:30:11 +02:00
WMDE-Fisch ccf3809413 Re-enable disabled ReferencePreviews Qunit test
I could just remove the getElementById replacement that was
failing the tests. In the Popups extension there really is a
renderer test that mocks this function call but that test is not
part of this file.

Also it seems that tracking is never triggered here. I think that
the beacon overwrite was only added to avoid tracking.

See I2638611ba67b785338f7e98a1c4b08a5e829812d

Change-Id: Ic3540f6f73783e79c81e2b693d2bf96cfc7fc66b
2024-07-01 18:32:13 +02:00
WMDE-Fisch af3f14d430 [Cypress] Always provide ref templates to fix Citoid
The Citoid dialog won't be available when the .json configuration
is missing. That's why test always failed here when triggered
from the Citoid CI.

Bug: T366383
Change-Id: I88ad478250328896c504ccbc95a973d4a0100dd7
2024-06-27 17:05:35 +00:00
WMDE-Fisch 5fcc9dab86 [Cypress] Fix VE save
In some cases the click on the save button did not trigger the
save dialog. After playing around with this, it seems that the
only thing helping here is a little pause.

Even if we wait for the button to change the state to `enabled`
the click sometimes does not trigger the dialog.

Bug: T366383
Change-Id: I2754fd5a0e9b439e9e0378f3597f67e743a6d0c1
2024-06-27 19:01:44 +02:00
WMDE-Fisch bcc109f943 [Cypress] Re-enable skipped backlinks test
I could identify and fix the issue in

I3224c6131a6e959821bc36e4525889e5088777a2

stress test run fine see

I8e38e8cc533065998f91794a9e490d38d77ad21a

Bug: T368267
Change-Id: Ib7db6c39988ef45404817b8c7a68132572f16e36
2024-06-26 11:59:56 +02:00
WMDE-Fisch 4f7b5b2d60 [Cypress] Fix module wait
This was never working it seems. The result of the check needs to
be wrapped in an expect() call.

Bug: T368267
Change-Id: I3224c6131a6e959821bc36e4525889e5088777a2
2024-06-26 09:01:31 +02:00
Kosta Harlan c51dc6e280
cypress: Disable flaky backlinks.cy.js test
Bug: T368267
Change-Id: I469c5d63d2db09c691b49a83200fcf39e0f2ac4a
2024-06-24 15:23:11 +02:00
thiemowmde ec9c8bda00 Use slightly narrower interfaces in a few places
The idea is to make the code less ambiguous and easier to predict.
We passed the same information around two times in a few places.

Change-Id: I39c7a2962bb70bbe40074986e63b1051d0766ea2
2024-06-24 08:07:19 +00:00
Ed Sanders 66fb3e661a Fix some documentation warnings
Change-Id: I7a97c99a919796f987a05ba17e25357fb5ef14c5
2024-06-21 18:00:45 +01:00
thiemowmde bc7f1a7005 Replace "shield" hack in MWReferenceResultWidget with CSS
Same as in I7e82e03. The extra "shield" element was added in
2013 (!), see Ib244ff6. Back then we couldn't use the CSS property.
But nowadays we can.

Bug: T360034
Bug: T367030
Change-Id: Ib41e062491e65eabc8a52facefe283ba04ce16ff
2024-06-18 12:06:37 +00:00
WMDE-Fisch aa5368ad32 Use full listKey for extends in the model
This makes it much easier to deal with the internal auto names
used on new elements created during one edit session.

We're ignoring the correct generation of the auto name literals
for now.

Bug: T367031
Bug: T367030
Change-Id: Idd579970cb64500dac27053213e9b116f23b6d76
2024-06-14 14:03:07 +02:00