Commit graph

17411 commits

Author SHA1 Message Date
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
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
Andrew Kostka 2fe6094099 Update the delete button's feature flag in the tranclusion context menu
Bug: T274263
Change-Id: If805ce9dfc44be34e07ec79179837f12898e626e
2021-05-21 09:24:14 +00:00
jenkins-bot 4f0c564fbc Merge "Remove empty translations that cause CI errors" 2021-05-21 09:23:01 +00:00
Thiemo Kreuz (WMDE) dab0f32cef Remove empty translations that cause CI errors
This reverts parts of commit
b72459409c.

Reason for revert: A user emptied several translations,
causing CI errors. The bogus edits are already reverted on
translatewiki.net.

Change-Id: I6600cb901953f99d363e14d2f41978ce9a447658
2021-05-21 11:03:48 +02:00
Translation updater bot 1811893632 Localisation updates from https://translatewiki.net.
Change-Id: Ib05124e2d7e1d387b94227db2e75cd0af7933610
2021-05-21 08:34:55 +02:00
Translation updater bot b72459409c Localisation updates from https://translatewiki.net.
Change-Id: I33b268a7bc43a75eb77455b1d82ae1b83fc6d69b
2021-05-20 09:11:55 +02:00
Translation updater bot ded166fdfd Localisation updates from https://translatewiki.net.
Change-Id: Ib0bf518f5134037f485566f0da86844cc70e94d5
2021-05-19 08:44:42 +02:00
Translation updater bot 04e468e5d3 Localisation updates from https://translatewiki.net.
Change-Id: I1772bfc3d8a05789bf5126180a7a8bd81960c321
2021-05-18 08:48:10 +02:00
jenkins-bot 13f8d7db67 Merge "Remove obsolete vendor prefixed properties" 2021-05-18 01:25:08 +00:00
James D. Forrester cce248ce01 Update VE core submodule to master (0c024f431)
New changes:
5866b762f build: Re-enable Firefox testing
501e8354e ve.dm.Converter: Remove unused branch
84086e60f Localisation updates from https://translatewiki.net.
e1eb88ea2 Unify `list-style` CSS
d8eae968d ve.dm.Converter: Move var declarations inline
a26ff5fa6 ve.ce.Surface: Move var declarations inline
47a2d36f3 Localisation updates from https://translatewiki.net.
cf97b4938 build: Merge eslint main and html tasks back together
381ade44c build: Updating grunt to 1.4.0
d98f7995a Localisation updates from https://translatewiki.net.
c6bc154d2 Check if alien context item is registered before using
e645b06af Localisation updates from https://translatewiki.net.
58830c0dd build: Updating postcss to 8.2.15
f7b193a7e Localisation updates from https://translatewiki.net.
9730bd748 Update OOjs to v6.0.0

Bug: T240955
Bug: T282194
Change-Id: I7a26365a24103ac4e4b1279fda3b74ac6e4a9497
2021-05-17 17:35:37 -07:00
jdlrobson 2a40996cb7 Add mw-body-content to surface element
VisualEditor recreates the mw-body-content element. The element
with mw-parser-output already exists as a child. All skins now
consistently follow this pattern.

To limit the impact to the editor, we use ArticleTarget and add the class
to the surface, which corresponds to the mw-body-content element of a skin.
This avoids unrelated regressions in experiences such as DiscussionTools.

Bug: T283014
Change-Id: I4833d1ca9fda4fc0bd433760e47fe7010f00db05
2021-05-17 19:06:54 +00:00
jenkins-bot a01b56bcf1 Merge "Invert template search result highlighting" 2021-05-17 12:30:49 +00:00
Adam Wight 9cac71676e Invert template search result highlighting
Bug: T275048
Change-Id: I50fc7407b4357e2cea9d5421d0de46a81d39c69d
2021-05-17 14:12:02 +02:00
Andrew Kostka b2aa35a90a Show a warning before resetting the transclusion dialog
Bug: T272355
Change-Id: Id97190a149ed7642eda82300eeee623e0debf528
2021-05-17 13:27:37 +02:00
Adam Wight f444610fbc Support isEmpty on transclusion dialog elements
Returns true if there is no meaningful user input yet.

Will be used in the next patch.

Bug: T272355
Change-Id: I4f88ce31662bbc46755f78d574c46b907581d438
2021-05-17 13:26:11 +02:00
Andrew Kostka b2c9b225bd Add back button to the transclusion dialog
Bug: T272354
Change-Id: I08c4a7db6239b485439bf547e3e8b4d6f7aeede8
2021-05-17 13:18:14 +02:00