diff options
author | Lauri Ojansivu <x@xet7.org> | 2019-06-29 07:47:57 -0400 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2019-06-29 07:47:57 -0400 |
commit | b84dc20ded0375d9ab14ec05c78b737398d76b83 (patch) | |
tree | c3b91b3657299c779e941a1257df17bb0eade866 /client/components/rules/actions/checklistActions.js | |
parent | 100288b3e1bce882ab9923a5bff7b5f620f33ee8 (diff) | |
parent | 3eb4d2c341b712268bd321173909e0a7b19a88c9 (diff) | |
download | wekan-b84dc20ded0375d9ab14ec05c78b737398d76b83.tar.gz wekan-b84dc20ded0375d9ab14ec05c78b737398d76b83.tar.bz2 wekan-b84dc20ded0375d9ab14ec05c78b737398d76b83.zip |
Merge branch 'linting' of https://github.com/justinr1234/wekan into justinr1234-linting
Diffstat (limited to 'client/components/rules/actions/checklistActions.js')
-rw-r--r-- | client/components/rules/actions/checklistActions.js | 261 |
1 files changed, 130 insertions, 131 deletions
diff --git a/client/components/rules/actions/checklistActions.js b/client/components/rules/actions/checklistActions.js index 3e79b075..64908ab1 100644 --- a/client/components/rules/actions/checklistActions.js +++ b/client/components/rules/actions/checklistActions.js @@ -3,137 +3,20 @@ BlazeComponent.extendComponent({ this.subscribe('allRules'); }, events() { - return [{ - 'click .js-add-checklist-items-action' (event) { - const ruleName = this.data().ruleName.get(); - const trigger = this.data().triggerVar.get(); - const checklistName = this.find('#checklist-name-3').value; - const checklistItems = this.find('#checklist-items').value; - const boardId = Session.get('currentBoard'); - const desc = Utils.getTriggerActionDesc(event, this); - const triggerId = Triggers.insert(trigger); - const actionId = Actions.insert({ - actionType: 'addChecklistWithItems', - checklistName, - checklistItems, - boardId, - desc, - }); - Rules.insert({ - title: ruleName, - triggerId, - actionId, - boardId, - }); - - }, - '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, - boardId, - desc, - }); - Rules.insert({ - title: ruleName, - triggerId, - actionId, - boardId, - }); - } - if (actionSelected === 'remove') { - const triggerId = Triggers.insert(trigger); - const actionId = Actions.insert({ - actionType: 'removeChecklist', - checklistName, - boardId, - desc, - }); - Rules.insert({ - title: ruleName, - triggerId, - actionId, - 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, - boardId, - desc, - }); - Rules.insert({ - title: ruleName, - triggerId, - actionId, - boardId, - }); - } - if (actionSelected === 'uncheck') { - const triggerId = Triggers.insert(trigger); - const actionId = Actions.insert({ - actionType: 'uncheckAll', - checklistName, - boardId, - desc, - }); - Rules.insert({ - title: ruleName, - triggerId, - actionId, - 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, - checkItemName, - boardId, - desc, - }); - Rules.insert({ - title: ruleName, - triggerId, - actionId, - boardId, - }); - } - if (actionSelected === 'uncheck') { + return [ + { + 'click .js-add-checklist-items-action'(event) { + const ruleName = this.data().ruleName.get(); + const trigger = this.data().triggerVar.get(); + const checklistName = this.find('#checklist-name-3').value; + const checklistItems = this.find('#checklist-items').value; + const boardId = Session.get('currentBoard'); + const desc = Utils.getTriggerActionDesc(event, this); const triggerId = Triggers.insert(trigger); const actionId = Actions.insert({ - actionType: 'uncheckItem', + actionType: 'addChecklistWithItems', checklistName, - checkItemName, + checklistItems, boardId, desc, }); @@ -143,9 +26,125 @@ BlazeComponent.extendComponent({ actionId, boardId, }); - } + }, + '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, + boardId, + desc, + }); + Rules.insert({ + title: ruleName, + triggerId, + actionId, + boardId, + }); + } + if (actionSelected === 'remove') { + const triggerId = Triggers.insert(trigger); + const actionId = Actions.insert({ + actionType: 'removeChecklist', + checklistName, + boardId, + desc, + }); + Rules.insert({ + title: ruleName, + triggerId, + actionId, + 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, + boardId, + desc, + }); + Rules.insert({ + title: ruleName, + triggerId, + actionId, + boardId, + }); + } + if (actionSelected === 'uncheck') { + const triggerId = Triggers.insert(trigger); + const actionId = Actions.insert({ + actionType: 'uncheckAll', + checklistName, + boardId, + desc, + }); + Rules.insert({ + title: ruleName, + triggerId, + actionId, + 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, + checkItemName, + boardId, + desc, + }); + Rules.insert({ + title: ruleName, + triggerId, + actionId, + boardId, + }); + } + if (actionSelected === 'uncheck') { + const triggerId = Triggers.insert(trigger); + const actionId = Actions.insert({ + actionType: 'uncheckItem', + checklistName, + checkItemName, + boardId, + desc, + }); + Rules.insert({ + title: ruleName, + triggerId, + actionId, + boardId, + }); + } + }, }, - }]; + ]; }, - }).register('checklistActions'); |