Commit graph

17477 commits

Author SHA1 Message Date
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
Bartosz Dziewoński 7f1c9ac7c0 Update VE core submodule to master (63e87da8e)
New changes:
e117cd238 Call contextItemFactory.lookup, not contextItemFactory.registry.lookup
2b81a0b7b Deactivate selection on mobile while in read-only mode
e9a8ff887 Actually handle inTargetWidget config

Bug: T281771
Bug: T282194
Bug: T283445
Change-Id: Ied3e94bc3ebd2b390d9832215a94893fce64a5d3
2021-05-24 23:22:06 +02:00
jenkins-bot f40bf5e3df Merge "Don't apply min-height hacks to TargetWidget surfaces" 2021-05-24 21:11:55 +00:00
jenkins-bot 539dc5ddba Merge "Remove unused 'inTargetWidget' config" 2021-05-24 21:11:53 +00:00
Bartosz Dziewoński 34ffaa99de Update VE core submodule to master (f7d2ac280)
New changes:
0d0965b2f ve.dm.Document: Move var declarations inline
eb1fe6cfd ve.dm.TreeModifier: Move var declarations inline
101fa6749 ve.dm.SurfaceFragment: Move var declarations inline
08f379651 ve.dm.Surface: Move var declarations inline
d0ded7f28 ve.ce files: Move var statements inline
453e4ae33 keydownhandlers: Move var statements inline
1d80e69e6 ce.nodes/selections: Move var statements inline

Change-Id: I5bb07a8c0da0b99d09f3c632cf51ba789b005063
2021-05-24 22:27:30 +02:00
Bartosz Dziewoński d84a2b7b69 Update VE core submodule to master (d1af2fd53)
New changes:
adb902514 Localisation updates from https://translatewiki.net.
d1af2fd53 Dist: Update language lists

Change-Id: I7c32537d3387c4d542842d9f10832db774573b6c
2021-05-24 21:56:30 +02:00
jenkins-bot 028658a4e1 Merge "Remove/fix a few small pieces of unused code" 2021-05-24 13:23:53 +00:00
Translation updater bot 31e883c07f Localisation updates from https://translatewiki.net.
Change-Id: I0648c6030d181236092d9e7306da820fe3c03bc5
2021-05-24 09:56:01 +02:00
Ed Sanders a71dd4f797 Ensure correct classes are added to surfaces
* Create getSurfaceClasses method.
* Pass surfaceClasses to target widgets.

This ensures that the 'content' class is passed to mobile
target widgets, and the 'mw-body-content' class is added
in a less hacky way.

Change-Id: Ibce6d1a1d0fda63cca354761f1b91f808858e95b
2021-05-23 20:04:28 +01:00
Bartosz Dziewoński 1f6466e93b Use the edited page's title for magic words in API error messages
Bug: T247661
Depends-On: Ic3d70efc23744ef6e90abc445f3babebf45c4697
Change-Id: I565c5391b0d3f0b5fae2366e06ad5e1a2a18301c
2021-05-21 18:04:01 +02:00
jenkins-bot 1afe7c9b0b Merge "Update VE core submodule to master (0c024f431)" 2021-05-21 15:40:06 +00:00
jenkins-bot 915a39064e Merge "Add star to template search term only when it's possible" 2021-05-21 14:31:23 +00:00
Thiemo Kreuz 8f045a7155 Remove/fix a few small pieces of unused code
I found these thanks to PHPStorm.

Change-Id: Ieb30a95debb58d3a454ac3c6f0546e5dbbe77ed4
2021-05-21 11:43:45 +00:00
Thiemo Kreuz b15455ec3d Fix duplication bug in MWTemplateTitleInputWidget
Template names sometimes show up twice when searching for a
template in the "Add a template" dialog.

This is a bit hard to test. The code responsible for this
is not in a single place. The feature is in the upstream
TitleWidget class. It's not broken. It makes sense to
provide e.g. "foo" and "Foo" as two separate options when
the user typed "foo", but the page is named "Foo". Both are
valid, and the feature allows the user to pick either.

But the VE widget does it's own normalization. Both entries
are normalized to "Foo". Both do the same. The additional
one is pointless.

You can try this on the actual enwiki: Open VE, insert a
template, search for "Template:nHLE".

Change-Id: I65e706c4d131a2f8c605d7979a02ea56f831bf03
2021-05-21 11:43:31 +00:00
jenkins-bot c2b7b7afcb Merge "Update the delete button's feature flag in the tranclusion context menu" 2021-05-21 10:20:44 +00:00
Translation updater bot 873f8203fc Localisation updates from https://translatewiki.net.
Change-Id: Ief871354eb9dd8c7c40cf093c7948dde70bf2288
2021-05-21 12:10:43 +02:00
Thiemo Kreuz b7043d6f24 Fix object vs. array initialization in template search
The "redirects" part in a prefixsearch query is always an
array, no matter if formatversion 1 or 2 is used.

The "pages" part is an object with formatversion 1, and an
array with formatversion 2.

As of now this always uses formatversion 1. This is
hard-coded in the upstream TitleWidget class.

Change-Id: I8cde8e104f8a288015da745db41016f6639b453b
2021-05-21 11:24:48 +02:00