mirror of
https://github.com/wekan/wekan.git
synced 2025-12-17 16:00:13 +01:00
Beautyfied
This commit is contained in:
parent
30a3daa6af
commit
25da8376ca
15 changed files with 715 additions and 461 deletions
|
|
@ -3,11 +3,9 @@ BlazeComponent.extendComponent({
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
events() {
|
events() {
|
||||||
return [
|
return [{
|
||||||
{'click .js-add-spec-move-action'(event) {
|
'click .js-add-spec-move-action' (event) {
|
||||||
const ruleName = this.data().ruleName.get();
|
const ruleName = this.data().ruleName.get();
|
||||||
const trigger = this.data().triggerVar.get();
|
const trigger = this.data().triggerVar.get();
|
||||||
const actionSelected = this.find('#move-spec-action').value;
|
const actionSelected = this.find('#move-spec-action').value;
|
||||||
|
|
@ -16,13 +14,33 @@ BlazeComponent.extendComponent({
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
if (actionSelected == "top") {
|
if (actionSelected == "top") {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({actionType: "moveCardToTop","listTitle":listTitle,"boardId":boardId,"desc":desc});
|
const actionId = Actions.insert({
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
actionType: "moveCardToTop",
|
||||||
|
"listTitle": listTitle,
|
||||||
|
"boardId": boardId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
|
Rules.insert({
|
||||||
|
title: ruleName,
|
||||||
|
triggerId: triggerId,
|
||||||
|
actionId: actionId,
|
||||||
|
"boardId": boardId
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "bottom") {
|
if (actionSelected == "bottom") {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({actionType: "moveCardToBottom","listTitle":listTitle,"boardId":boardId,"desc":desc});
|
const actionId = Actions.insert({
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
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) {
|
'click .js-add-gen-move-action' (event) {
|
||||||
|
|
@ -33,13 +51,33 @@ BlazeComponent.extendComponent({
|
||||||
const actionSelected = this.find('#move-gen-action').value;
|
const actionSelected = this.find('#move-gen-action').value;
|
||||||
if (actionSelected == "top") {
|
if (actionSelected == "top") {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({actionType: "moveCardToTop","listTitle":"*","boardId":boardId,"desc":desc});
|
const actionId = Actions.insert({
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
actionType: "moveCardToTop",
|
||||||
|
"listTitle": "*",
|
||||||
|
"boardId": boardId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
|
Rules.insert({
|
||||||
|
title: ruleName,
|
||||||
|
triggerId: triggerId,
|
||||||
|
actionId: actionId,
|
||||||
|
"boardId": boardId
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "bottom") {
|
if (actionSelected == "bottom") {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({actionType: "moveCardToBottom","listTitle":"*","boardId":boardId,"desc":desc});
|
const actionId = Actions.insert({
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
actionType: "moveCardToBottom",
|
||||||
|
"listTitle": "*",
|
||||||
|
"boardId": boardId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
|
Rules.insert({
|
||||||
|
title: ruleName,
|
||||||
|
triggerId: triggerId,
|
||||||
|
actionId: actionId,
|
||||||
|
"boardId": boardId
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-add-arch-action' (event) {
|
'click .js-add-arch-action' (event) {
|
||||||
|
|
@ -50,13 +88,31 @@ BlazeComponent.extendComponent({
|
||||||
const actionSelected = this.find('#arch-action').value;
|
const actionSelected = this.find('#arch-action').value;
|
||||||
if (actionSelected == "archive") {
|
if (actionSelected == "archive") {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({actionType: "archive","boardId":boardId,"desc":desc});
|
const actionId = Actions.insert({
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
actionType: "archive",
|
||||||
|
"boardId": boardId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
|
Rules.insert({
|
||||||
|
title: ruleName,
|
||||||
|
triggerId: triggerId,
|
||||||
|
actionId: actionId,
|
||||||
|
"boardId": boardId
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "unarchive") {
|
if (actionSelected == "unarchive") {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({actionType: "unarchive","boardId":boardId,"desc":desc});
|
const actionId = Actions.insert({
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
actionType: "unarchive",
|
||||||
|
"boardId": boardId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
|
Rules.insert({
|
||||||
|
title: ruleName,
|
||||||
|
triggerId: triggerId,
|
||||||
|
actionId: actionId,
|
||||||
|
"boardId": boardId
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}];
|
}];
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,9 @@ BlazeComponent.extendComponent({
|
||||||
return labels;
|
return labels;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
events() {
|
events() {
|
||||||
return [
|
return [{
|
||||||
{'click .js-add-label-action'(event) {
|
'click .js-add-label-action' (event) {
|
||||||
const ruleName = this.data().ruleName.get();
|
const ruleName = this.data().ruleName.get();
|
||||||
const trigger = this.data().triggerVar.get();
|
const trigger = this.data().triggerVar.get();
|
||||||
const actionSelected = this.find('#label-action').value;
|
const actionSelected = this.find('#label-action').value;
|
||||||
|
|
@ -27,13 +25,33 @@ BlazeComponent.extendComponent({
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
if (actionSelected == "add") {
|
if (actionSelected == "add") {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({actionType: "addLabel","labelId":labelId,"boardId":boardId,"desc":desc});
|
const actionId = Actions.insert({
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
actionType: "addLabel",
|
||||||
|
"labelId": labelId,
|
||||||
|
"boardId": boardId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
|
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: "removeLabel","labelId":labelId,"boardId":boardId,"desc":desc});
|
const actionId = Actions.insert({
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
actionType: "removeLabel",
|
||||||
|
"labelId": labelId,
|
||||||
|
"boardId": boardId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
|
Rules.insert({
|
||||||
|
title: ruleName,
|
||||||
|
triggerId: triggerId,
|
||||||
|
actionId: actionId,
|
||||||
|
"boardId": boardId
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
@ -46,13 +64,34 @@ BlazeComponent.extendComponent({
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
if (actionSelected == "add") {
|
if (actionSelected == "add") {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({actionType: "addMember","memberName":memberName,"boardId":boardId,"desc":desc});
|
const actionId = Actions.insert({
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId,"desc":desc});
|
actionType: "addMember",
|
||||||
|
"memberName": memberName,
|
||||||
|
"boardId": boardId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
|
Rules.insert({
|
||||||
|
title: ruleName,
|
||||||
|
triggerId: triggerId,
|
||||||
|
actionId: actionId,
|
||||||
|
"boardId": boardId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "remove") {
|
if (actionSelected == "remove") {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({actionType: "removeMember","memberName":memberName,"boardId":boardId,"desc":desc});
|
const actionId = Actions.insert({
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
actionType: "removeMember",
|
||||||
|
"memberName": memberName,
|
||||||
|
"boardId": boardId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
|
Rules.insert({
|
||||||
|
title: ruleName,
|
||||||
|
triggerId: triggerId,
|
||||||
|
actionId: actionId,
|
||||||
|
"boardId": boardId
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-add-removeall-action' (event) {
|
'click .js-add-removeall-action' (event) {
|
||||||
|
|
@ -61,8 +100,18 @@ BlazeComponent.extendComponent({
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
const boardId = Session.get('currentBoard');
|
const boardId = Session.get('currentBoard');
|
||||||
const actionId = Actions.insert({actionType: "removeMember","memberName":"*","boardId":boardId,"desc":desc});
|
const actionId = Actions.insert({
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
actionType: "removeMember",
|
||||||
|
"memberName": "*",
|
||||||
|
"boardId": boardId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
|
Rules.insert({
|
||||||
|
title: ruleName,
|
||||||
|
triggerId: triggerId,
|
||||||
|
actionId: actionId,
|
||||||
|
"boardId": boardId
|
||||||
|
});
|
||||||
},
|
},
|
||||||
}];
|
}];
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ BlazeComponent.extendComponent({
|
||||||
this.subscribe('allRules');
|
this.subscribe('allRules');
|
||||||
},
|
},
|
||||||
events() {
|
events() {
|
||||||
return [
|
return [{
|
||||||
{'click .js-add-checklist-action'(event) {
|
'click .js-add-checklist-action' (event) {
|
||||||
const ruleName = this.data().ruleName.get();
|
const ruleName = this.data().ruleName.get();
|
||||||
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;
|
||||||
|
|
@ -13,13 +13,33 @@ BlazeComponent.extendComponent({
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
if (actionSelected == "add") {
|
if (actionSelected == "add") {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({actionType: "addChecklist","checklistName":checklistName,"boardId":boardId,"desc":desc});
|
const actionId = Actions.insert({
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
actionType: "addChecklist",
|
||||||
|
"checklistName": checklistName,
|
||||||
|
"boardId": boardId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
|
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,"boardId":boardId,"desc":desc});
|
const actionId = Actions.insert({
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
actionType: "removeChecklist",
|
||||||
|
"checklistName": checklistName,
|
||||||
|
"boardId": boardId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
|
Rules.insert({
|
||||||
|
title: ruleName,
|
||||||
|
triggerId: triggerId,
|
||||||
|
actionId: actionId,
|
||||||
|
"boardId": boardId
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
@ -32,13 +52,33 @@ const desc = Utils.getTriggerActionDesc(event,this);
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
if (actionSelected == "check") {
|
if (actionSelected == "check") {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({actionType: "checkAll","checklistName":checklistName,"boardId":boardId,"desc":desc});
|
const actionId = Actions.insert({
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
actionType: "checkAll",
|
||||||
|
"checklistName": checklistName,
|
||||||
|
"boardId": boardId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
|
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,"boardId":boardId,"desc":desc});
|
const actionId = Actions.insert({
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
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) {
|
'click .js-add-check-item-action' (event) {
|
||||||
|
|
@ -51,13 +91,35 @@ const desc = Utils.getTriggerActionDesc(event,this);
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
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,"boardId":boardId,"desc":desc});
|
const actionId = Actions.insert({
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
actionType: "checkItem",
|
||||||
|
"checklistName": checklistName,
|
||||||
|
"checkItemName": checkItemName,
|
||||||
|
"boardId": boardId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
|
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,"boardId":boardId,"desc":desc});
|
const actionId = Actions.insert({
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
actionType: "uncheckItem",
|
||||||
|
"checklistName": checklistName,
|
||||||
|
"checkItemName": checkItemName,
|
||||||
|
"boardId": boardId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
|
Rules.insert({
|
||||||
|
title: ruleName,
|
||||||
|
triggerId: triggerId,
|
||||||
|
actionId: actionId,
|
||||||
|
"boardId": boardId
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}];
|
}];
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
|
|
||||||
events() {
|
events() {
|
||||||
return [
|
return [{
|
||||||
{'click .js-mail-action'(event) {
|
'click .js-mail-action' (event) {
|
||||||
const emailTo = this.find('#email-to').value;
|
const emailTo = this.find('#email-to').value;
|
||||||
const emailSubject = this.find('#email-subject').value;
|
const emailSubject = this.find('#email-subject').value;
|
||||||
const emailMsg = this.find('#email-msg').value;
|
const emailMsg = this.find('#email-msg').value;
|
||||||
|
|
@ -14,8 +14,20 @@ BlazeComponent.extendComponent({
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const boardId = Session.get('currentBoard');
|
const boardId = Session.get('currentBoard');
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
const actionId = Actions.insert({actionType: "sendEmail","emailTo":emailTo,"emailSubject":emailSubject,"emailMsg":emailMsg,"boardId":boardId,"desc":desc});
|
const actionId = Actions.insert({
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
actionType: "sendEmail",
|
||||||
|
"emailTo": emailTo,
|
||||||
|
"emailSubject": emailSubject,
|
||||||
|
"emailMsg": emailMsg,
|
||||||
|
"boardId": boardId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
|
Rules.insert({
|
||||||
|
title: ruleName,
|
||||||
|
triggerId: triggerId,
|
||||||
|
actionId: actionId,
|
||||||
|
"boardId": boardId
|
||||||
|
});
|
||||||
},
|
},
|
||||||
}];
|
}];
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -8,30 +8,29 @@ BlazeComponent.extendComponent({
|
||||||
|
|
||||||
trigger() {
|
trigger() {
|
||||||
const ruleId = this.data().ruleId;
|
const ruleId = this.data().ruleId;
|
||||||
const rule = Rules.findOne({_id: ruleId.get()});
|
const rule = Rules.findOne({
|
||||||
const trigger = Triggers.findOne({_id:rule.triggerId});
|
_id: ruleId.get()
|
||||||
|
});
|
||||||
|
const trigger = Triggers.findOne({
|
||||||
|
_id: rule.triggerId
|
||||||
|
});
|
||||||
console.log(trigger);
|
console.log(trigger);
|
||||||
return trigger.description();
|
return trigger.description();
|
||||||
},
|
},
|
||||||
action() {
|
action() {
|
||||||
const ruleId = this.data().ruleId;
|
const ruleId = this.data().ruleId;
|
||||||
const rule = Rules.findOne({_id: ruleId.get()});
|
const rule = Rules.findOne({
|
||||||
const action = Actions.findOne({_id:rule.actionId});
|
_id: ruleId.get()
|
||||||
|
});
|
||||||
|
const action = Actions.findOne({
|
||||||
|
_id: rule.actionId
|
||||||
|
});
|
||||||
console.log(action);
|
console.log(action);
|
||||||
return action.description();
|
return action.description();
|
||||||
},
|
},
|
||||||
|
|
||||||
events() {
|
events() {
|
||||||
return [{
|
return [{}];
|
||||||
}];
|
|
||||||
},
|
},
|
||||||
|
|
||||||
}).register('ruleDetails');
|
}).register('ruleDetails');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ BlazeComponent.extendComponent({
|
||||||
this.currentActions = new ReactiveVar("board");
|
this.currentActions = new ReactiveVar("board");
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
setBoardActions() {
|
setBoardActions() {
|
||||||
this.currentActions.set("board");
|
this.currentActions.set("board");
|
||||||
$('.js-set-card-actions').removeClass('active');
|
$('.js-set-card-actions').removeClass('active');
|
||||||
|
|
@ -41,7 +40,8 @@ BlazeComponent.extendComponent({
|
||||||
console.log(this.data());
|
console.log(this.data());
|
||||||
},
|
},
|
||||||
events() {
|
events() {
|
||||||
return [{'click .js-set-board-actions'(event) {
|
return [{
|
||||||
|
'click .js-set-board-actions' (event) {
|
||||||
this.setBoardActions();
|
this.setBoardActions();
|
||||||
},
|
},
|
||||||
'click .js-set-card-actions' (event) {
|
'click .js-set-card-actions' (event) {
|
||||||
|
|
@ -52,6 +52,7 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
'click .js-set-checklist-actions' (event) {
|
'click .js-set-checklist-actions' (event) {
|
||||||
this.setChecklistActions();
|
this.setChecklistActions();
|
||||||
},}];
|
},
|
||||||
|
}];
|
||||||
},
|
},
|
||||||
}).register('rulesActions');
|
}).register('rulesActions');
|
||||||
|
|
@ -5,7 +5,9 @@ BlazeComponent.extendComponent({
|
||||||
|
|
||||||
rules() {
|
rules() {
|
||||||
const boardId = Session.get('currentBoard');
|
const boardId = Session.get('currentBoard');
|
||||||
return Rules.find({"boardId":boardId});
|
return Rules.find({
|
||||||
|
"boardId": boardId
|
||||||
|
});
|
||||||
},
|
},
|
||||||
events() {
|
events() {
|
||||||
return [{}];
|
return [{}];
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,8 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
|
|
||||||
events() {
|
events() {
|
||||||
return [{'click .js-delete-rule'(event) {
|
return [{
|
||||||
|
'click .js-delete-rule' (event) {
|
||||||
const rule = this.currentData();
|
const rule = this.currentData();
|
||||||
Rules.remove(rule._id);
|
Rules.remove(rule._id);
|
||||||
Actions.remove(rule.actionId);
|
Actions.remove(rule.actionId);
|
||||||
|
|
@ -51,16 +52,7 @@ BlazeComponent.extendComponent({
|
||||||
this.setRuleDetails();
|
this.setRuleDetails();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
}];
|
}];
|
||||||
},
|
},
|
||||||
|
|
||||||
}).register('rulesMain');
|
}).register('rulesMain');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ BlazeComponent.extendComponent({
|
||||||
this.showChecklistTrigger = new ReactiveVar(false);
|
this.showChecklistTrigger = new ReactiveVar(false);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
setBoardTriggers() {
|
setBoardTriggers() {
|
||||||
this.showBoardTrigger.set(true);
|
this.showBoardTrigger.set(true);
|
||||||
this.showCardTrigger.set(false);
|
this.showCardTrigger.set(false);
|
||||||
|
|
@ -39,7 +38,8 @@ BlazeComponent.extendComponent({
|
||||||
console.log(this.data());
|
console.log(this.data());
|
||||||
},
|
},
|
||||||
events() {
|
events() {
|
||||||
return [{'click .js-set-board-triggers'(event) {
|
return [{
|
||||||
|
'click .js-set-board-triggers' (event) {
|
||||||
this.setBoardTriggers();
|
this.setBoardTriggers();
|
||||||
},
|
},
|
||||||
'click .js-set-card-triggers' (event) {
|
'click .js-set-card-triggers' (event) {
|
||||||
|
|
@ -47,6 +47,7 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
'click .js-set-checklist-triggers' (event) {
|
'click .js-set-checklist-triggers' (event) {
|
||||||
this.setChecklistTriggers();
|
this.setChecklistTriggers();
|
||||||
},}];
|
},
|
||||||
|
}];
|
||||||
},
|
},
|
||||||
}).register('rulesTriggers');
|
}).register('rulesTriggers');
|
||||||
|
|
@ -4,20 +4,28 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
|
|
||||||
events() {
|
events() {
|
||||||
return [
|
return [{
|
||||||
{'click .js-add-gen-trigger'(event) {
|
'click .js-add-gen-trigger' (event) {
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
let datas = this.data();
|
let datas = this.data();
|
||||||
const actionSelected = this.find('#gen-action').value;
|
const actionSelected = this.find('#gen-action').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard')
|
||||||
if (actionSelected == "created") {
|
if (actionSelected == "created") {
|
||||||
datas.triggerVar.set({activityType: "createCard","boardId":boardId,"listName":"*","desc":desc});
|
datas.triggerVar.set({
|
||||||
|
activityType: "createCard",
|
||||||
|
"boardId": boardId,
|
||||||
|
"listName": "*",
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "removed") {
|
if (actionSelected == "removed") {
|
||||||
datas.triggerVar.set({activityType: "removeCard","boardId":boardId,"desc":desc});
|
datas.triggerVar.set({
|
||||||
|
activityType: "removeCard",
|
||||||
|
"boardId": boardId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
'click .js-add-create-trigger' (event) {
|
'click .js-add-create-trigger' (event) {
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
|
|
@ -26,10 +34,20 @@ BlazeComponent.extendComponent({
|
||||||
const listName = this.find('#create-list-name').value;
|
const listName = this.find('#create-list-name').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard')
|
||||||
if (actionSelected == "created") {
|
if (actionSelected == "created") {
|
||||||
datas.triggerVar.set({activityType: "createCard","boardId":boardId,"listName":listName,"desc":desc});
|
datas.triggerVar.set({
|
||||||
|
activityType: "createCard",
|
||||||
|
"boardId": boardId,
|
||||||
|
"listName": listName,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "removed") {
|
if (actionSelected == "removed") {
|
||||||
datas.triggerVar.set({activityType: "removeCard","boardId":boardId,"listName":listName,"desc":desc});
|
datas.triggerVar.set({
|
||||||
|
activityType: "removeCard",
|
||||||
|
"boardId": boardId,
|
||||||
|
"listName": listName,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-add-moved-trigger' (event) {
|
'click .js-add-moved-trigger' (event) {
|
||||||
|
|
@ -40,10 +58,22 @@ BlazeComponent.extendComponent({
|
||||||
const listName = this.find('#move-list-name').value;
|
const listName = this.find('#move-list-name').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard')
|
||||||
if (actionSelected == "moved-to") {
|
if (actionSelected == "moved-to") {
|
||||||
datas.triggerVar.set({activityType: "moveCard","boardId":boardId,"listName":listName,"oldListName":"*","desc":desc});
|
datas.triggerVar.set({
|
||||||
|
activityType: "moveCard",
|
||||||
|
"boardId": boardId,
|
||||||
|
"listName": listName,
|
||||||
|
"oldListName": "*",
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "moved-from") {
|
if (actionSelected == "moved-from") {
|
||||||
datas.triggerVar.set({activityType: "moveCard","boardId":boardId,"listName":"*","oldListName":listName,"desc":desc});
|
datas.triggerVar.set({
|
||||||
|
activityType: "moveCard",
|
||||||
|
"boardId": boardId,
|
||||||
|
"listName": "*",
|
||||||
|
"oldListName": listName,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-add-arc-trigger' (event) {
|
'click .js-add-arc-trigger' (event) {
|
||||||
|
|
@ -52,10 +82,18 @@ BlazeComponent.extendComponent({
|
||||||
const actionSelected = this.find('#arch-action').value;
|
const actionSelected = this.find('#arch-action').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard')
|
||||||
if (actionSelected == "archived") {
|
if (actionSelected == "archived") {
|
||||||
datas.triggerVar.set({activityType: "archivedCard","boardId":boardId,"desc":desc});
|
datas.triggerVar.set({
|
||||||
|
activityType: "archivedCard",
|
||||||
|
"boardId": boardId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "unarchived") {
|
if (actionSelected == "unarchived") {
|
||||||
datas.triggerVar.set({activityType: "restoredCard","boardId":boardId,"desc":desc});
|
datas.triggerVar.set({
|
||||||
|
activityType: "restoredCard",
|
||||||
|
"boardId": boardId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,17 +3,27 @@ BlazeComponent.extendComponent({
|
||||||
this.subscribe('allRules');
|
this.subscribe('allRules');
|
||||||
},
|
},
|
||||||
events() {
|
events() {
|
||||||
return [
|
return [{
|
||||||
{'click .js-add-gen-check-trigger'(event) {
|
'click .js-add-gen-check-trigger' (event) {
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
let datas = this.data();
|
let datas = this.data();
|
||||||
const actionSelected = this.find('#gen-check-action').value;
|
const actionSelected = this.find('#gen-check-action').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard')
|
||||||
if (actionSelected == "created") {
|
if (actionSelected == "created") {
|
||||||
datas.triggerVar.set({activityType: "addChecklist","boardId":boardId,"checklistName":"*","desc":desc});
|
datas.triggerVar.set({
|
||||||
|
activityType: "addChecklist",
|
||||||
|
"boardId": boardId,
|
||||||
|
"checklistName": "*",
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "removed") {
|
if (actionSelected == "removed") {
|
||||||
datas.triggerVar.set({activityType: "removeChecklist","boardId":boardId,"checklistName":"*","desc":desc});
|
datas.triggerVar.set({
|
||||||
|
activityType: "removeChecklist",
|
||||||
|
"boardId": boardId,
|
||||||
|
"checklistName": "*",
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-add-spec-check-trigger' (event) {
|
'click .js-add-spec-check-trigger' (event) {
|
||||||
|
|
@ -23,10 +33,20 @@ BlazeComponent.extendComponent({
|
||||||
const checklistId = this.find('#check-name').value;
|
const checklistId = this.find('#check-name').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard')
|
||||||
if (actionSelected == "created") {
|
if (actionSelected == "created") {
|
||||||
datas.triggerVar.set({activityType: "addChecklist","boardId":boardId,"checklistName":checklistId,"desc":desc});
|
datas.triggerVar.set({
|
||||||
|
activityType: "addChecklist",
|
||||||
|
"boardId": boardId,
|
||||||
|
"checklistName": checklistId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "removed") {
|
if (actionSelected == "removed") {
|
||||||
datas.triggerVar.set({activityType: "removeChecklist","boardId":boardId,"checklistName":checklistId,"desc":desc});
|
datas.triggerVar.set({
|
||||||
|
activityType: "removeChecklist",
|
||||||
|
"boardId": boardId,
|
||||||
|
"checklistName": checklistId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-add-gen-comp-trigger' (event) {
|
'click .js-add-gen-comp-trigger' (event) {
|
||||||
|
|
@ -36,10 +56,20 @@ BlazeComponent.extendComponent({
|
||||||
const actionSelected = this.find('#gen-comp-check-action').value;
|
const actionSelected = this.find('#gen-comp-check-action').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard')
|
||||||
if (actionSelected == "completed") {
|
if (actionSelected == "completed") {
|
||||||
datas.triggerVar.set({activityType: "completeChecklist","boardId":boardId,"checklistName":"*","desc":desc});
|
datas.triggerVar.set({
|
||||||
|
activityType: "completeChecklist",
|
||||||
|
"boardId": boardId,
|
||||||
|
"checklistName": "*",
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "uncompleted") {
|
if (actionSelected == "uncompleted") {
|
||||||
datas.triggerVar.set({activityType: "uncompleteChecklist","boardId":boardId,"checklistName":"*","desc":desc});
|
datas.triggerVar.set({
|
||||||
|
activityType: "uncompleteChecklist",
|
||||||
|
"boardId": boardId,
|
||||||
|
"checklistName": "*",
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-add-spec-comp-trigger' (event) {
|
'click .js-add-spec-comp-trigger' (event) {
|
||||||
|
|
@ -49,10 +79,20 @@ BlazeComponent.extendComponent({
|
||||||
const checklistId = this.find('#spec-comp-check-name').value;
|
const checklistId = this.find('#spec-comp-check-name').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard')
|
||||||
if (actionSelected == "added") {
|
if (actionSelected == "added") {
|
||||||
datas.triggerVar.set({activityType: "completeChecklist","boardId":boardId,"checklistName":checklistId,"desc":desc});
|
datas.triggerVar.set({
|
||||||
|
activityType: "completeChecklist",
|
||||||
|
"boardId": boardId,
|
||||||
|
"checklistName": checklistId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "removed") {
|
if (actionSelected == "removed") {
|
||||||
datas.triggerVar.set({activityType: "uncompleteChecklist","boardId":boardId,"checklistName":checklistId,"desc":desc});
|
datas.triggerVar.set({
|
||||||
|
activityType: "uncompleteChecklist",
|
||||||
|
"boardId": boardId,
|
||||||
|
"checklistName": checklistId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-add-gen-check-item-trigger' (event) {
|
'click .js-add-gen-check-item-trigger' (event) {
|
||||||
|
|
@ -61,10 +101,20 @@ BlazeComponent.extendComponent({
|
||||||
const actionSelected = this.find('#check-item-gen-action').value;
|
const actionSelected = this.find('#check-item-gen-action').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard')
|
||||||
if (actionSelected == "checked") {
|
if (actionSelected == "checked") {
|
||||||
datas.triggerVar.set({activityType: "checkedItem","boardId":boardId,"checklistItemName":"*","desc":desc});
|
datas.triggerVar.set({
|
||||||
|
activityType: "checkedItem",
|
||||||
|
"boardId": boardId,
|
||||||
|
"checklistItemName": "*",
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "unchecked") {
|
if (actionSelected == "unchecked") {
|
||||||
datas.triggerVar.set({activityType: "uncheckedItem","boardId":boardId,"checklistItemName":"*","desc":desc});
|
datas.triggerVar.set({
|
||||||
|
activityType: "uncheckedItem",
|
||||||
|
"boardId": boardId,
|
||||||
|
"checklistItemName": "*",
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-add-spec-check-item-trigger' (event) {
|
'click .js-add-spec-check-item-trigger' (event) {
|
||||||
|
|
@ -74,15 +124,23 @@ BlazeComponent.extendComponent({
|
||||||
const checklistItemId = this.find('#check-item-name').value;
|
const checklistItemId = this.find('#check-item-name').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard')
|
||||||
if (actionSelected == "checked") {
|
if (actionSelected == "checked") {
|
||||||
datas.triggerVar.set({activityType: "checkedItem","boardId":boardId,"checklistItemName":checklistItemId,"desc":desc});
|
datas.triggerVar.set({
|
||||||
|
activityType: "checkedItem",
|
||||||
|
"boardId": boardId,
|
||||||
|
"checklistItemName": checklistItemId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "unchecked") {
|
if (actionSelected == "unchecked") {
|
||||||
datas.triggerVar.set({activityType: "uncheckedItem","boardId":boardId,"checklistItemName":checklistItemId,"desc":desc});
|
datas.triggerVar.set({
|
||||||
|
activityType: "uncheckedItem",
|
||||||
|
"boardId": boardId,
|
||||||
|
"checklistItemName": checklistItemId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}];
|
}];
|
||||||
},
|
},
|
||||||
|
|
||||||
}).register('checklistTriggers');
|
}).register('checklistTriggers');
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
Actions = new Mongo.Collection('actions');
|
Actions = new Mongo.Collection('actions');
|
||||||
|
|
||||||
|
|
||||||
Actions.allow({
|
Actions.allow({
|
||||||
insert(userId, doc) {
|
insert(userId, doc) {
|
||||||
return allowIsBoardAdmin(userId, Boards.findOne(doc.boardId));
|
return allowIsBoardAdmin(userId, Boards.findOne(doc.boardId));
|
||||||
|
|
@ -13,20 +12,8 @@ Actions.allow({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
Actions.helpers({
|
Actions.helpers({
|
||||||
description() {
|
description() {
|
||||||
return this.desc;
|
return this.desc;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,3 @@ allowIsBoardMemberByCard = function(userId, card) {
|
||||||
const board = card.board();
|
const board = card.board();
|
||||||
return board && board.hasMember(userId);
|
return board && board.hasMember(userId);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
Meteor.publish('rules', (ruleId) => {
|
Meteor.publish('rules', (ruleId) => {
|
||||||
check(ruleId, String);
|
check(ruleId, String);
|
||||||
return Rules.find({ _id: ruleId });
|
return Rules.find({
|
||||||
|
_id: ruleId
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
Meteor.publish('allRules', () => {
|
Meteor.publish('allRules', () => {
|
||||||
return Rules.find({});
|
return Rules.find({});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
Meteor.publish('allTriggers', () => {
|
Meteor.publish('allTriggers', () => {
|
||||||
return Triggers.find({});
|
return Triggers.find({});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue