Logging: editor_interface should be visualeditor not visual.

Also, it should switch when the editor switches.

Bug: T254291
Change-Id: I2550529f51a8417586d6f0791d958fcf4b9d4fc6
This commit is contained in:
David Lynch 2020-06-08 17:12:55 -05:00
parent e4da8b10f3
commit 5fa7d713d8
3 changed files with 7 additions and 2 deletions

View file

@ -156,7 +156,7 @@ CommentController.prototype.setup = function ( mode ) {
mechanism: 'click',
// TODO: Use 'wikitext-2017' when config.enable2017Wikitext is set
// eslint-disable-next-line camelcase
editor_interface: mode === 'visual' ? 'visual' : 'wikitext'
editor_interface: mode === 'visual' ? 'visualeditor' : 'wikitext'
} );
this.$replyLinkButtons.addClass( 'dt-init-replylink-active' );

View file

@ -252,7 +252,7 @@ ReplyWidget.prototype.onModeTabSelectChoose = function ( option ) {
mw.track( 'dt.schemaVisualEditorFeatureUse', {
feature: 'editor-switch',
// TODO: Log as `source-nwe-desktop` when enable2017Wikitext is set
action: mode + '-desktop'
action: ( mode === 'visual' ? 'visualeditor' : 'wikitext' ) + '-desktop'
} );
};

View file

@ -222,5 +222,10 @@ mw.loader.using( 'ext.eventLogging' ).done( function () {
mw.config.get( 'wgWMESchemaEditAttemptStepOversample' )
) ? 1 : sampleRate );
}
if ( data.feature === 'editor-switch' ) {
// eslint-disable-next-line camelcase
session.editor_interface = session.editor_interface === 'visualeditor' ? 'wikitext' : 'visualeditor';
}
} );
} );