mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateData
synced 2024-11-24 07:53:37 +00:00
Bucket the user's edit count before logging an event
Bug: T272569 Change-Id: I5313a3808b266bb60644b40bdb192db77208774a
This commit is contained in:
parent
777ce7963d
commit
d81226fdf7
|
@ -218,7 +218,7 @@
|
|||
"attributes": {
|
||||
"EventLogging": {
|
||||
"Schemas": {
|
||||
"TemplateDataEditor": 20759032,
|
||||
"TemplateDataEditor": 20990386,
|
||||
"TemplateDataApi": 20817949
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
function logEvent( eventName ) {
|
||||
mw.track( 'event.TemplateDataEditor', {
|
||||
/* eslint-disable camelcase */
|
||||
var event, editCountBucket;
|
||||
|
||||
/* eslint-disable camelcase */
|
||||
event = {
|
||||
action: eventName,
|
||||
page_id: mw.config.get( 'wgArticleId' ),
|
||||
page_title: mw.config.get( 'wgPageName' ),
|
||||
|
@ -8,8 +10,15 @@ function logEvent( eventName ) {
|
|||
rev_id: mw.config.get( 'wgCurRevisionId' ),
|
||||
user_edit_count: mw.config.get( 'wgUserEditCount', 0 ),
|
||||
user_id: mw.user.getId()
|
||||
/* eslint-enable camelcase */
|
||||
} );
|
||||
};
|
||||
|
||||
editCountBucket = mw.config.get( 'wgUserEditCountBucket' );
|
||||
if ( editCountBucket !== null ) {
|
||||
event.user_edit_count_bucket = editCountBucket;
|
||||
}
|
||||
|
||||
/* eslint-enable camelcase */
|
||||
mw.track( 'event.TemplateDataEditor', event );
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
|
Loading…
Reference in a new issue