From 5fa7d713d88a497ee370b62281ab4d85236dd98e Mon Sep 17 00:00:00 2001 From: David Lynch Date: Mon, 8 Jun 2020 17:12:55 -0500 Subject: [PATCH] Logging: editor_interface should be `visualeditor` not `visual`. Also, it should switch when the editor switches. Bug: T254291 Change-Id: I2550529f51a8417586d6f0791d958fcf4b9d4fc6 --- modules/CommentController.js | 2 +- modules/dt.ui.ReplyWidget.js | 2 +- modules/logger.js | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/CommentController.js b/modules/CommentController.js index 5d3718b8e..11d01894c 100644 --- a/modules/CommentController.js +++ b/modules/CommentController.js @@ -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' ); diff --git a/modules/dt.ui.ReplyWidget.js b/modules/dt.ui.ReplyWidget.js index be75172e7..ad503b7cd 100644 --- a/modules/dt.ui.ReplyWidget.js +++ b/modules/dt.ui.ReplyWidget.js @@ -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' } ); }; diff --git a/modules/logger.js b/modules/logger.js index fda5e3570..23705f128 100644 --- a/modules/logger.js +++ b/modules/logger.js @@ -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'; + } } ); } );