mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-24 07:54:13 +00:00
Merge "Log 'mark all read' button click actions"
This commit is contained in:
commit
ccab1d8351
2
Echo.php
2
Echo.php
|
@ -568,7 +568,7 @@ $wgEchoConfig = array(
|
|||
),
|
||||
'EchoInteraction' => array(
|
||||
'enabled' => false,
|
||||
'revision' => 15180901,
|
||||
'revision' => 15823738,
|
||||
'client' => true,
|
||||
),
|
||||
)
|
||||
|
|
|
@ -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' ) {
|
||||
|
|
|
@ -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();
|
||||
};
|
||||
|
||||
|
|
|
@ -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' );
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue