summaryrefslogtreecommitdiffstats
path: root/client/components/rules/actions/checklistActions.js
diff options
context:
space:
mode:
authorAngelo Gallarello <angelo.gallarell@gmail.com>2019-01-02 15:42:10 +0100
committerAngelo Gallarello <angelo.gallarell@gmail.com>2019-01-02 15:42:10 +0100
commit4c399a41f7b87247c979e98c422d7aad999fbdb1 (patch)
tree4d5ea6dd3725a2c8aef02167ac854d6fc4a3d56b /client/components/rules/actions/checklistActions.js
parent25968a35cc568e1c3f7d084632f4d2c8b41ed380 (diff)
downloadwekan-4c399a41f7b87247c979e98c422d7aad999fbdb1.tar.gz
wekan-4c399a41f7b87247c979e98c422d7aad999fbdb1.tar.bz2
wekan-4c399a41f7b87247c979e98c422d7aad999fbdb1.zip
Add action: create checklist with items
Diffstat (limited to 'client/components/rules/actions/checklistActions.js')
-rw-r--r--client/components/rules/actions/checklistActions.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/client/components/rules/actions/checklistActions.js b/client/components/rules/actions/checklistActions.js
index 4b70f959..59141c39 100644
--- a/client/components/rules/actions/checklistActions.js
+++ b/client/components/rules/actions/checklistActions.js
@@ -4,6 +4,29 @@ BlazeComponent.extendComponent({
},
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();