Remove all main_menu tracking related code.""

This reverts commit de353c06c9.

Bug: T228681
Change-Id: Idfd964c31e09e271dca9ac39f7932df49cdcb5f6
This commit is contained in:
Jdlrobson 2019-07-22 20:05:46 +00:00 committed by jdlrobson
parent d688190547
commit 8d703b7758
7 changed files with 1 additions and 101 deletions

View File

@ -237,13 +237,6 @@ Group membership can be debugged from the console via:
And since session ID is an input in calculating the group, reassignment occurs
when clearing it: `mw.storage.session.remove('mwuser-sessionId')`.
#### $wgMinervaSchemaMainMenuClickTrackingSampleRate
Defines the sampling rate for the MobileWebMainMenuClickTracking schema.
* Type: `Number`
* Default: `0`
### Components
Components may be shared between server and client. Keeping all code for a single component only in

View File

@ -281,8 +281,6 @@ class MinervaHooks {
$config = MediaWikiServices::getInstance()->getConfigFactory()
->makeConfig( 'minerva' );
$vars += [
'wgMinervaSchemaMainMenuClickTrackingSampleRate' =>
$config->get( 'MinervaSchemaMainMenuClickTrackingSampleRate' ),
'wgMinervaABSamplingRate' => $config->get( 'MinervaABSamplingRate' ),
'wgMinervaCountErrors' => $config->get( 'MinervaCountErrors' ),
'wgMinervaErrorLogSamplingRate' => $config->get( 'MinervaErrorLogSamplingRate' ),

View File

@ -8,7 +8,6 @@
errorLogging = require( './errorLogging.js' ),
notifications = require( './notifications.js' ),
preInit = require( './preInit.js' ),
initLogging = require( './initLogging.js' ),
mobileRedirect = require( './mobileRedirect.js' ),
search = require( './search.js' ),
references = require( './references.js' ),
@ -312,8 +311,6 @@
// - main menu closes when you click outside of it
// - redirects show a toast.
preInit();
// - logging
initLogging();
// - references
references();
// - search

View File

@ -1,14 +0,0 @@
// This initialises EventLogging for main menu and some prominent links in the UI.
// This code should only be loaded on the Minerva skin, it does not apply to other skins.
// @deprecated and to be removed the moment that T220016 is live.
var mainMenu = require( './menu.js' ),
logging = require( './menu/schema.js' );
module.exports = function () {
mw.loader.using( [
'ext.eventLogging'
] ).then( function () {
logging();
mainMenu.enableLogging();
} );
};

View File

@ -33,25 +33,6 @@
activator: undefined
},
/**
* Turn on event logging on the existing main menu by reading `event-name` data
* attributes on elements.
* @memberof MainMenu
* @deprecated and to be removed the moment that T220016 is live.
* @instance
*/
enableLogging: function () {
this.$el.find( 'a' ).on( 'click', function () {
var $link = $( this ),
eventName = $link.data( 'event-name' );
if ( eventName ) {
mw.track( 'minerva.schemaMobileWebMainMenuClickTracking', {
name: eventName,
destination: $link.attr( 'href' )
} );
}
} );
},
/**
* Remove the nearby menu entry if the browser doesn't support geo location
* @memberof MainMenu

View File

@ -1,51 +0,0 @@
module.exports = function () {
var M = mw.mobileFrontend,
user = mw.user,
editCount = mw.config.get( 'wgUserEditCount' ),
// Need to make amc default to false because it will not exist in mw.config
// if using desktop Minerva or if MobileFrontend extension is not installed.
amc = mw.config.get( 'wgMFAmc', false ),
// Schema class provided by ext.eventLogging module
Schema = mw.eventLog.Schema, // resource-modules-disable-line
context = M.require( 'mobile.startup' ).context,
DEFAULT_SAMPLING_RATE = mw.config.get( 'wgMinervaSchemaMainMenuClickTrackingSampleRate' ),
// T218627: Sampling rate should be 100% if user has amc enabled
AMC_SAMPLING_RATE = 1,
/**
* MobileWebMainMenuClickTracking schema
* https://meta.wikimedia.org/wiki/Schema:MobileWebMainMenuClickTracking
*
* @class MobileWebMainMenuClickTracking
* @deprecated and to be removed the moment that T220016 is live.
* @singleton
*/
schemaMobileWebMainMenuClickTracking = new Schema(
'MobileWebMainMenuClickTracking',
amc ? AMC_SAMPLING_RATE : DEFAULT_SAMPLING_RATE,
/**
* @property {Object} defaults Default options hash.
* @property {string} defaults.mode whether user is in stable, beta, or desktop
* @property {boolean} defaults.amc whether or not the user has advanced
* contributions mode enabled (true) or disabled (false)
* @property {string} [defaults.username] Username if the user is logged in,
* otherwise - undefined.
* Assigning undefined will make event logger omit this property when sending
* the data to a server. According to the schema username is optional.
* @property {number} [defaults.userEditCount] The number of edits the user has made
* if the user is logged in, otherwise - undefined. Assigning undefined will make event
* logger omit this property when sending the data to a server. According to the schema
* userEditCount is optional.
*/
{
mode: context.getMode() || 'desktop',
amc: amc,
username: user.getName() || undefined,
// FIXME: Use edit bucket here (T210106)
userEditCount: typeof editCount === 'number' ? editCount : undefined
}
);
mw.trackSubscribe( 'minerva.schemaMobileWebMainMenuClickTracking', function ( topic, data ) {
schemaMobileWebMainMenuClickTracking.log( data );
} );
};

View File

@ -66,7 +66,6 @@
"base": false,
"beta": true
},
"MinervaSchemaMainMenuClickTrackingSampleRate": 0,
"MinervaABSamplingRate": 0
},
"ValidSkinNames": {
@ -195,8 +194,7 @@
},
"EventLoggingSchemas": {
"WebClientError": 18340282,
"MobileWebShareButton": 18923688,
"MobileWebMainMenuClickTracking": 18984528
"MobileWebShareButton": 18923688
},
"ResourceModules": {
"skins.minerva.base.styles": {
@ -516,7 +514,6 @@
"resources/skins.minerva.scripts/NotificationBadge.js",
"resources/skins.minerva.scripts/notifications.js",
"resources/skins.minerva.scripts/overlayManager.js",
"resources/skins.minerva.scripts/menu/schema.js",
"resources/skins.minerva.scripts/menu/MainMenu.js",
"resources/skins.minerva.scripts/menu.js",
"resources/skins.minerva.scripts/errorLogging.js",
@ -536,7 +533,6 @@
"components/ToggleList/ToggleList.js",
"resources/skins.minerva.scripts/TabScroll.js",
"resources/skins.minerva.scripts/Toolbar.js",
"resources/skins.minerva.scripts/initLogging.js",
"resources/skins.minerva.scripts/mobileRedirect.js",
"resources/skins.minerva.scripts/search.js",
"resources/skins.minerva.scripts/references.js",