mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Move every CardComments.find(idOrFirstObjectSelector, options) to the ReactiveCache (directory models/)
This commit is contained in:
parent
fef6433b75
commit
25989b9736
6 changed files with 11 additions and 11 deletions
|
|
@ -129,11 +129,11 @@ template(name="minicard")
|
||||||
|
|
||||||
.badges
|
.badges
|
||||||
unless currentUser.isNoComments
|
unless currentUser.isNoComments
|
||||||
if comments.count
|
if comments.length
|
||||||
.badge(title="{{_ 'card-comments-title' comments.count }}")
|
.badge(title="{{_ 'card-comments-title' comments.length }}")
|
||||||
span.badge-icon.fa.fa-comment-o.badge-comment
|
span.badge-icon.fa.fa-comment-o.badge-comment
|
||||||
= ' '
|
= ' '
|
||||||
= comments.count
|
= comments.length
|
||||||
//span.badge-comment.badge-text
|
//span.badge-comment.badge-text
|
||||||
//| {{_ 'comment'}}
|
//| {{_ 'comment'}}
|
||||||
if getDescription
|
if getDescription
|
||||||
|
|
|
||||||
|
|
@ -172,7 +172,7 @@ CardComments.textSearch = (userId, textArray) => {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
// console.log('cardComments selector:', selector);
|
// console.log('cardComments selector:', selector);
|
||||||
|
|
||||||
const comments = CardComments.find(selector);
|
const comments = ReactiveCache.getCardComments(selector);
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
// console.log('count:', comments.count());
|
// console.log('count:', comments.count());
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
|
|
@ -246,7 +246,7 @@ if (Meteor.isServer) {
|
||||||
Authentication.checkBoardAccess(req.userId, paramBoardId);
|
Authentication.checkBoardAccess(req.userId, paramBoardId);
|
||||||
JsonRoutes.sendResult(res, {
|
JsonRoutes.sendResult(res, {
|
||||||
code: 200,
|
code: 200,
|
||||||
data: CardComments.find({
|
data: ReactiveCache.getCardComments({
|
||||||
boardId: paramBoardId,
|
boardId: paramBoardId,
|
||||||
cardId: paramCardId,
|
cardId: paramCardId,
|
||||||
}).map(function (doc) {
|
}).map(function (doc) {
|
||||||
|
|
|
||||||
|
|
@ -606,7 +606,7 @@ Cards.helpers({
|
||||||
});
|
});
|
||||||
|
|
||||||
// copy card comments
|
// copy card comments
|
||||||
CardComments.find({ cardId: oldId }).forEach(cmt => {
|
ReactiveCache.getCardComments({ cardId: oldId }).forEach(cmt => {
|
||||||
cmt.copy(_id);
|
cmt.copy(_id);
|
||||||
});
|
});
|
||||||
// restore the id, otherwise new copies will fail
|
// restore the id, otherwise new copies will fail
|
||||||
|
|
@ -780,12 +780,12 @@ Cards.helpers({
|
||||||
comments() {
|
comments() {
|
||||||
let ret
|
let ret
|
||||||
if (this.isLinkedBoard()) {
|
if (this.isLinkedBoard()) {
|
||||||
ret = CardComments.find(
|
ret = ReactiveCache.getCardComments(
|
||||||
{ boardId: this.linkedId },
|
{ boardId: this.linkedId },
|
||||||
{ sort: { createdAt: -1 } },
|
{ sort: { createdAt: -1 } },
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
ret = CardComments.find(
|
ret = ReactiveCache.getCardComments(
|
||||||
{ cardId: this.getRealId() },
|
{ cardId: this.getRealId() },
|
||||||
{ sort: { createdAt: -1 } },
|
{ sort: { createdAt: -1 } },
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ export class Exporter {
|
||||||
{ boardIds: this._boardId },
|
{ boardIds: this._boardId },
|
||||||
{ fields: { boardIds: 0 } },
|
{ fields: { boardIds: 0 } },
|
||||||
);
|
);
|
||||||
result.comments = CardComments.find(byBoard, noBoardId).fetch();
|
result.comments = ReactiveCache.getCardComments(byBoard, noBoardId);
|
||||||
result.activities = ReactiveCache.getActivities(byBoard, noBoardId);
|
result.activities = ReactiveCache.getActivities(byBoard, noBoardId);
|
||||||
result.rules = ReactiveCache.getRules(byBoard, noBoardId);
|
result.rules = ReactiveCache.getRules(byBoard, noBoardId);
|
||||||
result.checklists = [];
|
result.checklists = [];
|
||||||
|
|
|
||||||
|
|
@ -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.activities = ReactiveCache.getActivities(byBoard, noBoardId);
|
||||||
result.rules = ReactiveCache.getRules(byBoard, noBoardId);
|
result.rules = ReactiveCache.getRules(byBoard, noBoardId);
|
||||||
result.checklists = [];
|
result.checklists = [];
|
||||||
|
|
|
||||||
|
|
@ -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.activities = ReactiveCache.getActivities(byBoard, noBoardId);
|
||||||
result.rules = ReactiveCache.getRules(byBoard, noBoardId);
|
result.rules = ReactiveCache.getRules(byBoard, noBoardId);
|
||||||
result.checklists = [];
|
result.checklists = [];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue