diff --git a/client/components/boards/boardArchive.js b/client/components/boards/boardArchive.js index f269d1fdc..87525c1f7 100644 --- a/client/components/boards/boardArchive.js +++ b/client/components/boards/boardArchive.js @@ -10,12 +10,13 @@ BlazeComponent.extendComponent({ }, archivedBoards() { - return Boards.find( + const ret = ReactiveCache.getBoards( { archived: true }, { sort: { archivedAt: -1, modifiedAt: -1 }, }, ); + return ret; }, events() { diff --git a/client/components/boards/boardsList.js b/client/components/boards/boardsList.js index d817a4569..7a3a8bcd7 100644 --- a/client/components/boards/boardsList.js +++ b/client/components/boards/boardsList.js @@ -181,9 +181,10 @@ BlazeComponent.extendComponent({ }; } - return Boards.find(query, { + const ret = ReactiveCache.getBoards(query, { sort: { sort: 1 /* boards default sorting */ }, }); + return ret; }, boardLists(boardId) { let boardLists = []; @@ -248,7 +249,7 @@ BlazeComponent.extendComponent({ 'copyBoard', this.currentData()._id, { - sort: Boards.find({ archived: false }).count(), + sort: ReactiveCache.getBoards({ archived: false }).length, type: 'board', title: ReactiveCache.getBoard(this.currentData()._id).title, }, @@ -324,7 +325,7 @@ BlazeComponent.extendComponent({ query.$and[2].$or.push({ 'orgs.orgId': { $in: selectedOrgsValues } }); } - let filteredBoards = Boards.find(query, {}).fetch(); + let filteredBoards = ReactiveCache.getBoards(query, {}); let allBoards = document.getElementsByClassName("js-board"); let currBoard; if (filteredBoards.length > 0) { diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index 9b400e0e9..17b651734 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -961,18 +961,17 @@ BlazeComponent.extendComponent({ }, boards() { - return Boards.find( + const ret = ReactiveCache.getBoards( { archived: false, 'members.userId': Meteor.userId(), - _id: { - $ne: ReactiveCache.getCurrentUser().getTemplatesBoardId(), - }, + _id: { $ne: ReactiveCache.getCurrentUser().getTemplatesBoardId() }, }, { sort: { sort: 1 /* boards default sorting */ }, }, ); + return ret; }, cards() { diff --git a/client/components/cards/checklists.js b/client/components/cards/checklists.js index 98db51d52..8fb146960 100644 --- a/client/components/cards/checklists.js +++ b/client/components/cards/checklists.js @@ -233,7 +233,7 @@ BlazeComponent.extendComponent({ }, boards() { - return Boards.find( + const ret = ReactiveCache.getBoards( { archived: false, 'members.userId': Meteor.userId(), @@ -243,6 +243,7 @@ BlazeComponent.extendComponent({ sort: { sort: 1 /* boards default sorting */ }, }, ); + return ret; }, swimlanes() { diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js index 0a81e0986..1578cc7c2 100644 --- a/client/components/lists/listBody.js +++ b/client/components/lists/listBody.js @@ -444,7 +444,7 @@ BlazeComponent.extendComponent({ }, boards() { - const boards = Boards.find( + const ret = ReactiveCache.getBoards( { archived: false, 'members.userId': Meteor.userId(), @@ -455,7 +455,7 @@ BlazeComponent.extendComponent({ sort: { sort: 1 /* boards default sorting */ }, }, ); - return boards; + return ret; }, swimlanes() { @@ -650,7 +650,7 @@ BlazeComponent.extendComponent({ }, boards() { - const boards = Boards.find( + const ret = ReactiveCache.getBoards( { archived: false, 'members.userId': Meteor.userId(), @@ -661,7 +661,7 @@ BlazeComponent.extendComponent({ sort: { sort: 1 /* boards default sorting */ }, }, ); - return boards; + return ret; }, results() { @@ -752,7 +752,7 @@ BlazeComponent.extendComponent({ 'copyBoard', element.linkedId, { - sort: Boards.find({ archived: false }).count(), + sort: ReactiveCache.getBoards({ archived: false }).length, type: 'board', title: element.title, }, diff --git a/client/components/rules/actions/boardActions.js b/client/components/rules/actions/boardActions.js index 3eaa4a5fa..b69e9f476 100644 --- a/client/components/rules/actions/boardActions.js +++ b/client/components/rules/actions/boardActions.js @@ -4,7 +4,7 @@ BlazeComponent.extendComponent({ onCreated() {}, boards() { - const boards = Boards.find( + const ret = ReactiveCache.getBoards( { archived: false, 'members.userId': Meteor.userId(), @@ -16,7 +16,7 @@ BlazeComponent.extendComponent({ sort: { sort: 1 /* boards default sorting */ }, }, ); - return boards; + return ret; }, events() { diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index aa5608ce2..435073221 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -1,3 +1,4 @@ +import { ReactiveCache } from '/imports/reactiveCache'; import { TAPi18n } from '/imports/i18n'; import { ALLOWED_WAIT_SPINNERS } from '/config/const'; @@ -43,7 +44,7 @@ BlazeComponent.extendComponent({ }, boards() { - return Boards.find( + const ret = ReactiveCache.getBoards( { archived: false, 'members.userId': Meteor.userId(), @@ -53,6 +54,7 @@ BlazeComponent.extendComponent({ sort: { sort: 1 /* boards default sorting */ }, }, ); + return ret; }, toggleForgotPassword() { this.setLoading(true); diff --git a/client/components/sidebar/sidebar.js b/client/components/sidebar/sidebar.js index e6e1a4084..6747feabb 100644 --- a/client/components/sidebar/sidebar.js +++ b/client/components/sidebar/sidebar.js @@ -786,7 +786,7 @@ BlazeComponent.extendComponent({ }, boards() { - return Boards.find( + const ret = ReactiveCache.getBoards( { archived: false, 'members.userId': Meteor.userId(), @@ -795,6 +795,7 @@ BlazeComponent.extendComponent({ sort: { sort: 1 /* boards default sorting */ }, }, ); + return ret; }, lists() { @@ -984,7 +985,7 @@ BlazeComponent.extendComponent({ }, boards() { - return Boards.find( + const ret = ReactiveCache.getBoards( { archived: false, 'members.userId': Meteor.userId(), @@ -993,6 +994,7 @@ BlazeComponent.extendComponent({ sort: { sort: 1 /* boards default sorting */ }, }, ); + return ret; }, lists() { diff --git a/client/components/swimlanes/swimlanes.js b/client/components/swimlanes/swimlanes.js index 706b20767..49dd89590 100644 --- a/client/components/swimlanes/swimlanes.js +++ b/client/components/swimlanes/swimlanes.js @@ -345,7 +345,8 @@ class MoveSwimlaneComponent extends BlazeComponent { } toBoards() { - return Boards.find(this.toBoardsSelector(), { sort: { title: 1 } }); + const ret = ReactiveCache.getBoards(this.toBoardsSelector(), { sort: { title: 1 } }); + return ret; } events() { diff --git a/client/lib/dialogWithBoardSwimlaneList.js b/client/lib/dialogWithBoardSwimlaneList.js index 811170f7d..9d0658e1d 100644 --- a/client/lib/dialogWithBoardSwimlaneList.js +++ b/client/lib/dialogWithBoardSwimlaneList.js @@ -107,7 +107,7 @@ export class DialogWithBoardSwimlaneList extends BlazeComponent { /** returns all available board */ boards() { - const ret = Boards.find( + const ret = ReactiveCache.getBoards( { archived: false, 'members.userId': Meteor.userId(), diff --git a/client/lib/utils.js b/client/lib/utils.js index ce76c0322..ca25a6816 100644 --- a/client/lib/utils.js +++ b/client/lib/utils.js @@ -163,7 +163,7 @@ Utils = { archivedBoardIds() { const archivedBoards = []; - Boards.find({ archived: false }).forEach(board => { + ReactiveCache.getBoards({ archived: false }).forEach(board => { archivedBoards.push(board._id); }); return archivedBoards;