mirror of
https://github.com/wekan/wekan.git
synced 2025-12-17 07:50:12 +01: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() {
|
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(){
|
activeMembers(){
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,23 @@ Meteor.publish('activities', (kind, id, limit, hideSystem) => {
|
||||||
check(limit, Number);
|
check(limit, Number);
|
||||||
check(hideSystem, Boolean);
|
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
|
const selector = hideSystem
|
||||||
? { $and: [{ activityType: 'addComment' }, { [`${kind}Id`]: id }] }
|
? { $and: [{ activityType: 'addComment' }, { [`${kind}Id`]: { $in: linkedElmtId } }] }
|
||||||
: { [`${kind}Id`]: id };
|
: { [`${kind}Id`]: { $in: linkedElmtId } };
|
||||||
return Activities.find(selector, {
|
return Activities.find(selector, {
|
||||||
limit,
|
limit,
|
||||||
sort: { createdAt: -1 },
|
sort: { createdAt: -1 },
|
||||||
|
|
|
||||||
|
|
@ -270,7 +270,7 @@ Meteor.publishRelations('board', function(boardId, isArchived) {
|
||||||
checklists.push(cardId);
|
checklists.push(cardId);
|
||||||
checklistItems.push(cardId);
|
checklistItems.push(cardId);
|
||||||
parentCards.push(cardId);
|
parentCards.push(cardId);
|
||||||
cardCommentReactions.push(cardId)
|
cardCommentReactions.push(cardId);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue