mirror of
https://github.com/wekan/wekan.git
synced 2026-02-05 08:01:49 +01:00
Move every Boards.findOne(boardId) to the ReactiveCache (Part 2)
This commit is contained in:
parent
9022e9949f
commit
a182482cfb
37 changed files with 166 additions and 127 deletions
|
|
@ -1,3 +1,5 @@
|
|||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
|
||||
export class DialogWithBoardSwimlaneList extends BlazeComponent {
|
||||
/** returns the card dialog options
|
||||
* @return Object with properties { boardId, swimlaneId, listId }
|
||||
|
|
@ -62,7 +64,7 @@ export class DialogWithBoardSwimlaneList extends BlazeComponent {
|
|||
/** sets the first swimlane id */
|
||||
setFirstSwimlaneId() {
|
||||
try {
|
||||
const board = Boards.findOne(this.selectedBoardId.get());
|
||||
const board = ReactiveCache.getBoard(this.selectedBoardId.get());
|
||||
const swimlaneId = board.swimlanes().fetch()[0]._id;
|
||||
this.selectedSwimlaneId.set(swimlaneId);
|
||||
} catch (e) {}
|
||||
|
|
@ -70,7 +72,7 @@ export class DialogWithBoardSwimlaneList extends BlazeComponent {
|
|||
/** sets the first list id */
|
||||
setFirstListId() {
|
||||
try {
|
||||
const board = Boards.findOne(this.selectedBoardId.get());
|
||||
const board = ReactiveCache.getBoard(this.selectedBoardId.get());
|
||||
const listId = board.lists().fetch()[0]._id;
|
||||
this.selectedListId.set(listId);
|
||||
} catch (e) {}
|
||||
|
|
@ -120,14 +122,14 @@ export class DialogWithBoardSwimlaneList extends BlazeComponent {
|
|||
|
||||
/** returns all available swimlanes of the current board */
|
||||
swimlanes() {
|
||||
const board = Boards.findOne(this.selectedBoardId.get());
|
||||
const board = ReactiveCache.getBoard(this.selectedBoardId.get());
|
||||
const ret = board.swimlanes();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/** returns all available lists of the current board */
|
||||
lists() {
|
||||
const board = Boards.findOne(this.selectedBoardId.get());
|
||||
const board = ReactiveCache.getBoard(this.selectedBoardId.get());
|
||||
const ret = board.lists();
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
|
||||
// XXX There is no reason to define these shortcuts globally, they should be
|
||||
// attached to a template (most of them will go in the `board` template).
|
||||
|
||||
|
|
@ -76,7 +78,7 @@ Mousetrap.bind(numbArray, (evt, key) => {
|
|||
return;
|
||||
}
|
||||
const currentBoardId = Session.get('currentBoard');
|
||||
board = Boards.findOne(currentBoardId);
|
||||
board = ReactiveCache.getBoard(currentBoardId);
|
||||
labels = board.labels;
|
||||
if(MultiSelection.isActive())
|
||||
{
|
||||
|
|
@ -100,7 +102,7 @@ Mousetrap.bind(numArray, (evt, key) => {
|
|||
if (currentUserId === null) {
|
||||
return;
|
||||
}
|
||||
board = Boards.findOne(currentBoardId);
|
||||
board = ReactiveCache.getBoard(currentBoardId);
|
||||
labels = board.labels;
|
||||
if(MultiSelection.isActive() && Meteor.user().isBoardMember())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ Utils = {
|
|||
|
||||
// XXX We should remove these two methods
|
||||
goBoardId(_id) {
|
||||
const board = Boards.findOne(_id);
|
||||
const board = ReactiveCache.getBoard(_id);
|
||||
return (
|
||||
board &&
|
||||
FlowRouter.go('board', {
|
||||
|
|
@ -213,7 +213,7 @@ Utils = {
|
|||
|
||||
goCardId(_id) {
|
||||
const card = Cards.findOne(_id);
|
||||
const board = Boards.findOne(card.boardId);
|
||||
const board = ReactiveCache.getBoard(card.boardId);
|
||||
return (
|
||||
board &&
|
||||
FlowRouter.go('card', {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue