summaryrefslogtreecommitdiffstats
path: root/client/components
diff options
context:
space:
mode:
authorXavier Priour <xavier.priour@bubblyware.com>2015-10-14 10:10:07 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-10-14 23:23:16 +0200
commit432c1ebb5d9165b9c63b10ef489c6f9e84470e72 (patch)
treead44b22cd3c5e58af0d6fdd3e9068785c5c4a0d4 /client/components
parent1b9df0049259438d001abd9c81f15ce8f7d25b14 (diff)
downloadwekan-432c1ebb5d9165b9c63b10ef489c6f9e84470e72.tar.gz
wekan-432c1ebb5d9165b9c63b10ef489c6f9e84470e72.tar.bz2
wekan-432c1ebb5d9165b9c63b10ef489c6f9e84470e72.zip
Import single card: now with description and comments
Diffstat (limited to 'client/components')
-rw-r--r--client/components/lists/listHeader.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/client/components/lists/listHeader.js b/client/components/lists/listHeader.js
index 28e7ab89..745d1255 100644
--- a/client/components/lists/listHeader.js
+++ b/client/components/lists/listHeader.js
@@ -60,13 +60,28 @@ Template.listImportCardPopup.events({
sortIndex = Utils.calculateIndex(null, firstCardDom).base;
const cardToCreate = {
title: data.name,
+ description: data.desc,
listId: this._id,
boardId: this.boardId,
userId: Meteor.userId(),
sort: sortIndex,
}
- // 3. finally, insert new card into list
+ // 3. insert new card into list
const _id = Cards.insert(cardToCreate);
+ // 4. parse actions and add comments/activities - if any
+ data.actions.forEach((current, i, actions)=>{
+ if(current.type == 'commentCard') {
+ const commentToCreate = {
+ boardId: this.boardId,
+ cardId: _id,
+ userId: Meteor.userId(),
+ text: current.data.text
+ }
+ CardComments.insert(commentToCreate);
+ }
+ Popup.close();
+ });
+
// In case the filter is active we need to add the newly inserted card in
// the list of exceptions -- cards that are not filtered. Otherwise the
// card will disappear instantly.