diff options
author | Romulus Tsai 蔡仲明 <urakagi@gmail.com> | 2020-05-08 10:13:11 +0800 |
---|---|---|
committer | Romulus Tsai 蔡仲明 <urakagi@gmail.com> | 2020-05-08 10:13:11 +0800 |
commit | c3458855bdb52c976ee6689ad5a0d4e92e96f2e3 (patch) | |
tree | d9dbbcc3087b5bfc520710b5f5624a3f4e2b78e6 /client/components/cards/subtasks.js | |
parent | 444848876759173ad80203129250d2f0311f30fc (diff) | |
parent | cfcc73724fcd394150d1b815d0a7a4c466e216b5 (diff) | |
download | wekan-c3458855bdb52c976ee6689ad5a0d4e92e96f2e3.tar.gz wekan-c3458855bdb52c976ee6689ad5a0d4e92e96f2e3.tar.bz2 wekan-c3458855bdb52c976ee6689ad5a0d4e92e96f2e3.zip |
Merge branch 'master' into lib-change
Diffstat (limited to 'client/components/cards/subtasks.js')
-rw-r--r-- | client/components/cards/subtasks.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/client/components/cards/subtasks.js b/client/components/cards/subtasks.js index 34348fe1..4cd15c11 100644 --- a/client/components/cards/subtasks.js +++ b/client/components/cards/subtasks.js @@ -20,7 +20,22 @@ BlazeComponent.extendComponent({ const crtBoard = Boards.findOne(card.boardId); const targetBoard = crtBoard.getDefaultSubtasksBoard(); const listId = targetBoard.getDefaultSubtasksListId(); - const swimlaneId = targetBoard.getDefaultSwimline()._id; + + //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({ |