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:
Lauri Ojansivu 2022-01-22 23:27:34 +02:00 committed by GitHub
commit d63fa4aa89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View file

@ -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 },

View file

@ -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