summaryrefslogtreecommitdiffstats
path: root/client/components/rules/triggers/boardTriggers.js
diff options
context:
space:
mode:
authorAngelo Gallarello <angelo.gallarell@gmail.com>2018-09-14 17:39:37 +0200
committerAngelo Gallarello <angelo.gallarell@gmail.com>2018-09-14 17:39:37 +0200
commit25da8376ca2ee3b7bedadf924557d4d7bb6c6771 (patch)
treea96f00a3a050ea90385e6cd56cf15516cf4e437e /client/components/rules/triggers/boardTriggers.js
parent30a3daa6af179009ac17b40a71bf3f9e9b1d698a (diff)
downloadwekan-25da8376ca2ee3b7bedadf924557d4d7bb6c6771.tar.gz
wekan-25da8376ca2ee3b7bedadf924557d4d7bb6c6771.tar.bz2
wekan-25da8376ca2ee3b7bedadf924557d4d7bb6c6771.zip
Beautyfied
Diffstat (limited to 'client/components/rules/triggers/boardTriggers.js')
-rw-r--r--client/components/rules/triggers/boardTriggers.js140
1 files changed, 89 insertions, 51 deletions
diff --git a/client/components/rules/triggers/boardTriggers.js b/client/components/rules/triggers/boardTriggers.js
index 067c1df8..95c10a5b 100644
--- a/client/components/rules/triggers/boardTriggers.js
+++ b/client/components/rules/triggers/boardTriggers.js
@@ -4,60 +4,98 @@ BlazeComponent.extendComponent({
},
events() {
- return [
- {'click .js-add-gen-trigger'(event) {
- const desc = Utils.getTriggerActionDesc(event,this);
- let datas = this.data();
- const actionSelected = this.find('#gen-action').value;
- const boardId = Session.get('currentBoard')
- if(actionSelected == "created"){
- datas.triggerVar.set({activityType: "createCard","boardId":boardId,"listName":"*","desc":desc});
- }
- if(actionSelected == "removed"){
- datas.triggerVar.set({activityType: "removeCard","boardId":boardId,"desc":desc});
- }
-
+ return [{
+ 'click .js-add-gen-trigger' (event) {
+ const desc = Utils.getTriggerActionDesc(event, this);
+ let datas = this.data();
+ const actionSelected = this.find('#gen-action').value;
+ const boardId = Session.get('currentBoard')
+ if (actionSelected == "created") {
+ datas.triggerVar.set({
+ activityType: "createCard",
+ "boardId": boardId,
+ "listName": "*",
+ "desc": desc
+ });
+ }
+ if (actionSelected == "removed") {
+ datas.triggerVar.set({
+ activityType: "removeCard",
+ "boardId": boardId,
+ "desc": desc
+ });
+ }
- },
- 'click .js-add-create-trigger'(event) {
- const desc = Utils.getTriggerActionDesc(event,this);
- let datas = this.data();
- const actionSelected = this.find('#create-action').value;
- const listName = this.find('#create-list-name').value;
- const boardId = Session.get('currentBoard')
- if(actionSelected == "created"){
- datas.triggerVar.set({activityType: "createCard","boardId":boardId,"listName":listName,"desc":desc});
- }
- if(actionSelected == "removed"){
- datas.triggerVar.set({activityType: "removeCard","boardId":boardId,"listName":listName,"desc":desc});
- }
- },
- 'click .js-add-moved-trigger'(event) {
- let datas = this.data();
- const desc = Utils.getTriggerActionDesc(event,this);
+ },
+ 'click .js-add-create-trigger' (event) {
+ const desc = Utils.getTriggerActionDesc(event, this);
+ let datas = this.data();
+ const actionSelected = this.find('#create-action').value;
+ const listName = this.find('#create-list-name').value;
+ const boardId = Session.get('currentBoard')
+ if (actionSelected == "created") {
+ datas.triggerVar.set({
+ activityType: "createCard",
+ "boardId": boardId,
+ "listName": listName,
+ "desc": desc
+ });
+ }
+ if (actionSelected == "removed") {
+ datas.triggerVar.set({
+ activityType: "removeCard",
+ "boardId": boardId,
+ "listName": listName,
+ "desc": desc
+ });
+ }
+ },
+ 'click .js-add-moved-trigger' (event) {
+ let datas = this.data();
+ const desc = Utils.getTriggerActionDesc(event, this);
- const actionSelected = this.find('#move-action').value;
- const listName = this.find('#move-list-name').value;
- const boardId = Session.get('currentBoard')
- if(actionSelected == "moved-to"){
- datas.triggerVar.set({activityType: "moveCard","boardId":boardId,"listName":listName,"oldListName":"*","desc":desc});
- }
- if(actionSelected == "moved-from"){
- datas.triggerVar.set({activityType: "moveCard","boardId":boardId,"listName":"*","oldListName":listName,"desc":desc});
- }
- },
- 'click .js-add-arc-trigger'(event) {
- let datas = this.data();
- const desc = Utils.getTriggerActionDesc(event,this);
- const actionSelected = this.find('#arch-action').value;
- const boardId = Session.get('currentBoard')
- if(actionSelected == "archived"){
- datas.triggerVar.set({activityType: "archivedCard","boardId":boardId,"desc":desc});
- }
- if(actionSelected == "unarchived"){
- datas.triggerVar.set({activityType: "restoredCard","boardId":boardId,"desc":desc});
+ const actionSelected = this.find('#move-action').value;
+ const listName = this.find('#move-list-name').value;
+ const boardId = Session.get('currentBoard')
+ if (actionSelected == "moved-to") {
+ datas.triggerVar.set({
+ activityType: "moveCard",
+ "boardId": boardId,
+ "listName": listName,
+ "oldListName": "*",
+ "desc": desc
+ });
+ }
+ if (actionSelected == "moved-from") {
+ datas.triggerVar.set({
+ activityType: "moveCard",
+ "boardId": boardId,
+ "listName": "*",
+ "oldListName": listName,
+ "desc": desc
+ });
+ }
+ },
+ 'click .js-add-arc-trigger' (event) {
+ let datas = this.data();
+ const desc = Utils.getTriggerActionDesc(event, this);
+ const actionSelected = this.find('#arch-action').value;
+ const boardId = Session.get('currentBoard')
+ if (actionSelected == "archived") {
+ datas.triggerVar.set({
+ activityType: "archivedCard",
+ "boardId": boardId,
+ "desc": desc
+ });
+ }
+ if (actionSelected == "unarchived") {
+ datas.triggerVar.set({
+ activityType: "restoredCard",
+ "boardId": boardId,
+ "desc": desc
+ });
+ }
}
- }
}];
},