From 84d60b5908c4e2e7bc90939ba311bad7a5fecffd Mon Sep 17 00:00:00 2001 From: Thuan Pham Quoc Date: Sat, 9 Dec 2017 00:36:23 +0700 Subject: Added - auto update card cover with latest uploaded image attachment of card --- client/components/cards/attachments.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/components/cards/attachments.js b/client/components/cards/attachments.js index 36e8a5ec..b1f88bf1 100644 --- a/client/components/cards/attachments.js +++ b/client/components/cards/attachments.js @@ -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(); }); }, -- cgit v1.2.3-1-g7c22 From fd7a140429425fbc6c5cffc8d12f2da03e950e13 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Mon, 11 Dec 2017 22:07:47 +0200 Subject: Auto update card cover with latest uploaded image attachment. Thanks to thuanpq ! --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97497b7a..8517746a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. -- cgit v1.2.3-1-g7c22