summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2018-09-16 01:50:36 +0300
committerLauri Ojansivu <x@xet7.org>2018-09-16 01:50:36 +0300
commitdf84a2be9adb2eeee25141588a80d4523d38675d (patch)
treed7defe25d43e41a76d9d11461cbc539ad01598c2 /client
parentb3a752ef34cb1cd324f7e2b55bebef81fb2281c3 (diff)
downloadwekan-df84a2be9adb2eeee25141588a80d4523d38675d.tar.gz
wekan-df84a2be9adb2eeee25141588a80d4523d38675d.tar.bz2
wekan-df84a2be9adb2eeee25141588a80d4523d38675d.zip
Fix lint errors.
Diffstat (limited to 'client')
-rw-r--r--client/components/activities/activities.js4
-rw-r--r--client/components/rules/actions/boardActions.jade24
-rw-r--r--client/components/rules/actions/boardActions.js95
-rw-r--r--client/components/rules/actions/cardActions.js85
-rw-r--r--client/components/rules/actions/checklistActions.js106
-rw-r--r--client/components/rules/actions/mailActions.jade8
-rw-r--r--client/components/rules/actions/mailActions.js20
-rw-r--r--client/components/rules/ruleDetails.js12
-rw-r--r--client/components/rules/rulesActions.js10
-rw-r--r--client/components/rules/rulesList.js4
-rw-r--r--client/components/rules/rulesMain.js21
-rw-r--r--client/components/rules/rulesTriggers.js4
-rw-r--r--client/components/rules/triggers/boardTriggers.jade34
-rw-r--r--client/components/rules/triggers/boardTriggers.js98
-rw-r--r--client/components/rules/triggers/cardTriggers.jade50
-rw-r--r--client/components/rules/triggers/cardTriggers.js122
-rw-r--r--client/components/rules/triggers/checklistTriggers.jade54
-rw-r--r--client/components/rules/triggers/checklistTriggers.js146
-rw-r--r--client/lib/utils.js19
19 files changed, 457 insertions, 459 deletions
diff --git a/client/components/activities/activities.js b/client/components/activities/activities.js
index 6633a91a..b3fe8f50 100644
--- a/client/components/activities/activities.js
+++ b/client/components/activities/activities.js
@@ -49,7 +49,7 @@ BlazeComponent.extendComponent({
this.loadNextPageLocked = true;
}
},
-
+
checkItem(){
const checkItemId = this.currentData().checklistItemId;
const checkItem = ChecklistItems.findOne({_id:checkItemId});
@@ -75,7 +75,7 @@ BlazeComponent.extendComponent({
lastLabel(){
const lastLabelId = this.currentData().labelId;
const lastLabel = Boards.findOne(Session.get('currentBoard')).getLabelById(lastLabelId);
- if(lastLabel.name == undefined || lastLabel.name == ""){
+ if(lastLabel.name === undefined || lastLabel.name === ''){
return lastLabel.color;
}else{
return lastLabel.name;
diff --git a/client/components/rules/actions/boardActions.jade b/client/components/rules/actions/boardActions.jade
index dfeb3d84..768d77cf 100644
--- a/client/components/rules/actions/boardActions.jade
+++ b/client/components/rules/actions/boardActions.jade
@@ -2,28 +2,28 @@ template(name="boardActions")
div.trigger-item
div.trigger-content
div.trigger-text
- | {{{_'r-move-card-to'}}}
+ | {{_'r-move-card-to'}}
div.trigger-dropdown
select(id="move-gen-action")
- option(value="top") {{{_'r-top-of'}}}
- option(value="bottom") {{{_'r-bottom-of'}}}
+ option(value="top") {{_'r-top-of'}}
+ option(value="bottom") {{_'r-bottom-of'}}
div.trigger-text
- | {{{_'r-its-list'}}}
+ | {{_'r-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
- | {{{_'r-move-card-to'}}}
+ | {{_'r-move-card-to'}}
div.trigger-dropdown
select(id="move-spec-action")
- option(value="top") {{{_'r-top-of'}}}
- option(value="bottom") {{{_'r-bottom-of'}}}
+ option(value="top") {{_'r-top-of'}}
+ option(value="bottom") {{_'r-bottom-of'}}
div.trigger-text
- | {{{_'r-list'}}}
+ | {{_'r-list'}}
div.trigger-dropdown
- input(id="listName",type=text,placeholder="{{{_'r-name'}}}")
+ input(id="listName",type=text,placeholder="{{_'r-name'}}")
div.trigger-button.js-add-spec-move-action.js-goto-rules
i.fa.fa-plus
@@ -31,10 +31,10 @@ template(name="boardActions")
div.trigger-content
div.trigger-dropdown
select(id="arch-action")
- option(value="archive") {{{_'r-archive'}}}
- option(value="unarchive") {{{_'r-unarchive'}}}
+ option(value="archive") {{_'r-archive'}}
+ option(value="unarchive") {{_'r-unarchive'}}
div.trigger-text
- | {{{_'r-card'}}}
+ | {{_'r-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 3eda039f..95771fce 100644
--- a/client/components/rules/actions/boardActions.js
+++ b/client/components/rules/actions/boardActions.js
@@ -12,34 +12,34 @@ BlazeComponent.extendComponent({
const listTitle = this.find('#listName').value;
const boardId = Session.get('currentBoard');
const desc = Utils.getTriggerActionDesc(event, this);
- if (actionSelected == "top") {
+ if (actionSelected === 'top') {
const triggerId = Triggers.insert(trigger);
const actionId = Actions.insert({
- actionType: "moveCardToTop",
- "listTitle": listTitle,
- "boardId": boardId,
- "desc": desc
+ actionType: 'moveCardToTop',
+ listTitle,
+ boardId,
+ desc,
});
Rules.insert({
title: ruleName,
- triggerId: triggerId,
- actionId: actionId,
- "boardId": boardId
+ triggerId,
+ actionId,
+ boardId,
});
}
- if (actionSelected == "bottom") {
+ if (actionSelected === 'bottom') {
const triggerId = Triggers.insert(trigger);
const actionId = Actions.insert({
- actionType: "moveCardToBottom",
- "listTitle": listTitle,
- "boardId": boardId,
- "desc": desc
+ actionType: 'moveCardToBottom',
+ listTitle,
+ boardId,
+ desc,
});
Rules.insert({
title: ruleName,
- triggerId: triggerId,
- actionId: actionId,
- "boardId": boardId
+ triggerId,
+ actionId,
+ boardId,
});
}
},
@@ -49,34 +49,34 @@ BlazeComponent.extendComponent({
const ruleName = this.data().ruleName.get();
const trigger = this.data().triggerVar.get();
const actionSelected = this.find('#move-gen-action').value;
- if (actionSelected == "top") {
+ if (actionSelected === 'top') {
const triggerId = Triggers.insert(trigger);
const actionId = Actions.insert({
- actionType: "moveCardToTop",
- "listTitle": "*",
- "boardId": boardId,
- "desc": desc
+ actionType: 'moveCardToTop',
+ 'listTitle': '*',
+ boardId,
+ desc,
});
Rules.insert({
title: ruleName,
- triggerId: triggerId,
- actionId: actionId,
- "boardId": boardId
+ triggerId,
+ actionId,
+ boardId,
});
}
- if (actionSelected == "bottom") {
+ if (actionSelected === 'bottom') {
const triggerId = Triggers.insert(trigger);
const actionId = Actions.insert({
- actionType: "moveCardToBottom",
- "listTitle": "*",
- "boardId": boardId,
- "desc": desc
+ actionType: 'moveCardToBottom',
+ 'listTitle': '*',
+ boardId,
+ desc,
});
Rules.insert({
title: ruleName,
- triggerId: triggerId,
- actionId: actionId,
- "boardId": boardId
+ triggerId,
+ actionId,
+ boardId,
});
}
},
@@ -86,36 +86,37 @@ BlazeComponent.extendComponent({
const ruleName = this.data().ruleName.get();
const trigger = this.data().triggerVar.get();
const actionSelected = this.find('#arch-action').value;
- if (actionSelected == "archive") {
+ if (actionSelected === 'archive') {
const triggerId = Triggers.insert(trigger);
const actionId = Actions.insert({
- actionType: "archive",
- "boardId": boardId,
- "desc": desc
+ actionType: 'archive',
+ boardId,
+ desc,
});
Rules.insert({
title: ruleName,
- triggerId: triggerId,
- actionId: actionId,
- "boardId": boardId
+ triggerId,
+ actionId,
+ boardId,
});
}
- if (actionSelected == "unarchive") {
+ if (actionSelected === 'unarchive') {
const triggerId = Triggers.insert(trigger);
const actionId = Actions.insert({
- actionType: "unarchive",
- "boardId": boardId,
- "desc": desc
+ actionType: 'unarchive',
+ boardId,
+ desc,
});
Rules.insert({
title: ruleName,
- triggerId: triggerId,
- actionId: actionId,
- "boardId": boardId
+ triggerId,
+ actionId,
+ boardId,
});
}
},
}];
},
-}).register('boardActions'); \ No newline at end of file
+}).register('boardActions');
+/* eslint-no-undef */
diff --git a/client/components/rules/actions/cardActions.js b/client/components/rules/actions/cardActions.js
index a6e74fe9..a65407c1 100644
--- a/client/components/rules/actions/cardActions.js
+++ b/client/components/rules/actions/cardActions.js
@@ -6,11 +6,10 @@ BlazeComponent.extendComponent({
labels() {
const labels = Boards.findOne(Session.get('currentBoard')).labels;
for (let i = 0; i < labels.length; i++) {
- if (labels[i].name == "" || labels[i].name == undefined) {
+ if (labels[i].name === '' || labels[i].name === undefined) {
labels[i].name = labels[i].color.toUpperCase();
}
}
- console.log(labels);
return labels;
},
@@ -23,34 +22,34 @@ BlazeComponent.extendComponent({
const labelId = this.find('#label-id').value;
const boardId = Session.get('currentBoard');
const desc = Utils.getTriggerActionDesc(event, this);
- if (actionSelected == "add") {
+ if (actionSelected === 'add') {
const triggerId = Triggers.insert(trigger);
const actionId = Actions.insert({
- actionType: "addLabel",
- "labelId": labelId,
- "boardId": boardId,
- "desc": desc
+ actionType: 'addLabel',
+ labelId,
+ boardId,
+ desc,
});
Rules.insert({
title: ruleName,
- triggerId: triggerId,
- actionId: actionId,
- "boardId": boardId
+ triggerId,
+ actionId,
+ boardId,
});
}
- if (actionSelected == "remove") {
+ if (actionSelected === 'remove') {
const triggerId = Triggers.insert(trigger);
const actionId = Actions.insert({
- actionType: "removeLabel",
- "labelId": labelId,
- "boardId": boardId,
- "desc": desc
+ actionType: 'removeLabel',
+ labelId,
+ boardId,
+ desc,
});
Rules.insert({
title: ruleName,
- triggerId: triggerId,
- actionId: actionId,
- "boardId": boardId
+ triggerId,
+ actionId,
+ boardId,
});
}
@@ -62,35 +61,35 @@ BlazeComponent.extendComponent({
const memberName = this.find('#member-name').value;
const boardId = Session.get('currentBoard');
const desc = Utils.getTriggerActionDesc(event, this);
- if (actionSelected == "add") {
+ if (actionSelected === 'add') {
const triggerId = Triggers.insert(trigger);
const actionId = Actions.insert({
- actionType: "addMember",
- "memberName": memberName,
- "boardId": boardId,
- "desc": desc
+ actionType: 'addMember',
+ memberName,
+ boardId,
+ desc,
});
Rules.insert({
title: ruleName,
- triggerId: triggerId,
- actionId: actionId,
- "boardId": boardId,
- "desc": desc
+ triggerId,
+ actionId,
+ boardId,
+ desc,
});
}
- if (actionSelected == "remove") {
+ if (actionSelected === 'remove') {
const triggerId = Triggers.insert(trigger);
const actionId = Actions.insert({
- actionType: "removeMember",
- "memberName": memberName,
- "boardId": boardId,
- "desc": desc
+ actionType: 'removeMember',
+ memberName,
+ boardId,
+ desc,
});
Rules.insert({
title: ruleName,
- triggerId: triggerId,
- actionId: actionId,
- "boardId": boardId
+ triggerId,
+ actionId,
+ boardId,
});
}
},
@@ -101,19 +100,19 @@ BlazeComponent.extendComponent({
const desc = Utils.getTriggerActionDesc(event, this);
const boardId = Session.get('currentBoard');
const actionId = Actions.insert({
- actionType: "removeMember",
- "memberName": "*",
- "boardId": boardId,
- "desc": desc
+ actionType: 'removeMember',
+ 'memberName': '*',
+ boardId,
+ desc,
});
Rules.insert({
title: ruleName,
- triggerId: triggerId,
- actionId: actionId,
- "boardId": boardId
+ triggerId,
+ actionId,
+ boardId,
});
},
}];
},
-}).register('cardActions'); \ No newline at end of file
+}).register('cardActions');
diff --git a/client/components/rules/actions/checklistActions.js b/client/components/rules/actions/checklistActions.js
index 0b4c2167..4b70f959 100644
--- a/client/components/rules/actions/checklistActions.js
+++ b/client/components/rules/actions/checklistActions.js
@@ -11,34 +11,34 @@ BlazeComponent.extendComponent({
const checklistName = this.find('#checklist-name').value;
const boardId = Session.get('currentBoard');
const desc = Utils.getTriggerActionDesc(event, this);
- if (actionSelected == "add") {
+ if (actionSelected === 'add') {
const triggerId = Triggers.insert(trigger);
const actionId = Actions.insert({
- actionType: "addChecklist",
- "checklistName": checklistName,
- "boardId": boardId,
- "desc": desc
+ actionType: 'addChecklist',
+ checklistName,
+ boardId,
+ desc,
});
Rules.insert({
title: ruleName,
- triggerId: triggerId,
- actionId: actionId,
- "boardId": boardId
+ triggerId,
+ actionId,
+ boardId,
});
}
- if (actionSelected == "remove") {
+ if (actionSelected === 'remove') {
const triggerId = Triggers.insert(trigger);
const actionId = Actions.insert({
- actionType: "removeChecklist",
- "checklistName": checklistName,
- "boardId": boardId,
- "desc": desc
+ actionType: 'removeChecklist',
+ checklistName,
+ boardId,
+ desc,
});
Rules.insert({
title: ruleName,
- triggerId: triggerId,
- actionId: actionId,
- "boardId": boardId
+ triggerId,
+ actionId,
+ boardId,
});
}
@@ -50,79 +50,79 @@ BlazeComponent.extendComponent({
const checklistName = this.find('#checklist-name2').value;
const boardId = Session.get('currentBoard');
const desc = Utils.getTriggerActionDesc(event, this);
- if (actionSelected == "check") {
+ if (actionSelected === 'check') {
const triggerId = Triggers.insert(trigger);
const actionId = Actions.insert({
- actionType: "checkAll",
- "checklistName": checklistName,
- "boardId": boardId,
- "desc": desc
+ actionType: 'checkAll',
+ checklistName,
+ boardId,
+ desc,
});
Rules.insert({
title: ruleName,
- triggerId: triggerId,
- actionId: actionId,
- "boardId": boardId
+ triggerId,
+ actionId,
+ boardId,
});
}
- if (actionSelected == "uncheck") {
+ if (actionSelected === 'uncheck') {
const triggerId = Triggers.insert(trigger);
const actionId = Actions.insert({
- actionType: "uncheckAll",
- "checklistName": checklistName,
- "boardId": boardId,
- "desc": desc
+ actionType: 'uncheckAll',
+ checklistName,
+ boardId,
+ desc,
});
Rules.insert({
title: ruleName,
- triggerId: triggerId,
- actionId: actionId,
- "boardId": boardId
+ triggerId,
+ actionId,
+ boardId,
});
}
},
'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 checkItemName = this.find('#checkitem-name');
+ const checklistName = this.find('#checklist-name3');
const actionSelected = this.find('#check-item-action').value;
const boardId = Session.get('currentBoard');
const desc = Utils.getTriggerActionDesc(event, this);
- if (actionSelected == "check") {
+ if (actionSelected === 'check') {
const triggerId = Triggers.insert(trigger);
const actionId = Actions.insert({
- actionType: "checkItem",
- "checklistName": checklistName,
- "checkItemName": checkItemName,
- "boardId": boardId,
- "desc": desc
+ actionType: 'checkItem',
+ checklistName,
+ checkItemName,
+ boardId,
+ desc,
});
Rules.insert({
title: ruleName,
- triggerId: triggerId,
- actionId: actionId,
- "boardId": boardId
+ triggerId,
+ actionId,
+ boardId,
});
}
- if (actionSelected == "uncheck") {
+ if (actionSelected === 'uncheck') {
const triggerId = Triggers.insert(trigger);
const actionId = Actions.insert({
- actionType: "uncheckItem",
- "checklistName": checklistName,
- "checkItemName": checkItemName,
- "boardId": boardId,
- "desc": desc
+ actionType: 'uncheckItem',
+ checklistName,
+ checkItemName,
+ boardId,
+ desc,
});
Rules.insert({
title: ruleName,
- triggerId: triggerId,
- actionId: actionId,
- "boardId": boardId
+ triggerId,
+ actionId,
+ boardId,
});
}
},
}];
},
-}).register('checklistActions'); \ No newline at end of file
+}).register('checklistActions');
diff --git a/client/components/rules/actions/mailActions.jade b/client/components/rules/actions/mailActions.jade
index c10fb384..7be78c75 100644
--- a/client/components/rules/actions/mailActions.jade
+++ b/client/components/rules/actions/mailActions.jade
@@ -2,10 +2,10 @@ template(name="mailActions")
div.trigger-item.trigger-item-mail
div.trigger-content.trigger-content-mail
div.trigger-text.trigger-text-email
- | {{{_'r-send-email'}}}
+ | {{_'r-send-email'}}
div.trigger-dropdown-mail
- input(id="email-to",type=text,placeholder="{{{_'r-to'}}}")
- input(id="email-subject",type=text,placeholder="{{{_'r-subject'}}}")
+ input(id="email-to",type=text,placeholder="{{_'r-to'}}")
+ input(id="email-subject",type=text,placeholder="{{_'r-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
+ i.fa.fa-plus
diff --git a/client/components/rules/actions/mailActions.js b/client/components/rules/actions/mailActions.js
index dae7d08d..40cbc280 100644
--- a/client/components/rules/actions/mailActions.js
+++ b/client/components/rules/actions/mailActions.js
@@ -15,21 +15,21 @@ BlazeComponent.extendComponent({
const boardId = Session.get('currentBoard');
const desc = Utils.getTriggerActionDesc(event, this);
const actionId = Actions.insert({
- actionType: "sendEmail",
- "emailTo": emailTo,
- "emailSubject": emailSubject,
- "emailMsg": emailMsg,
- "boardId": boardId,
- "desc": desc
+ actionType: 'sendEmail',
+ emailTo,
+ emailSubject,
+ emailMsg,
+ boardId,
+ desc,
});
Rules.insert({
title: ruleName,
- triggerId: triggerId,
- actionId: actionId,
- "boardId": boardId
+ triggerId,
+ actionId,
+ boardId,
});
},
}];
},
-}).register('mailActions'); \ No newline at end of file
+}).register('mailActions');
diff --git a/client/components/rules/ruleDetails.js b/client/components/rules/ruleDetails.js
index 385b0bae..386b2b48 100644
--- a/client/components/rules/ruleDetails.js
+++ b/client/components/rules/ruleDetails.js
@@ -9,23 +9,21 @@ BlazeComponent.extendComponent({
trigger() {
const ruleId = this.data().ruleId;
const rule = Rules.findOne({
- _id: ruleId.get()
+ _id: ruleId.get(),
});
const trigger = Triggers.findOne({
- _id: rule.triggerId
+ _id: rule.triggerId,
});
- console.log(trigger);
return trigger.description();
},
action() {
const ruleId = this.data().ruleId;
const rule = Rules.findOne({
- _id: ruleId.get()
+ _id: ruleId.get(),
});
const action = Actions.findOne({
- _id: rule.actionId
+ _id: rule.actionId,
});
- console.log(action);
return action.description();
},
@@ -33,4 +31,4 @@ BlazeComponent.extendComponent({
return [{}];
},
-}).register('ruleDetails'); \ No newline at end of file
+}).register('ruleDetails');
diff --git a/client/components/rules/rulesActions.js b/client/components/rules/rulesActions.js
index 24143f8c..ecba857b 100644
--- a/client/components/rules/rulesActions.js
+++ b/client/components/rules/rulesActions.js
@@ -1,31 +1,31 @@
BlazeComponent.extendComponent({
onCreated() {
- this.currentActions = new ReactiveVar("board");
+ this.currentActions = new ReactiveVar('board');
},
setBoardActions() {
- this.currentActions.set("board");
+ 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");
+ 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");
+ 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");
+ this.currentActions.set('mail');
$('.js-set-card-actions').removeClass('active');
$('.js-set-board-actions').removeClass('active');
$('.js-set-checklist-actions').removeClass('active');
diff --git a/client/components/rules/rulesList.js b/client/components/rules/rulesList.js
index e7b4660a..d3923bf9 100644
--- a/client/components/rules/rulesList.js
+++ b/client/components/rules/rulesList.js
@@ -6,10 +6,10 @@ BlazeComponent.extendComponent({
rules() {
const boardId = Session.get('currentBoard');
return Rules.find({
- "boardId": boardId
+ boardId,
});
},
events() {
return [{}];
},
-}).register('rulesList'); \ No newline at end of file
+}).register('rulesList');
diff --git a/client/components/rules/rulesMain.js b/client/components/rules/rulesMain.js
index e4cac03d..65cc3d98 100644
--- a/client/components/rules/rulesMain.js
+++ b/client/components/rules/rulesMain.js
@@ -1,24 +1,25 @@
BlazeComponent.extendComponent({
onCreated() {
- this.rulesCurrentTab = new ReactiveVar("rulesList")
- this.ruleName = new ReactiveVar("");
+ this.rulesCurrentTab = new ReactiveVar('rulesList');
+ this.ruleName = new ReactiveVar('');
this.triggerVar = new ReactiveVar();
this.ruleId = new ReactiveVar();
},
setTrigger() {
- this.rulesCurrentTab.set("trigger")
+ this.rulesCurrentTab.set('trigger');
},
setRulesList() {
- this.rulesCurrentTab.set("rulesList")
+ this.rulesCurrentTab.set('rulesList');
},
setAction() {
- this.rulesCurrentTab.set("action")
+ this.rulesCurrentTab.set('action');
},
+
setRuleDetails() {
- this.rulesCurrentTab.set("ruleDetails")
+ this.rulesCurrentTab.set('ruleDetails');
},
events() {
@@ -33,8 +34,8 @@ BlazeComponent.extendComponent({
'click .js-goto-trigger' (event) {
event.preventDefault();
const ruleTitle = this.find('#ruleTitle').value;
- this.find('#ruleTitle').value = "";
- this.ruleName.set(ruleTitle)
+ this.find('#ruleTitle').value = '';
+ this.ruleName.set(ruleTitle);
this.setTrigger();
},
'click .js-goto-action' (event) {
@@ -48,11 +49,11 @@ BlazeComponent.extendComponent({
'click .js-goto-details' (event) {
event.preventDefault();
const rule = this.currentData();
- this.ruleId.set(rule._id)
+ this.ruleId.set(rule._id);
this.setRuleDetails();
},
}];
},
-}).register('rulesMain'); \ No newline at end of file
+}).register('rulesMain');
diff --git a/client/components/rules/rulesTriggers.js b/client/components/rules/rulesTriggers.js
index f9dd4ecc..506e63b2 100644
--- a/client/components/rules/rulesTriggers.js
+++ b/client/components/rules/rulesTriggers.js
@@ -35,7 +35,7 @@ BlazeComponent.extendComponent({
},
name() {
- console.log(this.data());
+ // console.log(this.data());
},
events() {
return [{
@@ -50,4 +50,4 @@ BlazeComponent.extendComponent({
},
}];
},
-}).register('rulesTriggers'); \ No newline at end of file
+}).register('rulesTriggers');
diff --git a/client/components/rules/triggers/boardTriggers.jade b/client/components/rules/triggers/boardTriggers.jade
index b5e08c8c..266f11f8 100644
--- a/client/components/rules/triggers/boardTriggers.jade
+++ b/client/components/rules/triggers/boardTriggers.jade
@@ -2,54 +2,54 @@ template(name="boardTriggers")
div.trigger-item
div.trigger-content
div.trigger-text
- | {{{_'r-when-a-card-is'}}}
+ | {{_'r-when-a-card-is'}}
div.trigger-dropdown
select(id="gen-action")
- option(value="created") {{{_'r-added-to'}}}
- option(value="removed") {{{_'r-removed-from'}}}
+ option(value="created") {{_'r-added-to'}}
+ option(value="removed") {{_'r-removed-from'}}
div.trigger-text
- | {{{_'r-the-board'}}}
+ | {{_'r-the-board'}}
div.trigger-button.js-add-gen-trigger.js-goto-action
i.fa.fa-plus
div.trigger-item
div.trigger-content
div.trigger-text
- | {{{_'r-when-a-card-is'}}}
+ | {{_'r-when-a-card-is'}}
div.trigger-dropdown
select(id="create-action")
- option(value="created") {{{_'r-added-to'}}}
- option(value="removed") {{{_'r-removed-from'}}}
+ option(value="created") {{_'r-added-to'}}
+ option(value="removed") {{_'r-removed-from'}}
div.trigger-text
- | {{{_'r-list'}}}
+ | {{_'r-list'}}
div.trigger-dropdown
- input(id="create-list-name",type=text,placeholder="{{{_'r-list-name'}}}")
+ input(id="create-list-name",type=text,placeholder="{{_'r-list-name'}}")
div.trigger-button.js-add-create-trigger.js-goto-action
i.fa.fa-plus
div.trigger-item
div.trigger-content
div.trigger-text
- | {{{_'r-when-a-card-is'}}}
+ | {{_'r-when-a-card-is'}}
div.trigger-dropdown
select(id="move-action")
- option(value="moved-to") {{{_'r-moved-to'}}}
- option(value="moved-from") {{{_'r-moved-from'}}}
+ option(value="moved-to") {{_'r-moved-to'}}
+ option(value="moved-from") {{_'r-moved-from'}}
div.trigger-text
- | {{{_'r-list'}}}
+ | {{_'r-list'}}
div.trigger-dropdown
- input(id="move-list-name",type=text,placeholder="{{{_'r-list-name'}}}")
+ input(id="move-list-name",type=text,placeholder="{{_'r-list-name'}}")
div.trigger-button.js-add-moved-trigger.js-goto-action
i.fa.fa-plus
div.trigger-item
div.trigger-content
div.trigger-text
- | {{{_'r-when-a-card-is'}}}
+ | {{_'r-when-a-card-is'}}
div.trigger-dropdown
select(id="arch-action")
- option(value="archived") {{{_'r-archived'}}}
- option(value="unarchived") {{{_'r-unarchived'}}}
+ option(value="archived") {{_'r-archived'}}
+ option(value="unarchived") {{_'r-unarchived'}}
div.trigger-button.js-add-arch-trigger.js-goto-action
i.fa.fa-plus
diff --git a/client/components/rules/triggers/boardTriggers.js b/client/components/rules/triggers/boardTriggers.js
index 95c10a5b..e4753642 100644
--- a/client/components/rules/triggers/boardTriggers.js
+++ b/client/components/rules/triggers/boardTriggers.js
@@ -7,97 +7,97 @@ BlazeComponent.extendComponent({
return [{
'click .js-add-gen-trigger' (event) {
const desc = Utils.getTriggerActionDesc(event, this);
- let datas = this.data();
+ const datas = this.data();
const actionSelected = this.find('#gen-action').value;
- const boardId = Session.get('currentBoard')
- if (actionSelected == "created") {
+ const boardId = Session.get('currentBoard');
+ if (actionSelected === 'created') {
datas.triggerVar.set({
- activityType: "createCard",
- "boardId": boardId,
- "listName": "*",
- "desc": desc
+ activityType: 'createCard',
+ boardId,
+ 'listName': '*',
+ desc,
});
}
- if (actionSelected == "removed") {
+ if (actionSelected === 'removed') {
datas.triggerVar.set({
- activityType: "removeCard",
- "boardId": boardId,
- "desc": desc
+ activityType: 'removeCard',
+ boardId,
+ desc,
});
}
},
'click .js-add-create-trigger' (event) {
const desc = Utils.getTriggerActionDesc(event, this);
- let datas = this.data();
+ const 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") {
+ const boardId = Session.get('currentBoard');
+ if (actionSelected === 'created') {
datas.triggerVar.set({
- activityType: "createCard",
- "boardId": boardId,
- "listName": listName,
- "desc": desc
+ activityType: 'createCard',
+ boardId,
+ listName,
+ desc,
});
}
- if (actionSelected == "removed") {
+ if (actionSelected === 'removed') {
datas.triggerVar.set({
- activityType: "removeCard",
- "boardId": boardId,
- "listName": listName,
- "desc": desc
+ activityType: 'removeCard',
+ boardId,
+ listName,
+ desc,
});
}
},
'click .js-add-moved-trigger' (event) {
- let datas = this.data();
+ const 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") {
+ const boardId = Session.get('currentBoard');
+ if (actionSelected === 'moved-to') {
datas.triggerVar.set({
- activityType: "moveCard",
- "boardId": boardId,
- "listName": listName,
- "oldListName": "*",
- "desc": desc
+ activityType: 'moveCard',
+ boardId,
+ listName,
+ 'oldListName': '*',
+ desc,
});
}
- if (actionSelected == "moved-from") {
+ if (actionSelected === 'moved-from') {
datas.triggerVar.set({
- activityType: "moveCard",
- "boardId": boardId,
- "listName": "*",
- "oldListName": listName,
- "desc": desc
+ activityType: 'moveCard',
+ boardId,
+ 'listName': '*',
+ 'oldListName': listName,
+ desc,
});
}
},
'click .js-add-arc-trigger' (event) {
- let datas = this.data();
+ const datas = this.data();
const desc = Utils.getTriggerActionDesc(event, this);
const actionSelected = this.find('#arch-action').value;
- const boardId = Session.get('currentBoard')
- if (actionSelected == "archived") {
+ const boardId = Session.get('currentBoard');
+ if (actionSelected === 'archived') {
datas.triggerVar.set({
- activityType: "archivedCard",
- "boardId": boardId,
- "desc": desc
+ activityType: 'archivedCard',
+ boardId,
+ desc,
});
}
- if (actionSelected == "unarchived") {
+ if (actionSelected === 'unarchived') {
datas.triggerVar.set({
- activityType: "restoredCard",
- "boardId": boardId,
- "desc": desc
+ activityType: 'restoredCard',
+ boardId,
+ desc,
});
}
- }
+ },
}];
},
-}).register('boardTriggers'); \ No newline at end of file
+}).register('boardTriggers');
diff --git a/client/components/rules/triggers/cardTriggers.jade b/client/components/rules/triggers/cardTriggers.jade
index dd02413c..5226e3c4 100644
--- a/client/components/rules/triggers/cardTriggers.jade
+++ b/client/components/rules/triggers/cardTriggers.jade
@@ -2,46 +2,46 @@ template(name="cardTriggers")
div.trigger-item
div.trigger-content
div.trigger-text
- | {{{_'r-when-a-label-is'}}}
+ | {{_'r-when-a-label-is'}}
div.trigger-dropdown
select(id="label-action")
- option(value="added") {{{_'r-added-to'}}}
- option(value="removed") {{{_'r-removed-from'}}}
+ option(value="added") {{_'r-added-to'}}
+ option(value="removed") {{_'r-removed-from'}}
div.trigger-text
- | {{{_'r-a-card'}}}
+ | {{_'r-a-card'}}
div.trigger-button.js-add-gen-label-trigger.js-goto-action
i.fa.fa-plus
div.trigger-item
div.trigger-content
div.trigger-text
- | {{{_'r-when-the-label-is'}}}
+ | {{_'r-when-the-label-is'}}
div.trigger-dropdown
select(id="spec-label")
each labels
option(value="#{_id}")
= name
div.trigger-text
- | {{{_'r-is'}}}
+ | {{_'r-is'}}
div.trigger-dropdown
select(id="spec-label-action")
- option(value="added") {{{_'r-added-to'}}}
- option(value="removed") {{{_'r-removed-from'}}}
+ option(value="added") {{_'r-added-to'}}
+ option(value="removed") {{_'r-removed-from'}}
div.trigger-text
- | {{{_'r-a-card'}}}
+ | {{_'r-a-card'}}
div.trigger-button.js-add-spec-label-trigger.js-goto-action
i.fa.fa-plus
div.trigger-item
div.trigger-content
div.trigger-text
- | {{{_'r-when-a-member'}}}
+ | {{_'r-when-a-member'}}
div.trigger-dropdown
select(id="gen-member-action")
- option(value="added") {{{_'r-added-to'}}}
- option(value="removed") {{{_'r-removed-from'}}}
+ option(value="added") {{_'r-added-to'}}
+ option(value="removed") {{_'r-removed-from'}}
div.trigger-text
- | {{{_'r-a-card'}}}
+ | {{_'r-a-card'}}
div.trigger-button.js-add-gen-member-trigger.js-goto-action
i.fa.fa-plus
@@ -49,31 +49,31 @@ template(name="cardTriggers")
div.trigger-item
div.trigger-content
div.trigger-text
- | {{{_'r-when-the-member'}}}
+ | {{_'r-when-the-member'}}
div.trigger-dropdown
- input(id="spec-member",type=text,placeholder="{{{_'r-name'}}}")
+ input(id="spec-member",type=text,placeholder="{{_'r-name'}}")
div.trigger-text
- | {{{_'r-is'}}}
+ | {{_'r-is'}}
div.trigger-dropdown
select(id="spec-member-action")
- option(value="added") {{{_'r-added-to'}}}
- option(value="removed") {{{_'r-removed-from'}}}
+ option(value="added") {{_'r-added-to'}}
+ option(value="removed") {{_'r-removed-from'}}
div.trigger-text
- | {{{_'r-a-card'}}}
+ | {{_'r-a-card'}}
div.trigger-button.js-add-spec-member-trigger.js-goto-action
i.fa.fa-plus
div.trigger-item
div.trigger-content
div.trigger-text
- | {{{_'r-when-a-attach'}}}
+ | {{_'r-when-a-attach'}}
div.trigger-text
- | {{{_'r-is'}}}
+ | {{_'r-is'}}
div.trigger-dropdown
select(id="attach-action")
- option(value="added") {{{_'r-added-to'}}}
- option(value="removed") {{{_'r-removed-from'}}}
+ option(value="added") {{_'r-added-to'}}
+ option(value="removed") {{_'r-removed-from'}}
div.trigger-text
- | {{{_'r-a-card'}}}
+ | {{_'r-a-card'}}
div.trigger-button.js-add-attachment-trigger.js-goto-action
- i.fa.fa-plus \ No newline at end of file
+ i.fa.fa-plus
diff --git a/client/components/rules/triggers/cardTriggers.js b/client/components/rules/triggers/cardTriggers.js
index c0a5ec1a..704c7690 100644
--- a/client/components/rules/triggers/cardTriggers.js
+++ b/client/components/rules/triggers/cardTriggers.js
@@ -4,127 +4,125 @@ BlazeComponent.extendComponent({
},
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) {
+ 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-gen-label-trigger' (event) {
const desc = Utils.getTriggerActionDesc(event, this);
- let datas = this.data();
+ const datas = this.data();
const actionSelected = this.find('#label-action').value;
- const boardId = Session.get('currentBoard')
- if (actionSelected == "added") {
+ const boardId = Session.get('currentBoard');
+ if (actionSelected === 'added') {
datas.triggerVar.set({
- activityType: "addedLabel",
- "boardId": boardId,
- "labelId": "*",
- "desc": desc
+ activityType: 'addedLabel',
+ boardId,
+ 'labelId': '*',
+ desc,
});
}
- if (actionSelected == "removed") {
+ if (actionSelected === 'removed') {
datas.triggerVar.set({
- activityType: "removedLabel",
- "boardId": boardId,
- "labelId": "*",
- "desc": desc
+ activityType: 'removedLabel',
+ boardId,
+ 'labelId': '*',
+ desc,
});
}
},
'click .js-add-spec-label-trigger' (event) {
const desc = Utils.getTriggerActionDesc(event, this);
- let datas = this.data();
+ const datas = this.data();
const actionSelected = this.find('#spec-label-action').value;
const labelId = this.find('#spec-label').value;
- const boardId = Session.get('currentBoard')
- if (actionSelected == "added") {
+ const boardId = Session.get('currentBoard');
+ if (actionSelected === 'added') {
datas.triggerVar.set({
- activityType: "addedLabel",
- "boardId": boardId,
- "labelId": labelId,
- "desc": desc
+ activityType: 'addedLabel',
+ boardId,
+ labelId,
+ desc,
});
}
- if (actionSelected == "removed") {
+ if (actionSelected === 'removed') {
datas.triggerVar.set({
- activityType: "removedLabel",
- "boardId": boardId,
- "labelId": labelId,
- "desc": desc
+ activityType: 'removedLabel',
+ boardId,
+ labelId,
+ desc,
});
}
},
'click .js-add-gen-member-trigger' (event) {
const desc = Utils.getTriggerActionDesc(event, this);
- let datas = this.data();
+ const datas = this.data();
const actionSelected = this.find('#gen-member-action').value;
- const boardId = Session.get('currentBoard')
- if (actionSelected == "added") {
+ const boardId = Session.get('currentBoard');
+ if (actionSelected === 'added') {
datas.triggerVar.set({
- activityType: "joinMember",
- "boardId": boardId,
- "memberId": "*",
- "desc": desc
+ activityType: 'joinMember',
+ boardId,
+ 'memberId': '*',
+ desc,
});
}
- if (actionSelected == "removed") {
+ if (actionSelected === 'removed') {
datas.triggerVar.set({
- activityType: "unjoinMember",
- "boardId": boardId,
- "memberId": "*",
- "desc": desc
+ activityType: 'unjoinMember',
+ boardId,
+ 'memberId': '*',
+ desc,
});
}
},
'click .js-add-spec-member-trigger' (event) {
const desc = Utils.getTriggerActionDesc(event, this);
- let datas = this.data();
+ const datas = this.data();
const actionSelected = this.find('#spec-member-action').value;
const memberId = this.find('#spec-member').value;
- const boardId = Session.get('currentBoard')
- if (actionSelected == "added") {
+ const boardId = Session.get('currentBoard');
+ if (actionSelected === 'added') {
datas.triggerVar.set({
- activityType: "joinMember",
- "boardId": boardId,
- "memberId": memberId,
- "desc": desc
+ activityType: 'joinMember',
+ boardId,
+ memberId,
+ desc,
});
}
- if (actionSelected == "removed") {
+ if (actionSelected === 'removed') {
datas.triggerVar.set({
- activityType: "unjoinMember",
- "boardId": boardId,
- "memberId": memberId,
- "desc": desc
+ activityType: 'unjoinMember',
+ boardId,
+ memberId,
+ desc,
});
}
},
'click .js-add-attachment-trigger' (event) {
const desc = Utils.getTriggerActionDesc(event, this);
- let datas = this.data();
+ const datas = this.data();
const actionSelected = this.find('#attach-action').value;
- const boardId = Session.get('currentBoard')
- if (actionSelected == "added") {
+ const boardId = Session.get('currentBoard');
+ if (actionSelected === 'added') {
datas.triggerVar.set({
- activityType: "addAttachment",
- "boardId": boardId,
- "desc": desc
+ activityType: 'addAttachment',
+ boardId,
+ desc,
});
}
- if (actionSelected == "removed") {
+ if (actionSelected === 'removed') {
datas.triggerVar.set({
- activityType: "deleteAttachment",
- "boardId": boardId,
- "desc": desc
+ activityType: 'deleteAttachment',
+ boardId,
+ desc,
});
}
},
}];
},
-}).register('cardTriggers'); \ No newline at end of file
+}).register('cardTriggers');
diff --git a/client/components/rules/triggers/checklistTriggers.jade b/client/components/rules/triggers/checklistTriggers.jade
index 465713c8..c6cd99a6 100644
--- a/client/components/rules/triggers/checklistTriggers.jade
+++ b/client/components/rules/triggers/checklistTriggers.jade
@@ -2,13 +2,13 @@ template(name="checklistTriggers")
div.trigger-item
div.trigger-content
div.trigger-text
- | {{{_'r-when-a-checklist'}}}
+ | {{_'r-when-a-checklist'}}
div.trigger-dropdown
select(id="gen-check-action")
- option(value="created") {{{_'r-added-to'}}}
- option(value="removed") {{{_'r-removed-from'}}}
+ option(value="created") {{_'r-added-to'}}
+ option(value="removed") {{_'r-removed-from'}}
div.trigger-text
- | {{{_'r-a-card'}}}
+ | {{_'r-a-card'}}
div.trigger-button.js-add-gen-check-trigger.js-goto-action
i.fa.fa-plus
@@ -16,68 +16,68 @@ template(name="checklistTriggers")
div.trigger-item
div.trigger-content
div.trigger-text
- | {{{_'r-when-the-checklist'}}}
+ | {{_'r-when-the-checklist'}}
div.trigger-dropdown
- input(id="check-name",type=text,placeholder="{{{_'r-name'}}}")
+ input(id="check-name",type=text,placeholder="{{_'r-name'}}")
div.trigger-text
- | {{{_'r-is'}}}
+ | {{_'r-is'}}
div.trigger-dropdown
select(id="spec-check-action")
- option(value="created") {{{_'r-added-to'}}}
- option(value="removed") {{{_'r-removed-from'}}}
+ option(value="created") {{_'r-added-to'}}
+ option(value="removed") {{_'r-removed-from'}}
div.trigger-text
- | {{{_'r-a-card'}}}
+ | {{_'r-a-card'}}
div.trigger-button.js-add-spec-check-trigger.js-goto-action
i.fa.fa-plus
div.trigger-item
div.trigger-content
div.trigger-text
- | {{{_'r-when-a-checklist'}}}
+ | {{_'r-when-a-checklist'}}
div.trigger-dropdown
select(id="gen-comp-check-action")
- option(value="completed") {{{_'r-completed'}}}
- option(value="uncompleted") {{{_'r-made-incomplete'}}}
+ option(value="completed") {{_'r-completed'}}
+ option(value="uncompleted") {{_'r-made-incomplete'}}
div.trigger-button.js-add-gen-comp-trigger.js-goto-action
i.fa.fa-plus
div.trigger-item
div.trigger-content
div.trigger-text
- | {{{_'r-when-the-checklist'}}}
+ | {{_'r-when-the-checklist'}}
div.trigger-dropdown
- input(id="spec-comp-check-name",type=text,placeholder="{{{_'r-name'}}}")
+ input(id="spec-comp-check-name",type=text,placeholder="{{_'r-name'}}")
div.trigger-text
- | {{{_'r-is'}}}
+ | {{_'r-is'}}
div.trigger-dropdown
select(id="spec-comp-check-action")
- option(value="completed") {{{_'r-completed'}}}
- option(value="uncompleted") {{{_'r-made-incomplete'}}}
+ option(value="completed") {{_'r-completed'}}
+ option(value="uncompleted") {{_'r-made-incomplete'}}
div.trigger-button.js-add-spec-comp-trigger.js-goto-action
i.fa.fa-plus
div.trigger-item
div.trigger-content
div.trigger-text
- | {{{_'r-when-a-item'}}}
+ | {{_'r-when-a-item'}}
div.trigger-dropdown
select(id="check-item-gen-action")
- option(value="checked") {{{_'r-checked'}}}
- option(value="unchecked") {{{_'r-unchecked'}}}
+ option(value="checked") {{_'r-checked'}}
+ option(value="unchecked") {{_'r-unchecked'}}
div.trigger-button.js-add-gen-check-item-trigger.js-goto-action
i.fa.fa-plus
div.trigger-item
div.trigger-content
div.trigger-text
- | {{{_'r-when-the-item'}}}
+ | {{_'r-when-the-item'}}
div.trigger-dropdown
- input(id="check-item-name",type=text,placeholder="{{{_'r-name'}}}")
+ input(id="check-item-name",type=text,placeholder="{{_'r-name'}}")
div.trigger-text
- | {{{_'r-is'}}}
+ | {{_'r-is'}}
div.trigger-dropdown
select(id="check-item-spec-action")
- option(value="checked") {{{_'r-checked'}}}
- option(value="unchecked") {{{_'r-unchecked'}}}
+ option(value="checked") {{_'r-checked'}}
+ option(value="unchecked") {{_'r-unchecked'}}
div.trigger-button.js-add-spec-check-item-trigger.js-goto-action
- i.fa.fa-plus \ No newline at end of file
+ i.fa.fa-plus
diff --git a/client/components/rules/triggers/checklistTriggers.js b/client/components/rules/triggers/checklistTriggers.js
index 6e7b3445..01f3effe 100644
--- a/client/components/rules/triggers/checklistTriggers.js
+++ b/client/components/rules/triggers/checklistTriggers.js
@@ -6,141 +6,141 @@ BlazeComponent.extendComponent({
return [{
'click .js-add-gen-check-trigger' (event) {
const desc = Utils.getTriggerActionDesc(event, this);
- let datas = this.data();
+ const datas = this.data();
const actionSelected = this.find('#gen-check-action').value;
- const boardId = Session.get('currentBoard')
- if (actionSelected == "created") {
+ const boardId = Session.get('currentBoard');
+ if (actionSelected === 'created') {
datas.triggerVar.set({
- activityType: "addChecklist",
- "boardId": boardId,
- "checklistName": "*",
- "desc": desc
+ activityType: 'addChecklist',
+ boardId,
+ 'checklistName': '*',
+ desc,
});
}
- if (actionSelected == "removed") {
+ if (actionSelected === 'removed') {
datas.triggerVar.set({
- activityType: "removeChecklist",
- "boardId": boardId,
- "checklistName": "*",
- "desc": desc
+ activityType: 'removeChecklist',
+ boardId,
+ 'checklistName': '*',
+ desc,
});
}
},
'click .js-add-spec-check-trigger' (event) {
const desc = Utils.getTriggerActionDesc(event, this);
- let datas = this.data();
+ const datas = this.data();
const actionSelected = this.find('#spec-check-action').value;
const checklistId = this.find('#check-name').value;
- const boardId = Session.get('currentBoard')
- if (actionSelected == "created") {
+ const boardId = Session.get('currentBoard');
+ if (actionSelected === 'created') {
datas.triggerVar.set({
- activityType: "addChecklist",
- "boardId": boardId,
- "checklistName": checklistId,
- "desc": desc
+ activityType: 'addChecklist',
+ boardId,
+ 'checklistName': checklistId,
+ desc,
});
}
- if (actionSelected == "removed") {
+ if (actionSelected === 'removed') {
datas.triggerVar.set({
- activityType: "removeChecklist",
- "boardId": boardId,
- "checklistName": checklistId,
- "desc": desc
+ activityType: 'removeChecklist',
+ boardId,
+ 'checklistName': checklistId,
+ desc,
});
}
},
'click .js-add-gen-comp-trigger' (event) {
const desc = Utils.getTriggerActionDesc(event, this);
- let datas = this.data();
+ const datas = this.data();
const actionSelected = this.find('#gen-comp-check-action').value;
- const boardId = Session.get('currentBoard')
- if (actionSelected == "completed") {
+ const boardId = Session.get('currentBoard');
+ if (actionSelected === 'completed') {
datas.triggerVar.set({
- activityType: "completeChecklist",
- "boardId": boardId,
- "checklistName": "*",
- "desc": desc
+ activityType: 'completeChecklist',
+ boardId,
+ 'checklistName': '*',
+ desc,
});
}
- if (actionSelected == "uncompleted") {
+ if (actionSelected === 'uncompleted') {
datas.triggerVar.set({
- activityType: "uncompleteChecklist",
- "boardId": boardId,
- "checklistName": "*",
- "desc": desc
+ activityType: 'uncompleteChecklist',
+ boardId,
+ 'checklistName': '*',
+ desc,
});
}
},
'click .js-add-spec-comp-trigger' (event) {
const desc = Utils.getTriggerActionDesc(event, this);
- let datas = this.data();
+ const datas = this.data();
const actionSelected = this.find('#spec-comp-check-action').value;
const checklistId = this.find('#spec-comp-check-name').value;
- const boardId = Session.get('currentBoard')
- if (actionSelected == "added") {
+ const boardId = Session.get('currentBoard');
+ if (actionSelected === 'added') {
datas.triggerVar.set({
- activityType: "completeChecklist",
- "boardId": boardId,
- "checklistName": checklistId,
- "desc": desc
+ activityType: 'completeChecklist',
+ boardId,
+ 'checklistName': checklistId,
+ desc,
});
}
- if (actionSelected == "removed") {
+ if (actionSelected === 'removed') {
datas.triggerVar.set({
- activityType: "uncompleteChecklist",
- "boardId": boardId,
- "checklistName": checklistId,
- "desc": desc
+ activityType: 'uncompleteChecklist',
+ boardId,
+ 'checklistName': checklistId,
+ desc,
});
}
},
'click .js-add-gen-check-item-trigger' (event) {
const desc = Utils.getTriggerActionDesc(event, this);
- let datas = this.data();
+ const datas = this.data();
const actionSelected = this.find('#check-item-gen-action').value;
- const boardId = Session.get('currentBoard')
- if (actionSelected == "checked") {
+ const boardId = Session.get('currentBoard');
+ if (actionSelected === 'checked') {
datas.triggerVar.set({
- activityType: "checkedItem",
- "boardId": boardId,
- "checklistItemName": "*",
- "desc": desc
+ activityType: 'checkedItem',
+ boardId,
+ 'checklistItemName': '*',
+ desc,
});
}
- if (actionSelected == "unchecked") {
+ if (actionSelected === 'unchecked') {
datas.triggerVar.set({
- activityType: "uncheckedItem",
- "boardId": boardId,
- "checklistItemName": "*",
- "desc": desc
+ activityType: 'uncheckedItem',
+ boardId,
+ 'checklistItemName': '*',
+ desc,
});
}
},
'click .js-add-spec-check-item-trigger' (event) {
const desc = Utils.getTriggerActionDesc(event, this);
- let datas = this.data();
+ const datas = this.data();
const actionSelected = this.find('#check-item-spec-action').value;
const checklistItemId = this.find('#check-item-name').value;
- const boardId = Session.get('currentBoard')
- if (actionSelected == "checked") {
+ const boardId = Session.get('currentBoard');
+ if (actionSelected === 'checked') {
datas.triggerVar.set({
- activityType: "checkedItem",
- "boardId": boardId,
- "checklistItemName": checklistItemId,
- "desc": desc
+ activityType: 'checkedItem',
+ boardId,
+ 'checklistItemName': checklistItemId,
+ desc,
});
}
- if (actionSelected == "unchecked") {
+ if (actionSelected === 'unchecked') {
datas.triggerVar.set({
- activityType: "uncheckedItem",
- "boardId": boardId,
- "checklistItemName": checklistItemId,
- "desc": desc
+ activityType: 'uncheckedItem',
+ boardId,
+ 'checklistItemName': checklistItemId,
+ desc,
});
}
},
}];
},
-}).register('checklistTriggers'); \ No newline at end of file
+}).register('checklistTriggers');
diff --git a/client/lib/utils.js b/client/lib/utils.js
index 24ff830a..525cfb83 100644
--- a/client/lib/utils.js
+++ b/client/lib/utils.js
@@ -188,23 +188,24 @@ Utils = {
} else if (matomo) {
window._paq.push(['trackPageView']);
}
+ },
getTriggerActionDesc(event, tempInstance) {
const jqueryEl = tempInstance.$(event.currentTarget.parentNode);
- const triggerEls = jqueryEl.find(".trigger-content").children();
- let finalString = "";
+ const triggerEls = jqueryEl.find('.trigger-content').children();
+ let finalString = '';
for (let i = 0; i < triggerEls.length; i++) {
const element = tempInstance.$(triggerEls[i]);
- if (element.hasClass("trigger-text")) {
+ if (element.hasClass('trigger-text')) {
finalString += element.text().toLowerCase();
- } else if (element.find("select").length > 0) {
- finalString += element.find("select option:selected").text().toLowerCase();
- } else if (element.find("input").length > 0) {
- finalString += element.find("input").val();
+ } else if (element.find('select').length > 0) {
+ finalString += element.find('select option:selected').text().toLowerCase();
+ } else if (element.find('input').length > 0) {
+ finalString += element.find('input').val();
}
// Add space
- if (i != length - 1) {
- finalString += " ";
+ if (i !== length - 1) {
+ finalString += ' ';
}
}
return finalString;