mirror of
https://github.com/wekan/wekan.git
synced 2026-02-13 11:44:20 +01:00
Beautyfied
This commit is contained in:
parent
30a3daa6af
commit
25da8376ca
15 changed files with 715 additions and 461 deletions
|
|
@ -3,63 +3,119 @@ BlazeComponent.extendComponent({
|
|||
|
||||
},
|
||||
|
||||
|
||||
|
||||
events() {
|
||||
return [
|
||||
{'click .js-add-spec-move-action'(event) {
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const actionSelected = this.find('#move-spec-action').value;
|
||||
const listTitle = this.find('#listName').value;
|
||||
const boardId = Session.get('currentBoard');
|
||||
const desc = Utils.getTriggerActionDesc(event,this);
|
||||
if(actionSelected == "top"){
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({actionType: "moveCardToTop","listTitle":listTitle,"boardId":boardId,"desc":desc});
|
||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||
}
|
||||
if(actionSelected == "bottom"){
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({actionType: "moveCardToBottom","listTitle":listTitle,"boardId":boardId,"desc":desc});
|
||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||
}
|
||||
},
|
||||
'click .js-add-gen-move-action'(event) {
|
||||
const desc = Utils.getTriggerActionDesc(event,this);
|
||||
const boardId = Session.get('currentBoard');
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const actionSelected = this.find('#move-gen-action').value;
|
||||
if(actionSelected == "top"){
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({actionType: "moveCardToTop","listTitle":"*","boardId":boardId,"desc":desc});
|
||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||
}
|
||||
if(actionSelected == "bottom"){
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({actionType: "moveCardToBottom","listTitle":"*","boardId":boardId,"desc":desc});
|
||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||
}
|
||||
},
|
||||
'click .js-add-arch-action'(event) {
|
||||
const desc = Utils.getTriggerActionDesc(event,this);
|
||||
const boardId = Session.get('currentBoard');
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const actionSelected = this.find('#arch-action').value;
|
||||
if(actionSelected == "archive"){
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({actionType: "archive","boardId":boardId,"desc":desc});
|
||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||
}
|
||||
if(actionSelected == "unarchive"){
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({actionType: "unarchive","boardId":boardId,"desc":desc});
|
||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||
}
|
||||
},
|
||||
}];
|
||||
},
|
||||
return [{
|
||||
'click .js-add-spec-move-action' (event) {
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const actionSelected = this.find('#move-spec-action').value;
|
||||
const listTitle = this.find('#listName').value;
|
||||
const boardId = Session.get('currentBoard');
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
if (actionSelected == "top") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "moveCardToTop",
|
||||
"listTitle": listTitle,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
if (actionSelected == "bottom") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "moveCardToBottom",
|
||||
"listTitle": listTitle,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-gen-move-action' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
const boardId = Session.get('currentBoard');
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const actionSelected = this.find('#move-gen-action').value;
|
||||
if (actionSelected == "top") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "moveCardToTop",
|
||||
"listTitle": "*",
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
if (actionSelected == "bottom") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "moveCardToBottom",
|
||||
"listTitle": "*",
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-arch-action' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
const boardId = Session.get('currentBoard');
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const actionSelected = this.find('#arch-action').value;
|
||||
if (actionSelected == "archive") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "archive",
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
if (actionSelected == "unarchive") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "unarchive",
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
},
|
||||
}];
|
||||
},
|
||||
|
||||
}).register('boardActions');
|
||||
|
|
@ -3,10 +3,10 @@ BlazeComponent.extendComponent({
|
|||
this.subscribe('allRules');
|
||||
},
|
||||
|
||||
labels(){
|
||||
labels() {
|
||||
const labels = Boards.findOne(Session.get('currentBoard')).labels;
|
||||
for(let i = 0;i<labels.length;i++){
|
||||
if(labels[i].name == "" || labels[i].name == undefined){
|
||||
for (let i = 0; i < labels.length; i++) {
|
||||
if (labels[i].name == "" || labels[i].name == undefined) {
|
||||
labels[i].name = labels[i].color.toUpperCase();
|
||||
}
|
||||
}
|
||||
|
|
@ -14,57 +14,106 @@ BlazeComponent.extendComponent({
|
|||
return labels;
|
||||
},
|
||||
|
||||
|
||||
|
||||
events() {
|
||||
return [
|
||||
{'click .js-add-label-action'(event) {
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const actionSelected = this.find('#label-action').value;
|
||||
const labelId = this.find('#label-id').value;
|
||||
const boardId = Session.get('currentBoard');
|
||||
const desc = Utils.getTriggerActionDesc(event,this);
|
||||
if(actionSelected == "add"){
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({actionType: "addLabel","labelId":labelId,"boardId":boardId,"desc":desc});
|
||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||
}
|
||||
if(actionSelected == "remove"){
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({actionType: "removeLabel","labelId":labelId,"boardId":boardId,"desc":desc});
|
||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||
}
|
||||
return [{
|
||||
'click .js-add-label-action' (event) {
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const actionSelected = this.find('#label-action').value;
|
||||
const labelId = this.find('#label-id').value;
|
||||
const boardId = Session.get('currentBoard');
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
if (actionSelected == "add") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "addLabel",
|
||||
"labelId": labelId,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
if (actionSelected == "remove") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "removeLabel",
|
||||
"labelId": labelId,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
'click .js-add-member-action'(event) {
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const actionSelected = this.find('#member-action').value;
|
||||
const memberName = this.find('#member-name').value;
|
||||
const boardId = Session.get('currentBoard');
|
||||
const desc = Utils.getTriggerActionDesc(event,this);
|
||||
if(actionSelected == "add"){
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({actionType: "addMember","memberName":memberName,"boardId":boardId,"desc":desc});
|
||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId,"desc":desc});
|
||||
}
|
||||
if(actionSelected == "remove"){
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({actionType: "removeMember","memberName":memberName,"boardId":boardId,"desc":desc});
|
||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||
}
|
||||
},
|
||||
'click .js-add-removeall-action'(event) {
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const desc = Utils.getTriggerActionDesc(event,this);
|
||||
const boardId = Session.get('currentBoard');
|
||||
const actionId = Actions.insert({actionType: "removeMember","memberName":"*","boardId":boardId,"desc":desc});
|
||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||
},
|
||||
}];
|
||||
},
|
||||
},
|
||||
'click .js-add-member-action' (event) {
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const actionSelected = this.find('#member-action').value;
|
||||
const memberName = this.find('#member-name').value;
|
||||
const boardId = Session.get('currentBoard');
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
if (actionSelected == "add") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "addMember",
|
||||
"memberName": memberName,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "remove") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "removeMember",
|
||||
"memberName": memberName,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-removeall-action' (event) {
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
const boardId = Session.get('currentBoard');
|
||||
const actionId = Actions.insert({
|
||||
actionType: "removeMember",
|
||||
"memberName": "*",
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
},
|
||||
}];
|
||||
},
|
||||
|
||||
}).register('cardActions');
|
||||
|
|
@ -3,64 +3,126 @@ BlazeComponent.extendComponent({
|
|||
this.subscribe('allRules');
|
||||
},
|
||||
events() {
|
||||
return [
|
||||
{'click .js-add-checklist-action'(event) {
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const actionSelected = this.find('#check-action').value;
|
||||
const checklistName = this.find('#checklist-name').value;
|
||||
const boardId = Session.get('currentBoard');
|
||||
const desc = Utils.getTriggerActionDesc(event,this);
|
||||
if(actionSelected == "add"){
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({actionType: "addChecklist","checklistName":checklistName,"boardId":boardId,"desc":desc});
|
||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||
}
|
||||
if(actionSelected == "remove"){
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({actionType: "removeChecklist","checklistName":checklistName,"boardId":boardId,"desc":desc});
|
||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||
}
|
||||
return [{
|
||||
'click .js-add-checklist-action' (event) {
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const actionSelected = this.find('#check-action').value;
|
||||
const checklistName = this.find('#checklist-name').value;
|
||||
const boardId = Session.get('currentBoard');
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
if (actionSelected == "add") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "addChecklist",
|
||||
"checklistName": checklistName,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
if (actionSelected == "remove") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "removeChecklist",
|
||||
"checklistName": checklistName,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
'click .js-add-checkall-action'(event) {
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const actionSelected = this.find('#checkall-action').value;
|
||||
const checklistName = this.find('#checklist-name2').value;
|
||||
const boardId = Session.get('currentBoard');
|
||||
const desc = Utils.getTriggerActionDesc(event,this);
|
||||
if(actionSelected == "check"){
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({actionType: "checkAll","checklistName":checklistName,"boardId":boardId,"desc":desc});
|
||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||
}
|
||||
if(actionSelected == "uncheck"){
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({actionType: "uncheckAll","checklistName":checklistName,"boardId":boardId,"desc":desc});
|
||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||
}
|
||||
},
|
||||
'click .js-add-check-item-action'(event) {
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const checkItemName = this.find("#checkitem-name");
|
||||
const checklistName = this.find("#checklist-name3");
|
||||
const actionSelected = this.find('#check-item-action').value;
|
||||
const boardId = Session.get('currentBoard');
|
||||
const desc = Utils.getTriggerActionDesc(event,this);
|
||||
if(actionSelected == "check"){
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({actionType: "checkItem","checklistName":checklistName,"checkItemName":checkItemName,"boardId":boardId,"desc":desc});
|
||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||
}
|
||||
if(actionSelected == "uncheck"){
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({actionType: "uncheckItem","checklistName":checklistName,"checkItemName":checkItemName,"boardId":boardId,"desc":desc});
|
||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||
}
|
||||
},
|
||||
}];
|
||||
},
|
||||
},
|
||||
'click .js-add-checkall-action' (event) {
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const actionSelected = this.find('#checkall-action').value;
|
||||
const checklistName = this.find('#checklist-name2').value;
|
||||
const boardId = Session.get('currentBoard');
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
if (actionSelected == "check") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "checkAll",
|
||||
"checklistName": checklistName,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
if (actionSelected == "uncheck") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "uncheckAll",
|
||||
"checklistName": checklistName,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-check-item-action' (event) {
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const checkItemName = this.find("#checkitem-name");
|
||||
const checklistName = this.find("#checklist-name3");
|
||||
const actionSelected = this.find('#check-item-action').value;
|
||||
const boardId = Session.get('currentBoard');
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
if (actionSelected == "check") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "checkItem",
|
||||
"checklistName": checklistName,
|
||||
"checkItemName": checkItemName,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
if (actionSelected == "uncheck") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "uncheckItem",
|
||||
"checklistName": checklistName,
|
||||
"checkItemName": checkItemName,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
},
|
||||
}];
|
||||
},
|
||||
|
||||
}).register('checklistActions');
|
||||
|
|
@ -4,20 +4,32 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
|
||||
events() {
|
||||
return [
|
||||
{'click .js-mail-action'(event) {
|
||||
const emailTo = this.find('#email-to').value;
|
||||
const emailSubject = this.find('#email-subject').value;
|
||||
const emailMsg = this.find('#email-msg').value;
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const boardId = Session.get('currentBoard');
|
||||
const desc = Utils.getTriggerActionDesc(event,this);
|
||||
const actionId = Actions.insert({actionType: "sendEmail","emailTo":emailTo,"emailSubject":emailSubject,"emailMsg":emailMsg,"boardId":boardId,"desc":desc});
|
||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||
},
|
||||
}];
|
||||
},
|
||||
return [{
|
||||
'click .js-mail-action' (event) {
|
||||
const emailTo = this.find('#email-to').value;
|
||||
const emailSubject = this.find('#email-subject').value;
|
||||
const emailMsg = this.find('#email-msg').value;
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const boardId = Session.get('currentBoard');
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "sendEmail",
|
||||
"emailTo": emailTo,
|
||||
"emailSubject": emailSubject,
|
||||
"emailMsg": emailMsg,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
},
|
||||
}];
|
||||
},
|
||||
|
||||
}).register('mailActions');
|
||||
Loading…
Add table
Add a link
Reference in a new issue