summaryrefslogtreecommitdiffstats
path: root/client/components/lists
diff options
context:
space:
mode:
authorAndrés Manelli <andresmanelli@gmail.com>2019-02-27 20:45:58 +0100
committerAndrés Manelli <andresmanelli@gmail.com>2019-02-27 21:50:08 +0100
commitda21a2a410c9b905de89d66236748e0c8f5357ea (patch)
tree631efc1954e7be787576284ea55321dd7c424d97 /client/components/lists
parent904b5bf0f5f6e36131bf2d081a5d08fef408ac81 (diff)
downloadwekan-da21a2a410c9b905de89d66236748e0c8f5357ea.tar.gz
wekan-da21a2a410c9b905de89d66236748e0c8f5357ea.tar.bz2
wekan-da21a2a410c9b905de89d66236748e0c8f5357ea.zip
Standarize copy functions. Match labels by name
Diffstat (limited to 'client/components/lists')
-rw-r--r--client/components/lists/listBody.js12
1 files changed, 3 insertions, 9 deletions
diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js
index 04c7eede..598f2130 100644
--- a/client/components/lists/listBody.js
+++ b/client/components/lists/listBody.js
@@ -621,15 +621,12 @@ BlazeComponent.extendComponent({
if (!this.isTemplateSearch || this.isCardTemplateSearch) {
// Card insertion
// 1. Common
- element.boardId = this.boardId;
- element.listId = this.listId;
- element.swimlaneId = this.swimlaneId;
element.sort = Lists.findOne(this.listId).cards().count();
// 1.A From template
if (this.isTemplateSearch) {
element.type = 'cardType-card';
element.linkedId = '';
- _id = element.copy();
+ _id = element.copy(this.boardId, this.swimlaneId, this.listId);
// 1.B Linked card
} else {
delete element._id;
@@ -640,21 +637,18 @@ BlazeComponent.extendComponent({
Filter.addException(_id);
// List insertion
} else if (this.isListTemplateSearch) {
- element.boardId = this.boardId;
element.sort = Swimlanes.findOne(this.swimlaneId).lists().count();
element.type = 'list';
- _id = element.copy(this.swimlaneId);
+ _id = element.copy(this.boardId, this.swimlaneId);
} else if (this.isSwimlaneTemplateSearch) {
- element.boardId = this.boardId;
element.sort = Boards.findOne(this.boardId).swimlanes().count();
element.type = 'swimlalne';
- _id = element.copy();
+ _id = element.copy(this.boardId);
} else if (this.isBoardTemplateSearch) {
board = Boards.findOne(element.linkedId);
board.sort = Boards.find({archived: false}).count();
board.type = 'board';
delete board.slug;
- delete board.members;
_id = board.copy();
}
Popup.close();