subtasks now use swimlane with title matching parent lane title

As discussed in #1953 this is required to handle two-board scenarios correctly.
This commit is contained in:
Daniel Eder 2020-04-02 07:49:26 +02:00
parent c41c1e5293
commit 89fe030fa3

View file

@ -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({