Commit graph

17453 commits

Author SHA1 Message Date
Thiemo Kreuz df419335bb Rename MWTransclusionDialog.setMode() to toggleSidebar()
This reflects better what the method actually does. This patch
is a direct follow-up for the renames started in Ib029fd4.

Change-Id: Ie3e87139a5c2f5ac196e0fcc02fb897fadc99177
2021-06-10 14:05:40 +02:00
WMDE-Fisch ecf317e0bd Fix message keys to show options in template dialog
The names of the messages keys are very confusing. The order was set
wrong during refactoring in Ib029fd48b393d2ab7d7cff6c842789e22989e944.

We should rename the keys in a follow up in sync with translatewiki.

Bug: T284649
Change-Id: I43794d80b7df7d00441cb583ca53bcab03999e65
2021-06-10 10:50:40 +00:00
Translation updater bot e62fe58edc Localisation updates from https://translatewiki.net.
Change-Id: Ic267006bab8209d6a3d823dd424f507edbfca665
2021-06-10 08:35:07 +02:00
Thiemo Kreuz 190237ee28 Rename sidebar state to distinguish from multiple transclusion
This dramatically simplifies the "mode" flag in
MWTransclusionDialog. The main reason to touch this code is:
The flag appears like it will be "single" when the dialog
contains a single template, and "multiple" when there are
multiple templates. But this is not true.

What the flag really does is show/hide the sidebar. The sidebar
is needed to be able to create multi-part templates. But a
dialog that already contains multiple templates can be set to
"single" mode (i.e. the user can collapse the sidebar), and
vice versa.

This patch focuses on private details inside of this class, but
keeps the terminology of a "mode" in some places. E.g. the
messages are not renamed to not cause unnecessary trouble for
translators.

Change-Id: Ib029fd48b393d2ab7d7cff6c842789e22989e944
2021-06-09 09:44:08 +02:00
Translation updater bot 23a3f1f6d2 Localisation updates from https://translatewiki.net.
Change-Id: Ib01be2b16643e1c729a1d526802a79a5956d10f4
2021-06-09 08:29:11 +02:00
jenkins-bot 28256b3ca4 Merge "Support watchlist expiry" 2021-06-08 20:31:30 +00:00
Ed Sanders 857014fae9 Support watchlist expiry
Bug: T251348
Change-Id: I017a54784c758c5e97fb640721bd456adc0fbab5
2021-06-08 20:14:45 +00:00
jenkins-bot eca1ef82f2 Merge "Rewrite MWParameterPlaceholderPage.onParameterChoose() for readability" 2021-06-08 19:35:17 +00:00
jenkins-bot 2b0da3e338 Merge "Update template dialog title when multiple transclusions present" 2021-06-08 08:14:11 +00:00
jenkins-bot 69e17ef432 Merge "ve.dm.MWLanguageVariantNode: Fix "undefined" appearing for some nodes" 2021-06-08 07:15:48 +00:00
Translation updater bot 14acac5558 Localisation updates from https://translatewiki.net.
Change-Id: Ifc3c8b2005958f5283db864560c0070216b53d1b
2021-06-08 08:36:43 +02:00
Thiemo Kreuz b81c18a017 Fix and update documentation in template dialog related code
Some of this was copy-pasted but forgotten.

Change-Id: I08c48e8e0a4cf17ec0888e4ce85427f4da825776
2021-06-07 23:47:23 +00:00
Thiemo Kreuz 7fdc560fb8 Rename "sequence" to "ordered parameter names"
There are 2 methods with the same name, but they are very
different. This makes it much easier to understand the
difference, I hope.

Change-Id: Ie1f049b2b14e1fe23f078e281ee797da29dfe3db
2021-06-07 23:24:17 +00:00
Thiemo Kreuz 6f72b7a391 Move initialization of optional elements into if block
This does have a few advantages:
* Less code is executed and less memory consumed when these
  elements are not needed.
* Code that belongs together is together.
* No local class properties are created when they are not
  needed in the code below.

This patch is kind of a proof of concept. It touches only a few
classes we currently actively work with. If this change is fine
we can change some of the other classes the same way.

Change-Id: I9f548765034f1f69799fff41aeb6c147ff28b82d
2021-06-07 20:53:34 +00:00
James D. Forrester 8fa0781a48 Update VE core submodule to master (3891890c2)
New changes:
a95611236 Set aria-hidden on pasteTarget
3891890c2 Localisation updates from https://translatewiki.net.

Bug: T283853
Change-Id: I9e2f657b8bba82fea0a9b0d97f94aec1849d44a5
2021-06-07 13:13:32 -07:00
Bartosz Dziewoński 90e76e7c52 ve.dm.MWLanguageVariantNode: Fix "undefined" appearing for some nodes
The variable `html` had the value of undefined and was treated as a string.
This would then be displayed on the editing surface.

Change-Id: I4682ea121aa37f06cac41dde618af847586ae01e
2021-06-07 21:34:55 +02:00
Translation updater bot 9a0534894d Localisation updates from https://translatewiki.net.
Change-Id: I992d929b4b31f55fdba4113a7104853b960560a1
2021-06-07 08:43:33 +02:00
jenkins-bot d268ae4e55 Merge "Make .ve-init-mw-target-surface styles not apply to nested non-target surfaces" 2021-06-05 03:31:24 +00:00
jenkins-bot f98d8da688 Merge "Fix adding 've-init-mw-target-surface' class only to main surface" 2021-06-05 03:31:21 +00:00
Bartosz Dziewoński a4cafb1691 Update VE core submodule to master (1f76dea7e)
New changes:
6cde8742e i18n: Rename keys for error messages in rebaser

Local changes:
* Rebaser i18n message renames

Change-Id: I0c2e3a956c81f625822bacd40835dc4fadb57211
2021-06-04 23:53:02 +02:00
Bartosz Dziewoński 9c2c4b82c7 Make .ve-init-mw-target-surface styles not apply to nested non-target surfaces
The class .ve-init-mw-target-surface is used on the same element
as .ve-ui-surface. This element contains surface overlays
.ve-ui-overlay, which can contain other .ve-ui-surface elements
(inside inspectors), which would then erroneously have the target
surface styles applied.

Bug: T284312
Change-Id: I8d20a830dc48f6a098b0f9e9a7c7c1656de0fe56
2021-06-04 20:48:18 +00:00
Bartosz Dziewoński 32ecfe4caf Fix adding 've-init-mw-target-surface' class only to main surface
Bug: T284312
Change-Id: Ic5320f6747907542285674d386c7a59c9e857f0a
2021-06-04 20:48:08 +00:00
Bartosz Dziewoński 6bcf1b9ca5 Update VE core submodule to master (7ab2ebb0f)
New changes:
4a5ebddd8 Localisation updates from https://translatewiki.net.
564cfaa37 Localisation updates from https://translatewiki.net.
1a670fa34 Fix lang list
22d56eb7a Localisation updates from https://translatewiki.net.
73182560c Remove dependency of the model registry from ve.dm.Transaction
058ea2c2c Fix toolbar dialog header collapse when in another dialog
3e88dfab3 i18n: Sort keys

Bug: T283458
Bug: T283598
Change-Id: I6b209d4063db37925dec64415f955a1c9709dfa9
2021-06-04 22:23:05 +02:00
Andrew Kostka 67e48a26ef Update template dialog title when multiple transclusions present
Bug: T276568
Change-Id: I530a6cd8aea4f9fcafe7a03fc5050883f1f4b37c
2021-06-04 16:48:05 +02:00
WMDE-Fisch 9ab43ee145 Fix typos
Missed these and found another one.

Change-Id: Ibc5ad8998e84d2bdffb0b89f8664271665b3b79c
2021-06-04 14:43:23 +02:00
jenkins-bot 69676950b3 Merge "Much longer descriptions of template dialog related classes" 2021-06-04 12:00:46 +00:00
Thiemo Kreuz e13b0dae48 Much longer descriptions of template dialog related classes
The idea is to possibly rename some of these classes, based on
these descriptions. But this should be done in later, separate
patches.

Change-Id: I7f9e5b2382711b434d6dd618489fa3ed8b7a46b4
2021-06-04 13:17:59 +02:00
jenkins-bot df5238cd11 Merge "Fix duplication bug in MWTemplateTitleInputWidget" 2021-06-04 10:50:39 +00:00
Thiemo Kreuz cdafea5663 Rewrite MWParameterPlaceholderPage.onParameterChoose() for readability
The main motivation for this patch is actually the comment. The
so called "spec" contains all parameters that are present in a
template, no matter if they are present in the TemplateData
documentation or not. This is critical here.

Change-Id: I5e1c79e3859a27562a9dea1d450cec196aa572ed
2021-06-04 12:49:53 +02:00
Translation updater bot b1d1f6c2fd Localisation updates from https://translatewiki.net.
Change-Id: If0e649e01dd472f9529043363a44fe5be3ed699c
2021-06-04 08:37:42 +02:00
jenkins-bot bc0f405317 Merge "NWE: Always paste rich text as plain, and show context item to convert" 2021-06-03 18:15:59 +00:00
jenkins-bot 353373cc1b Merge "Fix a series of minor style issues in PHP code" 2021-06-03 16:22:49 +00:00
Thiemo Kreuz ad014c834d Fix a series of minor style issues in PHP code
* Mismatching capitalization.
* Unused pieces of code.
* Properties that can be constants.
* Use $this->getConfig() in special pages.

Change-Id: Ia7e2c438c5ddd3c770070701e4cbdfc79fccf009
2021-06-03 15:55:38 +02:00
Translation updater bot 10c84cbf34 Localisation updates from https://translatewiki.net.
Change-Id: I969f946dcaa771f76cdd829618797c8b329e1772
2021-06-02 14:36:10 +02:00
Adam Wight d4eee82701 Update template dialog titles: Insert/Edit
Toggle depending on whether the transclusion existed or is new.

Bug: T276568
Change-Id: Ib9b76cac7cd57245e8db2ef10879069a86a6269e
2021-06-02 12:36:38 +02:00
jenkins-bot 7fe5b6a433 Merge "Template dialog button title toggles between Insert/Edit" 2021-06-02 10:34:53 +00:00
Adam Wight c49478de60 Template dialog button title toggles between Insert/Edit
Depends on whether this is a new or existing template transclusion.

Split from Ib9b76cac7cd57245e8db2ef10879069a86a6269e

Bug: T276568
Change-Id: I4d22e32fef067b640e9a9389deffaace736c3405
2021-06-02 12:00:15 +02:00
jenkins-bot fa94c27a8d Merge "Change header titles in the template dialog" 2021-06-02 09:05:04 +00:00
WMDE-Fisch 58cf1b0344 Change header titles in the template dialog
Bug: T276568
Change-Id: I5da40032c5b83d04ae92e86372c445d7a28d0444
2021-06-02 08:48:07 +00:00
Translation updater bot 42b9c3b21d Localisation updates from https://translatewiki.net.
Change-Id: I85ea58c251fb06e30033d44dd5a68b1e9c3dcce4
2021-06-01 08:36:49 +02:00
Thiemo Kreuz e97e325ac6 Guarantee exact match when searching for a template
When the existing search results don't contain an exact match
(see previous patch), perform an additional search for the
title. This uses OpenSearch. This is recommended in multiple
places and also used in the quick search field at the top of
MediaWiki.

Again, I came to the conclusion that an isolated unit test
would be complicated and not test much anyway. Better test
on-wiki.

Bug: T274903
Change-Id: Ib575248e089ff66814400202d224deff6369c772
2021-05-31 08:31:49 +00:00
jenkins-bot 4d4e3a077c Merge "Move exact matches to the top in template search" 2021-05-31 08:12:52 +00:00
Thiemo Kreuz 1a37edc53f Move exact matches to the top in template search
This code detects a few edge-cases:

1. When some search results are exact matches, make sure they
are always at the very top.

2. When the prefixsearch API is used, e.g. as a fallback,
redirects show up as a separate metadata structure outside of
the pages array. Consider these and stop if there is already
an exact match.

3. CirrusSearch returns redirects as part of the pages array.
When there is an exact match, make these redirects separate
options and add them to the top.

All of this is case-insensitive, on purpose. In case two
templates with different capitalization exist, we rely on
the backend to return both. The code introduced here is fine
with this.

Notes:
* This doesn't guarantee an exact match is always there. This
  requires an additional HTTP request and is done in the next
  patch.
* I tried to write unit tests for this, but gave up. The setup
  is complicated. An isolated unit test would not test much
  anyway. Better test this on-wiki.

Bug: T274903
Change-Id: I64e1b5633e7b878a4d0d23d66229ca87e69d0045
2021-05-31 09:54:39 +02:00
Translation updater bot f3757befa7 Localisation updates from https://translatewiki.net.
Change-Id: I54df46dce949f7b87de42e6b565e966db5468dd4
2021-05-31 08:33:30 +02:00
jenkins-bot 243701a528 Merge "Show redirects as part of description in template search" 2021-05-28 10:44:29 +00:00
Translation updater bot 4501463edc Localisation updates from https://translatewiki.net.
Change-Id: I200dc14379a07bbe6eadd7b961270f209df4b5e9
2021-05-28 09:08:30 +02:00
Translation updater bot a0d6ce660a Localisation updates from https://translatewiki.net.
Change-Id: Id40992cdf67131ae02a30f15ac1c50c437f5f017
2021-05-27 14:07:41 +02:00
Thiemo Kreuz 621bca1df4 Show redirects as part of description in template search
These are the most minimal (and therefor most stable,
hopefully) hacks I could come up with so far.

Bug: T274903
Change-Id: I28ba414dd34aad756e29400eb656f0942291a923
2021-05-27 12:40:51 +02:00
Translation updater bot 0354c656b7 Localisation updates from https://translatewiki.net.
Change-Id: Ie31b51461b4b5d2949da3a0c351086ca78d4db63
2021-05-27 12:06:35 +02:00
Bartosz Dziewoński d15535b7b6 Update VE core submodule to master (e5759ef32)
New changes:
aea74f1ae ui.actions: Move var statements inline
beb396899 IndentationAction: Refactor case runner
80379d8b2 IndentationAction: Add coverage for slug edge case
8d24c0a82 build: Updating browserslist to 4.16.6
55460cee6 utils: Move var statements inline
8592347e3 ve.ui files: Move var statements inline
ab2cf84d2 IndentationAction: Handle 'increase' when in a slug as well as 'decrease'
0470dddf6 IndentationAction: De-duplicate increase/decrease methods
c16ca4363 IndentationAction: Complete coverage

Change-Id: I95fd8022a07b3c7bec316498e0dc255144e584f1
2021-05-27 00:02:54 +02:00