mirror of
https://github.com/wekan/wekan.git
synced 2025-04-23 13:37:09 -04: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');
|
|
@ -6,32 +6,31 @@ BlazeComponent.extendComponent({
|
|||
|
||||
},
|
||||
|
||||
trigger(){
|
||||
trigger() {
|
||||
const ruleId = this.data().ruleId;
|
||||
const rule = Rules.findOne({_id: ruleId.get()});
|
||||
const trigger = Triggers.findOne({_id:rule.triggerId});
|
||||
const rule = Rules.findOne({
|
||||
_id: ruleId.get()
|
||||
});
|
||||
const trigger = Triggers.findOne({
|
||||
_id: rule.triggerId
|
||||
});
|
||||
console.log(trigger);
|
||||
return trigger.description();
|
||||
},
|
||||
action(){
|
||||
action() {
|
||||
const ruleId = this.data().ruleId;
|
||||
const rule = Rules.findOne({_id: ruleId.get()});
|
||||
const action = Actions.findOne({_id:rule.actionId});
|
||||
const rule = Rules.findOne({
|
||||
_id: ruleId.get()
|
||||
});
|
||||
const action = Actions.findOne({
|
||||
_id: rule.actionId
|
||||
});
|
||||
console.log(action);
|
||||
return action.description();
|
||||
},
|
||||
|
||||
events() {
|
||||
return [{
|
||||
}];
|
||||
return [{}];
|
||||
},
|
||||
|
||||
}).register('ruleDetails');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}).register('ruleDetails');
|
|
@ -3,29 +3,28 @@ BlazeComponent.extendComponent({
|
|||
this.currentActions = new ReactiveVar("board");
|
||||
},
|
||||
|
||||
|
||||
setBoardActions(){
|
||||
setBoardActions() {
|
||||
this.currentActions.set("board");
|
||||
$('.js-set-card-actions').removeClass('active');
|
||||
$('.js-set-board-actions').addClass('active');
|
||||
$('.js-set-checklist-actions').removeClass('active');
|
||||
$('.js-set-mail-actions').removeClass('active');
|
||||
},
|
||||
setCardActions(){
|
||||
setCardActions() {
|
||||
this.currentActions.set("card");
|
||||
$('.js-set-card-actions').addClass('active');
|
||||
$('.js-set-board-actions').removeClass('active');
|
||||
$('.js-set-checklist-actions').removeClass('active');
|
||||
$('.js-set-mail-actions').removeClass('active');
|
||||
},
|
||||
setChecklistActions(){
|
||||
setChecklistActions() {
|
||||
this.currentActions.set("checklist");
|
||||
$('.js-set-card-actions').removeClass('active');
|
||||
$('.js-set-board-actions').removeClass('active');
|
||||
$('.js-set-checklist-actions').addClass('active');
|
||||
$('.js-set-mail-actions').removeClass('active');
|
||||
},
|
||||
setMailActions(){
|
||||
setMailActions() {
|
||||
this.currentActions.set("mail");
|
||||
$('.js-set-card-actions').removeClass('active');
|
||||
$('.js-set-board-actions').removeClass('active');
|
||||
|
@ -37,21 +36,23 @@ BlazeComponent.extendComponent({
|
|||
return Rules.find({});
|
||||
},
|
||||
|
||||
name(){
|
||||
name() {
|
||||
console.log(this.data());
|
||||
},
|
||||
events() {
|
||||
return [{'click .js-set-board-actions'(event) {
|
||||
this.setBoardActions();
|
||||
},
|
||||
'click .js-set-card-actions'(event) {
|
||||
this.setCardActions();
|
||||
},
|
||||
'click .js-set-mail-actions'(event) {
|
||||
this.setMailActions();
|
||||
},
|
||||
'click .js-set-checklist-actions'(event) {
|
||||
this.setChecklistActions();
|
||||
},}];
|
||||
return [{
|
||||
'click .js-set-board-actions' (event) {
|
||||
this.setBoardActions();
|
||||
},
|
||||
'click .js-set-card-actions' (event) {
|
||||
this.setCardActions();
|
||||
},
|
||||
'click .js-set-mail-actions' (event) {
|
||||
this.setMailActions();
|
||||
},
|
||||
'click .js-set-checklist-actions' (event) {
|
||||
this.setChecklistActions();
|
||||
},
|
||||
}];
|
||||
},
|
||||
}).register('rulesActions');
|
|
@ -4,8 +4,10 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
|
||||
rules() {
|
||||
const boardId = Session.get('currentBoard');
|
||||
return Rules.find({"boardId":boardId});
|
||||
const boardId = Session.get('currentBoard');
|
||||
return Rules.find({
|
||||
"boardId": boardId
|
||||
});
|
||||
},
|
||||
events() {
|
||||
return [{}];
|
||||
|
|
|
@ -22,45 +22,37 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
|
||||
events() {
|
||||
return [{'click .js-delete-rule'(event) {
|
||||
const rule = this.currentData();
|
||||
Rules.remove(rule._id);
|
||||
Actions.remove(rule.actionId);
|
||||
Triggers.remove(rule.triggerId);
|
||||
return [{
|
||||
'click .js-delete-rule' (event) {
|
||||
const rule = this.currentData();
|
||||
Rules.remove(rule._id);
|
||||
Actions.remove(rule.actionId);
|
||||
Triggers.remove(rule.triggerId);
|
||||
|
||||
},
|
||||
'click .js-goto-trigger'(event) {
|
||||
event.preventDefault();
|
||||
const ruleTitle = this.find('#ruleTitle').value;
|
||||
this.find('#ruleTitle').value = "";
|
||||
this.ruleName.set(ruleTitle)
|
||||
this.setTrigger();
|
||||
},
|
||||
'click .js-goto-action'(event) {
|
||||
event.preventDefault();
|
||||
this.setAction();
|
||||
},
|
||||
'click .js-goto-rules'(event) {
|
||||
event.preventDefault();
|
||||
this.setRulesList();
|
||||
},
|
||||
'click .js-goto-details'(event) {
|
||||
event.preventDefault();
|
||||
const rule = this.currentData();
|
||||
this.ruleId.set(rule._id)
|
||||
this.setRuleDetails();
|
||||
},
|
||||
},
|
||||
'click .js-goto-trigger' (event) {
|
||||
event.preventDefault();
|
||||
const ruleTitle = this.find('#ruleTitle').value;
|
||||
this.find('#ruleTitle').value = "";
|
||||
this.ruleName.set(ruleTitle)
|
||||
this.setTrigger();
|
||||
},
|
||||
'click .js-goto-action' (event) {
|
||||
event.preventDefault();
|
||||
this.setAction();
|
||||
},
|
||||
'click .js-goto-rules' (event) {
|
||||
event.preventDefault();
|
||||
this.setRulesList();
|
||||
},
|
||||
'click .js-goto-details' (event) {
|
||||
event.preventDefault();
|
||||
const rule = this.currentData();
|
||||
this.ruleId.set(rule._id)
|
||||
this.setRuleDetails();
|
||||
},
|
||||
|
||||
|
||||
}];
|
||||
}];
|
||||
},
|
||||
|
||||
}).register('rulesMain');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}).register('rulesMain');
|
|
@ -5,8 +5,7 @@ BlazeComponent.extendComponent({
|
|||
this.showChecklistTrigger = new ReactiveVar(false);
|
||||
},
|
||||
|
||||
|
||||
setBoardTriggers(){
|
||||
setBoardTriggers() {
|
||||
this.showBoardTrigger.set(true);
|
||||
this.showCardTrigger.set(false);
|
||||
this.showChecklistTrigger.set(false);
|
||||
|
@ -14,7 +13,7 @@ BlazeComponent.extendComponent({
|
|||
$('.js-set-board-triggers').addClass('active');
|
||||
$('.js-set-checklist-triggers').removeClass('active');
|
||||
},
|
||||
setCardTriggers(){
|
||||
setCardTriggers() {
|
||||
this.showBoardTrigger.set(false);
|
||||
this.showCardTrigger.set(true);
|
||||
this.showChecklistTrigger.set(false);
|
||||
|
@ -22,7 +21,7 @@ BlazeComponent.extendComponent({
|
|||
$('.js-set-board-triggers').removeClass('active');
|
||||
$('.js-set-checklist-triggers').removeClass('active');
|
||||
},
|
||||
setChecklistTriggers(){
|
||||
setChecklistTriggers() {
|
||||
this.showBoardTrigger.set(false);
|
||||
this.showCardTrigger.set(false);
|
||||
this.showChecklistTrigger.set(true);
|
||||
|
@ -35,18 +34,20 @@ BlazeComponent.extendComponent({
|
|||
return Rules.find({});
|
||||
},
|
||||
|
||||
name(){
|
||||
name() {
|
||||
console.log(this.data());
|
||||
},
|
||||
events() {
|
||||
return [{'click .js-set-board-triggers'(event) {
|
||||
this.setBoardTriggers();
|
||||
},
|
||||
'click .js-set-card-triggers'(event) {
|
||||
this.setCardTriggers();
|
||||
},
|
||||
'click .js-set-checklist-triggers'(event) {
|
||||
this.setChecklistTriggers();
|
||||
},}];
|
||||
return [{
|
||||
'click .js-set-board-triggers' (event) {
|
||||
this.setBoardTriggers();
|
||||
},
|
||||
'click .js-set-card-triggers' (event) {
|
||||
this.setCardTriggers();
|
||||
},
|
||||
'click .js-set-checklist-triggers' (event) {
|
||||
this.setChecklistTriggers();
|
||||
},
|
||||
}];
|
||||
},
|
||||
}).register('rulesTriggers');
|
|
@ -4,60 +4,98 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
|
||||
events() {
|
||||
return [
|
||||
{'click .js-add-gen-trigger'(event) {
|
||||
const desc = Utils.getTriggerActionDesc(event,this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#gen-action').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if(actionSelected == "created"){
|
||||
datas.triggerVar.set({activityType: "createCard","boardId":boardId,"listName":"*","desc":desc});
|
||||
}
|
||||
if(actionSelected == "removed"){
|
||||
datas.triggerVar.set({activityType: "removeCard","boardId":boardId,"desc":desc});
|
||||
}
|
||||
|
||||
return [{
|
||||
'click .js-add-gen-trigger' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#gen-action').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if (actionSelected == "created") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "createCard",
|
||||
"boardId": boardId,
|
||||
"listName": "*",
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "removed") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "removeCard",
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
'click .js-add-create-trigger'(event) {
|
||||
const desc = Utils.getTriggerActionDesc(event,this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#create-action').value;
|
||||
const listName = this.find('#create-list-name').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if(actionSelected == "created"){
|
||||
datas.triggerVar.set({activityType: "createCard","boardId":boardId,"listName":listName,"desc":desc});
|
||||
}
|
||||
if(actionSelected == "removed"){
|
||||
datas.triggerVar.set({activityType: "removeCard","boardId":boardId,"listName":listName,"desc":desc});
|
||||
}
|
||||
},
|
||||
'click .js-add-moved-trigger'(event) {
|
||||
let datas = this.data();
|
||||
const desc = Utils.getTriggerActionDesc(event,this);
|
||||
},
|
||||
'click .js-add-create-trigger' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#create-action').value;
|
||||
const listName = this.find('#create-list-name').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if (actionSelected == "created") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "createCard",
|
||||
"boardId": boardId,
|
||||
"listName": listName,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "removed") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "removeCard",
|
||||
"boardId": boardId,
|
||||
"listName": listName,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-moved-trigger' (event) {
|
||||
let datas = this.data();
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
|
||||
const actionSelected = this.find('#move-action').value;
|
||||
const listName = this.find('#move-list-name').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if(actionSelected == "moved-to"){
|
||||
datas.triggerVar.set({activityType: "moveCard","boardId":boardId,"listName":listName,"oldListName":"*","desc":desc});
|
||||
const actionSelected = this.find('#move-action').value;
|
||||
const listName = this.find('#move-list-name').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if (actionSelected == "moved-to") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "moveCard",
|
||||
"boardId": boardId,
|
||||
"listName": listName,
|
||||
"oldListName": "*",
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "moved-from") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "moveCard",
|
||||
"boardId": boardId,
|
||||
"listName": "*",
|
||||
"oldListName": listName,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-arc-trigger' (event) {
|
||||
let datas = this.data();
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
const actionSelected = this.find('#arch-action').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if (actionSelected == "archived") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "archivedCard",
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "unarchived") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "restoredCard",
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
}
|
||||
if(actionSelected == "moved-from"){
|
||||
datas.triggerVar.set({activityType: "moveCard","boardId":boardId,"listName":"*","oldListName":listName,"desc":desc});
|
||||
}
|
||||
},
|
||||
'click .js-add-arc-trigger'(event) {
|
||||
let datas = this.data();
|
||||
const desc = Utils.getTriggerActionDesc(event,this);
|
||||
const actionSelected = this.find('#arch-action').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if(actionSelected == "archived"){
|
||||
datas.triggerVar.set({activityType: "archivedCard","boardId":boardId,"desc":desc});
|
||||
}
|
||||
if(actionSelected == "unarchived"){
|
||||
datas.triggerVar.set({activityType: "restoredCard","boardId":boardId,"desc":desc});
|
||||
}
|
||||
}
|
||||
|
||||
}];
|
||||
},
|
||||
|
|
|
@ -3,86 +3,144 @@ BlazeComponent.extendComponent({
|
|||
this.subscribe('allRules');
|
||||
},
|
||||
events() {
|
||||
return [
|
||||
{'click .js-add-gen-check-trigger'(event) {
|
||||
const desc = Utils.getTriggerActionDesc(event,this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#gen-check-action').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if(actionSelected == "created"){
|
||||
datas.triggerVar.set({activityType: "addChecklist","boardId":boardId,"checklistName":"*","desc":desc});
|
||||
}
|
||||
if(actionSelected == "removed"){
|
||||
datas.triggerVar.set({activityType: "removeChecklist","boardId":boardId,"checklistName":"*","desc":desc});
|
||||
}
|
||||
},
|
||||
'click .js-add-spec-check-trigger'(event) {
|
||||
const desc = Utils.getTriggerActionDesc(event,this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#spec-check-action').value;
|
||||
const checklistId = this.find('#check-name').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if(actionSelected == "created"){
|
||||
datas.triggerVar.set({activityType: "addChecklist","boardId":boardId,"checklistName":checklistId,"desc":desc});
|
||||
}
|
||||
if(actionSelected == "removed"){
|
||||
datas.triggerVar.set({activityType: "removeChecklist","boardId":boardId,"checklistName":checklistId,"desc":desc});
|
||||
}
|
||||
},
|
||||
'click .js-add-gen-comp-trigger'(event) {
|
||||
const desc = Utils.getTriggerActionDesc(event,this);
|
||||
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#gen-comp-check-action').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if(actionSelected == "completed"){
|
||||
datas.triggerVar.set({activityType: "completeChecklist","boardId":boardId,"checklistName":"*","desc":desc});
|
||||
}
|
||||
if(actionSelected == "uncompleted"){
|
||||
datas.triggerVar.set({activityType: "uncompleteChecklist","boardId":boardId,"checklistName":"*","desc":desc});
|
||||
}
|
||||
},
|
||||
'click .js-add-spec-comp-trigger'(event) {
|
||||
const desc = Utils.getTriggerActionDesc(event,this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#spec-comp-check-action').value;
|
||||
const checklistId = this.find('#spec-comp-check-name').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if(actionSelected == "added"){
|
||||
datas.triggerVar.set({activityType: "completeChecklist","boardId":boardId,"checklistName":checklistId,"desc":desc});
|
||||
}
|
||||
if(actionSelected == "removed"){
|
||||
datas.triggerVar.set({activityType: "uncompleteChecklist","boardId":boardId,"checklistName":checklistId,"desc":desc});
|
||||
}
|
||||
},
|
||||
'click .js-add-gen-check-item-trigger'(event) {
|
||||
const desc = Utils.getTriggerActionDesc(event,this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#check-item-gen-action').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if(actionSelected == "checked"){
|
||||
datas.triggerVar.set({activityType: "checkedItem","boardId":boardId,"checklistItemName":"*","desc":desc});
|
||||
}
|
||||
if(actionSelected == "unchecked"){
|
||||
datas.triggerVar.set({activityType: "uncheckedItem","boardId":boardId,"checklistItemName":"*","desc":desc});
|
||||
}
|
||||
},
|
||||
'click .js-add-spec-check-item-trigger'(event) {
|
||||
const desc = Utils.getTriggerActionDesc(event,this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#check-item-spec-action').value;
|
||||
const checklistItemId = this.find('#check-item-name').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if(actionSelected == "checked"){
|
||||
datas.triggerVar.set({activityType: "checkedItem","boardId":boardId,"checklistItemName":checklistItemId,"desc":desc});
|
||||
}
|
||||
if(actionSelected == "unchecked"){
|
||||
datas.triggerVar.set({activityType: "uncheckedItem","boardId":boardId,"checklistItemName":checklistItemId,"desc":desc});
|
||||
}
|
||||
},
|
||||
}];
|
||||
},
|
||||
|
||||
}).register('checklistTriggers');
|
||||
return [{
|
||||
'click .js-add-gen-check-trigger' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#gen-check-action').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if (actionSelected == "created") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "addChecklist",
|
||||
"boardId": boardId,
|
||||
"checklistName": "*",
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "removed") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "removeChecklist",
|
||||
"boardId": boardId,
|
||||
"checklistName": "*",
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-spec-check-trigger' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#spec-check-action').value;
|
||||
const checklistId = this.find('#check-name').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if (actionSelected == "created") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "addChecklist",
|
||||
"boardId": boardId,
|
||||
"checklistName": checklistId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "removed") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "removeChecklist",
|
||||
"boardId": boardId,
|
||||
"checklistName": checklistId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-gen-comp-trigger' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#gen-comp-check-action').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if (actionSelected == "completed") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "completeChecklist",
|
||||
"boardId": boardId,
|
||||
"checklistName": "*",
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "uncompleted") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "uncompleteChecklist",
|
||||
"boardId": boardId,
|
||||
"checklistName": "*",
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-spec-comp-trigger' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#spec-comp-check-action').value;
|
||||
const checklistId = this.find('#spec-comp-check-name').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if (actionSelected == "added") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "completeChecklist",
|
||||
"boardId": boardId,
|
||||
"checklistName": checklistId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "removed") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "uncompleteChecklist",
|
||||
"boardId": boardId,
|
||||
"checklistName": checklistId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-gen-check-item-trigger' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#check-item-gen-action').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if (actionSelected == "checked") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "checkedItem",
|
||||
"boardId": boardId,
|
||||
"checklistItemName": "*",
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "unchecked") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "uncheckedItem",
|
||||
"boardId": boardId,
|
||||
"checklistItemName": "*",
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-spec-check-item-trigger' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#check-item-spec-action').value;
|
||||
const checklistItemId = this.find('#check-item-name').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if (actionSelected == "checked") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "checkedItem",
|
||||
"boardId": boardId,
|
||||
"checklistItemName": checklistItemId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "unchecked") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "uncheckedItem",
|
||||
"boardId": boardId,
|
||||
"checklistItemName": checklistItemId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
},
|
||||
}];
|
||||
},
|
||||
|
||||
}).register('checklistTriggers');
|
|
@ -39,15 +39,15 @@ Utils = {
|
|||
if (!prevData && !nextData) {
|
||||
base = 0;
|
||||
increment = 1;
|
||||
// If we drop the card in the first position
|
||||
} else if (!prevData) {
|
||||
base = nextData.sort - 1;
|
||||
increment = -1;
|
||||
// If we drop the card in the last position
|
||||
} else if (!nextData) {
|
||||
base = prevData.sort + 1;
|
||||
increment = 1;
|
||||
}
|
||||
// If we drop the card in the first position
|
||||
} else if (!prevData) {
|
||||
base = nextData.sort - 1;
|
||||
increment = -1;
|
||||
// If we drop the card in the last position
|
||||
} else if (!nextData) {
|
||||
base = prevData.sort + 1;
|
||||
increment = 1;
|
||||
}
|
||||
// In the general case take the average of the previous and next element
|
||||
// sort indexes.
|
||||
else {
|
||||
|
@ -71,15 +71,15 @@ Utils = {
|
|||
if (!prevCardDomElement && !nextCardDomElement) {
|
||||
base = 0;
|
||||
increment = 1;
|
||||
// If we drop the card in the first position
|
||||
} else if (!prevCardDomElement) {
|
||||
base = Blaze.getData(nextCardDomElement).sort - 1;
|
||||
increment = -1;
|
||||
// If we drop the card in the last position
|
||||
} else if (!nextCardDomElement) {
|
||||
base = Blaze.getData(prevCardDomElement).sort + 1;
|
||||
increment = 1;
|
||||
}
|
||||
// If we drop the card in the first position
|
||||
} else if (!prevCardDomElement) {
|
||||
base = Blaze.getData(nextCardDomElement).sort - 1;
|
||||
increment = -1;
|
||||
// If we drop the card in the last position
|
||||
} else if (!nextCardDomElement) {
|
||||
base = Blaze.getData(prevCardDomElement).sort + 1;
|
||||
increment = 1;
|
||||
}
|
||||
// In the general case take the average of the previous and next element
|
||||
// sort indexes.
|
||||
else {
|
||||
|
@ -121,7 +121,7 @@ Utils = {
|
|||
return Math.sqrt(
|
||||
Math.pow(touchA.screenX - touchB.screenX, 2) +
|
||||
Math.pow(touchA.screenY - touchB.screenY, 2)
|
||||
);
|
||||
);
|
||||
},
|
||||
|
||||
enableClickOnTouch(selector) {
|
||||
|
@ -145,21 +145,21 @@ Utils = {
|
|||
});
|
||||
},
|
||||
|
||||
getTriggerActionDesc(event,tempInstance){
|
||||
getTriggerActionDesc(event, tempInstance) {
|
||||
const jqueryEl = tempInstance.$(event.currentTarget.parentNode);
|
||||
const triggerEls = jqueryEl.find(".trigger-content").children();
|
||||
let finalString = "";
|
||||
for(let i = 0;i< triggerEls.length;i++){
|
||||
for (let i = 0; i < triggerEls.length; i++) {
|
||||
const element = tempInstance.$(triggerEls[i]);
|
||||
if(element.hasClass("trigger-text")){
|
||||
if (element.hasClass("trigger-text")) {
|
||||
finalString += element.text().toLowerCase();
|
||||
}else if(element.find("select").length > 0){
|
||||
} else if (element.find("select").length > 0) {
|
||||
finalString += element.find("select option:selected").text().toLowerCase();
|
||||
}else if(element.find("input").length > 0){
|
||||
} else if (element.find("input").length > 0) {
|
||||
finalString += element.find("input").val();
|
||||
}
|
||||
// Add space
|
||||
if(i != length - 1){
|
||||
if (i != length - 1) {
|
||||
finalString += " ";
|
||||
}
|
||||
}
|
||||
|
@ -171,4 +171,4 @@ Utils = {
|
|||
// resized. This is used to reactively re-calculate the popup position in case
|
||||
// of a window resize. This is the equivalent of a "Signal" in some other
|
||||
// programming environments (eg, elm).
|
||||
$(window).on('resize', () => Utils.windowResizeDep.changed());
|
||||
$(window).on('resize', () => Utils.windowResizeDep.changed());
|
|
@ -1,6 +1,5 @@
|
|||
Actions = new Mongo.Collection('actions');
|
||||
|
||||
|
||||
Actions.allow({
|
||||
insert(userId, doc) {
|
||||
return allowIsBoardAdmin(userId, Boards.findOne(doc.boardId));
|
||||
|
@ -13,20 +12,8 @@ Actions.allow({
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
Actions.helpers({
|
||||
description() {
|
||||
return this.desc;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
|
@ -1,19 +1,16 @@
|
|||
allowIsBoardAdmin = function(userId, board) {
|
||||
return board && board.hasAdmin(userId);
|
||||
return board && board.hasAdmin(userId);
|
||||
};
|
||||
|
||||
allowIsBoardMember = function(userId, board) {
|
||||
return board && board.hasMember(userId);
|
||||
return board && board.hasMember(userId);
|
||||
};
|
||||
|
||||
allowIsBoardMemberNonComment = function(userId, board) {
|
||||
return board && board.hasMember(userId) && !board.hasCommentOnly(userId);
|
||||
return board && board.hasMember(userId) && !board.hasCommentOnly(userId);
|
||||
};
|
||||
|
||||
allowIsBoardMemberByCard = function(userId, card) {
|
||||
const board = card.board();
|
||||
return board && board.hasMember(userId);
|
||||
};
|
||||
|
||||
|
||||
|
||||
const board = card.board();
|
||||
return board && board.hasMember(userId);
|
||||
};
|
|
@ -1,18 +1,18 @@
|
|||
Meteor.publish('rules', (ruleId) => {
|
||||
check(ruleId, String);
|
||||
return Rules.find({ _id: ruleId });
|
||||
check(ruleId, String);
|
||||
return Rules.find({
|
||||
_id: ruleId
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Meteor.publish('allRules', () => {
|
||||
return Rules.find({});
|
||||
return Rules.find({});
|
||||
});
|
||||
|
||||
|
||||
Meteor.publish('allTriggers', () => {
|
||||
return Triggers.find({});
|
||||
return Triggers.find({});
|
||||
});
|
||||
|
||||
Meteor.publish('allActions', () => {
|
||||
return Actions.find({});
|
||||
});
|
||||
return Actions.find({});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue