From c41c1e5293ebb81cb767d2476ae6bf5cec0d983d Mon Sep 17 00:00:00 2001 From: Daniel Eder Date: Thu, 26 Mar 2020 10:57:05 +0100 Subject: subtasks now use parent task swimlane by default --- client/components/cards/subtasks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/components/cards/subtasks.js b/client/components/cards/subtasks.js index 34348fe1..fad859e7 100644 --- a/client/components/cards/subtasks.js +++ b/client/components/cards/subtasks.js @@ -20,7 +20,7 @@ BlazeComponent.extendComponent({ const crtBoard = Boards.findOne(card.boardId); const targetBoard = crtBoard.getDefaultSubtasksBoard(); const listId = targetBoard.getDefaultSubtasksListId(); - const swimlaneId = targetBoard.getDefaultSwimline()._id; + const swimlaneId = card.swimlaneId; if (title) { const _id = Cards.insert({ -- cgit v1.2.3-1-g7c22 From 89fe030fa35ea24195ac366aaf3a1c917b305249 Mon Sep 17 00:00:00 2001 From: Daniel Eder Date: Thu, 2 Apr 2020 07:49:26 +0200 Subject: subtasks now use swimlane with title matching parent lane title As discussed in #1953 this is required to handle two-board scenarios correctly. --- client/components/cards/subtasks.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/components/cards/subtasks.js b/client/components/cards/subtasks.js index fad859e7..cdc227fc 100644 --- a/client/components/cards/subtasks.js +++ b/client/components/cards/subtasks.js @@ -20,7 +20,13 @@ BlazeComponent.extendComponent({ const crtBoard = Boards.findOne(card.boardId); const targetBoard = crtBoard.getDefaultSubtasksBoard(); const listId = targetBoard.getDefaultSubtasksListId(); - const swimlaneId = card.swimlaneId; + + //Get the full swimlane data for the parent task. + const parentSwimlane = Swimlanes.findOne({boardId: crtBoard._id, _id: card.swimlaneId}); + //find the swimlane of the same name in the target board. + const targetSwimlane = Swimlanes.findOne({boardId: targetBoard._id, title: parentSwimlane.title}); + //If no swimlane with a matching title exists in the target board, fall back to the default swimlane. + const swimlaneId = targetSwimlane === undefined ? targetBoard.getDefaultSwimline()._id : targetSwimlane._id; if (title) { const _id = Cards.insert({ -- cgit v1.2.3-1-g7c22