mirror of
https://github.com/wekan/wekan.git
synced 2025-04-23 05:27:14 -04:00
Merge pull request #4315 from Ben0it-T/fix-cardType-linkedBoard-comments-not-loading
Fix comments not loading on cardType-linkedBoard
This commit is contained in:
commit
d63fa4aa89
2 changed files with 13 additions and 0 deletions
|
@ -721,6 +721,11 @@ Cards.helpers({
|
|||
{ cardId: this.linkedId },
|
||||
{ sort: { createdAt: -1 } },
|
||||
);
|
||||
} else if (this.isLinkedBoard()) {
|
||||
return CardComments.find(
|
||||
{ boardId: this.linkedId },
|
||||
{ sort: { createdAt: -1 } },
|
||||
);
|
||||
} else {
|
||||
return CardComments.find(
|
||||
{ cardId: this._id },
|
||||
|
|
|
@ -229,6 +229,8 @@ Meteor.publishRelations('board', function(boardId, isArchived) {
|
|||
// Gather queries and send in bulk
|
||||
const cardComments = this.join(CardComments);
|
||||
cardComments.selector = _ids => ({ cardId: _ids });
|
||||
const cardCommentsLinkedBoard = this.join(CardComments);
|
||||
cardCommentsLinkedBoard.selector = _ids => ({ boardId: _ids });
|
||||
const cardCommentReactions = this.join(CardCommentReactions);
|
||||
cardCommentReactions.selector = _ids => ({ cardId: _ids });
|
||||
const attachments = this.join(Attachments);
|
||||
|
@ -242,6 +244,8 @@ Meteor.publishRelations('board', function(boardId, isArchived) {
|
|||
const boards = this.join(Boards);
|
||||
const subCards = this.join(Cards);
|
||||
subCards.selector = _ids => ({ _id: _ids, archived: isArchived });
|
||||
const linkedBoardCards = this.join(Cards);
|
||||
linkedBoardCards.selector = _ids => ({ boardId: _ids });
|
||||
|
||||
this.cursor(
|
||||
Cards.find({
|
||||
|
@ -258,6 +262,8 @@ Meteor.publishRelations('board', function(boardId, isArchived) {
|
|||
checklistItems.push(impCardId);
|
||||
} else if (card.type === 'cardType-linkedBoard') {
|
||||
boards.push(card.linkedId);
|
||||
linkedBoardCards.push(card.linkedId);
|
||||
cardCommentsLinkedBoard.push(card.linkedId);
|
||||
}
|
||||
cardComments.push(cardId);
|
||||
attachments.push(cardId);
|
||||
|
@ -277,6 +283,8 @@ Meteor.publishRelations('board', function(boardId, isArchived) {
|
|||
checklistItems.send();
|
||||
boards.send();
|
||||
parentCards.send();
|
||||
linkedBoardCards.send();
|
||||
cardCommentsLinkedBoard.send();
|
||||
|
||||
if (board.members) {
|
||||
// Board members. This publication also includes former board members that
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue