Commit graph

17543 commits

Author SHA1 Message Date
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 35de3aa143 Remove docs that repeat what the code already says
Just reading the method signature gives the exact same
information in these cases. In other words, this code is
able to explain itself.

Change-Id: I04d031f2b24c3b0d21fede2c19c64b54d30b5b0c
2021-06-04 14:00:21 +02: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
jenkins-bot edec0d10ec Merge "Use the edited page's title for magic words in API error messages" 2021-05-26 13:00:14 +00:00
WMDE-Fisch f9c685c6f0 Improve wording around transclusion cancel
Bug: T272355
Change-Id: Id0a622eabdf44965ac6b7648152993777692a4f7
2021-05-26 08:02:11 +00:00
jenkins-bot 3d33b29288 Merge "Don't update backButton visibility if not set" 2021-05-26 07:41:32 +00:00
Translation updater bot e2c4fcf4c9 Localisation updates from https://translatewiki.net.
Change-Id: I26fd7fdf1d943838aa9457b377ba3a062b931731
2021-05-26 09:06:09 +02:00
WMDE-Fisch 98b6cc8bc2 Don't update backButton visibility if not set
Bug: T283511
Change-Id: Idb9668e45c6820cbb631d7a8aac34e03cf788802
2021-05-26 08:47:52 +02:00
jenkins-bot 30bf60cb87 Merge "ArticleTarget: Always set fromEditedState when preloaded is true" 2021-05-25 20:24:29 +00:00
jenkins-bot 09397b5105 Merge "Pass whole context to internal action API requests" 2021-05-25 19:41:35 +00:00
jenkins-bot d06554c81e Merge "Ensure correct classes are added to surfaces" 2021-05-25 19:33:17 +00:00
Bartosz Dziewoński 0154b9a09a Update VE core submodule to master (bc819fdc6)
New changes:
9f22a86f9 Add positions 'inline' and 'below' to ve.ui.ToolbarDialog
bc819fdc6 Fix incomplete ve.Document.getBranchNodeFromOffset() usage

Bug: T279299
Bug: T281788
Change-Id: Ibab7e7e50d6de8ea070a7aa2e0269c53e052f1c1
2021-05-25 20:49:17 +02:00
Translation updater bot 76d961f9ce Localisation updates from https://translatewiki.net.
Change-Id: I60a830547b7fd96d356a5b43fa85d89c52b02d4a
2021-05-25 08:54:40 +02:00
libraryupgrader 0c6f629dbe build: Updating npm dependencies
* hosted-git-info: 3.0.7 → 3.0.8
* hosted-git-info: 2.8.8 → 2.8.9
* hosted-git-info: 2.8.8 → 2.8.9
  * https://npmjs.com/advisories/1677 (CVE-2021-23362)
* browserslist: 4.16.1 → 4.16.6
  * https://npmjs.com/advisories/1747 (CVE-2021-23364)

Change-Id: I04c53361cab2a1c3d13c74572eb9320705cc0b66
2021-05-25 02:25:27 +00:00