Merge pull request #3733 from jrsupplee/issue-1569

Fix: Trello data without labels definition
This commit is contained in:
Lauri Ojansivu 2021-04-20 09:58:18 +03:00 committed by GitHub
commit 71702b5821
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -208,17 +208,19 @@ export class TrelloCreator {
}
});
}
trelloBoard.labels.forEach(label => {
const labelToCreate = {
_id: Random.id(6),
color: label.color ? label.color : 'black',
name: label.name,
};
// We need to remember them by Trello ID, as this is the only ref we have
// when importing cards.
this.labels[label.id] = labelToCreate._id;
boardToCreate.labels.push(labelToCreate);
});
if (trelloBoard.labels) {
trelloBoard.labels.forEach(label => {
const labelToCreate = {
_id: Random.id(6),
color: label.color ? label.color : 'black',
name: label.name,
};
// We need to remember them by Trello ID, as this is the only ref we have
// when importing cards.
this.labels[label.id] = labelToCreate._id;
boardToCreate.labels.push(labelToCreate);
});
}
const boardId = Boards.direct.insert(boardToCreate);
Boards.direct.update(boardId, { $set: { modifiedAt: this._now() } });
// log activity