diff --git a/client/components/cards/minicard.jade b/client/components/cards/minicard.jade index 673049d1f..7c2683d73 100644 --- a/client/components/cards/minicard.jade +++ b/client/components/cards/minicard.jade @@ -129,11 +129,11 @@ template(name="minicard") .badges unless currentUser.isNoComments - if comments.count - .badge(title="{{_ 'card-comments-title' comments.count }}") + if comments.length + .badge(title="{{_ 'card-comments-title' comments.length }}") span.badge-icon.fa.fa-comment-o.badge-comment = ' ' - = comments.count + = comments.length //span.badge-comment.badge-text //| {{_ 'comment'}} if getDescription diff --git a/models/cardComments.js b/models/cardComments.js index 077c38c40..eafbe5def 100644 --- a/models/cardComments.js +++ b/models/cardComments.js @@ -172,7 +172,7 @@ CardComments.textSearch = (userId, textArray) => { // eslint-disable-next-line no-console // console.log('cardComments selector:', selector); - const comments = CardComments.find(selector); + const comments = ReactiveCache.getCardComments(selector); // eslint-disable-next-line no-console // console.log('count:', comments.count()); // eslint-disable-next-line no-console @@ -246,7 +246,7 @@ if (Meteor.isServer) { Authentication.checkBoardAccess(req.userId, paramBoardId); JsonRoutes.sendResult(res, { code: 200, - data: CardComments.find({ + data: ReactiveCache.getCardComments({ boardId: paramBoardId, cardId: paramCardId, }).map(function (doc) { diff --git a/models/cards.js b/models/cards.js index 099de5593..7be74ea7e 100644 --- a/models/cards.js +++ b/models/cards.js @@ -606,7 +606,7 @@ Cards.helpers({ }); // copy card comments - CardComments.find({ cardId: oldId }).forEach(cmt => { + ReactiveCache.getCardComments({ cardId: oldId }).forEach(cmt => { cmt.copy(_id); }); // restore the id, otherwise new copies will fail @@ -780,12 +780,12 @@ Cards.helpers({ comments() { let ret if (this.isLinkedBoard()) { - ret = CardComments.find( + ret = ReactiveCache.getCardComments( { boardId: this.linkedId }, { sort: { createdAt: -1 } }, ); } else { - ret = CardComments.find( + ret = ReactiveCache.getCardComments( { cardId: this.getRealId() }, { sort: { createdAt: -1 } }, ); diff --git a/models/exporter.js b/models/exporter.js index 748ed787e..a1b911691 100644 --- a/models/exporter.js +++ b/models/exporter.js @@ -104,7 +104,7 @@ export class Exporter { { boardIds: this._boardId }, { fields: { boardIds: 0 } }, ); - result.comments = CardComments.find(byBoard, noBoardId).fetch(); + result.comments = ReactiveCache.getCardComments(byBoard, noBoardId); result.activities = ReactiveCache.getActivities(byBoard, noBoardId); result.rules = ReactiveCache.getRules(byBoard, noBoardId); result.checklists = []; diff --git a/models/server/ExporterCardPDF.js b/models/server/ExporterCardPDF.js index c9d43696d..f3fde0f85 100644 --- a/models/server/ExporterCardPDF.js +++ b/models/server/ExporterCardPDF.js @@ -55,7 +55,7 @@ class ExporterCardPDF { }, }, ); - result.comments = CardComments.find(byBoard, noBoardId).fetch(); + result.comments = ReactiveCache.getCardComments(byBoard, noBoardId); result.activities = ReactiveCache.getActivities(byBoard, noBoardId); result.rules = ReactiveCache.getRules(byBoard, noBoardId); result.checklists = []; diff --git a/models/server/ExporterExcel.js b/models/server/ExporterExcel.js index f651b67cc..72120dddb 100644 --- a/models/server/ExporterExcel.js +++ b/models/server/ExporterExcel.js @@ -57,7 +57,7 @@ class ExporterExcel { }, }, ); - result.comments = CardComments.find(byBoard, noBoardId).fetch(); + result.comments = ReactiveCache.getCardComments(byBoard, noBoardId); result.activities = ReactiveCache.getActivities(byBoard, noBoardId); result.rules = ReactiveCache.getRules(byBoard, noBoardId); result.checklists = [];