2018-08-15 18:47:09 +02:00
|
|
|
BlazeComponent.extendComponent({
|
|
|
|
|
onCreated() {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
events() {
|
|
|
|
|
return [
|
|
|
|
|
{'click .js-add-gen-trigger'(event) {
|
|
|
|
|
|
|
|
|
|
let datas = this.data();
|
|
|
|
|
const actionSelected = this.find('#action').value;
|
|
|
|
|
const boardId = Session.get('currentBoard')
|
|
|
|
|
if(actionSelected == "created"){
|
2018-08-16 00:32:31 +02:00
|
|
|
Triggers.insert({activityType: "createCard","boardId":boardId,"listId":"*"},function(error,id){
|
2018-08-15 18:47:09 +02:00
|
|
|
datas.triggerIdVar.set(id);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if(actionSelected == "removed"){
|
|
|
|
|
Triggers.insert({activityType: "removeCard","boardId":boardId},function(error,id){
|
|
|
|
|
datas.triggerIdVar.set(id);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
}];
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
}).register('boardTriggers');
|