Merge "Log 'mark all read' button click actions"

This commit is contained in:
jenkins-bot 2016-08-11 20:58:31 +00:00 committed by Gerrit Code Review
commit ccab1d8351
4 changed files with 23 additions and 4 deletions

View file

@ -568,7 +568,7 @@ $wgEchoConfig = array(
),
'EchoInteraction' => array(
'enabled' => false,
'revision' => 15180901,
'revision' => 15823738,
'client' => true,
),
)

View file

@ -75,7 +75,8 @@
mw.echo.Logger.static.actions = {
notificationClick: 'notification-link-click',
notificationBundleExpand: 'notification-bundle-expand',
notificationImpression: 'notification-impression'
notificationImpression: 'notification-impression',
markAllReadClick: 'mark-all-read-click'
};
/* Methods */
@ -111,8 +112,8 @@
if ( eventType ) {
myEvt.notificationType = eventType;
}
if ( mobile ) {
myEvt.mobile = mobile;
if ( mobile !== undefined || mw.config.get( 'skin' ) === 'minerva' ) {
myEvt.mobile = mobile || mw.config.get( 'skin' ) === 'minerva';
}
if ( notifWiki && notifWiki !== mw.config.get( 'wgDBname' ) && notifWiki !== 'local' ) {

View file

@ -294,6 +294,14 @@
* Respond to 'mark all as read' button click
*/
mw.echo.ui.NotificationBadgeWidget.prototype.onMarkAllReadButtonClick = function () {
// Log the click action
mw.echo.logger.logInteraction(
mw.echo.Logger.static.actions.markAllReadClick,
mw.echo.Logger.static.context.popup,
null, // Event id isn't relevant
this.manager.getTypeString() // The type of the list
);
this.controller.markLocalNotificationsRead();
};

View file

@ -106,6 +106,16 @@
* Respond to mark all read button click
*/
mw.echo.ui.SpecialHelpMenuWidget.prototype.onMarkAllreadButtonClick = function () {
// Log this action
mw.echo.logger.logInteraction(
mw.echo.Logger.static.actions.markAllReadClick,
mw.echo.Logger.static.context.archive,
null, // Notification ID is irrelevant
this.manager.getTypeString(), // The type of the list in general
null, // The Logger has logic to decide whether this is mobile or not
this.manager.getFiltersModel().getSourcePagesModel().getCurrentSource() // Source name
);
this.popup.toggle( false );
this.emit( 'markAllRead' );
};