diff options
author | Ghassen Rjab <rjab.ghassen@gmail.com> | 2017-09-02 13:19:31 +0100 |
---|---|---|
committer | Ghassen Rjab <rjab.ghassen@gmail.com> | 2017-09-02 13:19:31 +0100 |
commit | 2e845a51343fccf6f8b6a2b9e1142d771f2cf40d (patch) | |
tree | 9a47a4634204b620525a1c37dbacb62de8ee8ee2 /models | |
parent | 255df20da068a203589dba15a5ad249183cd50f5 (diff) | |
download | wekan-2e845a51343fccf6f8b6a2b9e1142d771f2cf40d.tar.gz wekan-2e845a51343fccf6f8b6a2b9e1142d771f2cf40d.tar.bz2 wekan-2e845a51343fccf6f8b6a2b9e1142d771f2cf40d.zip |
Uncomment code about adding attachments' related activities
Diffstat (limited to 'models')
-rw-r--r-- | models/trelloCreator.js | 30 | ||||
-rw-r--r-- | models/wekanCreator.js | 30 |
2 files changed, 24 insertions, 36 deletions
diff --git a/models/trelloCreator.js b/models/trelloCreator.js index 4f64edd6..b296efdf 100644 --- a/models/trelloCreator.js +++ b/models/trelloCreator.js @@ -547,24 +547,18 @@ export class TrelloCreator { // Comment related activities // Trello doesn't export the comment id // Attachment related activities - // TODO: We can't add activities related to adding attachments - // because when we import an attachment, an activity is - // autmatically created. We need to directly insert the attachment - // without calling the "Attachments.files.after.insert" hook first, - // then we can uncomment the code below - // case 'addAttachment': { - // console.log(this.attachmentIds); - // Activities.direct.insert({ - // userId: this._user(activity.userId), - // type: 'card', - // activityType: activity.activityType, - // attachmentId: this.attachmentIds[activity.attachmentId], - // cardId: this.cards[activity.cardId], - // boardId, - // createdAt: this._now(activity.createdAt), - // }); - // break; - // } + case 'addAttachmentToCard': { + Activities.direct.insert({ + userId: this._user(action.idMemberCreator), + type: 'card', + activityType: 'addAttachment', + attachmentId: this.attachmentIds[action.data.attachment.id], + cardId: this.cards[action.data.card.id], + boardId, + createdAt: this._now(action.date), + }); + break; + } // Checklist related activities case 'addChecklistToCard': { Activities.direct.insert({ diff --git a/models/wekanCreator.js b/models/wekanCreator.js index 7e320817..9c7f50ec 100644 --- a/models/wekanCreator.js +++ b/models/wekanCreator.js @@ -550,24 +550,18 @@ export class WekanCreator { break; } // Attachment related activities - // TODO: We can't add activities related to adding attachments - // because when we import an attachment, an activity is - // autmatically created. We need to directly insert the attachment - // without calling the "Attachments.files.after.insert" hook first, - // then we can uncomment the code below - // case 'addAttachment': { - // console.log(this.attachmentIds); - // Activities.direct.insert({ - // userId: this._user(activity.userId), - // type: 'card', - // activityType: activity.activityType, - // attachmentId: this.attachmentIds[activity.attachmentId], - // cardId: this.cards[activity.cardId], - // boardId, - // createdAt: this._now(activity.createdAt), - // }); - // break; - // } + case 'addAttachment': { + Activities.direct.insert({ + userId: this._user(activity.userId), + type: 'card', + activityType: activity.activityType, + attachmentId: this.attachmentIds[activity.attachmentId], + cardId: this.cards[activity.cardId], + boardId, + createdAt: this._now(activity.createdAt), + }); + break; + } // Checklist related activities case 'addChecklist': { Activities.direct.insert({ |