diff options
Diffstat (limited to 'client/components/rules/actions/cardActions.js')
-rw-r--r-- | client/components/rules/actions/cardActions.js | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/client/components/rules/actions/cardActions.js b/client/components/rules/actions/cardActions.js index a1e43c38..d6e11eea 100644 --- a/client/components/rules/actions/cardActions.js +++ b/client/components/rules/actions/cardActions.js @@ -29,6 +29,54 @@ BlazeComponent.extendComponent({ events() { return [{ + 'click .js-set-date-action' (event) { + const ruleName = this.data().ruleName.get(); + const trigger = this.data().triggerVar.get(); + const triggerId = Triggers.insert(trigger); + const actionSelected = this.find('#setdate-action').value; + const dateFieldSelected = this.find('#setdate-datefield').value; + const boardId = Session.get('currentBoard'); + const desc = Utils.getTriggerActionDesc(event, this); + + const actionId = Actions.insert({ + actionType: actionSelected, + dateField: dateFieldSelected, + boardId, + desc, + }); + + Rules.insert({ + title: ruleName, + triggerId, + actionId, + boardId, + desc, + }); + }, + + 'click .js-remove-datevalue-action' (event) { + const ruleName = this.data().ruleName.get(); + const trigger = this.data().triggerVar.get(); + const triggerId = Triggers.insert(trigger); + const dateFieldSelected = this.find('#setdate-removedatefieldvalue').value; + const boardId = Session.get('currentBoard'); + const desc = Utils.getTriggerActionDesc(event, this); + + const actionId = Actions.insert({ + actionType: 'removeDate', + dateField: dateFieldSelected, + boardId, + desc, + }); + + Rules.insert({ + title: ruleName, + triggerId, + actionId, + boardId, + desc, + }); + }, 'click .js-add-label-action' (event) { const ruleName = this.data().ruleName.get(); const trigger = this.data().triggerVar.get(); |