mirror of
https://github.com/wekan/wekan.git
synced 2025-12-18 00:10:13 +01:00
Merge pull request #3389 from daniel-eder/fix/clone-board-checklist-items
Fix not all checklist items being imported/cloned
This commit is contained in:
commit
ee7d82c006
1 changed files with 18 additions and 12 deletions
|
|
@ -716,18 +716,24 @@ export class WekanCreator {
|
||||||
|
|
||||||
createChecklistItems(wekanChecklistItems) {
|
createChecklistItems(wekanChecklistItems) {
|
||||||
wekanChecklistItems.forEach((checklistitem, checklistitemIndex) => {
|
wekanChecklistItems.forEach((checklistitem, checklistitemIndex) => {
|
||||||
// Create the checklistItem
|
//Check if the checklist for this item (still) exists
|
||||||
const checklistItemTocreate = {
|
//If a checklist was deleted, but items remain, the import would error out here
|
||||||
title: checklistitem.title,
|
//Leading to no further checklist items being imported
|
||||||
checklistId: this.checklists[checklistitem.checklistId],
|
if (this.checklists[checklistitem.checklistId]) {
|
||||||
cardId: this.cards[checklistitem.cardId],
|
// Create the checklistItem
|
||||||
sort: checklistitem.sort ? checklistitem.sort : checklistitemIndex,
|
const checklistItemTocreate = {
|
||||||
isFinished: checklistitem.isFinished,
|
title: checklistitem.title,
|
||||||
};
|
checklistId: this.checklists[checklistitem.checklistId],
|
||||||
const checklistItemId = ChecklistItems.direct.insert(
|
cardId: this.cards[checklistitem.cardId],
|
||||||
checklistItemTocreate,
|
sort: checklistitem.sort ? checklistitem.sort : checklistitemIndex,
|
||||||
);
|
isFinished: checklistitem.isFinished,
|
||||||
this.checklistItems[checklistitem._id] = checklistItemId;
|
};
|
||||||
|
|
||||||
|
const checklistItemId = ChecklistItems.direct.insert(
|
||||||
|
checklistItemTocreate,
|
||||||
|
);
|
||||||
|
this.checklistItems[checklistitem._id] = checklistItemId;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue