Commit graph

2606 commits

Author SHA1 Message Date
jenkins-bot 54cae18fb8 Merge "Update messages when becoming logged-in/logged-out for IP masking" 2023-08-30 13:37:00 +00:00
jenkins-bot 69c37c9863 Merge "Fix showing temp user popup after page reload" 2023-08-30 13:32:37 +00:00
jenkins-bot 4e9baea69a Merge "Acquire a temporary user username before previewing" 2023-08-30 13:20:46 +00:00
Bartosz Dziewoński cc2b4e27d8 Fix showing temp user popup after page reload
I apparently forgot to pass the parameter to fireHookOnPageReload()
that I introduced exactly for this purpose. As a result, the basic
post-edit popup appeared, but the temp user popup did not.

Also rearrange code so that fireHookOnPageReload() is still called if
we need to redirect to complete creation of the temp user.

Bug: T344879
Change-Id: I36c64f27d2b8866ca88642621a135e7e25a91ce1
2023-08-24 16:09:12 +00:00
Bartosz Dziewoński 59a665c424 Acquire a temporary user username before previewing
Abortable promises are definitely among my least favorite things.
It takes all of this bookkeeping to make .abort() work consistently
(so that it always aborts a request if one is in flight, and always
causes the final promise to be rejected even if we didn't start a
request yet or it has already finished). But, if you squint and ignore
every line with the word "abort", it's like a normal promise chain.

Depends-On: Iec8a15dadd595bed0f7e54f907fbb8e192b45cf3
Bug: T331397
Change-Id: I67309c79e6d211d69630fe89cbf5402f8fbd350c
2023-08-22 23:40:55 +02:00
Ed Sanders 3ece481e71 Implement add a reference edit check
Change-Id: I4cebc5bbaa34300d1c5bb5fde8277269b14779c9
2023-08-16 17:19:28 +01:00
David Lynch 228596cba0 Add a Process to the save workflow
A new hook `ve.preSaveProcess` is triggered to give other code the
chance to add steps to the process. The save dialog won't show until
the process completes. A step can be failed to return to normal
editing.

Change-Id: Id0740ff58ba9d9519c81174100ef1b8f8740870b
2023-08-16 15:59:04 +01:00
Bartosz Dziewoński 9dd85ee26f Update messages when becoming logged-in/logged-out for IP masking
See T343848 for discussion about the phrasing.

Bug: T343848
Change-Id: I15628492fd2ff7ba93f91d3eeefa4b65ca313ca5
2023-08-14 23:37:04 +02:00
Bartosz Dziewoński 870841b407 ArticleTarget: Remove misleading error message on 'badtoken' errors
This method was only called, and the message was only shown, when
retrying after the first 'badtoken' error and refreshing the token
fails again.

If this happens, it usually indicates some terrible problem with
the wiki, and it is not something that can be fixed by logging in
again (or anything else the user can do).

Let the default API error message appear ("Invalid CSRF token.").
While not very helpful to the user, it should be more helpful to
the site administrator trying to unbreak their wiki.

Remove the "visualeditor-savedialog-identify-trylogin" message.
Keep "visualeditor-savedialog-error-badtoken", which is re-used
in another error message. I'll fix that separately.

Change-Id: Ib680218bce5ae38aa52d7d941218a6410ab7e09e
2023-08-14 19:58:26 +02:00
Bartosz Dziewoński 4bb8d8f8ea ArticleTarget: Remove unused retrying support
This has not been used for many, many years, since we started using
mw.Api#postWithToken, which automatically retries on 'badtoken' errors.
Most of our code for it was removed (e.g. save() is never called
with three parameters), but some comments and parameters remained.

Change-Id: Ibca2a222f808e6e2796ed6a61e9587a646afcf31
2023-08-14 19:58:26 +02:00
Bartosz Dziewoński 46f661ac66 ArticleTarget: Remove duplicate error codes when logging
Occasionally we end up logging error codes like
"abusefilter-disallowed,abusefilter-disallowed,abusefilter-warning"
when someone hits a bunch of different filtes.

Change-Id: I967d374d13473ca684412b380d732653a3ceaff3
2023-08-14 19:58:26 +02:00
Ed Sanders 85d584930f Simplify definition of textStyle group in toolbar
This makes it easier for 3rd parties to insert extra tools
in sensible places.

Change-Id: I6c8d0c96f53655d8f9ae9f01e5d0e1a1678d29a1
Depends-On: Ib8882fa6319915d291b345a69ab95f362739ad7b
2023-07-31 11:06:18 +00:00
James D. Forrester 325ca8a40a build: Upgrade stylelint-config-wikimedia from 0.15.0 to 0.16.0
Change-Id: I993074948832a50997255bd413192c8fdeaf9edb
2023-07-14 13:02:49 -04:00
jenkins-bot 82f72cfeda Merge "Merge mobile and desktop save buttons" 2023-07-11 21:34:17 +00:00
jenkins-bot 7ae61934a3 Merge "Remove remains of lossy-switching and discard-switching" 2023-07-11 15:34:52 +00:00
jenkins-bot 5574237f47 Merge "Support '&editintro=…' etc. on subsequent loads via page tabs" 2023-07-11 15:33:30 +00:00
jenkins-bot c4fb50b59f Merge "Support '&editintro=…' etc. on back/forward and VE/NWE switch" 2023-07-11 15:33:26 +00:00
jenkins-bot 93427a6708 Merge "Reload page or redirect when saving an edit creates a temp account" 2023-07-11 15:16:56 +00:00
Bartosz Dziewoński 0dddd98b5f Reload page or redirect when saving an edit creates a temp account
Depends-On: I6cdc014fb39d35ce1f091b53dc3a9c4a3c95f9e9
Bug: T338002
Change-Id: I01e13ce1ebab462eeb0ba3847d4205a88965a127
2023-07-10 19:33:16 +02:00
Ed Sanders 4f90ce2594 Merge mobile and desktop save buttons
Use toolbar groups where appropriate.

Change-Id: If4e0d157f04ba741ed4cf891e4183fe351d537b8
2023-07-10 17:06:58 +01:00
jenkins-bot 76ed447217 Merge "Convert MWPopupTool into MWHelpListToolGroup" 2023-07-08 00:19:14 +00:00
jenkins-bot 329faab1e9 Merge "MobileArticleTarget teardown behavior is upstreamed to MobileFrontend" 2023-07-07 23:49:57 +00:00
Ed Sanders d7d344035c Add tag when content added, according to EditCheck heuristic
Bug: T333714
Change-Id: Id806e6d4d856aead4af98d43078c534d4d46c7f0
2023-07-03 14:43:14 +01:00
Ed Sanders ea03287908 Convert MWPopupTool into MWHelpListToolGroup
The popup contains three buttons, one of which already exists
in core as a tool. By converting them all to tools we can reduce
some duplication, and better integrate with other features
that use the tool factory, such as HelpCompletionAction.

Bug: T339153
Change-Id: I81d217bc1ab9a1a6a9bf7c7ad588c2a3216b10db
2023-07-01 11:10:53 +01:00
jenkins-bot 1d6a748fed Merge "Revert "Revert "Targets: Use align:'after' instead of actionGroups""" 2023-06-30 18:05:44 +00:00
jenkins-bot 19904571b8 Merge "Replace ve-ce-surface-enabled with ve-ce-surface" 2023-06-29 19:32:36 +00:00
Bartosz Dziewoński bbda4fc160 Revert "Revert "Targets: Use align:'after' instead of actionGroups""
This reverts commit e2b5e2a1bb.
It should be safe to re-attempt this now.

Bug: T339317
Change-Id: Ia4ebb11ca162a4e6d985076ea2d2dd914d04fc1d
2023-06-29 18:17:01 +00:00
Ed Sanders d857750e12 Make better use of toolbar groups
Bug: T340751
Depends-On: Ie7ca24cbcd95baa082b3b1cb907354f6da21d93c
Change-Id: Ibcc81c90bc9ba6c5fd012c512daf861973b03b2e
2023-06-29 16:58:38 +00:00
David Lynch 14b32181ea MobileArticleTarget teardown behavior is upstreamed to MobileFrontend
Bug: T334263
Depends-On: If1ad6e88cf595ef3d3e54d41c00f0b79704be043
Change-Id: Idb95bfd2b71f5967396a1f36636b0a155dec2fb2
2023-06-29 09:54:03 -05:00
jenkins-bot 312b1c08ec Merge "Unwrap headings in lists (and <blockquote>) when pasting external HTML" 2023-06-27 18:18:16 +00:00
Bartosz Dziewoński 34c6d3e1a3 Remove remains of lossy-switching and discard-switching
After the demise of RESTBase we are always able to switch from
wikitext to visual mode with changes, and we no longer need to
support these two poor experiences.

Bug: T339871
Bug: T339872
Change-Id: I2be4068447b21e16c87db0e56d6422ea64ba4708
2023-06-25 09:16:45 +00:00
Bartosz Dziewoński 5a792b6558 ApiVisualEditorEdit: Allow not returning the new revision content
Sometimes we call this API and then reload the page (or navigate to
another URL), without using the page content it returns. Save some
work and some data transfer and don't generate it in those cases.

Change-Id: Ic5fac61f3ef9b2dfce6ff757f1d414a9f41f217d
2023-06-22 21:08:15 +00:00
jenkins-bot 68265fcd14 Merge "Use new helpers to show the post-edit message" 2023-06-22 15:33:28 +00:00
Ed Sanders 94fb927242 Replace ve-ce-surface-enabled with ve-ce-surface
The former is deprecated, and not required here.

Bug: T340124
Change-Id: I874b40bd8288763aeba8946ce40cecfd27e47c1b
2023-06-22 16:26:47 +01:00
Bartosz Dziewoński dd509c1072 Use new helpers to show the post-edit message
Undo some changes from 95454e710f1b619f7c538bc1dc88f238409719ca,
as this functionality is now provided by the core code.

Depends-On: I1c9020b2efb2785279f5c09539a49208a310ccf7
Depends-On: Ifeffcf214719f0d5c1371dc7d51a410fb313c978
Bug: T338003
Change-Id: I90a618897699c844f9c558bbeb4d1563f8050fe3
2023-06-22 13:51:59 +00:00
Bartosz Dziewoński ac8f8791f1 Don't show edit notices popup after switching VE/NWE
The user has already seen the notices, and getting hit with yet
another popup doesn't feel nice.

Bug: T169179
Change-Id: I421e42d32cb67ea210644b705e9c6e5af74e75ee
2023-06-22 13:42:25 +00:00
Bartosz Dziewoński eedafae69e Support '&editintro=…' etc. on subsequent loads via page tabs
Before this change DesktopArticleTarget's history management was not
working correctly because .currentUrl was not being updated on every
activation, and we worked around this problem by activating it in a
different way on subsequent loads in DesktopArticleTarget.init.

Fix the first bug by updating .currentUrl whenever we activate it,
and remove the guards around the normal way of activating it, which
fixes the parsing of 'editintro' parameter.

Bug: T56029
Change-Id: Ifd6af60cdf1d2c87536017b316ab8da1f5133400
2023-06-21 13:35:43 +00:00
Bartosz Dziewoński bcabb774ab Support '&editintro=…' etc. on back/forward and VE/NWE switch
The edit intro message is now shown again when closing/opening
the editor using the back/forward browser navigation,
and it is preserved when switching between VE and NWE.

Bug: T56029
Change-Id: I12083926341a6d3ba4c7a9f84736cddc7f2ac0fa
2023-06-21 15:35:06 +02:00
Bartosz Dziewoński 3008aaf325 ArticleTarget: Simplify switching to NWE with no changes
This code was identical to what happens if you just call
reloadSurface(), except for some half-hearted error handling.
We already do it this way when switching from NWE to VE.

Change-Id: I8027680b7ca272930b951d0403594679ef308083
2023-06-21 15:07:47 +02:00
jenkins-bot d5e4ead3c7 Merge "Revert "Targets: Use align:'after' instead of actionGroups"" 2023-06-15 20:30:32 +00:00
Bartosz Dziewoński e2b5e2a1bb Revert "Targets: Use align:'after' instead of actionGroups"
This reverts commit 45a60e3fb2.

Bug: T339292
Change-Id: Ifefdf36370ff0de87218f390e5e21d2800a81ebd
2023-06-15 20:06:21 +00:00
Ed Sanders b982512605 Unwrap headings in lists (and <blockquote>) when pasting external HTML
Bug: T339155
Change-Id: I8e82b3455c120edd11e993c4fa80a06e3f9bdeee
2023-06-15 16:22:15 +01:00
jenkins-bot 2d9e31e0e5 Merge "Don't try to prefix browser title if a custom message is incompatible" 2023-06-15 05:45:53 +00:00
jenkins-bot 4b6e819440 Merge "Set a JS config var to force VisualEditor to edit the current version" 2023-06-14 01:56:12 +00:00
Ed Sanders 43699fe94c Exclude after-aligned tools when creating target widgets
Bug: T338978
Change-Id: I86d2546926fa58c36d3679a2d6d31b5a89e6364f
2023-06-13 18:06:14 +00:00
Ed Sanders 45a60e3fb2 Targets: Use align:'after' instead of actionGroups
Change-Id: I2b2b0c86697e3afde7ea192ce6dc5996998dfa4b
2023-06-09 18:09:27 +01:00
Dringsim d27825caa1 Set a JS config var to force VisualEditor to edit the current version
Rename wgFlaggedRevsEditLatestRevision to wgEditLatestRevision (not use 'VisualEditor' - this config may be used by other editors)

Bug: T338312
Change-Id: I6c9c46774fe197ca7775b65f12e62bb3bcbe53b4
2023-06-09 12:45:37 +00:00
Bartosz Dziewoński 09fec16583 Don't try to prefix browser title if a custom message is incompatible
Some wikis customize the 'pagetitle' in ways that are not compatible
with the client-side message parser.

Depends-On: If1979da12777e4ee4e97937640fc5e6176f9b5fe
Bug: T317600
Change-Id: Ie7c1813552582e10de9e57cd8d772c2134146289
2023-06-01 01:08:31 +02:00
Bartosz Dziewoński 872679aeec DesktopArticleTarget.init: Support '&editintro=…' in edit links
Support gadgets adding '&editintro=…' to the default edit link.
It was already supported when opening the link in a new window, or
following an external link, or when clicking a section edit link.

Also, clean up these parameters when leaving the editor. This also
applies to 'preload', 'preloadparams', 'preloadtitle', 'summary'.

KNOWN BUG: Only works the first time the editor is loaded on the page.
Afterwards, DesktopArticleTarget.init lets DesktopArticleTarget handle
initialization, and it ignores extra parameters. I made a few attempts
at fixing this, but I only broke it further. I don't understand why
the history handling code even works. Maybe I'll come back to this.

Bug: T56029
Change-Id: I38fcde573f728250aaa125b391815e7fac7df362
2023-05-30 12:52:53 +00:00
David Lynch 50c646050d Update VE core submodule to master (fd2f048e4)
Also supporting changes to support the new HelpCompletionAction,
including adding a preference to disable it if required.

New changes:
985b553cc Localisation updates from https://translatewiki.net.
aa26e27dc Localisation updates from https://translatewiki.net.
4cdc753ab Update OOUI to v0.47.0
bfc96a7ee Completions: always abandon if the first input is a space
616a6458f Fuzzy command bar
92b6525a2 Tweak the fuzzy command bar's behavior
fd2f048e4 Fuzzy bar: change how command groups are generated

Change-Id: Ic77b8822baecf5ad1ab466d94df29bb945172b55
2023-05-20 22:04:27 +03:00