Fix various bugs in mw.echo.Logger and its callers

* Fix typo that caused logInteraction() to never do anything
* Fix incorrect context parameter passed by NotificationBadgeWidget
* Consistently use mw.Echo.Logger.static.context.* constants for the
  context parameter everywhere

Bug: T114833
Change-Id: I140e4222169ad9e78c6bf016d9765828513adcbb
This commit is contained in:
Roan Kattouw 2015-10-08 15:20:31 -07:00
parent bb89634306
commit 877e621a6a
3 changed files with 4 additions and 4 deletions

View file

@ -89,7 +89,7 @@
* @param {boolean} [mobile] True if interaction was on a mobile device
*/
mw.echo.Logger.prototype.logInteraction = function ( action, context, eventId, eventType, mobile ) {
if ( !this.constructor.clickThroughEnabled ) {
if ( !this.constructor.static.clickThroughEnabled ) {
return;
}

View file

@ -303,7 +303,7 @@
// Log the click event
mw.echo.logger.logInteraction(
'ui-badge-link-click',
mw.echo.Logger.static.context,
mw.echo.Logger.static.context.badge,
null,
this.type
);
@ -337,7 +337,7 @@
if ( items[ i ].getModel ) {
mw.echo.logger.logInteraction(
mw.echo.Logger.static.actions.notificationImpression,
'flyout',
mw.echo.Logger.static.context.popup,
items[ i ].getModel().getId(),
items[ i ].getModel().getCategory()
);

View file

@ -58,7 +58,7 @@
// Log notification click
mw.echo.logger.logInteraction(
mw.echo.Logger.static.actions.notificationClick,
'flyout',
mw.echo.Logger.static.context.popup,
widget.getModel().getId(),
widget.getModel().getCategory()
);