From a2d756074f05299248944ecce2cc87a9a28ab020 Mon Sep 17 00:00:00 2001 From: Angelo Gallarello Date: Sun, 30 Dec 2018 22:08:34 +0100 Subject: Added swimlane trigger --- client/components/rules/triggers/boardTriggers.js | 37 ++++++++--------------- 1 file changed, 13 insertions(+), 24 deletions(-) (limited to 'client/components/rules/triggers/boardTriggers.js') diff --git a/client/components/rules/triggers/boardTriggers.js b/client/components/rules/triggers/boardTriggers.js index 40c5b07e..b822d643 100644 --- a/client/components/rules/triggers/boardTriggers.js +++ b/client/components/rules/triggers/boardTriggers.js @@ -8,60 +8,48 @@ BlazeComponent.extendComponent({ 'click .js-add-gen-trigger' (event) { const desc = Utils.getTriggerActionDesc(event, this); const datas = this.data(); - const actionSelected = this.find('#gen-action').value; const boardId = Session.get('currentBoard'); - if (actionSelected === 'created') { - datas.triggerVar.set({ + datas.triggerVar.set({ activityType: 'createCard', boardId, 'listName': '*', desc, }); - } - if (actionSelected === 'removed') { - datas.triggerVar.set({ - activityType: 'removeCard', - boardId, - desc, - }); - } }, 'click .js-add-create-trigger' (event) { const desc = Utils.getTriggerActionDesc(event, this); const datas = this.data(); - const actionSelected = this.find('#create-action').value; const listName = this.find('#create-list-name').value; + const swimlaneName = this.find('#create-swimlane-name').value; + if(swimlaneName == undefined || swimlaneName == ""){ + swimlaneName = "*"; + } const boardId = Session.get('currentBoard'); - if (actionSelected === 'created') { - datas.triggerVar.set({ + datas.triggerVar.set({ activityType: 'createCard', boardId, + swimlaneName, listName, desc, }); - } - if (actionSelected === 'removed') { - datas.triggerVar.set({ - activityType: 'removeCard', - boardId, - listName, - desc, - }); - } }, 'click .js-add-moved-trigger' (event) { const datas = this.data(); const desc = Utils.getTriggerActionDesc(event, this); - + const swimlaneName = this.find('#create-swimlane-name').value; const actionSelected = this.find('#move-action').value; const listName = this.find('#move-list-name').value; const boardId = Session.get('currentBoard'); + if(swimlaneName == undefined || swimlaneName == ""){ + swimlaneName = "*"; + } if (actionSelected === 'moved-to') { datas.triggerVar.set({ activityType: 'moveCard', boardId, listName, + swimlaneName, 'oldListName': '*', desc, }); @@ -70,6 +58,7 @@ BlazeComponent.extendComponent({ datas.triggerVar.set({ activityType: 'moveCard', boardId, + swimlaneName, 'listName': '*', 'oldListName': listName, desc, -- cgit v1.2.3-1-g7c22