Commit graph

16302 commits

Author SHA1 Message Date
jenkins-bot 124ae7a444 Merge "Tag VE edits from the client-side" 2020-02-04 16:43:59 +00:00
Translation updater bot ab357925de Localisation updates from https://translatewiki.net.
Change-Id: Icb65fd5af73dd906f60325851293327c50b0f9f8
2020-02-04 08:34:24 +01:00
jenkins-bot 48da3746f8 Merge "Disallow switching in NWE welcome dialog if VE should be unavailable" 2020-02-03 23:59:10 +00:00
jenkins-bot f7a61e3f42 Merge "Allow switching in welcome dialog on mobile" 2020-02-03 23:57:18 +00:00
James D. Forrester ff95a56c0c Update VE core submodule to master (d930b6581)
New changes:
d930b6581 build: Update all karma-related tools to latest

Bug: T243791
Change-Id: I2616c28c6327921ddd21f0f39b635e0f622a6ecd
2020-02-03 13:09:48 -08:00
Bartosz Dziewoński 06ab627b29 Update VE core submodule to master (daa98ac4e)
New changes:
ab2f2ca1a ve.ce.BranchNode: Detach all children first when calling #detach
dae5a8c7e Localisation updates from https://translatewiki.net.
98e69f146 Remove hack to avoid iOS Safari menu bar area tap stealing

Bug: T206278
Bug: T227628
Change-Id: Id9442f433277bb32b7a581286ab3308bb0b16aae
2020-02-03 19:50:56 +01:00
jenkins-bot cb303c2b65 Merge "Remove hack to avoid iOS Safari menu bar area tap stealing" 2020-02-03 18:46:13 +00:00
jenkins-bot 6cd05e686d Merge "Don't display duplicate protection notices when user can't edit" 2020-02-03 17:33:39 +00:00
Translation updater bot b79f68e762 Localisation updates from https://translatewiki.net.
Change-Id: Idae99750161b4d18014b7af8e538be39f982d0ce
2020-02-03 08:28:47 +01:00
James D. Forrester a318f448e6 Update VE core submodule to master (62458b89d)
New changes:
c5582eab7 Localisation updates from https://translatewiki.net.
33f0680f2 Always use excludeInsertion when translating table selections
6d9d86720 eslint: Use /mediawiki ruleset
48cf4045e ve.dm.SourceConverter: Add a trailing newline to each full paragraph

Bug: T243606
Bug: T243860
Change-Id: Ib2a2025dea1c393e436c0bad1ad42b6aa8a3717e
2020-01-31 17:56:05 -08:00
Bartosz Dziewoński ba3f222e42 Don't display duplicate protection notices when user can't edit
In the core MediaWiki editor, the detailed messages about page
protection are only shown when the user is allowed to edit the page;
otherwise, a generic permission error is shown. Do the same here.

Change-Id: Ia0ca52b9bf556354218b2aa91f141b429b0c5880
2020-01-31 14:55:32 -08:00
Bartosz Dziewoński f525f63b03 Remove hack to avoid iOS Safari menu bar area tap stealing
Explanation of what this code was for: T227628#5339392

As noted on that task, our behavior is actually unintuitive and
distracting, and iOS Safari limitations prevent us from doing it
better.

This reverts commit 600e369347.

Bug: T227628
Change-Id: Id1a5eebd06e4218e3e102165c60791999293d273
2020-01-31 21:22:23 +00:00
jenkins-bot dfb7f7d4a3 Merge "Use autogenerated parameter info for templates without TemplateData" 2020-01-31 21:19:40 +00:00
Máté Szabó ff4f382322 Use autogenerated parameter info for templates without TemplateData
When a template does not have user-provided TemplateData documentation,
the TemplateData API falls back to extracting possible parameters from the raw wikitext
to generate an API response with a list of potential parameters. However, it also
sets the "notemplatedata" field in the response, causing the VisualEditor to think
the response contains no useful information and ignore it. This appears to have been
an unintended side-effect of I97a1bfc9f9ead082a673a91b9d2053630a90309c.

This patch ensures that the VisualEditor will correctly consider such responses from
TemplateData by modifying ve.dm.MWTransclusionModel to check if the response contains
a parameter map. Some unit tests were added for the class to verify this behavior.

Bug: T243868
Change-Id: I72005880d9301a53224473900efe2917379e8708
2020-01-31 13:43:56 +01:00
Translation updater bot e0d7efcef2 Localisation updates from https://translatewiki.net.
Change-Id: I5c1293e09a4a4d33da4620d4ee320be9ae503ea9
2020-01-31 09:54:37 +01:00
David Lynch d85d30f9b3 Tag VE edits from the client-side
This opens up the API so that other tools can use it without being
forced to tag those edits as being from VE.

Also, document that tags is a working parameter that can be passed
through to the edit API.

Bug: T242184
Change-Id: I2c1d0f8d69bc03e5c1877c790247e165f160e966
2020-01-29 21:55:07 -08:00
Thalia cbf259a6ed ApiVisualEditor: Replace calls to deprecated Title methods
Replace Title::userCan with PermissionManager::userCan.

