diff options
Diffstat (limited to 'client/components')
-rw-r--r-- | client/components/rules/actions/boardActions.jade | 17 | ||||
-rw-r--r-- | client/components/rules/actions/boardActions.js | 25 |
2 files changed, 42 insertions, 0 deletions
diff --git a/client/components/rules/actions/boardActions.jade b/client/components/rules/actions/boardActions.jade index ab7d77a8..6034184c 100644 --- a/client/components/rules/actions/boardActions.jade +++ b/client/components/rules/actions/boardActions.jade @@ -47,6 +47,23 @@ template(name="boardActions") div.trigger-button.js-add-swimlane-action.js-goto-rules i.fa.fa-plus + div.trigger-item + div.trigger-content + div.trigger-text + | {{_'r-create-card'}} + div.trigger-dropdown + input(id="card-name",type=text,placeholder="{{_'r-name'}}") + div.trigger-text + | {{_'r-in-list'}} + div.trigger-dropdown + input(id="list-name",type=text,placeholder="{{_'r-name'}}") + div.trigger-text + | {{_'r-in-swimlane'}} + div.trigger-dropdown + input(id="swimlane-name2",type=text,placeholder="{{_'r-name'}}") + div.trigger-button.js-create-card-action.js-goto-rules + i.fa.fa-plus + diff --git a/client/components/rules/actions/boardActions.js b/client/components/rules/actions/boardActions.js index 34f7c4b4..c2ac156c 100644 --- a/client/components/rules/actions/boardActions.js +++ b/client/components/rules/actions/boardActions.js @@ -5,6 +5,31 @@ BlazeComponent.extendComponent({ events() { return [{ + 'click .js-create-card-action' (event) { + const ruleName = this.data().ruleName.get(); + const trigger = this.data().triggerVar.get(); + const cardName = this.find('#card-name').value; + const listName = this.find('#list-name').value; + const swimlaneName = this.find('#swimlane-name2').value; + const boardId = Session.get('currentBoard'); + const desc = Utils.getTriggerActionDesc(event, this); + const triggerId = Triggers.insert(trigger); + const actionId = Actions.insert({ + actionType: 'createCard', + swimlaneName, + cardName, + listName, + boardId, + desc, + }); + Rules.insert({ + title: ruleName, + triggerId, + actionId, + boardId, + }); + + }, 'click .js-add-swimlane-action' (event) { const ruleName = this.data().ruleName.get(); const trigger = this.data().triggerVar.get(); |