mirror of
https://github.com/wekan/wekan.git
synced 2025-12-27 04:38:49 +01:00
Finished alpha rules
This commit is contained in:
parent
fc73dc5bbc
commit
30a3daa6af
11 changed files with 237 additions and 306 deletions
|
|
@ -13,47 +13,49 @@ BlazeComponent.extendComponent({
|
||||||
const actionSelected = this.find('#move-spec-action').value;
|
const actionSelected = this.find('#move-spec-action').value;
|
||||||
const listTitle = this.find('#listName').value;
|
const listTitle = this.find('#listName').value;
|
||||||
const boardId = Session.get('currentBoard');
|
const boardId = Session.get('currentBoard');
|
||||||
|
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});
|
const actionId = Actions.insert({actionType: "moveCardToTop","listTitle":listTitle,"boardId":boardId,"desc":desc});
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
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});
|
const actionId = Actions.insert({actionType: "moveCardToBottom","listTitle":listTitle,"boardId":boardId,"desc":desc});
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-add-gen-move-action'(event) {
|
'click .js-add-gen-move-action'(event) {
|
||||||
|
const desc = Utils.getTriggerActionDesc(event,this);
|
||||||
const boardId = Session.get('currentBoard');
|
const boardId = Session.get('currentBoard');
|
||||||
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-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});
|
const actionId = Actions.insert({actionType: "moveCardToTop","listTitle":"*","boardId":boardId,"desc":desc});
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
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});
|
const actionId = Actions.insert({actionType: "moveCardToBottom","listTitle":"*","boardId":boardId,"desc":desc});
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-add-arch-action'(event) {
|
'click .js-add-arch-action'(event) {
|
||||||
|
const desc = Utils.getTriggerActionDesc(event,this);
|
||||||
const boardId = Session.get('currentBoard');
|
const boardId = Session.get('currentBoard');
|
||||||
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('#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});
|
const actionId = Actions.insert({actionType: "archive","boardId":boardId,"desc":desc});
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
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});
|
const actionId = Actions.insert({actionType: "unarchive","boardId":boardId,"desc":desc});
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -24,45 +24,47 @@ BlazeComponent.extendComponent({
|
||||||
const actionSelected = this.find('#label-action').value;
|
const actionSelected = this.find('#label-action').value;
|
||||||
const labelId = this.find('#label-id').value;
|
const labelId = this.find('#label-id').value;
|
||||||
const boardId = Session.get('currentBoard');
|
const boardId = Session.get('currentBoard');
|
||||||
|
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});
|
const actionId = Actions.insert({actionType: "addLabel","labelId":labelId,"boardId":boardId,"desc":desc});
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||||
}
|
}
|
||||||
if(actionSelected == "remove"){
|
if(actionSelected == "remove"){
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({actionType: "removeLabel","labelId":labelId,"boardId":boardId});
|
const actionId = Actions.insert({actionType: "removeLabel","labelId":labelId,"boardId":boardId,"desc":desc});
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
'click .js-add-member-action'(event) {
|
'click .js-add-member-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('#member-action').value;
|
const actionSelected = this.find('#member-action').value;
|
||||||
const memberName = this.find('#member-name').value;
|
const memberName = this.find('#member-name').value;
|
||||||
const boardId = Session.get('currentBoard');
|
const boardId = Session.get('currentBoard');
|
||||||
if(actionSelected == "add"){
|
const desc = Utils.getTriggerActionDesc(event,this);
|
||||||
const triggerId = Triggers.insert(trigger);
|
if(actionSelected == "add"){
|
||||||
const actionId = Actions.insert({actionType: "addMember","memberName":memberName,"boardId":boardId});
|
const triggerId = Triggers.insert(trigger);
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
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);
|
if(actionSelected == "remove"){
|
||||||
const actionId = Actions.insert({actionType: "removeMember","memberName":memberName,"boardId":boardId});
|
const triggerId = Triggers.insert(trigger);
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
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();
|
'click .js-add-removeall-action'(event) {
|
||||||
const trigger = this.data().triggerVar.get();
|
const ruleName = this.data().ruleName.get();
|
||||||
const triggerId = Triggers.insert(trigger);
|
const trigger = this.data().triggerVar.get();
|
||||||
const boardId = Session.get('currentBoard');
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({actionType: "removeMember","memberName":"*","boardId":boardId});
|
const desc = Utils.getTriggerActionDesc(event,this);
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
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');
|
}).register('cardActions');
|
||||||
|
|
@ -10,15 +10,15 @@ BlazeComponent.extendComponent({
|
||||||
const actionSelected = this.find('#check-action').value;
|
const actionSelected = this.find('#check-action').value;
|
||||||
const checklistName = this.find('#checklist-name').value;
|
const checklistName = this.find('#checklist-name').value;
|
||||||
const boardId = Session.get('currentBoard');
|
const boardId = Session.get('currentBoard');
|
||||||
|
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});
|
const actionId = Actions.insert({actionType: "addChecklist","checklistName":checklistName,"boardId":boardId,"desc":desc});
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||||
}
|
}
|
||||||
if(actionSelected == "remove"){
|
if(actionSelected == "remove"){
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({actionType: "removeChecklist","checklistName":checklistName,"boardId":boardId});
|
const actionId = Actions.insert({actionType: "removeChecklist","checklistName":checklistName,"boardId":boardId,"desc":desc});
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -29,14 +29,15 @@ BlazeComponent.extendComponent({
|
||||||
const actionSelected = this.find('#checkall-action').value;
|
const actionSelected = this.find('#checkall-action').value;
|
||||||
const checklistName = this.find('#checklist-name2').value;
|
const checklistName = this.find('#checklist-name2').value;
|
||||||
const boardId = Session.get('currentBoard');
|
const boardId = Session.get('currentBoard');
|
||||||
|
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});
|
const actionId = Actions.insert({actionType: "checkAll","checklistName":checklistName,"boardId":boardId,"desc":desc});
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||||
}
|
}
|
||||||
if(actionSelected == "uncheck"){
|
if(actionSelected == "uncheck"){
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({actionType: "uncheckAll","checklistName":checklistName,"boardId":boardId});
|
const actionId = Actions.insert({actionType: "uncheckAll","checklistName":checklistName,"boardId":boardId,"desc":desc});
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -47,14 +48,15 @@ BlazeComponent.extendComponent({
|
||||||
const checklistName = this.find("#checklist-name3");
|
const checklistName = this.find("#checklist-name3");
|
||||||
const actionSelected = this.find('#check-item-action').value;
|
const actionSelected = this.find('#check-item-action').value;
|
||||||
const boardId = Session.get('currentBoard');
|
const boardId = Session.get('currentBoard');
|
||||||
|
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});
|
const actionId = Actions.insert({actionType: "checkItem","checklistName":checklistName,"checkItemName":checkItemName,"boardId":boardId,"desc":desc});
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||||
}
|
}
|
||||||
if(actionSelected == "uncheck"){
|
if(actionSelected == "uncheck"){
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({actionType: "uncheckItem","checklistName":checklistName,"checkItemName":checkItemName,"boardId":boardId});
|
const actionId = Actions.insert({actionType: "uncheckItem","checklistName":checklistName,"checkItemName":checkItemName,"boardId":boardId,"desc":desc});
|
||||||
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,8 @@ BlazeComponent.extendComponent({
|
||||||
const ruleName = this.data().ruleName.get();
|
const ruleName = this.data().ruleName.get();
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const boardId = Session.get('currentBoard');
|
const boardId = Session.get('currentBoard');
|
||||||
const actionId = Actions.insert({actionType: "sendEmail","emailTo":emailTo,"emailSubject":emailSubject,"emailMsg":emailMsg,"boardId":boardId});
|
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});
|
Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId});
|
||||||
},
|
},
|
||||||
}];
|
}];
|
||||||
|
|
|
||||||
|
|
@ -3,5 +3,16 @@ template(name="ruleDetails")
|
||||||
h2
|
h2
|
||||||
i.fa.fa-magic
|
i.fa.fa-magic
|
||||||
| {{{_ 'r-rule-details' }}}
|
| {{{_ 'r-rule-details' }}}
|
||||||
= trigger
|
.triggers-content
|
||||||
= action
|
.triggers-body
|
||||||
|
.triggers-main-body
|
||||||
|
div.trigger-item
|
||||||
|
div.trigger-content
|
||||||
|
div.trigger-text
|
||||||
|
= trigger
|
||||||
|
div.trigger-item
|
||||||
|
div.trigger-content
|
||||||
|
div.trigger-text
|
||||||
|
= action
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -2,12 +2,11 @@ BlazeComponent.extendComponent({
|
||||||
onCreated() {
|
onCreated() {
|
||||||
this.subscribe('allRules');
|
this.subscribe('allRules');
|
||||||
},
|
},
|
||||||
|
labels() {
|
||||||
labels(){
|
|
||||||
const labels = Boards.findOne(Session.get('currentBoard')).labels;
|
const labels = Boards.findOne(Session.get('currentBoard')).labels;
|
||||||
console.log(labels);
|
console.log(labels);
|
||||||
for(let i = 0;i<labels.length;i++){
|
for (let i = 0; i < labels.length; i++) {
|
||||||
if(labels[i].name == "" || labels[i].name == undefined){
|
if (labels[i].name == "" || labels[i].name == undefined) {
|
||||||
labels[i].name = labels[i].color.toUpperCase();
|
labels[i].name = labels[i].color.toUpperCase();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -15,70 +14,117 @@ BlazeComponent.extendComponent({
|
||||||
return labels;
|
return labels;
|
||||||
},
|
},
|
||||||
events() {
|
events() {
|
||||||
return [
|
return [{
|
||||||
{'click .js-add-gen-label-trigger'(event) {
|
'click .js-add-gen-label-trigger' (event) {
|
||||||
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
let datas = this.data();
|
let datas = this.data();
|
||||||
const actionSelected = this.find('#label-action').value;
|
const actionSelected = this.find('#label-action').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard')
|
||||||
if(actionSelected == "added"){
|
if (actionSelected == "added") {
|
||||||
datas.triggerVar.set({activityType: "addedLabel","boardId":boardId,"labelId":"*"});
|
datas.triggerVar.set({
|
||||||
}
|
activityType: "addedLabel",
|
||||||
if(actionSelected == "removed"){
|
"boardId": boardId,
|
||||||
datas.triggerVar.set({activityType: "removedLabel","boardId":boardId,"labelId":"*"});
|
"labelId": "*",
|
||||||
}
|
"desc": desc
|
||||||
},
|
});
|
||||||
'click .js-add-spec-label-trigger'(event) {
|
}
|
||||||
let datas = this.data();
|
if (actionSelected == "removed") {
|
||||||
const actionSelected = this.find('#spec-label-action').value;
|
datas.triggerVar.set({
|
||||||
const labelId = this.find('#spec-label').value;
|
activityType: "removedLabel",
|
||||||
const boardId = Session.get('currentBoard')
|
"boardId": boardId,
|
||||||
if(actionSelected == "added"){
|
"labelId": "*",
|
||||||
datas.triggerVar.set({activityType: "addedLabel","boardId":boardId,"labelId":labelId});
|
"desc": desc
|
||||||
}
|
});
|
||||||
if(actionSelected == "removed"){
|
}
|
||||||
datas.triggerVar.set({activityType: "removedLabel","boardId":boardId,"labelId":labelId});
|
},
|
||||||
}
|
'click .js-add-spec-label-trigger' (event) {
|
||||||
},
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
'click .js-add-gen-member-trigger'(event) {
|
let datas = this.data();
|
||||||
|
const actionSelected = this.find('#spec-label-action').value;
|
||||||
let datas = this.data();
|
const labelId = this.find('#spec-label').value;
|
||||||
const actionSelected = this.find('#gen-member-action').value;
|
const boardId = Session.get('currentBoard')
|
||||||
const boardId = Session.get('currentBoard')
|
if (actionSelected == "added") {
|
||||||
if(actionSelected == "added"){
|
datas.triggerVar.set({
|
||||||
datas.triggerVar.set({activityType: "joinMember","boardId":boardId,"memberId":"*"});
|
activityType: "addedLabel",
|
||||||
}
|
"boardId": boardId,
|
||||||
if(actionSelected == "removed"){
|
"labelId": labelId,
|
||||||
datas.triggerVar.set({activityType: "unjoinMember","boardId":boardId,"memberId":"*"});
|
"desc": desc
|
||||||
}
|
});
|
||||||
},
|
}
|
||||||
'click .js-add-spec-member-trigger'(event) {
|
if (actionSelected == "removed") {
|
||||||
let datas = this.data();
|
datas.triggerVar.set({
|
||||||
const actionSelected = this.find('#spec-member-action').value;
|
activityType: "removedLabel",
|
||||||
const memberId = this.find('#spec-member').value;
|
"boardId": boardId,
|
||||||
const boardId = Session.get('currentBoard')
|
"labelId": labelId,
|
||||||
if(actionSelected == "added"){
|
"desc": desc
|
||||||
datas.triggerVar.set({activityType: "joinMember","boardId":boardId,"memberId":memberId});
|
});
|
||||||
}
|
}
|
||||||
if(actionSelected == "removed"){
|
},
|
||||||
datas.triggerVar.set({activityType: "unjoinMember","boardId":boardId,"memberId":memberId});
|
'click .js-add-gen-member-trigger' (event) {
|
||||||
}
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
},
|
let datas = this.data();
|
||||||
'click .js-add-attachment-trigger'(event) {
|
const actionSelected = this.find('#gen-member-action').value;
|
||||||
|
const boardId = Session.get('currentBoard')
|
||||||
let datas = this.data();
|
if (actionSelected == "added") {
|
||||||
const actionSelected = this.find('#attach-action').value;
|
datas.triggerVar.set({
|
||||||
const boardId = Session.get('currentBoard')
|
activityType: "joinMember",
|
||||||
if(actionSelected == "added"){
|
"boardId": boardId,
|
||||||
datas.triggerVar.set({activityType: "addAttachment","boardId":boardId});
|
"memberId": "*",
|
||||||
}
|
"desc": desc
|
||||||
if(actionSelected == "removed"){
|
});
|
||||||
datas.triggerVar.set({activityType: "deleteAttachment","boardId":boardId});
|
}
|
||||||
}
|
if (actionSelected == "removed") {
|
||||||
},
|
datas.triggerVar.set({
|
||||||
|
activityType: "unjoinMember",
|
||||||
|
"boardId": boardId,
|
||||||
|
"memberId": "*",
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'click .js-add-spec-member-trigger' (event) {
|
||||||
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
|
let datas = this.data();
|
||||||
|
const actionSelected = this.find('#spec-member-action').value;
|
||||||
|
const memberId = this.find('#spec-member').value;
|
||||||
|
const boardId = Session.get('currentBoard')
|
||||||
|
if (actionSelected == "added") {
|
||||||
|
datas.triggerVar.set({
|
||||||
|
activityType: "joinMember",
|
||||||
|
"boardId": boardId,
|
||||||
|
"memberId": memberId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (actionSelected == "removed") {
|
||||||
|
datas.triggerVar.set({
|
||||||
|
activityType: "unjoinMember",
|
||||||
|
"boardId": boardId,
|
||||||
|
"memberId": memberId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'click .js-add-attachment-trigger' (event) {
|
||||||
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
|
let datas = this.data();
|
||||||
|
const actionSelected = this.find('#attach-action').value;
|
||||||
|
const boardId = Session.get('currentBoard')
|
||||||
|
if (actionSelected == "added") {
|
||||||
|
datas.triggerVar.set({
|
||||||
|
activityType: "addAttachment",
|
||||||
|
"boardId": boardId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (actionSelected == "removed") {
|
||||||
|
datas.triggerVar.set({
|
||||||
|
activityType: "deleteAttachment",
|
||||||
|
"boardId": boardId,
|
||||||
|
"desc": desc
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
}];
|
}];
|
||||||
},
|
},
|
||||||
|
|
||||||
}).register('cardTriggers');
|
}).register('cardTriggers');
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,79 +5,83 @@ BlazeComponent.extendComponent({
|
||||||
events() {
|
events() {
|
||||||
return [
|
return [
|
||||||
{'click .js-add-gen-check-trigger'(event) {
|
{'click .js-add-gen-check-trigger'(event) {
|
||||||
|
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":"*"});
|
datas.triggerVar.set({activityType: "addChecklist","boardId":boardId,"checklistName":"*","desc":desc});
|
||||||
}
|
}
|
||||||
if(actionSelected == "removed"){
|
if(actionSelected == "removed"){
|
||||||
datas.triggerVar.set({activityType: "removeChecklist","boardId":boardId,"checklistName":"*"});
|
datas.triggerVar.set({activityType: "removeChecklist","boardId":boardId,"checklistName":"*","desc":desc});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-add-spec-check-trigger'(event) {
|
'click .js-add-spec-check-trigger'(event) {
|
||||||
|
const desc = Utils.getTriggerActionDesc(event,this);
|
||||||
let datas = this.data();
|
let datas = this.data();
|
||||||
const actionSelected = this.find('#spec-check-action').value;
|
const actionSelected = this.find('#spec-check-action').value;
|
||||||
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});
|
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});
|
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) {
|
||||||
|
const desc = Utils.getTriggerActionDesc(event,this);
|
||||||
|
|
||||||
let datas = this.data();
|
let datas = this.data();
|
||||||
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":"*"});
|
datas.triggerVar.set({activityType: "completeChecklist","boardId":boardId,"checklistName":"*","desc":desc});
|
||||||
}
|
}
|
||||||
if(actionSelected == "uncompleted"){
|
if(actionSelected == "uncompleted"){
|
||||||
datas.triggerVar.set({activityType: "uncompleteChecklist","boardId":boardId,"checklistName":"*"});
|
datas.triggerVar.set({activityType: "uncompleteChecklist","boardId":boardId,"checklistName":"*","desc":desc});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-add-spec-comp-trigger'(event) {
|
'click .js-add-spec-comp-trigger'(event) {
|
||||||
|
const desc = Utils.getTriggerActionDesc(event,this);
|
||||||
let datas = this.data();
|
let datas = this.data();
|
||||||
const actionSelected = this.find('#spec-comp-check-action').value;
|
const actionSelected = this.find('#spec-comp-check-action').value;
|
||||||
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});
|
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});
|
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) {
|
||||||
|
const desc = Utils.getTriggerActionDesc(event,this);
|
||||||
let datas = this.data();
|
let datas = this.data();
|
||||||
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":"*"});
|
datas.triggerVar.set({activityType: "checkedItem","boardId":boardId,"checklistItemName":"*","desc":desc});
|
||||||
}
|
}
|
||||||
if(actionSelected == "unchecked"){
|
if(actionSelected == "unchecked"){
|
||||||
datas.triggerVar.set({activityType: "uncheckedItem","boardId":boardId,"checklistItemName":"*"});
|
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) {
|
||||||
|
const desc = Utils.getTriggerActionDesc(event,this);
|
||||||
let datas = this.data();
|
let datas = this.data();
|
||||||
const actionSelected = this.find('#check-item-spec-action').value;
|
const actionSelected = this.find('#check-item-spec-action').value;
|
||||||
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});
|
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});
|
datas.triggerVar.set({activityType: "uncheckedItem","boardId":boardId,"checklistItemName":checklistItemId,"desc":desc});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}];
|
}];
|
||||||
},
|
},
|
||||||
|
|
||||||
}).register('checklistTriggers');
|
}).register('checklistTriggers');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -152,9 +152,9 @@ Utils = {
|
||||||
for(let i = 0;i< triggerEls.length;i++){
|
for(let i = 0;i< triggerEls.length;i++){
|
||||||
const element = tempInstance.$(triggerEls[i]);
|
const element = tempInstance.$(triggerEls[i]);
|
||||||
if(element.hasClass("trigger-text")){
|
if(element.hasClass("trigger-text")){
|
||||||
finalString += element.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();
|
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();
|
finalString += element.find("input").val();
|
||||||
}
|
}
|
||||||
|
|
@ -163,7 +163,7 @@ Utils = {
|
||||||
finalString += " ";
|
finalString += " ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return finalString.toLowerCase();
|
return finalString;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,85 +16,7 @@ Actions.allow({
|
||||||
|
|
||||||
Actions.helpers({
|
Actions.helpers({
|
||||||
description() {
|
description() {
|
||||||
if(this.actionType == "moveCardToTop"){
|
return this.desc;
|
||||||
if(this.listTitle == "*"){
|
|
||||||
return TAPi18n.__('r-d-move-to-top-gen');
|
|
||||||
}else{
|
|
||||||
return TAPi18n.__('r-d-move-to-top-spec') + " " + this.listTitle;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(this.actionType == "moveCardToBottom"){
|
|
||||||
if(this.listTitle == "*"){
|
|
||||||
return TAPi18n.__('r-d-move-to-bottom-gen');
|
|
||||||
}else{
|
|
||||||
return TAPi18n.__('r-d-move-to-bottom-spec') + " " + this.listTitle;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(this.actionType == "sendEmail"){
|
|
||||||
const to = " " + TAPi18n.__('r-d-send-email-to') + ": " + this.emailTo + ", ";
|
|
||||||
const subject = TAPi18n.__('r-d-send-email-subject') + ": " + this.emailSubject + ", ";
|
|
||||||
const message = TAPi18n.__('r-d-send-email-message') + ": " + this.emailMsg;
|
|
||||||
const total = TAPi18n.__('r-d-send-email') + to + subject + message;
|
|
||||||
return total;
|
|
||||||
}
|
|
||||||
if(this.actionType == "archive"){
|
|
||||||
return TAPi18n.__('r-d-archive');
|
|
||||||
}
|
|
||||||
if(this.actionType == "unarchive"){
|
|
||||||
return TAPi18n.__('r-d-unarchive');
|
|
||||||
}
|
|
||||||
if(this.actionType == "addLabel"){
|
|
||||||
const board = Boards.findOne(Session.get('currentBoard'));
|
|
||||||
const label = board.getLabelById(this.labelId);
|
|
||||||
let name;
|
|
||||||
if(label.name == "" || label.name == undefined){
|
|
||||||
name = label.color.toUpperCase();
|
|
||||||
}else{
|
|
||||||
name = label.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TAPi18n.__('r-d-add-label') + ": "+name;
|
|
||||||
}
|
|
||||||
if(this.actionType == "removeLabel"){
|
|
||||||
const board = Boards.findOne(Session.get('currentBoard'));
|
|
||||||
const label = board.getLabelById(this.labelId);
|
|
||||||
let name;
|
|
||||||
if(label.name == "" || label.name == undefined){
|
|
||||||
name = label.color.toUpperCase();
|
|
||||||
}else{
|
|
||||||
name = label.name;
|
|
||||||
}
|
|
||||||
return TAPi18n.__('r-d-remove-label') + ": " + name;
|
|
||||||
}
|
|
||||||
if(this.actionType == "addMember"){
|
|
||||||
return TAPi18n.__('r-d-add-member') + ": " + this.memberName;
|
|
||||||
}
|
|
||||||
if(this.actionType == "removeMember"){
|
|
||||||
if(this.memberName == "*"){
|
|
||||||
return TAPi18n.__('r-d-remove-all-member');
|
|
||||||
}
|
|
||||||
return TAPi18n.__('r-d-remove-member') + ": "+ this.memberName;
|
|
||||||
}
|
|
||||||
if(this.actionType == "checkAll"){
|
|
||||||
return TAPi18n.__('r-d-check-all') + ": " + this.checklistName;
|
|
||||||
}
|
|
||||||
if(this.actionType == "uncheckAll"){
|
|
||||||
return TAPi18n.__('r-d-uncheck-all') + ": "+ this.checklistName;
|
|
||||||
}
|
|
||||||
if(this.actionType == "checkItem"){
|
|
||||||
return TAPi18n.__('r-d-check-one') + ": "+ this.checkItemName + " " + TAPi18n.__('r-d-check-of-list') + ": " +this.checklistName;
|
|
||||||
}
|
|
||||||
if(this.actionType == "uncheckItem"){
|
|
||||||
return TAPi18n.__('r-d-check-one') + ": "+ this.checkItemName + " " + TAPi18n.__('r-d-check-of-list') + ": " +this.checklistName;
|
|
||||||
}
|
|
||||||
if(this.actionType == "addChecklist"){
|
|
||||||
return TAPi18n.__('r-d-add-checklist') + ": "+ this.checklistName;
|
|
||||||
}
|
|
||||||
if(this.actionType == "removeChecklist"){
|
|
||||||
return TAPi18n.__('r-d-remove-checklist') + ": "+ this.checklistName;
|
|
||||||
}
|
|
||||||
|
|
||||||
return "Ops not trigger description";
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
Triggers = new Mongo.Collection('triggers');
|
Triggers = new Mongo.Collection('triggers');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Triggers.mutations({
|
Triggers.mutations({
|
||||||
rename(description) {
|
rename(description) {
|
||||||
return { $set: { description } };
|
return {
|
||||||
|
$set: {
|
||||||
|
description
|
||||||
|
}
|
||||||
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -20,87 +22,37 @@ Triggers.allow({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
Triggers.helpers({
|
Triggers.helpers({
|
||||||
|
|
||||||
|
description() {
|
||||||
|
return this.desc;
|
||||||
|
},
|
||||||
|
|
||||||
description(){
|
getRule() {
|
||||||
if(this.activityType == "createCard"){
|
return Rules.findOne({
|
||||||
if(this.listName == "*"){
|
triggerId: this._id
|
||||||
return TAPi18n.__('r-when-a-card-is') + " " + TAPi18n.__('r-added-to').toLowerCase() + " " + TAPi18n.__('r-the-board');
|
});
|
||||||
}else{
|
},
|
||||||
return TAPi18n.__('r-when-a-card-is') + " " + TAPi18n.__('r-added-to').toLowerCase() + " " + TAPi18n.__('r-list') + " " +this.listName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(this.activityType == "removeCard"){
|
|
||||||
if(this.listName == "*"){
|
|
||||||
return TAPi18n.__('r-when-a-card-is') + " " + TAPi18n.__('r-removed-from') + " " + TAPi18n.__('r-the-board');
|
|
||||||
}else{
|
|
||||||
return TAPi18n.__('r-when-a-card-is') + " " + TAPi18n.__('r-removed-from') + " " + TAPi18n.__('r-list') + " " +this.listName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(this.activityType == "moveCard"){
|
|
||||||
if(this.listName = "*"){
|
|
||||||
return TAPi18n.__('r-when-a-card-is') + " " + TAPi18n.__('r-moved-from') + " " + this.oldListName;
|
|
||||||
}else{
|
|
||||||
return TAPi18n.__('r-when-a-card-is') + " " + TAPi18n.__('r-moved-to') + " " + this.listName;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
fromList() {
|
||||||
if(this.activityType = "archivedCard"){
|
return Lists.findOne(this.fromId);
|
||||||
return TAPi18n.__('r-when-a-card-is') + " " + TAPi18n.__('r-archived');
|
},
|
||||||
}
|
|
||||||
if(this.activityType = "restoredCard"){
|
toList() {
|
||||||
return TAPi18n.__('r-when-a-card-is') + " " + TAPi18n.__('r-unarchived');
|
return Lists.findOne(this.toId);
|
||||||
}
|
},
|
||||||
if(this.activityType = "addedLabel"){
|
|
||||||
if(this.labelId == "*"){
|
findList(title) {
|
||||||
return TAPi18n.__('r-when-a-label-is') + " " + TAPi18n.__('r-added-to') + " " + TAPi18n.__('r-a-card');
|
return Lists.findOne({
|
||||||
}else{
|
title: title
|
||||||
const board = Boards.findOne(Session.get('currentBoard'));
|
});
|
||||||
const label = board.getLabelById(this.labelId);
|
},
|
||||||
let name;
|
|
||||||
if(label.name == "" || label.name == undefined){
|
labels() {
|
||||||
name = label.color.toUpperCase();
|
const boardLabels = this.board().labels;
|
||||||
}else{
|
const cardLabels = _.filter(boardLabels, (label) => {
|
||||||
name = label.name;
|
return _.contains(this.labelIds, label._id);
|
||||||
}
|
});
|
||||||
}
|
return cardLabels;
|
||||||
}
|
}
|
||||||
if(this.activityType = "restoredCard"){
|
});
|
||||||
return TAPi18n.__('r-when-a-card-is') + " " + TAPi18n.__('r-unarchived');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return "No description found";
|
|
||||||
},
|
|
||||||
|
|
||||||
getRule(){
|
|
||||||
return Rules.findOne({triggerId:this._id});
|
|
||||||
},
|
|
||||||
|
|
||||||
fromList() {
|
|
||||||
return Lists.findOne(this.fromId);
|
|
||||||
},
|
|
||||||
|
|
||||||
toList() {
|
|
||||||
return Lists.findOne(this.toId);
|
|
||||||
},
|
|
||||||
|
|
||||||
findList(title) {
|
|
||||||
return Lists.findOne({title:title});
|
|
||||||
},
|
|
||||||
|
|
||||||
labels() {
|
|
||||||
const boardLabels = this.board().labels;
|
|
||||||
const cardLabels = _.filter(boardLabels, (label) => {
|
|
||||||
return _.contains(this.labelIds, label._id);
|
|
||||||
});
|
|
||||||
return cardLabels;
|
|
||||||
}});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,10 +1,7 @@
|
||||||
RulesHelper = {
|
RulesHelper = {
|
||||||
executeRules(activity){
|
executeRules(activity){
|
||||||
const matchingRules = this.findMatchingRules(activity);
|
const matchingRules = this.findMatchingRules(activity);
|
||||||
console.log("Matching rules:")
|
|
||||||
console.log(matchingRules);
|
|
||||||
for(let i = 0;i< matchingRules.length;i++){
|
for(let i = 0;i< matchingRules.length;i++){
|
||||||
console.log(matchingRules[i]);
|
|
||||||
const action = matchingRules[i].getAction();
|
const action = matchingRules[i].getAction();
|
||||||
this.performAction(activity,action);
|
this.performAction(activity,action);
|
||||||
}
|
}
|
||||||
|
|
@ -34,11 +31,6 @@ RulesHelper = {
|
||||||
return matchingMap;
|
return matchingMap;
|
||||||
},
|
},
|
||||||
performAction(activity,action){
|
performAction(activity,action){
|
||||||
|
|
||||||
console.log("Performing action - Activity");
|
|
||||||
console.log(activity);
|
|
||||||
console.log("Performing action - Action");
|
|
||||||
console.log(action);
|
|
||||||
const card = Cards.findOne({_id:activity.cardId});
|
const card = Cards.findOne({_id:activity.cardId});
|
||||||
const boardId = activity.boardId;
|
const boardId = activity.boardId;
|
||||||
if(action.actionType == "moveCardToTop"){
|
if(action.actionType == "moveCardToTop"){
|
||||||
|
|
@ -96,14 +88,11 @@ RulesHelper = {
|
||||||
}
|
}
|
||||||
if(action.actionType == "addMember"){
|
if(action.actionType == "addMember"){
|
||||||
const memberId = Users.findOne({username:action.memberName})._id;
|
const memberId = Users.findOne({username:action.memberName})._id;
|
||||||
console.log(memberId);
|
|
||||||
card.assignMember(memberId);
|
card.assignMember(memberId);
|
||||||
}
|
}
|
||||||
if(action.actionType == "removeMember"){
|
if(action.actionType == "removeMember"){
|
||||||
if(action.memberName == "*"){
|
if(action.memberName == "*"){
|
||||||
console.log(card);
|
|
||||||
const members = card.members;
|
const members = card.members;
|
||||||
console.log(members);
|
|
||||||
for(let i = 0;i< members.length;i++){
|
for(let i = 0;i< members.length;i++){
|
||||||
card.unassignMember(members[i]);
|
card.unassignMember(members[i]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue