mirror of
https://github.com/wekan/wekan.git
synced 2025-12-17 16:00:13 +01:00
Ignore checklists with missing cards
This commit is contained in:
parent
eb945f26a3
commit
f883757552
1 changed files with 22 additions and 20 deletions
|
|
@ -398,27 +398,29 @@ export class TrelloCreator {
|
||||||
|
|
||||||
createChecklists(trelloChecklists) {
|
createChecklists(trelloChecklists) {
|
||||||
trelloChecklists.forEach((checklist) => {
|
trelloChecklists.forEach((checklist) => {
|
||||||
// Create the checklist
|
if (this.cards[checklist.idCard]) {
|
||||||
const checklistToCreate = {
|
// Create the checklist
|
||||||
cardId: this.cards[checklist.idCard],
|
const checklistToCreate = {
|
||||||
title: checklist.name,
|
cardId: this.cards[checklist.idCard],
|
||||||
createdAt: this._now(),
|
title: checklist.name,
|
||||||
sort: checklist.pos,
|
createdAt: this._now(),
|
||||||
};
|
sort: checklist.pos,
|
||||||
const checklistId = Checklists.direct.insert(checklistToCreate);
|
};
|
||||||
// keep track of Trello id => WeKan id
|
const checklistId = Checklists.direct.insert(checklistToCreate);
|
||||||
this.checklists[checklist.id] = checklistId;
|
// keep track of Trello id => WeKan id
|
||||||
// Now add the items to the checklist
|
this.checklists[checklist.id] = checklistId;
|
||||||
const itemsToCreate = [];
|
// Now add the items to the checklist
|
||||||
checklist.checkItems.forEach((item) => {
|
const itemsToCreate = [];
|
||||||
itemsToCreate.push({
|
checklist.checkItems.forEach((item) => {
|
||||||
_id: checklistId + itemsToCreate.length,
|
itemsToCreate.push({
|
||||||
title: item.name,
|
_id: checklistId + itemsToCreate.length,
|
||||||
isFinished: item.state === 'complete',
|
title: item.name,
|
||||||
sort: item.pos,
|
isFinished: item.state === 'complete',
|
||||||
|
sort: item.pos,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
Checklists.direct.update(checklistId, {$set: {items: itemsToCreate}});
|
||||||
Checklists.direct.update(checklistId, {$set: {items: itemsToCreate}});
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue