summaryrefslogtreecommitdiffstats
path: root/client/components/rules/actions/boardActions.js
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2020-01-23 17:24:27 +0200
committerLauri Ojansivu <x@xet7.org>2020-01-23 17:24:27 +0200
commit2216cc1b07e80001029bf3404636d4c8d8c5388a (patch)
tree26734a463883265d49a7ce328447cdd901cd85b8 /client/components/rules/actions/boardActions.js
parentf275eb5e477f2988289a8544ff7b5171eacb913e (diff)
parent4b56bbfe6dd1c16ac8d2cc8da91dc55cff60177e (diff)
downloadwekan-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.js30
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({