Replace Title::getUserPermissionsErrors with
PermissionManager::getPermissionErrors.

Change-Id: I1afec4ba62185c3cd555a10ae35cef01b7194221
2020-01-29 20:58:19 -08:00
jenkins-bot 4c8c0e0253 Merge "ApiVisualEditor: Refactor edit notice code" 2020-01-29 21:46:00 +00:00
jenkins-bot 430d890cfb Merge "Pass the "count" parameter to 'cascadeprotectedwarning'" 2020-01-29 21:45:34 +00:00
jenkins-bot c72e3fbd48 Merge "Display log entry underneath 'titleprotectedwarning'" 2020-01-29 21:30:11 +00:00
jenkins-bot 9be7403342 Merge "Enable visual diff code on mobile" 2020-01-29 20:32:48 +00:00
jenkins-bot 32b121e221 Merge "ArticleTargetLoader: Fix loading visual diffs when no RESTBase" 2020-01-29 20:29:30 +00:00
Bartosz Dziewoński c1ea108327 Enable visual diff code on mobile
Bug: T242351
Change-Id: I4cf6c9ef846d24847a844d443952c7026fcd306b
2020-01-29 11:15:18 -08:00
Bartosz Dziewoński 4fc5d964db ArticleTargetLoader: Fix loading visual diffs when no RESTBase
When mw.libs.ve.diffLoader#fetchRevision was calling this method, we
were accidentally making no query at all if RESTBase wasn't in use.

Change-Id: Ia98343aa1ba7f4f3be0c1a8ee5864653c429fb82
2020-01-29 11:15:18 -08:00
Translation updater bot 01990fcb4d Localisation updates from https://translatewiki.net.
Change-Id: I92e0f4ed5133d38e2bf96179c0bf5ae50e785b47
2020-01-29 08:19:12 +01:00
Bartosz Dziewoński 5c8d04afdb Disallow switching in NWE welcome dialog if VE should be unavailable
When NWE is enabled but VE is supposed to be unavailable on the page
(e.g. in talk namespaces), do not show the option to switch to VE in
the welcome dialog.

This is relevant if new users use NWE, due to config like below
(we use this on WMF Office wiki):

    $wgDefaultUserOptions['visualeditor-newwikitext'] = true;

Change-Id: Iee8c3d3604a13dcd20efa713e49461ba9b885749
2020-01-28 16:26:03 -08:00
Bartosz Dziewoński 36c2cb90ab Allow switching in welcome dialog on mobile
This code works perfectly on mobile now, I believe change
4fb17205b6 fixed that.

Note that the dialog is currently never shown due to the override
in MobileArticleTarget, but I tested after removing it.

Change-Id: I305a01fc78366a3d2d13662e6d71711864e0dffc
2020-01-28 16:25:53 -08:00
Translation updater bot ff6c7ec702 Localisation updates from https://translatewiki.net.
Change-Id: I7763599de42e8d33c3c0a83f55ce50592e3d0a4b
2020-01-28 08:26:55 +01:00
libraryupgrader 1baeb9ef0c build: Updating composer dependencies
* mediawiki/minus-x: 0.3.2 → 1.0.0
* mediawiki/mediawiki-phan-config: 0.9.0 → 0.9.1

Change-Id: Ibf55f382c586603967da0086f86bfe4924e7cf96
2020-01-26 18:27:39 +00:00
Ed Sanders 62145b11e6 Fix variable scope in ArticleTargetSaver
Also fix docs

Change-Id: Ida47968c995166b1dca36fc9fe28fac374010564
2020-01-24 15:32:46 -08:00
jenkins-bot 2abe5931e9 Merge "Update VE core submodule to master (13a8f4092)" 2020-01-24 22:21:42 +00:00
Translation updater bot 4984b3d7da Localisation updates from https://translatewiki.net.
Change-Id: I0898365c628b60cbd351a806fd0297fe60c0b71f
2020-01-24 08:16:00 +01:00
James D. Forrester e73ecef638 Update VE core submodule to master (13a8f4092)
New changes:
b609a378c Localisation updates from https://translatewiki.net.
908602288 Localisation updates from https://translatewiki.net.
13a8f4092 Update OOUI to v0.36.3

