Commit graph

5210 commits

Author SHA1 Message Date
WMDE-Fisch 70e1f91bc0 Set more methods private in EditPanel class
These are just for internal use.

Bug: T369005
Change-Id: Ia3c6338c79c3ec4144727c841c24ea5066060eed
2024-08-13 20:37:42 +02:00
WMDE-Fisch 3af9dfdb71 Move event handler to the EditPanel class
Making sure that change events form the fields are handled in the
panel and forwarded to the dialog with the information needed.

Also slighly moving some calls in the setup process that inits
the dialog and removing some duplication. Calling focus on the
edit panel only makes sense in the ready step. Not during setup.

Bug: T369005
Change-Id: I4f9a022a06ec6543b106620eae030235b8f6712b
2024-08-13 15:53:24 +02:00
jenkins-bot e163f354a5 Merge "Add method to get the updated ref from the edit panel" 2024-08-13 13:22:15 +00:00
thiemowmde b223649f9d Move existing ReferenceListFormatter code closer together
This moves existing code around a little bit without changing
anything, as proven by the tests.

This is motivated by Iaca0e14.

Change-Id: I30366d32b07f87f238b045f0d7817686b5cc26bd
2024-08-13 12:42:02 +00:00
thiemowmde a4ffedbcc2 Remove not needed int type from ReferenceListFormatter
It's always a string anyway. Also improve the test coverage. The
localization was pretty much untested before.

Change-Id: Ie6f34c67ae7dd9559346eb45a2604e14c5633991
2024-08-13 10:46:52 +02:00
thiemowmde 3cebd437e8 Make use of createNoOpMock in ReferenceListFormatterTest
The main benefit is that this makes it more obvious what is actually
under test, and what's not.

This is mainly motivated by the ongoing work in Iaca0e14.

Change-Id: Icbf1b824ba1f5468dbdb30445134db2b568e19f8
2024-08-13 10:41:04 +02:00
jenkins-bot 17241a296a Merge "Fix typo in closing sup tag in parsoid html in a test" 2024-08-13 07:55:03 +00:00
Translation updater bot 7d7a2469b8
Localisation updates from https://translatewiki.net.
Change-Id: I45f0398a3c72bf8c2d5e48e5f9e40887ac7837e3
2024-08-13 09:50:20 +02:00
Subramanya Sastry e66fedcfbe Fix typo in closing sup tag in parsoid html in a test
Change-Id: I06b827ed4b03216eaf73296739cb428eabe14aae
2024-08-12 16:23:36 -05:00
WMDE-Fisch 48d0699f09 Add method to get the updated ref from the edit panel
That's another step to separate the editing form the dialog. The dialog should not know about internals of the edit panel.

And eventually the dialog can get rid of the referenceModel property.

Bug: T369005
Change-Id: I9cf3a68ef58bc5791497af362c0572734e4bcadd
2024-08-12 18:00:32 +00:00
jenkins-bot d847caf5b8 Merge "Hide main ref warning on orphan refs" 2024-08-12 13:34:09 +00:00
thiemowmde d885a0c6b5 Allow disabling the alternative backlink labels message
The message cite_references_link_many_format_backlink_labels contains
e.g. "a b c …" and so on, to be used as alternative backlink labels
when a single reference is re-used multiple times. The default numeric
rendering is "1.1 1.2 …" and so on.

The two labels end in the message cite_references_link_many_format as
parameters $2 and $3. But only one of the two parameters is ever used.
By default the alternative label in $3 is unused.

This implies that everything about these alternative backlink labels
including the error message is effectively dead code most of the time,
never to be seen on the majority of wikis.

This change makes it possible to disable the message without breaking
anything. Instead the code will silently fallback to the default
behavior of showing the numeric label. This is much more efficient
than rendering possibly hundreds of error messages that never show
up anyhere. The same optimization is already done for the extremely
similar cite_link_label_group-… messages, see
FootnoteMarkFormatter::fetchCustomizedLinkLabel.

This is also partly motivated by T335129 as well as T321217.

Change-Id: Iab818d7db7eddaf7091234f6a22a18cdff70f8e8
2024-08-12 13:36:20 +02:00
jenkins-bot d056400800 Merge "Simplify ErrorReporter mocks in tests" 2024-08-12 09:17:19 +00:00
jenkins-bot e5808ef6fb Merge "Fix missing cursor focus visualization in reference search" 2024-08-12 09:17:18 +00:00
jenkins-bot 4d231c347c Merge "Fix incomplete test setup now that ref items are objects" 2024-08-12 09:02:25 +00:00
jenkins-bot 7955321a2f Merge "Remove unused test setup from ReferenceListFormatterTest" 2024-08-12 09:02:24 +00:00
jenkins-bot f11e415c24 Merge "Remove obsolete disconnect()" 2024-08-12 08:59:34 +00:00
Translation updater bot bde79b6a61
Localisation updates from https://translatewiki.net.
Change-Id: I2b315df554f6a1444e9b3175d0706410893d75ed
2024-08-12 09:22:11 +02:00
libraryupgrader 0ccfdc41e7 build: Updating composer dependencies
* mediawiki/mediawiki-codesniffer: 43.0.0 → 44.0.0
* mediawiki/minus-x: 1.1.1 → 1.1.3

