Skip to content

Commit f6765c9

Browse files
committed
[compare] add event groups
1 parent 695066b commit f6765c9

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

frontend/express/public/javascripts/countly/countly.event.js

+3
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,9 @@
866866
if (eventMap[mapKey] && eventMap[mapKey].name) {
867867
return eventMap[mapKey].name;
868868
}
869+
else if (_eventGroups[mapKey] && _eventGroups[mapKey].label) {
870+
return _eventGroups[mapKey].label;
871+
}
869872
else {
870873
return eventKey;
871874
}

plugins/compare/api/api.js

+11-4
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var exported = {},
3737

3838
for (var i = 0; i < eventKeysArr.length; i++) {
3939
collectionNames.push(
40-
"events" + crypto.createHash('sha1').update(eventKeysArr[i] + params.app_id).digest('hex')
40+
(eventKeysArr[i].startsWith('[CLY]_group_')) ? eventKeysArr[i] : "events" + crypto.createHash('sha1').update(eventKeysArr[i] + params.app_id).digest('hex')
4141
);
4242
}
4343

@@ -58,9 +58,16 @@ var exported = {},
5858
* @param {function} callback - callback method
5959
**/
6060
function getEventData(collectionName, callback) {
61-
fetch.getTimeObjForEvents(collectionName, params, function(output) {
62-
callback(null, output || {});
63-
});
61+
if (collectionName.startsWith('[CLY]_group_')) {
62+
fetch.getMergedEventGroups(params, collectionName, {}, function(output) {
63+
callback(null, output || {});
64+
});
65+
}
66+
else {
67+
fetch.getTimeObjForEvents(collectionName, params, function(output) {
68+
callback(null, output || {});
69+
});
70+
}
6471
}
6572

6673
return true;

0 commit comments

Comments
 (0)