diff options
author | Lauri Ojansivu <x@xet7.org> | 2018-02-07 15:37:53 +0200 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2018-02-07 15:37:53 +0200 |
commit | c5a707a7f543001c1d53a5c0e92840d059475e87 (patch) | |
tree | 56844e83f659dbbc8f3503a37e62147b18bb3428 /models/trelloCreator.js | |
parent | b2d3138220d37e8e21e22e2437b888b490341eb9 (diff) | |
parent | b3d31588634b3ff01b113579a7a715f1f9f2f234 (diff) | |
download | wekan-c5a707a7f543001c1d53a5c0e92840d059475e87.tar.gz wekan-c5a707a7f543001c1d53a5c0e92840d059475e87.tar.bz2 wekan-c5a707a7f543001c1d53a5c0e92840d059475e87.zip |
Merge branch 'devel'
Diffstat (limited to 'models/trelloCreator.js')
-rw-r--r-- | models/trelloCreator.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/models/trelloCreator.js b/models/trelloCreator.js index 972673e6..2d85ee71 100644 --- a/models/trelloCreator.js +++ b/models/trelloCreator.js @@ -23,6 +23,8 @@ export class TrelloCreator { // Map of labels Trello ID => Wekan ID this.labels = {}; + // Default swimlane + this.swimlane = null; // Map of lists Trello ID => Wekan ID this.lists = {}; // Map of cards Trello ID => Wekan ID @@ -230,6 +232,7 @@ export class TrelloCreator { dateLastActivity: this._now(), description: card.desc, listId: this.lists[card.idList], + swimlaneId: this.swimlane, sort: card.pos, title: card.name, // we attribute the card to its creator if available @@ -397,6 +400,22 @@ export class TrelloCreator { }); } + createSwimlanes(boardId) { + const swimlaneToCreate = { + archived: false, + boardId, + // We are being defensing here by providing a default date (now) if the + // creation date wasn't found on the action log. This happen on old + // Wekan boards (eg from 2013) that didn't log the 'createList' action + // we require. + createdAt: this._now(), + title: 'Default', + }; + const swimlaneId = Swimlanes.direct.insert(swimlaneToCreate); + Swimlanes.direct.update(swimlaneId, {$set: {'updatedAt': this._now()}}); + this.swimlane = swimlaneId; + } + createChecklists(trelloChecklists) { trelloChecklists.forEach((checklist) => { if (this.cards[checklist.idCard]) { @@ -607,6 +626,7 @@ export class TrelloCreator { this.parseActions(board.actions); const boardId = this.createBoardAndLabels(board); this.createLists(board.lists, boardId); + this.createSwimlanes(boardId); this.createCards(board.cards, boardId); this.createChecklists(board.checklists); this.importActions(board.actions, boardId); |