diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js index 78d6b71ab..a9ec5beeb 100644 --- a/client/components/lists/listBody.js +++ b/client/components/lists/listBody.js @@ -65,7 +65,7 @@ BlazeComponent.extendComponent({ swimlaneId = this.parentComponent() .parentComponent() .data()._id; // Always swimlanes view - const swimlane = Swimlanes.findOne(swimlaneId); + const swimlane = ReactiveCache.getSwimlane(swimlaneId); // If this is the card templates swimlane, insert a card template if (swimlane.isCardTemplatesSwimlane()) cardType = 'template-card'; // If this is the board templates swimlane, insert a board template and a linked card @@ -739,7 +739,7 @@ BlazeComponent.extendComponent({ Filter.addException(_id); // List insertion } else if (this.isListTemplateSearch) { - element.sort = Swimlanes.findOne(this.swimlaneId) + element.sort = ReactiveCache.getSwimlane(this.swimlaneId) .lists() .count(); element.type = 'list'; diff --git a/client/components/swimlanes/swimlanes.js b/client/components/swimlanes/swimlanes.js index 127e1c04a..32afbd0a9 100644 --- a/client/components/swimlanes/swimlanes.js +++ b/client/components/swimlanes/swimlanes.js @@ -370,7 +370,6 @@ class MoveSwimlaneComponent extends BlazeComponent { return [ { 'click .js-done'() { - // const swimlane = Swimlanes.findOne(this.currentSwimlane._id); const bSelect = $('.js-select-boards')[0]; let boardId; if (bSelect) { diff --git a/models/activities.js b/models/activities.js index 04e889b69..387975d07 100644 --- a/models/activities.js +++ b/models/activities.js @@ -29,10 +29,10 @@ Activities.helpers({ return ReactiveCache.getList(this.listId); }, swimlane() { - return Swimlanes.findOne(this.swimlaneId); + return ReactiveCache.getSwimlane(this.swimlaneId); }, oldSwimlane() { - return Swimlanes.findOne(this.oldSwimlaneId); + return ReactiveCache.getSwimlane(this.oldSwimlaneId); }, oldList() { return ReactiveCache.getList(this.oldListId); diff --git a/models/cards.js b/models/cards.js index 4222f6d17..7b35210d9 100644 --- a/models/cards.js +++ b/models/cards.js @@ -2688,7 +2688,7 @@ function cardMove( oldBoardId, oldBoardName: ReactiveCache.getBoard(oldBoardId).title, cardId: doc._id, - swimlaneName: Swimlanes.findOne(doc.swimlaneId).title, + swimlaneName: ReactiveCache.getSwimlane(doc.swimlaneId).title, swimlaneId: doc.swimlaneId, oldSwimlaneId, }); @@ -2705,7 +2705,7 @@ function cardMove( boardId: doc.boardId, cardId: doc._id, cardTitle: doc.title, - swimlaneName: Swimlanes.findOne(doc.swimlaneId).title, + swimlaneName: ReactiveCache.getSwimlane(doc.swimlaneId).title, swimlaneId: doc.swimlaneId, oldSwimlaneId, }); @@ -2917,7 +2917,7 @@ function cardCreation(userId, doc) { listId: doc.listId, cardId: doc._id, cardTitle: doc.title, - swimlaneName: Swimlanes.findOne(doc.swimlaneId).title, + swimlaneName: ReactiveCache.getSwimlane(doc.swimlaneId).title, swimlaneId: doc.swimlaneId, }); } diff --git a/server/publications/swimlanes.js b/server/publications/swimlanes.js index b3f72fa0e..312403509 100644 --- a/server/publications/swimlanes.js +++ b/server/publications/swimlanes.js @@ -5,7 +5,7 @@ Meteor.methods({ check(swimlaneId, String); check(toBoardId, String); - const swimlane = Swimlanes.findOne(swimlaneId); + const swimlane = ReactiveCache.getSwimlane(swimlaneId); const toBoard = ReactiveCache.getBoard(toBoardId); if (swimlane && toBoard) { @@ -20,7 +20,7 @@ Meteor.methods({ check(swimlaneId, String); check(toBoardId, String); - const swimlane = Swimlanes.findOne(swimlaneId); + const swimlane = ReactiveCache.getSwimlane(swimlaneId); const toBoard = ReactiveCache.getBoard(toBoardId); if (swimlane && toBoard) { diff --git a/server/rulesHelper.js b/server/rulesHelper.js index 221e2b94e..8693de0c4 100644 --- a/server/rulesHelper.js +++ b/server/rulesHelper.js @@ -42,7 +42,7 @@ RulesHelper = { value = oldList.title; } } else if (field === 'oldSwimlaneName') { - const oldSwimlane = Swimlanes.findOne({ _id: activity.oldSwimlaneId }); + const oldSwimlane = ReactiveCache.getSwimlane(activity.oldSwimlaneId); if (oldSwimlane) { value = oldSwimlane.title; } @@ -86,7 +86,7 @@ RulesHelper = { let swimlane; let swimlaneId; if (action.swimlaneName === '*') { - swimlane = Swimlanes.findOne(card.swimlaneId); + swimlane = ReactiveCache.getSwimlane(card.swimlaneId); if (boardId !== action.boardId) { swimlane = Swimlanes.findOne({ title: swimlane.title,