Merge branch 'thuanpq-auto-update-card-cover-with-latest-uploaded-image' into devel

This commit is contained in:
Lauri Ojansivu 2017-12-11 22:08:17 +02:00
commit 7214e4bb2f
2 changed files with 8 additions and 1 deletions

View file

@ -4,6 +4,7 @@ This release adds the following new features:
* [Change password of any user in Standalone Wekan Admin Panel](https://github.com/wekan/wekan/pull/1372);
* [Performance optimization: Move more global subscriptions to template subscription](https://github.com/wekan/wekan/pull/1373);
* [Auto update card cover with latest uploaded image attachment](https://github.com/wekan/wekan/pull/1387).
* Update tranlations. Add Latvian language;
* Update to Meteor 1.6.0, Node 6.12.2 and MongoDB 3.2.18.

View file

@ -60,7 +60,13 @@ Template.cardAttachmentsPopup.events({
file.boardId = card.boardId;
file.cardId = card._id;
file.userId = Meteor.userId();
Attachments.insert(file);
const attachment = Attachments.insert(file);
if (attachment && attachment._id && attachment.isImage()) {
card.setCover(attachment._id);
}
Popup.close();
});
},