Change-Id: Ib615394fac35a007d98eca80468a256912f0bcce
2020-01-23 16:26:06 -08:00
Translation updater bot ac8dbe8363 Localisation updates from https://translatewiki.net.
Change-Id: Ia2455634fb322b3a30a3b1f416f118b00d0aa447
2020-01-22 08:30:56 +01:00
Translation updater bot 37ba2c223a Localisation updates from https://translatewiki.net.
Change-Id: Ice1e8344729a4a505205ad3c2cea31f00ea7844e
2020-01-21 08:17:20 +01:00
Translation updater bot 22f99583b5 Localisation updates from https://translatewiki.net.
Change-Id: Ie8ff32ca1c0c60536177635c2dac13e2d76a54e9
2020-01-20 08:51:05 +01:00
libraryupgrader 63fa79a946 build: Updating jakub-onderka/php-console-highlighter to 0.4.0
Change-Id: I668a20ccee89a7822d6cb3fe6001d865ee266f0d
2020-01-17 05:29:10 +00:00
Bartosz Dziewoński f708ff907b Update VE core submodule to master (eb68d80cb)
New changes:
d9eb26ac7 Localisation updates from https://translatewiki.net.
c9478e729 Localisation updates from https://translatewiki.net.
b71e36065 build: Upgrade stylelint-config-wikimedia from 0.7.0 to 0.8.0
eb68d80cb ve.ce.Surface: Fix copy-pasting `display: inline` lists into NWE

Bug: T239550
Change-Id: Ib12500c4e9e2a31bba3ea9f19931b211559dc767
2020-01-17 01:28:19 +01:00
Bartosz Dziewoński a9066989f2 ApiVisualEditor: Refactor edit notice code
* Query permission errors for 'edit' and 'create' in the same way,
  and consistently with how MediaWiki core EditPage does it.

* Prefer using Title::getUserPermissionsErrors() instead of custom
  code for user blocks. The result is the same, except for an extra
  line like "You do not have permission to edit this page, for the
  following reason:".

  Note that this loses the 'type' => 'block' property on each notice,
  which was previously used to track when a block notice was shown.
  This was however removed in 96de1353d3,
  and could probably be re-implemented by using the root 'blockinfo'
  property anyway.

* When Title::getUserPermissionsErrors() returns multiple messages
  (for example, you're blocked *and* the page is protected),
  display them all in a list instead of only the first one, using
  OutputPage::formatPermissionsErrorMessage().

  That method returns wikitext, which we have to parse ourselves. This
  is a bit silly, but I found this approach in SpecialChangeContentModel
  in MediaWiki core, so it should be fine.

Change-Id: Ifaf95d8aab836e45665b1fbdf98dd1980a867d8c
2020-01-17 01:18:46 +01:00
Bartosz Dziewoński ac36b242c3 Pass the "count" parameter to 'cascadeprotectedwarning'
It will now correctly say "page" instead of "pages" when there is just one.

Change-Id: I7be6368da977a7eeba976ca63134efce3db1e01a
2020-01-17 01:17:30 +01:00
Bartosz Dziewoński 18c899374b Display log entry underneath 'titleprotectedwarning'
The message ends with "The latest log entry is provided below for
reference:", but we were not providing it. Use the same code as
'protectedpagewarning' and 'semiprotectedpagewarning', which behave
the same.

Change-Id: Ibe5463aa3d93cd1d6d6e3c0b9da82bfa2c813f86
2020-01-17 01:08:12 +01:00
jenkins-bot 523e9379c2 Merge "ApiVisualEditor.php: Add notices also when not blocked" 2020-01-16 23:29:36 +00:00
Translation updater bot 6d5b9c31dd Localisation updates from https://translatewiki.net.
Change-Id: Ia68d5015e3816268fa770270827d1130b53b92f2
2020-01-15 09:54:22 +01:00
Translation updater bot 24480a24bd Localisation updates from https://translatewiki.net.
Change-Id: I4ab6ba49c3319a880c9a8df293c2e1d4cd43afe5
2020-01-14 10:59:54 +01:00
Translation updater bot a335e3acdf Localisation updates from https://translatewiki.net.
Change-Id: I917f992c01e252317149598a1ba30156b113a4a9
2020-01-13 09:12:32 +01:00
Umherirrender a7497703a7 Fix new documentation sniffs
Change-Id: If9fc2d1d29aefdcb61a5f69c28f7d50c86b3ac4a
2020-01-10 16:28:16 -08:00
libraryupgrader 6afa14fe4d build: Updating mediawiki/mediawiki-codesniffer to 29.0.0
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate
* MediaWiki.Commenting.FunctionComment.MissingParamName
* MediaWiki.Commenting.FunctionComment.MissingParamTag

Change-Id: If59d450236a7d1afa3c6a05536abea819535f984
2020-01-10 17:51:43 +00:00
jenkins-bot 9e6a40a827 Merge "Use mw.Api#getErrorMessage instead of custom handling" 2020-01-10 14:22:14 +00:00
Translation updater bot a09935cc41 Localisation updates from https://translatewiki.net.
Change-Id: I281f83f9442ad20b8f2d67dc673c64a509d29181
2020-01-10 08:34:54 +01:00
James D. Forrester 3f9bd6bf54 Update VE core submodule to master (57689b9ed)
New changes:
b90385a44 Update OOUI to v0.36.2
95cf15506 doc: Point to gerrit, not Phabricator Diffusion
57689b9ed doc: Update copyright statement for new year

Change-Id: I3edd80c990101e4ba33163b1da5a45c300654977
2020-01-08 16:45:10 -08:00