From af119ff7c096e6cb077ba40e1eb0df8d3cc09821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Manelli?= Date: Mon, 22 Jan 2018 23:43:47 -0300 Subject: Add card on first swimlane found --- client/components/lists/listBody.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js index 2ca654b2..6cc94371 100644 --- a/client/components/lists/listBody.js +++ b/client/components/lists/listBody.js @@ -36,7 +36,14 @@ BlazeComponent.extendComponent({ const members = formComponent.members.get(); const labelIds = formComponent.labels.get(); - const swimlaneId = this.parentComponent().parentComponent().data()._id; + const boardId = this.data().board()._id; + const board = Boards.findOne(boardId); + let swimlaneId = ''; + if (board.view === 'board-view-swimlanes') + swimlaneId = this.parentComponent().parentComponent().data()._id; + else + swimlaneId = Swimlanes.findOne({boardId})._id; + if (title) { const _id = Cards.insert({ title, -- cgit v1.2.3-1-g7c22