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

Change subject: Update to latest schema
......................................................................


Update to latest schema

Will log namespace as requested in Bug: 51061
As well as user edit count at time of edit to identify new editors
As well as whether AB test was run

Dependency: I7e7a99fd5e17dc1b5038b14df21d32320e581806
Change-Id: I37079a3501844cff433ccadd42c0b813b7cc2e37
---
M javascripts/modules/editor/EditorOverlay.js
1 file changed, 10 insertions(+), 2 deletions(-)

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



diff --git a/javascripts/modules/editor/EditorOverlay.js 
b/javascripts/modules/editor/EditorOverlay.js
index 845beb4..86bfc37 100644
--- a/javascripts/modules/editor/EditorOverlay.js
+++ b/javascripts/modules/editor/EditorOverlay.js
@@ -1,6 +1,7 @@
 ( function( M, $ ) {
 
        var Overlay = M.require( 'Overlay' ),
+               isTestA = mw.config.get( 'wgUserId' ) % 2 === 0,
                Page = M.require( 'page' ),
                popup = M.require( 'notifications' ),
                api = M.require( 'api' ),
@@ -31,6 +32,9 @@
                                        token: M.getSessionId(),
                                        action: action,
                                        section: this.sectionId,
+                                       namespace: mw.config.get( 
'wgNamespaceNumber' ),
+                                       userEditCount: mw.config.get( 
'wgUserEditCount' ),
+                                       isTestA: isTestA,
                                        pageId: mw.config.get( 'wgArticleId' ),
                                        username: mw.config.get( 'wgUserName' ),
                                        mobileMode: mw.config.get( 'wgMFMode' ),
@@ -198,19 +202,23 @@
 
                        this.api.save( this.$( '.summary' ).val() ).
                                done( function() {
-                                       var title = self.options.title;
+                                       var title = self.options.title,
+                                               editCount = mw.config.get( 
'wgUserEditCount' );
                                        // log success!
                                        self.log( 'success' );
                                        M.history.invalidateCachedPage( title );
                                        new Page( { title: title, el: $( 
'#content_wrapper' ) } );
                                        M.router.navigate( '' );
                                        self.hide();
-                                       if ( self.isNewEditor ) {
+                                       if ( isTestA && self.isNewEditor ) {
                                                msg = 
'mobile-frontend-editor-success-landmark-1';
                                        } else {
                                                className = 'toast';
                                                msg = 
'mobile-frontend-editor-success';
                                        }
+                                       // update edit count
+                                       // FIXME: this should be an integer 
(see bug 51633)
+                                       mw.config.set( 'wgUserEditCount', ( 
parseInt( editCount, 10 ) + 1 ).toString() );
                                        popup.show( mw.msg( msg ), className );
                                } ).
                                fail( function( err ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I37079a3501844cff433ccadd42c0b813b7cc2e37
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to