jenkins-bot has submitted this change and it was merged.

Change subject: Use correct switch type when opening welcome dialog on NWE
......................................................................


Use correct switch type when opening welcome dialog on NWE

Bug: T145225
Change-Id: I032652733576d1a9797cc3dbb3dd24ca69cb30e5
---
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
M modules/ve-mw/init/ve.init.MWWelcomeDialog.js
M modules/ve-mw/init/ve.init.mw.ArticleTarget.js
3 files changed, 9 insertions(+), 5 deletions(-)

Approvals:
  Jforrester: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js 
b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
index 5aa6038..6bf9527 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
@@ -962,7 +962,7 @@
                                        welcomeDialog,
                                        {
                                                switchable: init.isAvailable,
-                                               editor: 'wte'
+                                               editor: 'source'
                                        }
                                )
                                        .then( function ( opened ) { return 
opened; } )
diff --git a/modules/ve-mw/init/ve.init.MWWelcomeDialog.js 
b/modules/ve-mw/init/ve.init.MWWelcomeDialog.js
index 702f631..4599e36 100644
--- a/modules/ve-mw/init/ve.init.MWWelcomeDialog.js
+++ b/modules/ve-mw/init/ve.init.MWWelcomeDialog.js
@@ -40,18 +40,18 @@
        {
                action: 'switch-wte',
                label: OO.ui.deferMsg( 'visualeditor-welcomedialog-switch' ),
-               modes: [ 've' ]
+               modes: [ 'visual' ]
        },
        {
                action: 'switch-ve',
                label: OO.ui.deferMsg( 'visualeditor-welcomedialog-switch-ve' ),
-               modes: [ 'wte' ]
+               modes: [ 'source' ]
        },
        {
                action: 'accept',
                label: OO.ui.deferMsg( 'visualeditor-welcomedialog-action' ),
                flags: [ 'progressive', 'primary' ],
-               modes: [ 've', 'wte', 'noswitch' ]
+               modes: [ 'visual', 'source', 'noswitch' ]
        }
 ];
 
diff --git a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js 
b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
index e1c50d5..4ae2277 100644
--- a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
+++ b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
@@ -1812,7 +1812,7 @@
                                this.welcomeDialog,
                                {
                                        switchable: 
this.constructor.static.trackingName !== 'mobile',
-                                       editor: 've'
+                                       editor: this.mode
                                }
                        )
                                .then( function ( opened ) {
@@ -1824,11 +1824,15 @@
                                .then( function ( data ) {
                                        target.welcomeDialogPromise.resolve();
                                        target.welcomeDialog = null;
+                                       // switchToWikitextEditor and 
switchToVisualEditor are actually
+                                       // only defined in subclasses :/
                                        if ( data && data.action === 
'switch-wte' ) {
                                                // TODO: Make this work on 
mobile - right now we can only
                                                // get away with it because the 
button which triggers this
                                                // action is hidden on mobile
                                                target.switchToWikitextEditor( 
true, true );
+                                       } else if ( data && data.action === 
'switch-ve' ) {
+                                               target.switchToVisualEditor();
                                        }
                                } );
                } else {

-- 
To view, visit https://gerrit.wikimedia.org/r/310709
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I032652733576d1a9797cc3dbb3dd24ca69cb30e5
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <a...@wikimedia.org>
Gerrit-Reviewer: Esanders <esand...@wikimedia.org>
Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to