summaryrefslogtreecommitdiffstats
path: root/client/components/rules/actions/boardActions.js
diff options
context:
space:
mode:
authorJustin Reynolds <justinr1234@gmail.com>2019-06-28 12:52:09 -0500
committerJustin Reynolds <justinr1234@gmail.com>2019-06-28 12:56:51 -0500
commit3eb4d2c341b712268bd321173909e0a7b19a88c9 (patch)
tree25a8fcb088f3984e72a5bd3ded9e6a45376e0693 /client/components/rules/actions/boardActions.js
parenta0a482aa8efb3255a523de4524c8e09453d5571f (diff)
downloadwekan-3eb4d2c341b712268bd321173909e0a7b19a88c9.tar.gz
wekan-3eb4d2c341b712268bd321173909e0a7b19a88c9.tar.bz2
wekan-3eb4d2c341b712268bd321173909e0a7b19a88c9.zip
Prettier & eslint project style update
Diffstat (limited to 'client/components/rules/actions/boardActions.js')
-rw-r--r--client/components/rules/actions/boardActions.js275
1 files changed, 136 insertions, 139 deletions
diff --git a/client/components/rules/actions/boardActions.js b/client/components/rules/actions/boardActions.js
index e0b8edc9..8568d2bf 100644
--- a/client/components/rules/actions/boardActions.js
+++ b/client/components/rules/actions/boardActions.js
@@ -1,68 +1,23 @@
BlazeComponent.extendComponent({
- onCreated() {
-
- },
+ onCreated() {},
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();
- const swimlaneName = this.find('#swimlane-name').value;
- const boardId = Session.get('currentBoard');
- const desc = Utils.getTriggerActionDesc(event, this);
- const triggerId = Triggers.insert(trigger);
- const actionId = Actions.insert({
- actionType: 'addSwimlane',
- swimlaneName,
- boardId,
- desc,
- });
- Rules.insert({
- title: ruleName,
- triggerId,
- actionId,
- boardId,
- });
-
- },
- 'click .js-add-spec-move-action' (event) {
- 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 boardId = Session.get('currentBoard');
- const desc = Utils.getTriggerActionDesc(event, this);
- if (actionSelected === 'top') {
+ 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: 'moveCardToTop',
- listTitle,
+ actionType: 'createCard',
+ swimlaneName,
+ cardName,
+ listName,
boardId,
desc,
});
@@ -72,12 +27,17 @@ BlazeComponent.extendComponent({
actionId,
boardId,
});
- }
- if (actionSelected === 'bottom') {
+ },
+ 'click .js-add-swimlane-action'(event) {
+ const ruleName = this.data().ruleName.get();
+ const trigger = this.data().triggerVar.get();
+ const swimlaneName = this.find('#swimlane-name').value;
+ const boardId = Session.get('currentBoard');
+ const desc = Utils.getTriggerActionDesc(event, this);
const triggerId = Triggers.insert(trigger);
const actionId = Actions.insert({
- actionType: 'moveCardToBottom',
- listTitle,
+ actionType: 'addSwimlane',
+ swimlaneName,
boardId,
desc,
});
@@ -87,82 +47,119 @@ BlazeComponent.extendComponent({
actionId,
boardId,
});
- }
+ },
+ 'click .js-add-spec-move-action'(event) {
+ 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 boardId = Session.get('currentBoard');
+ const desc = Utils.getTriggerActionDesc(event, this);
+ if (actionSelected === 'top') {
+ const triggerId = Triggers.insert(trigger);
+ const actionId = Actions.insert({
+ actionType: 'moveCardToTop',
+ listTitle,
+ boardId,
+ desc,
+ });
+ Rules.insert({
+ title: ruleName,
+ triggerId,
+ actionId,
+ boardId,
+ });
+ }
+ if (actionSelected === 'bottom') {
+ const triggerId = Triggers.insert(trigger);
+ const actionId = Actions.insert({
+ actionType: 'moveCardToBottom',
+ listTitle,
+ boardId,
+ desc,
+ });
+ Rules.insert({
+ title: ruleName,
+ triggerId,
+ actionId,
+ boardId,
+ });
+ }
+ },
+ 'click .js-add-gen-move-action'(event) {
+ const desc = Utils.getTriggerActionDesc(event, this);
+ const boardId = Session.get('currentBoard');
+ const ruleName = this.data().ruleName.get();
+ const trigger = this.data().triggerVar.get();
+ const actionSelected = this.find('#move-gen-action').value;
+ if (actionSelected === 'top') {
+ const triggerId = Triggers.insert(trigger);
+ const actionId = Actions.insert({
+ actionType: 'moveCardToTop',
+ listTitle: '*',
+ boardId,
+ desc,
+ });
+ Rules.insert({
+ title: ruleName,
+ triggerId,
+ actionId,
+ boardId,
+ });
+ }
+ if (actionSelected === 'bottom') {
+ const triggerId = Triggers.insert(trigger);
+ const actionId = Actions.insert({
+ actionType: 'moveCardToBottom',
+ listTitle: '*',
+ boardId,
+ desc,
+ });
+ Rules.insert({
+ title: ruleName,
+ triggerId,
+ actionId,
+ boardId,
+ });
+ }
+ },
+ 'click .js-add-arch-action'(event) {
+ const desc = Utils.getTriggerActionDesc(event, this);
+ const boardId = Session.get('currentBoard');
+ const ruleName = this.data().ruleName.get();
+ const trigger = this.data().triggerVar.get();
+ const actionSelected = this.find('#arch-action').value;
+ if (actionSelected === 'archive') {
+ const triggerId = Triggers.insert(trigger);
+ const actionId = Actions.insert({
+ actionType: 'archive',
+ boardId,
+ desc,
+ });
+ Rules.insert({
+ title: ruleName,
+ triggerId,
+ actionId,
+ boardId,
+ });
+ }
+ if (actionSelected === 'unarchive') {
+ const triggerId = Triggers.insert(trigger);
+ const actionId = Actions.insert({
+ actionType: 'unarchive',
+ boardId,
+ desc,
+ });
+ Rules.insert({
+ title: ruleName,
+ triggerId,
+ actionId,
+ boardId,
+ });
+ }
+ },
},
- 'click .js-add-gen-move-action' (event) {
- const desc = Utils.getTriggerActionDesc(event, this);
- const boardId = Session.get('currentBoard');
- const ruleName = this.data().ruleName.get();
- const trigger = this.data().triggerVar.get();
- const actionSelected = this.find('#move-gen-action').value;
- if (actionSelected === 'top') {
- const triggerId = Triggers.insert(trigger);
- const actionId = Actions.insert({
- actionType: 'moveCardToTop',
- 'listTitle': '*',
- boardId,
- desc,
- });
- Rules.insert({
- title: ruleName,
- triggerId,
- actionId,
- boardId,
- });
- }
- if (actionSelected === 'bottom') {
- const triggerId = Triggers.insert(trigger);
- const actionId = Actions.insert({
- actionType: 'moveCardToBottom',
- 'listTitle': '*',
- boardId,
- desc,
- });
- Rules.insert({
- title: ruleName,
- triggerId,
- actionId,
- boardId,
- });
- }
- },
- 'click .js-add-arch-action' (event) {
- const desc = Utils.getTriggerActionDesc(event, this);
- const boardId = Session.get('currentBoard');
- const ruleName = this.data().ruleName.get();
- const trigger = this.data().triggerVar.get();
- const actionSelected = this.find('#arch-action').value;
- if (actionSelected === 'archive') {
- const triggerId = Triggers.insert(trigger);
- const actionId = Actions.insert({
- actionType: 'archive',
- boardId,
- desc,
- });
- Rules.insert({
- title: ruleName,
- triggerId,
- actionId,
- boardId,
- });
- }
- if (actionSelected === 'unarchive') {
- const triggerId = Triggers.insert(trigger);
- const actionId = Actions.insert({
- actionType: 'unarchive',
- boardId,
- desc,
- });
- Rules.insert({
- title: ruleName,
- triggerId,
- actionId,
- boardId,
- });
- }
- },
- }];
+ ];
},
-
}).register('boardActions');
/* eslint-no-undef */