diff options
author | Angelo Gallarello <angelo.gallarell@gmail.com> | 2018-09-14 17:35:14 +0200 |
---|---|---|
committer | Angelo Gallarello <angelo.gallarell@gmail.com> | 2018-09-14 17:35:14 +0200 |
commit | 30a3daa6af179009ac17b40a71bf3f9e9b1d698a (patch) | |
tree | 16e2ecdc589aa67367f3d53a44c1eaba8ba1f637 /client/components/rules/actions/checklistActions.js | |
parent | fc73dc5bbcbbd203efc4f10ecb4bd1a66e0d9efb (diff) | |
download | wekan-30a3daa6af179009ac17b40a71bf3f9e9b1d698a.tar.gz wekan-30a3daa6af179009ac17b40a71bf3f9e9b1d698a.tar.bz2 wekan-30a3daa6af179009ac17b40a71bf3f9e9b1d698a.zip |
Finished alpha rules
Diffstat (limited to 'client/components/rules/actions/checklistActions.js')
-rw-r--r-- | client/components/rules/actions/checklistActions.js | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/client/components/rules/actions/checklistActions.js b/client/components/rules/actions/checklistActions.js index e6989fc6..bfc07623 100644 --- a/client/components/rules/actions/checklistActions.js +++ b/client/components/rules/actions/checklistActions.js @@ -10,15 +10,15 @@ BlazeComponent.extendComponent({ 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}); + 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}); + const actionId = Actions.insert({actionType: "removeChecklist","checklistName":checklistName,"boardId":boardId,"desc":desc}); Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId}); } @@ -29,14 +29,15 @@ BlazeComponent.extendComponent({ 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}); + 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}); + const actionId = Actions.insert({actionType: "uncheckAll","checklistName":checklistName,"boardId":boardId,"desc":desc}); Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId}); } }, @@ -47,14 +48,15 @@ BlazeComponent.extendComponent({ 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}); + 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}); + const actionId = Actions.insert({actionType: "uncheckItem","checklistName":checklistName,"checkItemName":checkItemName,"boardId":boardId,"desc":desc}); Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId,"boardId":boardId}); } }, |