summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/components/rules/actions/boardActions.jade30
-rw-r--r--client/components/rules/actions/boardActions.js53
-rw-r--r--client/components/rules/actions/cardActions.jade43
-rw-r--r--client/components/rules/actions/cardActions.js66
-rw-r--r--client/components/rules/actions/checklistActions.jade51
-rw-r--r--client/components/rules/actions/checklistActions.js61
-rw-r--r--client/components/rules/actions/mailActions.jade11
-rw-r--r--client/components/rules/actions/mailActions.js21
-rw-r--r--client/components/rules/rules.styl16
-rw-r--r--client/components/rules/rulesActions.jade18
-rw-r--r--client/components/rules/rulesActions.js69
-rw-r--r--client/components/rules/rulesMain.jade4
-rw-r--r--client/components/rules/rulesMain.js2
-rw-r--r--client/components/rules/triggers/boardTriggers.js32
-rw-r--r--client/components/rules/triggers/cardTriggers.js40
-rw-r--r--client/components/rules/triggers/checklistTriggers.js52
16 files changed, 421 insertions, 148 deletions
diff --git a/client/components/rules/actions/boardActions.jade b/client/components/rules/actions/boardActions.jade
index fe56c3ee..81b2023d 100644
--- a/client/components/rules/actions/boardActions.jade
+++ b/client/components/rules/actions/boardActions.jade
@@ -4,16 +4,40 @@ template(name="boardActions")
div.trigger-text
| Move card to
div.trigger-dropdown
- select(id="action")
+ select(id="move-gen-action")
+ option(value="top") Top of
+ option(value="bottom") Bottom of
+ div.trigger-text
+ | its list
+ div.trigger-button.js-add-gen-move-action.js-goto-rules
+ i.fa.fa-plus
+
+ div.trigger-item
+ div.trigger-content
+ div.trigger-text
+ | Move card to
+ div.trigger-dropdown
+ select(id="move-spec-action")
option(value="top") Top of
option(value="bottom") Bottom of
div.trigger-text
| list
div.trigger-dropdown
- input(type=text,placeholder="List Name")
- div.trigger-button.js-add-move-action.js-goto-rules
+ input(id="listName",type=text,placeholder="List Name")
+ div.trigger-button.js-add-spec-move-action.js-goto-rules
i.fa.fa-plus
+ div.trigger-item
+ div.trigger-content
+ div.trigger-dropdown
+ select(id="arch-action")
+ option(value="archive") Archive
+ option(value="unarchive") Unarchive
+ div.trigger-text
+ | card
+ div.trigger-button.js-add-arch-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 53325ca0..94c2778d 100644
--- a/client/components/rules/actions/boardActions.js
+++ b/client/components/rules/actions/boardActions.js
@@ -7,23 +7,50 @@ BlazeComponent.extendComponent({
events() {
return [
- {'click .js-add-move-action'(event) {
-
- console.log(this.data());
- console.log(this.data().triggerIdVar.get());
+ {'click .js-add-spec-move-action'(event) {
const ruleName = this.data().ruleName.get();
- const triggerId = this.data().triggerIdVar.get();
- const actionSelected = this.find('#action').value;
-
+ const trigger = this.data().triggerVar.get();
+ const actionSelected = this.find('#move-spec-action').value;
+ const listTitle = this.find('#listName').value;
+ if(actionSelected == "top"){
+ const triggerId = Triggers.insert(trigger);
+ const actionId = Actions.insert({actionType: "moveCardToTop","listTitle":listTitle});
+ Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId});
+ }
+ if(actionSelected == "bottom"){
+ const triggerId = Triggers.insert(trigger);
+ const actionId = Actions.insert({actionType: "moveCardToBottom","listTitle":listTitle});
+ Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId});
+ }
+ },
+ 'click .js-add-gen-move-action'(event) {
+ const ruleName = this.data().ruleName.get();
+ const trigger = this.data().triggerVar.get();
+ const actionSelected = this.find('#move-gen-action').value;
if(actionSelected == "top"){
- Actions.insert({actionType: "moveCardToTop"},function(err,id){
- Rules.insert({title: ruleName, triggerId: triggerId, actionId: id});
- });
+ const triggerId = Triggers.insert(trigger);
+ const actionId = Actions.insert({actionType: "moveCardToTop","listTitle":"*"});
+ Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId});
}
if(actionSelected == "bottom"){
- Actions.insert({actionType: "moveCardToBottom"},function(err,id){
- Rules.insert({title: ruleName, triggerId: triggerId, actionId: id});
- });
+ const triggerId = Triggers.insert(trigger);
+ const actionId = Actions.insert({actionType: "moveCardToBottom","listTitle":"*"});
+ Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId});
+ }
+ },
+ 'click .js-add-arch-action'(event) {
+ 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"});
+ Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId});
+ }
+ if(actionSelected == "unarchive"){
+ const triggerId = Triggers.insert(trigger);
+ const actionId = Actions.insert({actionType: "unarchive"});
+ Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId});
}
},
}];
diff --git a/client/components/rules/actions/cardActions.jade b/client/components/rules/actions/cardActions.jade
new file mode 100644
index 00000000..8d218a49
--- /dev/null
+++ b/client/components/rules/actions/cardActions.jade
@@ -0,0 +1,43 @@
+template(name="cardActions")
+ div.trigger-item
+ div.trigger-content
+ div.trigger-dropdown
+ select(id="label-action")
+ option(value="add") Add
+ option(value="remove") Remove
+ div.trigger-text
+ | label
+ div.trigger-dropdown
+ select(id="label-id")
+ each labels
+ option(value="#{_id}")
+ = name
+ div.trigger-button.js-add-label-action.js-goto-rules
+ i.fa.fa-plus
+
+ div.trigger-item
+ div.trigger-content
+ div.trigger-dropdown
+ select(id="member-action")
+ option(value="add") Add
+ option(value="remove") Removed
+ div.trigger-text
+ | member
+ div.trigger-dropdown
+ input(id="member-name",type=text,placeholder="Member name")
+ div.trigger-button.js-add-member-action.js-goto-rules
+ i.fa.fa-plus
+
+ div.trigger-item
+ div.trigger-content
+ div.trigger-text
+ | Remove all member from the card
+ div.trigger-button.js-add-removeall-action.js-goto-rules
+ i.fa.fa-plus
+
+
+
+
+
+
+
diff --git a/client/components/rules/actions/cardActions.js b/client/components/rules/actions/cardActions.js
new file mode 100644
index 00000000..48120d91
--- /dev/null
+++ b/client/components/rules/actions/cardActions.js
@@ -0,0 +1,66 @@
+BlazeComponent.extendComponent({
+ onCreated() {
+ this.subscribe('allRules');
+ },
+
+ labels(){
+ const labels = Boards.findOne(Session.get('currentBoard')).labels;
+ console.log(labels);
+ for(let i = 0;i<labels.length;i++){
+ if(labels[i].name == "" || labels[i].name == undefined){
+ labels[i].name = labels[i].color.toUpperCase();
+ }
+ }
+ console.log(labels);
+ return labels;
+ },
+
+
+
+ events() {
+ return [
+ {'click .js-add-label-action'(event) {
+ const ruleName = this.data().ruleName.get();
+ const trigger = this.data().triggerVar.get();
+ const actionSelected = this.find('#label-action').value;
+ const labelId = this.find('#label-id').value;
+
+ if(actionSelected == "add"){
+ const triggerId = Triggers.insert(trigger);
+ const actionId = Actions.insert({actionType: "addLabel","labelId":labelId});
+ Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId});
+ }
+ if(actionSelected == "remove"){
+ const triggerId = Triggers.insert(trigger);
+ const actionId = Actions.insert({actionType: "removeLabel","labelId":labelId});
+ Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId});
+ }
+
+ },
+ 'click .js-add-member-action'(event) {
+ const ruleName = this.data().ruleName.get();
+ const trigger = this.data().triggerVar.get();
+ const actionSelected = this.find('#member-action').value;
+ const memberName = this.find('#member-name').value;
+ if(actionSelected == "add"){
+ const triggerId = Triggers.insert(trigger);
+ const actionId = Actions.insert({actionType: "addMember","memberName":memberName});
+ Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId});
+ }
+ if(actionSelected == "remove"){
+ const triggerId = Triggers.insert(trigger);
+ const actionId = Actions.insert({actionType: "removeMember","memberName":memberName});
+ Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId});
+ }
+ },
+ 'click .js-add-removeall-action'(event) {
+ const ruleName = this.data().ruleName.get();
+ const trigger = this.data().triggerVar.get();
+ const triggerId = Triggers.insert(trigger);
+ const actionId = Actions.insert({actionType: "removeMember","memberName":"*"});
+ Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId});
+ },
+ }];
+},
+
+}).register('cardActions'); \ No newline at end of file
diff --git a/client/components/rules/actions/checklistActions.jade b/client/components/rules/actions/checklistActions.jade
new file mode 100644
index 00000000..c85ec078
--- /dev/null
+++ b/client/components/rules/actions/checklistActions.jade
@@ -0,0 +1,51 @@
+template(name="checklistActions")
+ div.trigger-item
+ div.trigger-content
+ div.trigger-dropdown
+ select(id="check-action")
+ option(value="add") Add
+ option(value="remove") Remove
+ div.trigger-text
+ | checklist
+ div.trigger-dropdown
+ input(id="checklist-name",type=text,placeholder="name")
+ div.trigger-button.js-add-checklist-action.js-goto-rules
+ i.fa.fa-plus
+
+ div.trigger-item
+ div.trigger-content
+ div.trigger-dropdown
+ select(id="checkall-action")
+ option(value="check") Check all
+ option(value="uncheck") Unchek all
+ div.trigger-text
+ | items of checklist
+ div.trigger-dropdown
+ input(id="checklist-name2",type=text,placeholder="name")
+ div.trigger-button.js-add-checkall-action.js-goto-rules
+ i.fa.fa-plus
+
+
+ div.trigger-item
+ div.trigger-content
+ div.trigger-dropdown
+ select(id="check-item-action")
+ option(value="check") Check
+ option(value="uncheck") Unchek
+ div.trigger-text
+ | item
+ div.trigger-dropdown
+ input(id="checkitem-name",type=text,placeholder="name")
+ div.trigger-text
+ | of checklist
+ div.trigger-dropdown
+ input(id="checklist-name3",type=text,placeholder="name")
+ div.trigger-button.js-add-check-item-action.js-goto-rules
+ i.fa.fa-plus
+
+
+
+
+
+
+
diff --git a/client/components/rules/actions/checklistActions.js b/client/components/rules/actions/checklistActions.js
new file mode 100644
index 00000000..2a70ca7f
--- /dev/null
+++ b/client/components/rules/actions/checklistActions.js
@@ -0,0 +1,61 @@
+BlazeComponent.extendComponent({
+ onCreated() {
+ this.subscribe('allRules');
+ },
+ events() {
+ return [
+ {'click .js-add-checklist-action'(event) {
+ const ruleName = this.data().ruleName.get();
+ const trigger = this.data().triggerVar.get();
+ const actionSelected = this.find('#check-action').value;
+ const checklistName = this.find('#checklist-name').value;
+
+ if(actionSelected == "add"){
+ const triggerId = Triggers.insert(trigger);
+ const actionId = Actions.insert({actionType: "addChecklist","checklistName":checklistName});
+ Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId});
+ }
+ if(actionSelected == "remove"){
+ const triggerId = Triggers.insert(trigger);
+ const actionId = Actions.insert({actionType: "removeChecklist","checklistName":checklistName});
+ Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId});
+ }
+
+ },
+ 'click .js-add-checkall-action'(event) {
+ const ruleName = this.data().ruleName.get();
+ const trigger = this.data().triggerVar.get();
+ const actionSelected = this.find('#checkall-action').value;
+ const checklistName = this.find('#checklist-name2').value;
+ if(actionSelected == "check"){
+ const triggerId = Triggers.insert(trigger);
+ const actionId = Actions.insert({actionType: "checkAll","checklistName":checklistName});
+ Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId});
+ }
+ if(actionSelected == "uncheck"){
+ const triggerId = Triggers.insert(trigger);
+ const actionId = Actions.insert({actionType: "uncheckAll","checklistName":checklistName});
+ Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId});
+ }
+ },
+ 'click .js-add-check-item-action'(event) {
+ const ruleName = this.data().ruleName.get();
+ const trigger = this.data().triggerVar.get();
+ const checkItemName = this.find("#checkitem-name");
+ const checklistName = this.find("#checklist-name3");
+ const actionSelected = this.find('#check-item-action').value;
+ if(actionSelected == "check"){
+ const triggerId = Triggers.insert(trigger);
+ const actionId = Actions.insert({actionType: "checkItem","checklistName":checklistName,"checkItemName":checkItemName});
+ Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId});
+ }
+ if(actionSelected == "uncheck"){
+ const triggerId = Triggers.insert(trigger);
+ const actionId = Actions.insert({actionType: "uncheckItem","checklistName":checklistName,"checkItemName":checkItemName});
+ Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId});
+ }
+},
+}];
+},
+
+}).register('checklistActions'); \ No newline at end of file
diff --git a/client/components/rules/actions/mailActions.jade b/client/components/rules/actions/mailActions.jade
new file mode 100644
index 00000000..5680d430
--- /dev/null
+++ b/client/components/rules/actions/mailActions.jade
@@ -0,0 +1,11 @@
+template(name="mailActions")
+ div.trigger-item.trigger-item-mail
+ div.trigger-content.trigger-content-mail
+ div.trigger-text.trigger-text-email
+ | Send an email
+ div.trigger-dropdown-mail
+ input(id="email-to",type=text,placeholder="to")
+ input(id="email-subject",type=text,placeholder="subject")
+ textarea(id="email-msg")
+ div.trigger-button.trigger-button-email.js-mail-action.js-goto-rules
+ i.fa.fa-plus \ No newline at end of file
diff --git a/client/components/rules/actions/mailActions.js b/client/components/rules/actions/mailActions.js
new file mode 100644
index 00000000..0e4b539e
--- /dev/null
+++ b/client/components/rules/actions/mailActions.js
@@ -0,0 +1,21 @@
+BlazeComponent.extendComponent({
+ onCreated() {
+
+ },
+
+ events() {
+ return [
+ {'click .js-mail-action'(event) {
+ const emailTo = this.find('#email-to').value;
+ const emailSubject = this.find('#email-subject').value;
+ const emailMsg = this.find('#email-msg').value;
+ const trigger = this.data().triggerVar.get();
+ const ruleName = this.data().ruleName.get();
+ const triggerId = Triggers.insert(trigger);
+ const actionId = Actions.insert({actionType: "sendEmail","emailTo":emailTo,"emailSubject":emailSubject,"emailMsg":emailMsg});
+ Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId});
+ },
+ }];
+},
+
+}).register('mailActions'); \ No newline at end of file
diff --git a/client/components/rules/rules.styl b/client/components/rules/rules.styl
index c9684709..68d74d32 100644
--- a/client/components/rules/rules.styl
+++ b/client/components/rules/rules.styl
@@ -40,6 +40,8 @@
display: -ms-flexbox
display: flex
+
+
.triggers-content
color: #727479
background: #dedede
@@ -107,6 +109,10 @@
.trigger-text
font-size: 16px
display:inline-block
+ .trigger-text.trigger-text-email
+ margin-left: 5px;
+ margin-top: 10px;
+ margin-bottom: 10px;
.trigger-dropdown
display:inline-block
select
@@ -118,6 +124,9 @@
display: inline-block
width: 80px;
margin: 0;
+ .trigger-content-mail
+ left:20px
+ right:100px
.trigger-button
position:absolute
top:50%
@@ -138,3 +147,10 @@
transform: translate(-50%,-50%)
&:hover, &.is-active
box-shadow: 0 0 0 2px darken(white, 60%) inset
+ .trigger-button.trigger-button-email
+ top:30px
+ .trigger-item.trigger-item-mail
+ height:300px
+
+
+
diff --git a/client/components/rules/rulesActions.jade b/client/components/rules/rulesActions.jade
index 35b070fc..9fcecf46 100644
--- a/client/components/rules/rulesActions.jade
+++ b/client/components/rules/rulesActions.jade
@@ -6,12 +6,20 @@ template(name="rulesActions")
.triggers-body
.triggers-side-menu
ul
- li.active.js-set-board-triggers
+ li.active.js-set-board-actions
i.fa.fa-columns
- li.js-set-card-triggers
+ li.js-set-card-actions
i.fa.fa-sticky-note
- li.js-set-checklist-triggers
+ li.js-set-checklist-actions
i.fa.fa-check
+ li.js-set-mail-actions
+ i.fa.fa-at
.triggers-main-body
- if showBoardActions.get
- +boardActions(ruleName=data.ruleName triggerIdVar=data.triggerIdVar) \ No newline at end of file
+ if ($eq currentActions.get 'board')
+ +boardActions(ruleName=data.ruleName triggerVar=data.triggerVar)
+ else if ($eq currentActions.get 'card')
+ +cardActions(ruleName=data.ruleName triggerVar=data.triggerVar)
+ else if ($eq currentActions.get 'checklist')
+ +checklistActions(ruleName=data.ruleName triggerVar=data.triggerVar)
+ else if ($eq currentActions.get 'mail')
+ +mailActions(ruleName=data.ruleName triggerVar=data.triggerVar) \ No newline at end of file
diff --git a/client/components/rules/rulesActions.js b/client/components/rules/rulesActions.js
index 297fc806..bf8d222d 100644
--- a/client/components/rules/rulesActions.js
+++ b/client/components/rules/rulesActions.js
@@ -1,34 +1,36 @@
BlazeComponent.extendComponent({
onCreated() {
- this.showBoardActions = new ReactiveVar(true);
- this.showCardActions = new ReactiveVar(false);
- this.showChecklistAction = new ReactiveVar(false);
+ this.currentActions = new ReactiveVar("board");
},
- setBoardTriggers(){
- this.showBoardActions.set(true);
- this.showCardActions.set(false);
- this.showChecklistActionsr.set(false);
- $('.js-set-card-triggers').removeClass('active');
- $('.js-set-board-triggers').addClass('active');
- $('.js-set-checklist-triggers').removeClass('active');
- },
- setCardTriggers(){
- this.showBoardActions.set(false);
- this.showCardActions.set(true);
- this.showChecklistActions.set(false);
- $('.js-set-card-triggers').addClass('active');
- $('.js-set-board-triggers').removeClass('active');
- $('.js-set-checklist-triggers').removeClass('active');
- },
- setChecklistTriggers(){
- this.showBoardActions.set(false);
- this.showCardActions.set(false);
- this.showChecklistActions.set(true);
- $('.js-set-card-triggers').removeClass('active');
- $('.js-set-board-triggers').removeClass('active');
- $('.js-set-checklist-triggers').addClass('active');
+ setBoardActions(){
+ this.currentActions.set("board");
+ $('.js-set-card-actions').removeClass('active');
+ $('.js-set-board-actions').addClass('active');
+ $('.js-set-checklist-actions').removeClass('active');
+ $('.js-set-mail-actions').removeClass('active');
+ },
+ setCardActions(){
+ this.currentActions.set("card");
+ $('.js-set-card-actions').addClass('active');
+ $('.js-set-board-actions').removeClass('active');
+ $('.js-set-checklist-actions').removeClass('active');
+ $('.js-set-mail-actions').removeClass('active');
+ },
+ setChecklistActions(){
+ this.currentActions.set("checklist");
+ $('.js-set-card-actions').removeClass('active');
+ $('.js-set-board-actions').removeClass('active');
+ $('.js-set-checklist-actions').addClass('active');
+ $('.js-set-mail-actions').removeClass('active');
+ },
+ setMailActions(){
+ this.currentActions.set("mail");
+ $('.js-set-card-actions').removeClass('active');
+ $('.js-set-board-actions').removeClass('active');
+ $('.js-set-checklist-actions').removeClass('active');
+ $('.js-set-mail-actions').addClass('active');
},
rules() {
@@ -39,14 +41,17 @@ BlazeComponent.extendComponent({
console.log(this.data());
},
events() {
- return [{'click .js-set-board-triggers'(event) {
- this.setBoardTriggers();
+ return [{'click .js-set-board-actions'(event) {
+ this.setBoardActions();
+ },
+ 'click .js-set-card-actions'(event) {
+ this.setCardActions();
},
- 'click .js-set-card-triggers'(event) {
- this.setCardTriggers();
+ 'click .js-set-mail-actions'(event) {
+ this.setMailActions();
},
- 'click .js-set-checklist-triggers'(event) {
- this.setChecklistTriggers();
+ 'click .js-set-checklist-actions'(event) {
+ this.setChecklistActions();
},}];
},
}).register('rulesActions'); \ No newline at end of file
diff --git a/client/components/rules/rulesMain.jade b/client/components/rules/rulesMain.jade
index 8e0efd63..2c308223 100644
--- a/client/components/rules/rulesMain.jade
+++ b/client/components/rules/rulesMain.jade
@@ -2,6 +2,6 @@ template(name="rulesMain")
if rulesListVar.get
+rulesList
else if rulesTriggerVar.get
- +rulesTriggers(ruleName=ruleName triggerIdVar=triggerIdVar)
+ +rulesTriggers(ruleName=ruleName triggerVar=triggerVar)
else if rulesActionVar.get
- +rulesActions(ruleName=ruleName triggerIdVar=triggerIdVar) \ No newline at end of file
+ +rulesActions(ruleName=ruleName triggerVar=triggerVar) \ No newline at end of file
diff --git a/client/components/rules/rulesMain.js b/client/components/rules/rulesMain.js
index 5a4b612a..ee4886b6 100644
--- a/client/components/rules/rulesMain.js
+++ b/client/components/rules/rulesMain.js
@@ -4,7 +4,7 @@ BlazeComponent.extendComponent({
this.rulesTriggerVar = new ReactiveVar(false);
this.rulesActionVar = new ReactiveVar(false);
this.ruleName = new ReactiveVar("");
- this.triggerIdVar = new ReactiveVar("");
+ this.triggerVar = new ReactiveVar();
},
setTrigger() {
diff --git a/client/components/rules/triggers/boardTriggers.js b/client/components/rules/triggers/boardTriggers.js
index 49c00c16..dcc1c187 100644
--- a/client/components/rules/triggers/boardTriggers.js
+++ b/client/components/rules/triggers/boardTriggers.js
@@ -11,14 +11,10 @@ BlazeComponent.extendComponent({
const actionSelected = this.find('#gen-action').value;
const boardId = Session.get('currentBoard')
if(actionSelected == "created"){
- Triggers.insert({activityType: "createCard","boardId":boardId,"listName":"*"},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "createCard","boardId":boardId,"listName":"*"});
}
if(actionSelected == "removed"){
- Triggers.insert({activityType: "removeCard","boardId":boardId},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "removeCard","boardId":boardId});
}
},
'click .js-add-create-trigger'(event) {
@@ -28,14 +24,10 @@ BlazeComponent.extendComponent({
const listName = this.find('#create-list-name').value;
const boardId = Session.get('currentBoard')
if(actionSelected == "created"){
- Triggers.insert({activityType: "createCard","boardId":boardId,"listName":listName},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "createCard","boardId":boardId,"listName":listName});
}
if(actionSelected == "removed"){
- Triggers.insert({activityType: "removeCard","boardId":boardId,"listName":listName},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "removeCard","boardId":boardId,"listName":listName});
}
},
'click .js-add-moved-trigger'(event) {
@@ -44,14 +36,10 @@ BlazeComponent.extendComponent({
const listName = this.find('#move-list-name').value;
const boardId = Session.get('currentBoard')
if(actionSelected == "moved-to"){
- Triggers.insert({activityType: "moveCard","boardId":boardId,"listName":listName,"oldListName":"*"},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "moveCard","boardId":boardId,"listName":listName,"oldListName":"*"});
}
if(actionSelected == "moved-from"){
- Triggers.insert({activityType: "moveCard","boardId":boardId,"listName":"*","oldListName":listName},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "moveCard","boardId":boardId,"listName":"*","oldListName":listName});
}
},
'click .js-add-arc-trigger'(event) {
@@ -59,14 +47,10 @@ BlazeComponent.extendComponent({
const actionSelected = this.find('#arch-action').value;
const boardId = Session.get('currentBoard')
if(actionSelected == "archived"){
- Triggers.insert({activityType: "archivedCard","boardId":boardId},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "archivedCard","boardId":boardId});
}
if(actionSelected == "unarchived"){
- Triggers.insert({activityType: "restoredCard","boardId":boardId},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "restoredCard","boardId":boardId});
}
}
diff --git a/client/components/rules/triggers/cardTriggers.js b/client/components/rules/triggers/cardTriggers.js
index a9940e07..e860d806 100644
--- a/client/components/rules/triggers/cardTriggers.js
+++ b/client/components/rules/triggers/cardTriggers.js
@@ -22,14 +22,10 @@ BlazeComponent.extendComponent({
const actionSelected = this.find('#label-action').value;
const boardId = Session.get('currentBoard')
if(actionSelected == "added"){
- Triggers.insert({activityType: "addedLabel","boardId":boardId,"labelId":"*"},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "addedLabel","boardId":boardId,"labelId":"*"});
}
if(actionSelected == "removed"){
- Triggers.insert({activityType: "removedLabel","boardId":boardId,"labelId":"*"},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "removedLabel","boardId":boardId,"labelId":"*"});
}
},
'click .js-add-spec-label-trigger'(event) {
@@ -38,14 +34,10 @@ BlazeComponent.extendComponent({
const labelId = this.find('#spec-label').value;
const boardId = Session.get('currentBoard')
if(actionSelected == "added"){
- Triggers.insert({activityType: "addedLabel","boardId":boardId,"labelId":labelId},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "addedLabel","boardId":boardId,"labelId":labelId});
}
if(actionSelected == "removed"){
- Triggers.insert({activityType: "removedLabel","boardId":boardId,"labelId":labelId},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "removedLabel","boardId":boardId,"labelId":labelId});
}
},
'click .js-add-gen-member-trigger'(event) {
@@ -54,14 +46,10 @@ BlazeComponent.extendComponent({
const actionSelected = this.find('#gen-member-action').value;
const boardId = Session.get('currentBoard')
if(actionSelected == "added"){
- Triggers.insert({activityType: "joinMember","boardId":boardId,"memberId":"*"},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "joinMember","boardId":boardId,"memberId":"*"});
}
if(actionSelected == "removed"){
- Triggers.insert({activityType: "unjoinMember","boardId":boardId,"memberId":"*"},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "unjoinMember","boardId":boardId,"memberId":"*"});
}
},
'click .js-add-spec-member-trigger'(event) {
@@ -70,14 +58,10 @@ BlazeComponent.extendComponent({
const memberId = this.find('#spec-member').value;
const boardId = Session.get('currentBoard')
if(actionSelected == "added"){
- Triggers.insert({activityType: "joinMember","boardId":boardId,"memberId":memberId},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "joinMember","boardId":boardId,"memberId":memberId});
}
if(actionSelected == "removed"){
- Triggers.insert({activityType: "unjoinMember","boardId":boardId,"memberId":memberId},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "unjoinMember","boardId":boardId,"memberId":memberId});
}
},
'click .js-add-attachment-trigger'(event) {
@@ -86,14 +70,10 @@ BlazeComponent.extendComponent({
const actionSelected = this.find('#attach-action').value;
const boardId = Session.get('currentBoard')
if(actionSelected == "added"){
- Triggers.insert({activityType: "addAttachment","boardId":boardId},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "addAttachment","boardId":boardId});
}
if(actionSelected == "removed"){
- Triggers.insert({activityType: "deleteAttachment","boardId":boardId},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "deleteAttachment","boardId":boardId});
}
},
}];
diff --git a/client/components/rules/triggers/checklistTriggers.js b/client/components/rules/triggers/checklistTriggers.js
index 9880e3bb..b790aff4 100644
--- a/client/components/rules/triggers/checklistTriggers.js
+++ b/client/components/rules/triggers/checklistTriggers.js
@@ -10,14 +10,10 @@ BlazeComponent.extendComponent({
const actionSelected = this.find('#gen-check-action').value;
const boardId = Session.get('currentBoard')
if(actionSelected == "created"){
- Triggers.insert({activityType: "addChecklist","boardId":boardId,"checklistName":"*"},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "addChecklist","boardId":boardId,"checklistName":"*"});
}
if(actionSelected == "removed"){
- Triggers.insert({activityType: "removeChecklist","boardId":boardId,"checklistName":"*"},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "removeChecklist","boardId":boardId,"checklistName":"*"});
}
},
'click .js-add-spec-check-trigger'(event) {
@@ -26,14 +22,10 @@ BlazeComponent.extendComponent({
const checklistId = this.find('#check-name').value;
const boardId = Session.get('currentBoard')
if(actionSelected == "created"){
- Triggers.insert({activityType: "addChecklist","boardId":boardId,"checklistName":checklistId},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "addChecklist","boardId":boardId,"checklistName":checklistId});
}
if(actionSelected == "removed"){
- Triggers.insert({activityType: "removeChecklist","boardId":boardId,"checklistName":checklistId},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "removeChecklist","boardId":boardId,"checklistName":checklistId});
}
},
'click .js-add-gen-comp-trigger'(event) {
@@ -42,14 +34,10 @@ BlazeComponent.extendComponent({
const actionSelected = this.find('#gen-comp-check-action').value;
const boardId = Session.get('currentBoard')
if(actionSelected == "completed"){
- Triggers.insert({activityType: "completeChecklist","boardId":boardId,"checklistName":"*"},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "completeChecklist","boardId":boardId,"checklistName":"*"});
}
if(actionSelected == "uncompleted"){
- Triggers.insert({activityType: "uncompleteChecklist","boardId":boardId,"checklistName":"*"},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "uncompleteChecklist","boardId":boardId,"checklistName":"*"});
}
},
'click .js-add-spec-comp-trigger'(event) {
@@ -58,14 +46,10 @@ BlazeComponent.extendComponent({
const checklistId = this.find('#spec-comp-check-name').value;
const boardId = Session.get('currentBoard')
if(actionSelected == "added"){
- Triggers.insert({activityType: "joinMember","boardId":boardId,"checklistName":checklistId},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "completeChecklist","boardId":boardId,"checklistName":checklistId});
}
if(actionSelected == "removed"){
- Triggers.insert({activityType: "unjoinMember","boardId":boardId,"checklistName":checklistId},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "uncompleteChecklist","boardId":boardId,"checklistName":checklistId});
}
},
'click .js-add-gen-check-item-trigger'(event) {
@@ -74,14 +58,10 @@ BlazeComponent.extendComponent({
const actionSelected = this.find('#check-item-gen-action').value;
const boardId = Session.get('currentBoard')
if(actionSelected == "checked"){
- Triggers.insert({activityType: "checkedItem","boardId":boardId,"checklistItemName":"*"},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "checkedItem","boardId":boardId,"checklistItemName":"*"});
}
if(actionSelected == "unchecked"){
- Triggers.insert({activityType: "uncheckedItem","boardId":boardId,"checklistItemName":"*"},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ datas.triggerVar.set({activityType: "uncheckedItem","boardId":boardId,"checklistItemName":"*"});
}
},
'click .js-add-spec-check-item-trigger'(event) {
@@ -89,15 +69,11 @@ BlazeComponent.extendComponent({
const actionSelected = this.find('#check-item-spec-action').value;
const checklistItemId = this.find('#check-item-name').value;
const boardId = Session.get('currentBoard')
- if(actionSelected == "added"){
- Triggers.insert({activityType: "joinMember","boardId":boardId,"checklistItemName":checklistItemId},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ if(actionSelected == "checked"){
+ datas.triggerVar.set({activityType: "checkedItem","boardId":boardId,"checklistItemName":checklistItemId});
}
- if(actionSelected == "removed"){
- Triggers.insert({activityType: "unjoinMember","boardId":boardId,"checklistItemName":checklistItemId},function(error,id){
- datas.triggerIdVar.set(id);
- });
+ if(actionSelected == "unchecked"){
+ datas.triggerVar.set({activityType: "uncheckedItem","boardId":boardId,"checklistItemName":checklistItemId});
}
},
}];