Change-Id: I72a2f4568f516075a4fb713c0718b95f1f212e7c
2024-08-11 03:53:05 +00:00
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
Translation updater bot 70a19357f3
Localisation updates from https://translatewiki.net.
Change-Id: I9f0054a7cee1233669adccbbd9f36b4f1b36fd3a
2024-08-08 09:19:17 +02:00
thiemowmde f3b732bf93 Simplify ErrorReporter mocks in tests
In some tests we want to see the message parameters. But not here.
Simply echoing the message key (thats parameter number one) is
enough.

Change-Id: Id9824cbbe944c84c9fd1932b0863ac1b3f232b75
2024-08-07 18:22:59 +00:00
Translation updater bot e9d8aa1f25
Localisation updates from https://translatewiki.net.
Change-Id: I57fe9d001d75b5caf2499184f74fd4cf5c927eef
2024-08-06 09:46:17 +02:00
thiemowmde e078155e94 Remove unused test setup from ReferenceListFormatterTest
I think this was just a mistake in I5457304 when this test was
written. There was never an ->exists() call in the code, as far as
I can see.

This is motivated by our ongoing, probably year-long efforts to
clean this codebase up, see T335129.

Change-Id: I72d89213c5cff06d78ac119b3c79827afbd0b4f5
2024-08-05 16:25:03 +02:00
Translation updater bot 26d8a80cb5
Localisation updates from https://translatewiki.net.
Change-Id: I1fe4ce3d87042a69ca9eaee30b43a1023acf8f81
2024-08-05 09:24:41 +02:00
WMDE-Fisch 3d0a88c384 Hide main ref warning on orphan refs
Also adding tests.

Bug: T369005
Change-Id: Icb3deaf0c8e14e34bd05455590bd9680a7a5adec
2024-08-02 15:33:44 +02:00
jenkins-bot 0ad0baa001 Merge "Don't use the edit form when reusing a reference" 2024-08-02 10:11:46 +00:00
WMDE-Fisch 6bfe4f1c5d Remove obsolete disconnect()
I could not find any connect() was applied from this codebase to
the SurfaceModel. Looking back it seems that the code that connects
the event was removed in Icba13d84e10cf18a6c68e26448b2efe93b8c42b8
and the disconnect was never touched.

Bug: T369005
Change-Id: Ieab623751dd946ba43c42a1be144e6b3725abce3
2024-08-02 12:00:27 +02:00
Adam Wight 4328a8c9bd Test orphaned subrefs
Change-Id: If3091b5a7e1ac382d95691bade0cfff2d418d270
2024-08-02 08:18:33 +02:00
WMDE-Fisch cc6aec4c77 Don't use the edit form when reusing a reference
There's no need to populate and use the form fields when we're
reusing a reference. The group and content are already stored
in the model and we can insert more directly.

I found that it's also not needed to update the internal item
because we're not changing the content or group. The same is done
in Citoid when reusing a reference.

Bug: T369003
Change-Id: I57315aafb73b0cd68a0d397d2f79833ac54a7c7f
2024-08-01 18:09:07 +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
Translation updater bot 5390af6c37
Localisation updates from https://translatewiki.net.
Change-Id: I4e3c07184856ef853e3aaef690b9f29b59eb1b3a
2024-07-31 09:22:33 +02: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
Translation updater bot 8cfe81657e
Localisation updates from https://translatewiki.net.
Change-Id: Iafeb6359268042d54e8b8d30c76d217738204b20
2024-07-30 09:42:37 +02: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
jenkins-bot 96bba4a1e3 Merge "Add basic QUnit test for MWDocumentReferences" 2024-07-29 07:59:23 +00:00
WMDE-Fisch f9b9c7aa9b Add basic QUnit test for MWDocumentReferences
Change-Id: I40a62ceecc4ab5d0b4b6154bd934ccf4ae6a2774
2024-07-29 09:33:23 +02:00
Translation updater bot d3431d5302
Localisation updates from https://translatewiki.net.
Change-Id: I4d03f63062d35d457acd30f1af446b47531cc158
2024-07-29 09:26:12 +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
jenkins-bot c50282b381 Merge "Switch reuse dialog to use shared numbering mechanism" 2024-07-26 10:06:56 +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
Translation updater bot c29b10683d
Localisation updates from https://translatewiki.net.
Change-Id: Ieb35a338d876deb54874e95d7c0ccc04d02e2e8c
2024-07-26 09:43:38 +02:00
Translation updater bot 886751669f
Localisation updates from https://translatewiki.net.
Change-Id: I605a1e4827c83860d68b727d5167d9350c7e10ce
2024-07-25 09:18:38 +02:00