summaryrefslogtreecommitdiffstats
path: root/models/import.js
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2016-02-13 03:12:01 +0100
committerMaxime Quandalle <maxime@quandalle.com>2016-03-17 16:26:14 +0100
commit90601eacae616c3bca46d6dcb643aa94b1fd05c6 (patch)
tree764e2aa0b91e392cdb1ef9faa92ff6c9ffe7efd1 /models/import.js
parentb8aefedcc3dcaf62d1b45f1e4ffb1dc4fdc55f63 (diff)
downloadwekan-90601eacae616c3bca46d6dcb643aa94b1fd05c6.tar.gz
wekan-90601eacae616c3bca46d6dcb643aa94b1fd05c6.tar.bz2
wekan-90601eacae616c3bca46d6dcb643aa94b1fd05c6.zip
Upgrade ESLint to v2
This commit also tweak the code style following backward-incompatible v2 rules.
Diffstat (limited to 'models/import.js')
-rw-r--r--models/import.js19
1 files changed, 5 insertions, 14 deletions
diff --git a/models/import.js b/models/import.js
index fecc5c4d..86ef75b3 100644
--- a/models/import.js
+++ b/models/import.js
@@ -397,8 +397,7 @@ class TrelloCreator {
parseActions(trelloActions) {
trelloActions.forEach((action) => {
- switch (action.type) {
- case 'addAttachmentToCard':
+ if (action.type === 'addAttachmentToCard') {
// We have to be cautious, because the attachment could have been removed later.
// In that case Trello still reports its addition, but removes its 'url' field.
// So we test for that
@@ -412,30 +411,22 @@ class TrelloCreator {
}
this.attachments[trelloCardId].push(trelloAttachment);
}
- break;
- case 'commentCard':
+ } else if (action.type === 'commentCard') {
const id = action.data.card.id;
if (this.comments[id]) {
this.comments[id].push(action);
} else {
this.comments[id] = [action];
}
- break;
- case 'createBoard':
+ } else if (action.type === 'createBoard') {
this.createdAt.board = action.date;
- break;
- case 'createCard':
+ } else if (action.type === 'createCard') {
const cardId = action.data.card.id;
this.createdAt.cards[cardId] = action.date;
this.createdBy.cards[cardId] = action.idMemberCreator;
- break;
- case 'createList':
+ } else if (action.type === 'createList') {
const listId = action.data.list.id;
this.createdAt.lists[listId] = action.date;
- break;
- default:
- // do nothing
- break;
}
});
}