|
@@ -9,16 +9,17 @@ BlazeComponent.extendComponent({
|
|
const trigger = this.data().triggerVar.get();
|
|
const trigger = this.data().triggerVar.get();
|
|
const actionSelected = this.find('#check-action').value;
|
|
const actionSelected = this.find('#check-action').value;
|
|
const checklistName = this.find('#checklist-name').value;
|
|
const checklistName = this.find('#checklist-name').value;
|
|
|
|
+ const boardId = Session.get('currentBoard');
|
|
|
|
|
|
if(actionSelected == "add"){
|
|
if(actionSelected == "add"){
|
|
const triggerId = Triggers.insert(trigger);
|
|
const triggerId = Triggers.insert(trigger);
|
|
- const actionId = Actions.insert({actionType: "addChecklist","checklistName":checklistName});
|
|
|
|
- Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId});
|
|
|
|
|
|
+ const actionId = Actions.insert({actionType: "addChecklist","checklistName":checklistName,"boardId":boardId});
|
|
|
|
+ Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
|
}
|
|
}
|
|
if(actionSelected == "remove"){
|
|
if(actionSelected == "remove"){
|
|
const triggerId = Triggers.insert(trigger);
|
|
const triggerId = Triggers.insert(trigger);
|
|
- const actionId = Actions.insert({actionType: "removeChecklist","checklistName":checklistName});
|
|
|
|
- Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId});
|
|
|
|
|
|
+ const actionId = Actions.insert({actionType: "removeChecklist","checklistName":checklistName,"boardId":boardId});
|
|
|
|
+ Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
|
}
|
|
}
|
|
|
|
|
|
},
|
|
},
|
|
@@ -27,15 +28,16 @@ BlazeComponent.extendComponent({
|
|
const trigger = this.data().triggerVar.get();
|
|
const trigger = this.data().triggerVar.get();
|
|
const actionSelected = this.find('#checkall-action').value;
|
|
const actionSelected = this.find('#checkall-action').value;
|
|
const checklistName = this.find('#checklist-name2').value;
|
|
const checklistName = this.find('#checklist-name2').value;
|
|
|
|
+ const boardId = Session.get('currentBoard');
|
|
if(actionSelected == "check"){
|
|
if(actionSelected == "check"){
|
|
const triggerId = Triggers.insert(trigger);
|
|
const triggerId = Triggers.insert(trigger);
|
|
- const actionId = Actions.insert({actionType: "checkAll","checklistName":checklistName});
|
|
|
|
- Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId});
|
|
|
|
|
|
+ const actionId = Actions.insert({actionType: "checkAll","checklistName":checklistName,"boardId":boardId});
|
|
|
|
+ Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
|
}
|
|
}
|
|
if(actionSelected == "uncheck"){
|
|
if(actionSelected == "uncheck"){
|
|
const triggerId = Triggers.insert(trigger);
|
|
const triggerId = Triggers.insert(trigger);
|
|
- const actionId = Actions.insert({actionType: "uncheckAll","checklistName":checklistName});
|
|
|
|
- Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId});
|
|
|
|
|
|
+ const actionId = Actions.insert({actionType: "uncheckAll","checklistName":checklistName,"boardId":boardId});
|
|
|
|
+ Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
|
}
|
|
}
|
|
},
|
|
},
|
|
'click .js-add-check-item-action'(event) {
|
|
'click .js-add-check-item-action'(event) {
|
|
@@ -44,15 +46,16 @@ BlazeComponent.extendComponent({
|
|
const checkItemName = this.find("#checkitem-name");
|
|
const checkItemName = this.find("#checkitem-name");
|
|
const checklistName = this.find("#checklist-name3");
|
|
const checklistName = this.find("#checklist-name3");
|
|
const actionSelected = this.find('#check-item-action').value;
|
|
const actionSelected = this.find('#check-item-action').value;
|
|
|
|
+ const boardId = Session.get('currentBoard');
|
|
if(actionSelected == "check"){
|
|
if(actionSelected == "check"){
|
|
const triggerId = Triggers.insert(trigger);
|
|
const triggerId = Triggers.insert(trigger);
|
|
- const actionId = Actions.insert({actionType: "checkItem","checklistName":checklistName,"checkItemName":checkItemName});
|
|
|
|
- Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId});
|
|
|
|
|
|
+ const actionId = Actions.insert({actionType: "checkItem","checklistName":checklistName,"checkItemName":checkItemName,"boardId":boardId});
|
|
|
|
+ Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
|
}
|
|
}
|
|
if(actionSelected == "uncheck"){
|
|
if(actionSelected == "uncheck"){
|
|
const triggerId = Triggers.insert(trigger);
|
|
const triggerId = Triggers.insert(trigger);
|
|
- const actionId = Actions.insert({actionType: "uncheckItem","checklistName":checklistName,"checkItemName":checkItemName});
|
|
|
|
- Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId});
|
|
|
|
|
|
+ const actionId = Actions.insert({actionType: "uncheckItem","checklistName":checklistName,"checkItemName":checkItemName,"boardId":boardId});
|
|
|
|
+ Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
|
}
|
|
}
|
|
},
|
|
},
|
|
}];
|
|
}];
|