diff options
author | Lauri Ojansivu <x@xet7.org> | 2020-01-23 17:24:27 +0200 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2020-01-23 17:24:27 +0200 |
commit | 2216cc1b07e80001029bf3404636d4c8d8c5388a (patch) | |
tree | 26734a463883265d49a7ce328447cdd901cd85b8 /client/components/rules/actions/boardActions.js | |
parent | f275eb5e477f2988289a8544ff7b5171eacb913e (diff) | |
parent | 4b56bbfe6dd1c16ac8d2cc8da91dc55cff60177e (diff) | |
download | wekan-2216cc1b07e80001029bf3404636d4c8d8c5388a.tar.gz wekan-2216cc1b07e80001029bf3404636d4c8d8c5388a.tar.bz2 wekan-2216cc1b07e80001029bf3404636d4c8d8c5388a.zip |
Merge branch 'feature-action-move-other-board' of https://github.com/kuleuven/wekan into kuleuven-feature-action-move-other-board
Diffstat (limited to 'client/components/rules/actions/boardActions.js')
-rw-r--r-- | client/components/rules/actions/boardActions.js | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/client/components/rules/actions/boardActions.js b/client/components/rules/actions/boardActions.js index 8568d2bf..c2f2375a 100644 --- a/client/components/rules/actions/boardActions.js +++ b/client/components/rules/actions/boardActions.js @@ -1,6 +1,22 @@ BlazeComponent.extendComponent({ onCreated() {}, + boards() { + const boards = Boards.find( + { + archived: false, + 'members.userId': Meteor.userId(), + _id: { + $ne: Meteor.user().getTemplatesBoardId(), + }, + }, + { + sort: ['title'], + }, + ); + return boards; + }, + events() { return [ { @@ -52,15 +68,18 @@ BlazeComponent.extendComponent({ const ruleName = this.data().ruleName.get(); const trigger = this.data().triggerVar.get(); const actionSelected = this.find('#move-spec-action').value; - const listTitle = this.find('#listName').value; + const swimlaneName = this.find('#swimlaneName').value; + const listName = this.find('#listName').value; const boardId = Session.get('currentBoard'); + const destBoardId = this.find('#board-id').value; const desc = Utils.getTriggerActionDesc(event, this); if (actionSelected === 'top') { const triggerId = Triggers.insert(trigger); const actionId = Actions.insert({ actionType: 'moveCardToTop', - listTitle, - boardId, + listName, + swimlaneName, + boardId: destBoardId, desc, }); Rules.insert({ @@ -74,8 +93,9 @@ BlazeComponent.extendComponent({ const triggerId = Triggers.insert(trigger); const actionId = Actions.insert({ actionType: 'moveCardToBottom', - listTitle, - boardId, + listName, + swimlaneName, + boardId: destBoardId, desc, }); Rules.insert({ |