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

Change subject: Hygiene: remove some MobileWebClickTracking schemas
......................................................................


Hygiene: remove some MobileWebClickTracking schemas

Removed schemas:
  * MobileWebDiffClickTracking
  * MobileWebWatchlistClickTracking

The data generated by these schemas is not being used.

Bug: T122504
Change-Id: I40ac27e56fcc3ccc58870660d0ed7353c7a17748
---
M extension.json
M includes/MobileFrontend.hooks.php
D resources/mobile.special.mobilediff.scripts/mobilediff.js
M resources/skins.minerva.special.watchlist.scripts/watchlist.js
4 files changed, 2 insertions(+), 68 deletions(-)

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



diff --git a/extension.json b/extension.json
index d5e9b32..98a03d9 100644
--- a/extension.json
+++ b/extension.json
@@ -1523,11 +1523,7 @@
                                "mobile",
                                "desktop"
                        ],
-                       "dependencies": [
-                               "mobile.loggingSchemas"
-                       ],
                        "scripts": [
-                               
"resources/mobile.special.mobilediff.scripts/mobilediff.js"
                        ]
                },
                "skins.minerva.special.styles": {
diff --git a/includes/MobileFrontend.hooks.php 
b/includes/MobileFrontend.hooks.php
index d4c63fd..6a89e10 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -1145,19 +1145,6 @@
        }
 
        /**
-        * Returns an array of schema names mapped to a schema revision ID
-        *
-        * @see 
https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderGetLessVars
-        * @param array Array of schema names associated to revision IDs
-        */
-       private static function getEventLoggingSchemas() {
-               return array(
-                       'MobileWebDiffClickTracking' => 10720373,
-                       'MobileWebWatchlistClickTracking' => 10720361,
-               );
-       }
-
-       /**
         * EventLoggingRegisterSchemas hook handler.
         *
         * Registers our EventLogging schemas so that they can be converted to
@@ -1172,9 +1159,6 @@
         * @return bool Always true
         */
        public static function onEventLoggingRegisterSchemas( &$schemas ) {
-               $schemas += self::getEventLoggingSchemas();
-               // eventually we'll get rid of the getEventLoggingSchemas 
function
-               // FIXME: remove the above comment when we do
                $schemas['MobileWebMainMenuClickTracking'] = 11568715;
                $schemas['MobileWebSearch'] = 12054448;
                $schemas['MobileWebLanguageSwitcher'] = 15302503;
@@ -1206,13 +1190,6 @@
                $schemaMobileWebSearch = $mfResourceFileModuleBoilerplate;
 
                if ( class_exists( 'EventLogging' ) ) {
-                       $schemaModules = array_map(
-                               function ( $schema ) {
-                                       return "schema.{$schema}";
-                               },
-                               array_keys( self::getEventLoggingSchemas() )
-                       );
-
                        // schema.Edit is provided by WikimediaEvents
                        if ( $resourceLoader->isModuleRegistered( 'schema.Edit' 
) ) {
                                $schemaEdit += array(
diff --git a/resources/mobile.special.mobilediff.scripts/mobilediff.js 
b/resources/mobile.special.mobilediff.scripts/mobilediff.js
deleted file mode 100644
index 5da8f95..0000000
--- a/resources/mobile.special.mobilediff.scripts/mobilediff.js
+++ /dev/null
@@ -1,18 +0,0 @@
-( function ( $, M ) {
-       var SchemaMobileWebClickTracking = M.require( 
'mobile.loggingSchemas/SchemaMobileWebClickTracking' ),
-               diffSchema = new SchemaMobileWebClickTracking( {}, 
'MobileWebDiffClickTracking' );
-
-       // EventLogging events
-       // Clicking through to article
-       diffSchema.hijackLink( 'h2 a', 'view' );
-
-       // Clicking previous or next diff links
-       diffSchema.hijackLink( '.revision-history-links a', 'prev-or-next' );
-
-       // user link
-       diffSchema.hijackLink( '.mw-mf-user a', 'user' );
-
-       // thank button is already logged tracked in the Thank extension
-       // If you update the schema related code, remember to update the Thank 
extension too
-
-} )( jQuery, mw.mobileFrontend );
diff --git a/resources/skins.minerva.special.watchlist.scripts/watchlist.js 
b/resources/skins.minerva.special.watchlist.scripts/watchlist.js
index 3caf9d1..d158ab3 100644
--- a/resources/skins.minerva.special.watchlist.scripts/watchlist.js
+++ b/resources/skins.minerva.special.watchlist.scripts/watchlist.js
@@ -1,11 +1,6 @@
 ( function ( M, $ ) {
        var watchlist,
-               WatchList = M.require( 'mobile.watchlist/WatchList' ),
-               SchemaMobileWebClickTracking = M.require( 
'mobile.loggingSchemas/SchemaMobileWebClickTracking' ),
-               wlSchema = new SchemaMobileWebClickTracking( {}, 
'MobileWebWatchlistClickTracking' ),
-               canonicalName = mw.config.get( 'wgCanonicalSpecialPageName' ),
-               pageName = canonicalName === 'EditWatchlist' || canonicalName 
=== 'Watchlist' ? 'watchlist' : 'diff',
-               subPageName = mw.util.getParamValue( 'watchlistview' ) || 'a-z';
+               WatchList = M.require( 'mobile.watchlist/WatchList' );
 
        /**
         * Initialises JavaScript on Special:Watchlist
@@ -13,8 +8,7 @@
         * @ignore
         */
        function init() {
-               var $watchlist = $( 'ul.page-list' ),
-                       actionNamePrefix = pageName + '-' + subPageName + '-';
+               var $watchlist = $( 'ul.page-list' );
 
                // FIXME: find more elegant way to not show watchlist stars on 
recent changes
                if ( $( '.mw-mf-watchlist-selector' ).length === 0 ) {
@@ -25,24 +19,9 @@
                                enhance: true
                        } );
                        $watchlist.find( '.page-summary .info' ).css( 
'visibility', 'visible' );
-                       watchlist.on( 'unwatch', function () {
-                               wlSchema.log( {
-                                       name: actionNamePrefix + 'unwatch'
-                               } );
-                       } );
-                       watchlist.on( 'watch', function () {
-                               wlSchema.log( {
-                                       name: actionNamePrefix + 'watch'
-                               } );
-                       } );
                }
                // not needed now we have JS view which has infinite scrolling
                $( '.more' ).remove();
-
-               // Register EventLogging events
-               wlSchema.hijackLink( '.button-bar a', actionNamePrefix + 
'switch' );
-               wlSchema.hijackLink( '.mw-mf-watchlist-selector a', 
actionNamePrefix + 'filter' );
-               wlSchema.hijackLink( '.page-list .title', actionNamePrefix + 
'view' );
        }
 
        $( function () {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I40ac27e56fcc3ccc58870660d0ed7353c7a17748
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Bmansurov <[email protected]>
Gerrit-Reviewer: Phuedx <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to