mirror of
https://github.com/wekan/wekan.git
synced 2025-04-24 14:08:31 -04:00
add linkedBoard Activities to selector
This commit is contained in:
parent
d52e0bcb6e
commit
bf6bfc8ed6
3 changed files with 26 additions and 4 deletions
|
@ -773,7 +773,15 @@ Boards.helpers({
|
|||
},
|
||||
|
||||
activities() {
|
||||
return Activities.find({ boardId: this._id }, { sort: { createdAt: -1 } });
|
||||
let linkedBoardId = [this._id];
|
||||
Cards.find({
|
||||
"type": "cardType-linkedBoard",
|
||||
"boardId": this._id}
|
||||
).forEach(card => {
|
||||
linkedBoardId.push(card.linkedId);
|
||||
});
|
||||
return Activities.find({ boardId: { $in: linkedBoardId } }, { sort: { createdAt: -1 } });
|
||||
//return Activities.find({ boardId: this._id }, { sort: { createdAt: -1 } });
|
||||
},
|
||||
|
||||
activeMembers(){
|
||||
|
|
|
@ -14,9 +14,23 @@ Meteor.publish('activities', (kind, id, limit, hideSystem) => {
|
|||
check(limit, Number);
|
||||
check(hideSystem, Boolean);
|
||||
|
||||
// Get linkedBoard
|
||||
let linkedElmtId = [id];
|
||||
if (kind == 'board') {
|
||||
Cards.find({
|
||||
"type": "cardType-linkedBoard",
|
||||
"boardId": id}
|
||||
).forEach(card => {
|
||||
linkedElmtId.push(card.linkedId);
|
||||
});
|
||||
}
|
||||
|
||||
//const selector = hideSystem
|
||||
// ? { $and: [{ activityType: 'addComment' }, { [`${kind}Id`]: id }] }
|
||||
// : { [`${kind}Id`]: id };
|
||||
const selector = hideSystem
|
||||
? { $and: [{ activityType: 'addComment' }, { [`${kind}Id`]: id }] }
|
||||
: { [`${kind}Id`]: id };
|
||||
? { $and: [{ activityType: 'addComment' }, { [`${kind}Id`]: { $in: linkedElmtId } }] }
|
||||
: { [`${kind}Id`]: { $in: linkedElmtId } };
|
||||
return Activities.find(selector, {
|
||||
limit,
|
||||
sort: { createdAt: -1 },
|
||||
|
|
|
@ -270,7 +270,7 @@ Meteor.publishRelations('board', function(boardId, isArchived) {
|
|||
checklists.push(cardId);
|
||||
checklistItems.push(cardId);
|
||||
parentCards.push(cardId);
|
||||
cardCommentReactions.push(cardId)
|
||||
cardCommentReactions.push(cardId);
|
||||
},
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue