From 775476f97c1dda92e856ca4650e6003ea1487d2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Manelli?= Date: Sun, 24 Feb 2019 11:54:52 +0100 Subject: Fix miniscreen render --- models/lists.js | 6 +++--- models/swimlanes.js | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'models') diff --git a/models/lists.js b/models/lists.js index 453e0be1..bf2430ee 100644 --- a/models/lists.js +++ b/models/lists.js @@ -29,7 +29,7 @@ Lists.attachSchema(new SimpleSchema({ }, swimlaneId: { /** - * the swimalen associated to this list. Used for templates + * the swimlane associated to this list. Used for templates */ type: String, defaultValue: '', @@ -137,7 +137,7 @@ Lists.allow({ }); Lists.helpers({ - copy() { + copy(swimlaneId) { const oldId = this._id; let _id = null; existingListWithSameName = Lists.findOne({ @@ -159,7 +159,7 @@ Lists.helpers({ card.type = 'cardType-card'; card.listId = _id; card.boardId = this.boardId; - card.swimlaneId = this.swimlaneId; + card.swimlaneId = swimlaneId; card.copy(); }); }, diff --git a/models/swimlanes.js b/models/swimlanes.js index 6f679a8d..d3548329 100644 --- a/models/swimlanes.js +++ b/models/swimlanes.js @@ -112,9 +112,9 @@ Swimlanes.helpers({ archived: false, }).forEach((list) => { list.type = 'list'; - list.swimlaneId = _id; + list.swimlaneId = ''; list.boardId = this.boardId; - list.copy(); + list.copy(_id); }); }, @@ -127,7 +127,8 @@ Swimlanes.helpers({ lists() { return Lists.find(Filter.mongoSelector({ - swimlaneId: this._id, + boardId: this.boardId, + swimlaneId: {$in: [this._id, '']}, archived: false, }), { sort: ['sort'] }); }, -- cgit v1.2.3-1-g7c22