diff options
author | Lauri Ojansivu <x@xet7.org> | 2018-04-27 17:00:56 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2018-04-27 17:00:56 +0300 |
commit | 21e68f3e54b0253d3fef238a3c8fd20fc0d560d9 (patch) | |
tree | d435939676a0dd40299336a8b78b39f90735b49b | |
parent | 3b6ec34bf504ebfc7e83416ec1a67ce37ecf907d (diff) | |
parent | 116bc38136dd1a428b89e6f4daba934a62c16baa (diff) | |
download | wekan-21e68f3e54b0253d3fef238a3c8fd20fc0d560d9.tar.gz wekan-21e68f3e54b0253d3fef238a3c8fd20fc0d560d9.tar.bz2 wekan-21e68f3e54b0253d3fef238a3c8fd20fc0d560d9.zip |
Merge branch 'zebby76-devel' into devel
-rw-r--r-- | CHANGELOG.md | 8 | ||||
-rw-r--r-- | models/trelloCreator.js | 16 |
2 files changed, 18 insertions, 6 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index fb53b18d..828298b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# Upcoming Wekan release + +This release fixes the following bugs: + +- [Fix Trello import of ChecklistItems](https://github.com/wekan/wekan/pull/1611). + +Thanks to Github user zebby76 for contributions. + # v0.87 2018-04-27 Wekan release This release fixes the following bugs: diff --git a/models/trelloCreator.js b/models/trelloCreator.js index 89e48a16..72af1f84 100644 --- a/models/trelloCreator.js +++ b/models/trelloCreator.js @@ -429,17 +429,21 @@ export class TrelloCreator { const checklistId = Checklists.direct.insert(checklistToCreate); // keep track of Trello id => WeKan id this.checklists[checklist.id] = checklistId; - // Now add the items to the checklist + // Now add the items to the checklistItems + var counter = 0; const itemsToCreate = []; checklist.checkItems.forEach((item) => { - itemsToCreate.push({ - _id: checklistId + itemsToCreate.length, + counter++; + const checklistItemTocreate = { + _id: checklistId + counter, title: item.name, - isFinished: item.state === 'complete', + checklistId: this.checklists[checklist.id], + cardId: this.cards[checklist.idCard], sort: item.pos, - }); + isFinished: item.state === 'complete', + }; + ChecklistItems.direct.insert(checklistItemTocreate); }); - Checklists.direct.update(checklistId, {$set: {items: itemsToCreate}}); } }); } |