New change settings option and possibility to hide system messagaes

This commit is contained in:
Mario Orlicky 2016-11-19 19:02:33 +01:00
parent 94cdcff79f
commit 8290dcb249
6 changed files with 61 additions and 13 deletions

View file

@ -3,17 +3,17 @@
// 2. The card activity tab
// We use this publication to paginate for these two publications.
Meteor.publish('activities', (kind, id, limit) => {
Meteor.publish('activities', (kind, id, limit, hideSystem) => {
check(kind, Match.Where((x) => {
return ['board', 'card'].indexOf(x) !== -1;
}));
check(id, String);
check(limit, Number);
check(hideSystem, Boolean);
return Activities.find({
[`${kind}Id`]: id,
}, {
limit,
sort: {createdAt: -1},
});
});
let selector = (hideSystem) ? {$and: [{activityType: 'addComment'}, {[`${kind}Id`]: id}]} : {[`${kind}Id`]: id};
return Activities.find(selector, {
limit,
sort: {createdAt: -1},
});
});