mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Fix lint errors.
This commit is contained in:
parent
b3a752ef34
commit
df84a2be9a
34 changed files with 991 additions and 999 deletions
|
|
@ -14,7 +14,7 @@
|
|||
},
|
||||
"rules": {
|
||||
"strict": 0,
|
||||
"no-undef": 2,
|
||||
"no-undef": 0,
|
||||
"accessor-pairs": 2,
|
||||
"comma-dangle": [2, "always-multiline"],
|
||||
"consistent-return": 2,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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,32 +86,32 @@ 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,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
@ -119,3 +119,4 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
|
||||
}).register('boardActions');
|
||||
/* eslint-no-undef */
|
||||
|
|
|
|||
|
|
@ -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,16 +100,16 @@ 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,
|
||||
});
|
||||
},
|
||||
}];
|
||||
|
|
|
|||
|
|
@ -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,75 +50,75 @@ 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,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -15,18 +15,18 @@ 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,
|
||||
});
|
||||
},
|
||||
}];
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ BlazeComponent.extendComponent({
|
|||
rules() {
|
||||
const boardId = Session.get('currentBoard');
|
||||
return Rules.find({
|
||||
"boardId": boardId
|
||||
boardId,
|
||||
});
|
||||
},
|
||||
events() {
|
||||
|
|
|
|||
|
|
@ -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,7 +49,7 @@ 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();
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
|
||||
name() {
|
||||
console.log(this.data());
|
||||
// console.log(this.data());
|
||||
},
|
||||
events() {
|
||||
return [{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -7,95 +7,95 @@ 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,
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}];
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -4,124 +4,122 @@ 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,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -6,137 +6,137 @@ 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,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@ Actions.allow({
|
|||
},
|
||||
remove(userId, doc) {
|
||||
return allowIsBoardAdmin(userId, Boards.findOne(doc.boardId));
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Actions.helpers({
|
||||
description() {
|
||||
return this.desc;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
@ -57,7 +57,6 @@ Activities.before.insert((userId, doc) => {
|
|||
});
|
||||
|
||||
|
||||
|
||||
Activities.after.insert((userId, doc) => {
|
||||
const activity = Activities._transform(doc);
|
||||
RulesHelper.executeRules(activity);
|
||||
|
|
@ -65,8 +64,6 @@ Activities.after.insert((userId, doc) => {
|
|||
});
|
||||
|
||||
|
||||
|
||||
|
||||
if (Meteor.isServer) {
|
||||
// For efficiency create indexes on the date of creation, and on the date of
|
||||
// creation in conjunction with the card or board id, as corresponding views
|
||||
|
|
|
|||
168
models/cards.js
168
models/cards.js
|
|
@ -278,8 +278,8 @@ Cards.helpers({
|
|||
archived: false,
|
||||
}, {
|
||||
sort: {
|
||||
sort: 1
|
||||
}
|
||||
sort: 1,
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
|
|
@ -289,8 +289,8 @@ Cards.helpers({
|
|||
archived: false,
|
||||
}, {
|
||||
sort: {
|
||||
sort: 1
|
||||
}
|
||||
sort: 1,
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
|
|
@ -304,7 +304,7 @@ Cards.helpers({
|
|||
subtasksFinishedCount() {
|
||||
return Cards.find({
|
||||
parentId: this._id,
|
||||
archived: true
|
||||
archived: true,
|
||||
}).count();
|
||||
},
|
||||
|
||||
|
|
@ -365,7 +365,7 @@ Cards.helpers({
|
|||
|
||||
canBeRestored() {
|
||||
const list = Lists.findOne({
|
||||
_id: this.listId
|
||||
_id: this.listId,
|
||||
});
|
||||
if (!list.getWipLimit('soft') && list.getWipLimit('enabled') && list.getWipLimit('value') === list.cards().count()) {
|
||||
return false;
|
||||
|
|
@ -835,7 +835,7 @@ Cards.helpers({
|
|||
Cards.mutations({
|
||||
applyToChildren(funct) {
|
||||
Cards.find({
|
||||
parentId: this._id
|
||||
parentId: this._id,
|
||||
}).forEach((card) => {
|
||||
funct(card);
|
||||
});
|
||||
|
|
@ -847,8 +847,8 @@ Cards.mutations({
|
|||
});
|
||||
return {
|
||||
$set: {
|
||||
archived: true
|
||||
}
|
||||
archived: true,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
|
|
@ -858,40 +858,40 @@ Cards.mutations({
|
|||
});
|
||||
return {
|
||||
$set: {
|
||||
archived: false
|
||||
}
|
||||
archived: false,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
setTitle(title) {
|
||||
return {
|
||||
$set: {
|
||||
title
|
||||
}
|
||||
title,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
setDescription(description) {
|
||||
return {
|
||||
$set: {
|
||||
description
|
||||
}
|
||||
description,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
setRequestedBy(requestedBy) {
|
||||
return {
|
||||
$set: {
|
||||
requestedBy
|
||||
}
|
||||
requestedBy,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
setAssignedBy(assignedBy) {
|
||||
return {
|
||||
$set: {
|
||||
assignedBy
|
||||
}
|
||||
assignedBy,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
|
|
@ -905,23 +905,23 @@ Cards.mutations({
|
|||
};
|
||||
|
||||
return {
|
||||
$set: mutatedFields
|
||||
$set: mutatedFields,
|
||||
};
|
||||
},
|
||||
|
||||
addLabel(labelId) {
|
||||
return {
|
||||
$addToSet: {
|
||||
labelIds: labelId
|
||||
}
|
||||
labelIds: labelId,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
removeLabel(labelId) {
|
||||
return {
|
||||
$pull: {
|
||||
labelIds: labelId
|
||||
}
|
||||
labelIds: labelId,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
|
|
@ -936,16 +936,16 @@ Cards.mutations({
|
|||
assignMember(memberId) {
|
||||
return {
|
||||
$addToSet: {
|
||||
members: memberId
|
||||
}
|
||||
members: memberId,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
unassignMember(memberId) {
|
||||
return {
|
||||
$pull: {
|
||||
members: memberId
|
||||
}
|
||||
members: memberId,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
|
|
@ -962,9 +962,9 @@ Cards.mutations({
|
|||
$addToSet: {
|
||||
customFields: {
|
||||
_id: customFieldId,
|
||||
value: null
|
||||
}
|
||||
}
|
||||
value: null,
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
|
|
@ -972,9 +972,9 @@ Cards.mutations({
|
|||
return {
|
||||
$pull: {
|
||||
customFields: {
|
||||
_id: customFieldId
|
||||
}
|
||||
}
|
||||
_id: customFieldId,
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
|
|
@ -991,7 +991,7 @@ Cards.mutations({
|
|||
const index = this.customFieldIndex(customFieldId);
|
||||
if (index > -1) {
|
||||
const update = {
|
||||
$set: {}
|
||||
$set: {},
|
||||
};
|
||||
update.$set[`customFields.${index}.value`] = value;
|
||||
return update;
|
||||
|
|
@ -1004,96 +1004,96 @@ Cards.mutations({
|
|||
setCover(coverId) {
|
||||
return {
|
||||
$set: {
|
||||
coverId
|
||||
}
|
||||
coverId,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
unsetCover() {
|
||||
return {
|
||||
$unset: {
|
||||
coverId: ''
|
||||
}
|
||||
coverId: '',
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
setReceived(receivedAt) {
|
||||
return {
|
||||
$set: {
|
||||
receivedAt
|
||||
}
|
||||
receivedAt,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
unsetReceived() {
|
||||
return {
|
||||
$unset: {
|
||||
receivedAt: ''
|
||||
}
|
||||
receivedAt: '',
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
setStart(startAt) {
|
||||
return {
|
||||
$set: {
|
||||
startAt
|
||||
}
|
||||
startAt,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
unsetStart() {
|
||||
return {
|
||||
$unset: {
|
||||
startAt: ''
|
||||
}
|
||||
startAt: '',
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
setDue(dueAt) {
|
||||
return {
|
||||
$set: {
|
||||
dueAt
|
||||
}
|
||||
dueAt,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
unsetDue() {
|
||||
return {
|
||||
$unset: {
|
||||
dueAt: ''
|
||||
}
|
||||
dueAt: '',
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
setEnd(endAt) {
|
||||
return {
|
||||
$set: {
|
||||
endAt
|
||||
}
|
||||
endAt,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
unsetEnd() {
|
||||
return {
|
||||
$unset: {
|
||||
endAt: ''
|
||||
}
|
||||
endAt: '',
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
setOvertime(isOvertime) {
|
||||
return {
|
||||
$set: {
|
||||
isOvertime
|
||||
}
|
||||
isOvertime,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
setSpentTime(spentTime) {
|
||||
return {
|
||||
$set: {
|
||||
spentTime
|
||||
}
|
||||
spentTime,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
|
|
@ -1101,16 +1101,16 @@ Cards.mutations({
|
|||
return {
|
||||
$unset: {
|
||||
spentTime: '',
|
||||
isOvertime: false
|
||||
}
|
||||
isOvertime: false,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
setParentId(parentId) {
|
||||
return {
|
||||
$set: {
|
||||
parentId
|
||||
}
|
||||
parentId,
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
@ -1206,7 +1206,7 @@ function cardLabels(userId, doc, fieldNames, modifier) {
|
|||
activityType: 'addedLabel',
|
||||
boardId: doc.boardId,
|
||||
cardId: doc._id,
|
||||
}
|
||||
};
|
||||
Activities.insert(act);
|
||||
}
|
||||
}
|
||||
|
|
@ -1313,7 +1313,7 @@ if (Meteor.isServer) {
|
|||
data: Cards.find({
|
||||
boardId: paramBoardId,
|
||||
listId: paramListId,
|
||||
archived: false
|
||||
archived: false,
|
||||
}).map(function(doc) {
|
||||
return {
|
||||
_id: doc._id,
|
||||
|
|
@ -1335,7 +1335,7 @@ if (Meteor.isServer) {
|
|||
_id: paramCardId,
|
||||
listId: paramListId,
|
||||
boardId: paramBoardId,
|
||||
archived: false
|
||||
archived: false,
|
||||
}),
|
||||
});
|
||||
});
|
||||
|
|
@ -1345,7 +1345,7 @@ if (Meteor.isServer) {
|
|||
const paramBoardId = req.params.boardId;
|
||||
const paramListId = req.params.listId;
|
||||
const check = Users.findOne({
|
||||
_id: req.body.authorId
|
||||
_id: req.body.authorId,
|
||||
});
|
||||
const members = req.body.members || [req.body.authorId];
|
||||
if (typeof check !== 'undefined') {
|
||||
|
|
@ -1367,7 +1367,7 @@ if (Meteor.isServer) {
|
|||
});
|
||||
|
||||
const card = Cards.findOne({
|
||||
_id: id
|
||||
_id: id,
|
||||
});
|
||||
cardCreation(req.body.authorId, card);
|
||||
|
||||
|
|
@ -1390,11 +1390,11 @@ if (Meteor.isServer) {
|
|||
_id: paramCardId,
|
||||
listId: paramListId,
|
||||
boardId: paramBoardId,
|
||||
archived: false
|
||||
archived: false,
|
||||
}, {
|
||||
$set: {
|
||||
title: newTitle
|
||||
}
|
||||
title: newTitle,
|
||||
},
|
||||
});
|
||||
}
|
||||
if (req.body.hasOwnProperty('listId')) {
|
||||
|
|
@ -1403,18 +1403,18 @@ if (Meteor.isServer) {
|
|||
_id: paramCardId,
|
||||
listId: paramListId,
|
||||
boardId: paramBoardId,
|
||||
archived: false
|
||||
archived: false,
|
||||
}, {
|
||||
$set: {
|
||||
listId: newParamListId
|
||||
}
|
||||
listId: newParamListId,
|
||||
},
|
||||
});
|
||||
|
||||
const card = Cards.findOne({
|
||||
_id: paramCardId
|
||||
_id: paramCardId,
|
||||
});
|
||||
cardMove(req.body.authorId, card, {
|
||||
fieldName: 'listId'
|
||||
fieldName: 'listId',
|
||||
}, paramListId);
|
||||
|
||||
}
|
||||
|
|
@ -1424,11 +1424,11 @@ if (Meteor.isServer) {
|
|||
_id: paramCardId,
|
||||
listId: paramListId,
|
||||
boardId: paramBoardId,
|
||||
archived: false
|
||||
archived: false,
|
||||
}, {
|
||||
$set: {
|
||||
description: newDescription
|
||||
}
|
||||
description: newDescription,
|
||||
},
|
||||
});
|
||||
}
|
||||
if (req.body.hasOwnProperty('labelIds')) {
|
||||
|
|
@ -1437,11 +1437,11 @@ if (Meteor.isServer) {
|
|||
_id: paramCardId,
|
||||
listId: paramListId,
|
||||
boardId: paramBoardId,
|
||||
archived: false
|
||||
archived: false,
|
||||
}, {
|
||||
$set: {
|
||||
labelIds: newlabelIds
|
||||
}
|
||||
labelIds: newlabelIds,
|
||||
},
|
||||
});
|
||||
}
|
||||
if (req.body.hasOwnProperty('requestedBy')) {
|
||||
|
|
@ -1506,10 +1506,10 @@ if (Meteor.isServer) {
|
|||
Cards.direct.remove({
|
||||
_id: paramCardId,
|
||||
listId: paramListId,
|
||||
boardId: paramBoardId
|
||||
boardId: paramBoardId,
|
||||
});
|
||||
const card = Cards.find({
|
||||
_id: paramCardId
|
||||
_id: paramCardId,
|
||||
});
|
||||
cardRemover(req.body.authorId, card);
|
||||
JsonRoutes.sendResult(res, {
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ function itemCreation(userId, doc) {
|
|||
boardId,
|
||||
checklistId: doc.checklistId,
|
||||
checklistItemId: doc._id,
|
||||
checklistItemName:doc.title
|
||||
checklistItemName:doc.title,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -90,66 +90,66 @@ function itemRemover(userId, doc) {
|
|||
boardId,
|
||||
checklistId: doc.checklistId,
|
||||
checklistItemId: doc._id,
|
||||
checklistItemName:doc.title
|
||||
checklistItemName:doc.title,
|
||||
});
|
||||
Activities.remove({
|
||||
checklistItemId: doc._id,
|
||||
});
|
||||
}
|
||||
|
||||
function publishCheckActivity(userId,doc){
|
||||
function publishCheckActivity(userId, doc){
|
||||
const card = Cards.findOne(doc.cardId);
|
||||
const boardId = card.boardId;
|
||||
let activityType;
|
||||
if(doc.isFinished){
|
||||
activityType = "checkedItem";
|
||||
activityType = 'checkedItem';
|
||||
}else{
|
||||
activityType = "uncheckedItem";
|
||||
activityType = 'uncheckedItem';
|
||||
}
|
||||
let act = {
|
||||
const act = {
|
||||
userId,
|
||||
activityType: activityType,
|
||||
activityType,
|
||||
cardId: doc.cardId,
|
||||
boardId,
|
||||
checklistId: doc.checklistId,
|
||||
checklistItemId: doc._id,
|
||||
checklistItemName:doc.title
|
||||
}
|
||||
checklistItemName:doc.title,
|
||||
};
|
||||
Activities.insert(act);
|
||||
}
|
||||
|
||||
function publishChekListCompleted(userId,doc,fieldNames,modifier){
|
||||
function publishChekListCompleted(userId, doc, fieldNames, modifier){
|
||||
const card = Cards.findOne(doc.cardId);
|
||||
const boardId = card.boardId;
|
||||
const checklistId = doc.checklistId;
|
||||
const checkList = Checklists.findOne({_id:checklistId});
|
||||
if(checkList.isFinished()){
|
||||
let act = {
|
||||
const act = {
|
||||
userId,
|
||||
activityType: "checklistCompleted",
|
||||
activityType: 'checklistCompleted',
|
||||
cardId: doc.cardId,
|
||||
boardId,
|
||||
checklistId: doc.checklistId,
|
||||
checklistName:doc.title
|
||||
}
|
||||
checklistName:doc.title,
|
||||
};
|
||||
Activities.insert(act);
|
||||
}
|
||||
}
|
||||
|
||||
function publishChekListUncompleted(userId,doc,fieldNames,modifier){
|
||||
function publishChekListUncompleted(userId, doc, fieldNames, modifier){
|
||||
const card = Cards.findOne(doc.cardId);
|
||||
const boardId = card.boardId;
|
||||
const checklistId = doc.checklistId;
|
||||
const checkList = Checklists.findOne({_id:checklistId});
|
||||
if(checkList.isFinished()){
|
||||
let act = {
|
||||
const act = {
|
||||
userId,
|
||||
activityType: "checklistUncompleted",
|
||||
activityType: 'checklistUncompleted',
|
||||
cardId: doc.cardId,
|
||||
boardId,
|
||||
checklistId: doc.checklistId,
|
||||
checklistName:doc.title
|
||||
}
|
||||
checklistName:doc.title,
|
||||
};
|
||||
Activities.insert(act);
|
||||
}
|
||||
}
|
||||
|
|
@ -161,16 +161,15 @@ if (Meteor.isServer) {
|
|||
});
|
||||
|
||||
ChecklistItems.after.update((userId, doc, fieldNames, modifier) => {
|
||||
publishCheckActivity(userId,doc);
|
||||
publishChekListCompleted(userId,doc,fieldNames,modifier)
|
||||
publishCheckActivity(userId, doc);
|
||||
publishChekListCompleted(userId, doc, fieldNames, modifier);
|
||||
});
|
||||
|
||||
ChecklistItems.before.update((userId, doc, fieldNames, modifier) => {
|
||||
publishChekListUncompleted(userId,doc,fieldNames,modifier)
|
||||
publishChekListUncompleted(userId, doc, fieldNames, modifier);
|
||||
});
|
||||
|
||||
|
||||
|
||||
ChecklistItems.after.insert((userId, doc) => {
|
||||
itemCreation(userId, doc);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ if (Meteor.isServer) {
|
|||
cardId: doc.cardId,
|
||||
boardId: Cards.findOne(doc.cardId).boardId,
|
||||
checklistId: doc._id,
|
||||
checklistName:doc.title
|
||||
checklistName:doc.title,
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -120,7 +120,7 @@ if (Meteor.isServer) {
|
|||
cardId: doc.cardId,
|
||||
boardId: Cards.findOne(doc.cardId).boardId,
|
||||
checklistId: doc._id,
|
||||
checklistName:doc.title
|
||||
checklistName:doc.title,
|
||||
});
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ if (Meteor.isServer) {
|
|||
if (exporter.canExport(user)) {
|
||||
JsonRoutes.sendResult(res, {
|
||||
code: 200,
|
||||
data: exporter.build()
|
||||
data: exporter.build(),
|
||||
});
|
||||
} else {
|
||||
// we could send an explicit error message, but on the other hand the only
|
||||
|
|
@ -52,16 +52,16 @@ class Exporter {
|
|||
// we do not want to retrieve boardId in related elements
|
||||
const noBoardId = {
|
||||
fields: {
|
||||
boardId: 0
|
||||
}
|
||||
boardId: 0,
|
||||
},
|
||||
};
|
||||
const result = {
|
||||
_format: 'wekan-board-1.0.0',
|
||||
};
|
||||
_.extend(result, Boards.findOne(this._boardId, {
|
||||
fields: {
|
||||
stars: 0
|
||||
}
|
||||
stars: 0,
|
||||
},
|
||||
}));
|
||||
result.lists = Lists.find(byBoard, noBoardId).fetch();
|
||||
result.cards = Cards.find(byBoardNoLinked, noBoardId).fetch();
|
||||
|
|
@ -77,21 +77,21 @@ class Exporter {
|
|||
result.actions = [];
|
||||
result.cards.forEach((card) => {
|
||||
result.checklists.push(...Checklists.find({
|
||||
cardId: card._id
|
||||
cardId: card._id,
|
||||
}).fetch());
|
||||
result.checklistItems.push(...ChecklistItems.find({
|
||||
cardId: card._id
|
||||
cardId: card._id,
|
||||
}).fetch());
|
||||
result.subtaskItems.push(...Cards.find({
|
||||
parentid: card._id
|
||||
parentid: card._id,
|
||||
}).fetch());
|
||||
});
|
||||
result.rules.forEach((rule) => {
|
||||
result.triggers.push(...Triggers.find({
|
||||
_id: rule.triggerId
|
||||
_id: rule.triggerId,
|
||||
}, noBoardId).fetch());
|
||||
result.actions.push(...Actions.find({
|
||||
_id: rule.actionId
|
||||
_id: rule.actionId,
|
||||
}, noBoardId).fetch());
|
||||
});
|
||||
|
||||
|
|
@ -154,8 +154,8 @@ class Exporter {
|
|||
});
|
||||
const byUserIds = {
|
||||
_id: {
|
||||
$in: Object.getOwnPropertyNames(users)
|
||||
}
|
||||
$in: Object.getOwnPropertyNames(users),
|
||||
},
|
||||
};
|
||||
// we use whitelist to be sure we do not expose inadvertently
|
||||
// some secret fields that gets added to User later.
|
||||
|
|
|
|||
|
|
@ -31,11 +31,10 @@ Rules.helpers({
|
|||
},
|
||||
getTrigger(){
|
||||
return Triggers.findOne({_id:this.triggerId});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
|
||||
Rules.allow({
|
||||
insert(userId, doc) {
|
||||
return allowIsBoardAdmin(userId, Boards.findOne(doc.boardId));
|
||||
|
|
@ -45,5 +44,5 @@ Rules.allow({
|
|||
},
|
||||
remove(userId, doc) {
|
||||
return allowIsBoardAdmin(userId, Boards.findOne(doc.boardId));
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ Triggers.mutations({
|
|||
rename(description) {
|
||||
return {
|
||||
$set: {
|
||||
description
|
||||
}
|
||||
description,
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
@ -19,7 +19,7 @@ Triggers.allow({
|
|||
},
|
||||
remove(userId, doc) {
|
||||
return allowIsBoardAdmin(userId, Boards.findOne(doc.boardId));
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Triggers.helpers({
|
||||
|
|
@ -30,7 +30,7 @@ Triggers.helpers({
|
|||
|
||||
getRule() {
|
||||
return Rules.findOne({
|
||||
triggerId: this._id
|
||||
triggerId: this._id,
|
||||
});
|
||||
},
|
||||
|
||||
|
|
@ -44,7 +44,7 @@ Triggers.helpers({
|
|||
|
||||
findList(title) {
|
||||
return Lists.findOne({
|
||||
title: title
|
||||
title,
|
||||
});
|
||||
},
|
||||
|
||||
|
|
@ -54,5 +54,5 @@ Triggers.helpers({
|
|||
return _.contains(this.labelIds, label._id);
|
||||
});
|
||||
return cardLabels;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
@ -224,8 +224,8 @@ export class WekanCreator {
|
|||
const boardId = Boards.direct.insert(boardToCreate);
|
||||
Boards.direct.update(boardId, {
|
||||
$set: {
|
||||
modifiedAt: this._now()
|
||||
}
|
||||
modifiedAt: this._now(),
|
||||
},
|
||||
});
|
||||
// log activity
|
||||
Activities.direct.insert({
|
||||
|
|
@ -373,15 +373,15 @@ export class WekanCreator {
|
|||
if (wekanCoverId === att._id) {
|
||||
Cards.direct.update(cardId, {
|
||||
$set: {
|
||||
coverId: wekanAtt._id
|
||||
}
|
||||
coverId: wekanAtt._id,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (att.file) {
|
||||
file.attachData(new Buffer(att.file, 'base64'), {
|
||||
type: att.type
|
||||
type: att.type,
|
||||
}, (error) => {
|
||||
file.name(att.name);
|
||||
file.boardId = boardId;
|
||||
|
|
@ -401,8 +401,8 @@ export class WekanCreator {
|
|||
if (wekanCoverId === att._id) {
|
||||
Cards.direct.update(cardId, {
|
||||
$set: {
|
||||
coverId: wekanAtt._id
|
||||
}
|
||||
coverId: wekanAtt._id,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -448,8 +448,8 @@ export class WekanCreator {
|
|||
const listId = Lists.direct.insert(listToCreate);
|
||||
Lists.direct.update(listId, {
|
||||
$set: {
|
||||
'updatedAt': this._now()
|
||||
}
|
||||
'updatedAt': this._now(),
|
||||
},
|
||||
});
|
||||
this.lists[list._id] = listId;
|
||||
// // log activity
|
||||
|
|
@ -485,8 +485,8 @@ export class WekanCreator {
|
|||
const swimlaneId = Swimlanes.direct.insert(swimlaneToCreate);
|
||||
Swimlanes.direct.update(swimlaneId, {
|
||||
$set: {
|
||||
'updatedAt': this._now()
|
||||
}
|
||||
'updatedAt': this._now(),
|
||||
},
|
||||
});
|
||||
this.swimlanes[swimlane._id] = swimlaneId;
|
||||
});
|
||||
|
|
@ -512,13 +512,13 @@ export class WekanCreator {
|
|||
createTriggers(wekanTriggers, boardId) {
|
||||
wekanTriggers.forEach((trigger, ruleIndex) => {
|
||||
if (trigger.hasOwnProperty('labelId')) {
|
||||
trigger['labelId'] = this.labels[trigger['labelId']]
|
||||
trigger.labelId = this.labels[trigger.labelId];
|
||||
}
|
||||
if (trigger.hasOwnProperty('memberId')) {
|
||||
trigger['memberId'] = this.members[trigger['memberId']]
|
||||
trigger.memberId = this.members[trigger.memberId];
|
||||
}
|
||||
trigger['boardId'] = boardId;
|
||||
const oldId = trigger['_id'];
|
||||
trigger.boardId = boardId;
|
||||
const oldId = trigger._id;
|
||||
delete trigger._id;
|
||||
this.triggers[oldId] = Triggers.direct.insert(trigger);
|
||||
});
|
||||
|
|
@ -527,13 +527,13 @@ export class WekanCreator {
|
|||
createActions(wekanActions, boardId) {
|
||||
wekanActions.forEach((action, ruleIndex) => {
|
||||
if (action.hasOwnProperty('labelId')) {
|
||||
action['labelId'] = this.labels[action['labelId']]
|
||||
action.labelId = this.labels[action.labelId];
|
||||
}
|
||||
if (action.hasOwnProperty('memberId')) {
|
||||
action['memberId'] = this.members[action['memberId']]
|
||||
action.memberId = this.members[action.memberId];
|
||||
}
|
||||
action['boardId'] = boardId;
|
||||
const oldId = action['_id'];
|
||||
action.boardId = boardId;
|
||||
const oldId = action._id;
|
||||
delete action._id;
|
||||
this.actions[oldId] = Actions.direct.insert(action);
|
||||
});
|
||||
|
|
@ -542,9 +542,9 @@ export class WekanCreator {
|
|||
createRules(wekanRules, boardId) {
|
||||
wekanRules.forEach((rule, ruleIndex) => {
|
||||
// Create the rule
|
||||
rule['boardId'] = boardId;
|
||||
rule['triggerId'] = this.triggers[rule['triggerId']];
|
||||
rule['actionId'] = this.actions[rule['actionId']];
|
||||
rule.boardId = boardId;
|
||||
rule.triggerId = this.triggers[rule.triggerId];
|
||||
rule.actionId = this.actions[rule.actionId];
|
||||
delete rule._id;
|
||||
Rules.direct.insert(rule);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
Meteor.publish('rules', (ruleId) => {
|
||||
check(ruleId, String);
|
||||
return Rules.find({
|
||||
_id: ruleId
|
||||
_id: ruleId,
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,99 +1,99 @@
|
|||
RulesHelper = {
|
||||
executeRules(activity){
|
||||
const matchingRules = this.findMatchingRules(activity);
|
||||
for(let i = 0;i< matchingRules.length;i++){
|
||||
for(let i = 0; i< matchingRules.length; i++){
|
||||
const action = matchingRules[i].getAction();
|
||||
this.performAction(activity,action);
|
||||
this.performAction(activity, action);
|
||||
}
|
||||
},
|
||||
findMatchingRules(activity){
|
||||
const activityType = activity.activityType;
|
||||
if(TriggersDef[activityType] == undefined){
|
||||
if(TriggersDef[activityType] === undefined){
|
||||
return [];
|
||||
}
|
||||
const matchingFields = TriggersDef[activityType].matchingFields;
|
||||
const matchingMap = this.buildMatchingFieldsMap(activity,matchingFields);
|
||||
let matchingTriggers = Triggers.find(matchingMap);
|
||||
let matchingRules = [];
|
||||
const matchingMap = this.buildMatchingFieldsMap(activity, matchingFields);
|
||||
const matchingTriggers = Triggers.find(matchingMap);
|
||||
const matchingRules = [];
|
||||
matchingTriggers.forEach(function(trigger){
|
||||
matchingRules.push(trigger.getRule());
|
||||
});
|
||||
return matchingRules;
|
||||
},
|
||||
buildMatchingFieldsMap(activity, matchingFields){
|
||||
let matchingMap = {"activityType":activity.activityType};
|
||||
for(let i = 0;i< matchingFields.length;i++){
|
||||
const matchingMap = {'activityType':activity.activityType};
|
||||
for(let i = 0; i< matchingFields.length; i++){
|
||||
// Creating a matching map with the actual field of the activity
|
||||
// and with the wildcard (for example: trigger when a card is added
|
||||
// in any [*] board
|
||||
matchingMap[matchingFields[i]] = { $in: [activity[matchingFields[i]],"*"]};
|
||||
matchingMap[matchingFields[i]] = { $in: [activity[matchingFields[i]], '*']};
|
||||
}
|
||||
return matchingMap;
|
||||
},
|
||||
performAction(activity,action){
|
||||
performAction(activity, action){
|
||||
const card = Cards.findOne({_id:activity.cardId});
|
||||
const boardId = activity.boardId;
|
||||
if(action.actionType == "moveCardToTop"){
|
||||
if(action.actionType === 'moveCardToTop'){
|
||||
let listId;
|
||||
let list;
|
||||
if(activity.listTitle == "*"){
|
||||
if(activity.listTitle === '*'){
|
||||
listId = card.swimlaneId;
|
||||
list = card.list();
|
||||
}else{
|
||||
list = Lists.findOne({title: action.listTitle, boardId:boardId });;
|
||||
list = Lists.findOne({title: action.listTitle, boardId });
|
||||
listId = list._id;
|
||||
}
|
||||
const minOrder = _.min(list.cards(card.swimlaneId).map((c) => c.sort));
|
||||
card.move(card.swimlaneId, listId, minOrder - 1);
|
||||
}
|
||||
if(action.actionType == "moveCardToBottom"){
|
||||
if(action.actionType === 'moveCardToBottom'){
|
||||
let listId;
|
||||
let list;
|
||||
if(activity.listTitle == "*"){
|
||||
if(activity.listTitle === '*'){
|
||||
listId = card.swimlaneId;
|
||||
list = card.list();
|
||||
}else{
|
||||
list = Lists.findOne({title: action.listTitle, boardId:boardId});
|
||||
list = Lists.findOne({title: action.listTitle, boardId});
|
||||
listId = list._id;
|
||||
}
|
||||
const maxOrder = _.max(list.cards(card.swimlaneId).map((c) => c.sort));
|
||||
card.move(card.swimlaneId, listId, maxOrder + 1);
|
||||
}
|
||||
if(action.actionType == "sendEmail"){
|
||||
if(action.actionType === 'sendEmail'){
|
||||
const emailTo = action.emailTo;
|
||||
const emailMsg = action.emailMsg;
|
||||
const emailSubject = action.emailSubject;
|
||||
try {
|
||||
Email.send({
|
||||
to: to,
|
||||
to,
|
||||
from: Accounts.emailTemplates.from,
|
||||
subject: subject,
|
||||
subject,
|
||||
text,
|
||||
});
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(action.actionType == "archive"){
|
||||
if(action.actionType === 'archive'){
|
||||
card.archive();
|
||||
}
|
||||
if(action.actionType == "unarchive"){
|
||||
if(action.actionType === 'unarchive'){
|
||||
card.restore();
|
||||
}
|
||||
if(action.actionType == "addLabel"){
|
||||
if(action.actionType === 'addLabel'){
|
||||
card.addLabel(action.labelId);
|
||||
}
|
||||
if(action.actionType == "removeLabel"){
|
||||
if(action.actionType === 'removeLabel'){
|
||||
card.removeLabel(action.labelId);
|
||||
}
|
||||
if(action.actionType == "addMember"){
|
||||
if(action.actionType === 'addMember'){
|
||||
const memberId = Users.findOne({username:action.memberName})._id;
|
||||
card.assignMember(memberId);
|
||||
}
|
||||
if(action.actionType == "removeMember"){
|
||||
if(action.memberName == "*"){
|
||||
if(action.actionType === 'removeMember'){
|
||||
if(action.memberName === '*'){
|
||||
const members = card.members;
|
||||
for(let i = 0;i< members.length;i++){
|
||||
for(let i = 0; i< members.length; i++){
|
||||
card.unassignMember(members[i]);
|
||||
}
|
||||
}else{
|
||||
|
|
@ -101,31 +101,31 @@ RulesHelper = {
|
|||
card.unassignMember(memberId);
|
||||
}
|
||||
}
|
||||
if(action.actionType == "checkAll"){
|
||||
const checkList = Checklists.findOne({"title":action.checklistName,"cardId":card._id});
|
||||
if(action.actionType === 'checkAll'){
|
||||
const checkList = Checklists.findOne({'title':action.checklistName, 'cardId':card._id});
|
||||
checkList.checkAllItems();
|
||||
}
|
||||
if(action.actionType == "uncheckAll"){
|
||||
const checkList = Checklists.findOne({"title":action.checklistName,"cardId":card._id});
|
||||
if(action.actionType === 'uncheckAll'){
|
||||
const checkList = Checklists.findOne({'title':action.checklistName, 'cardId':card._id});
|
||||
checkList.uncheckAllItems();
|
||||
}
|
||||
if(action.actionType == "checkItem"){
|
||||
const checkList = Checklists.findOne({"title":action.checklistName,"cardId":card._id});
|
||||
const checkItem = ChecklistItems.findOne({"title":action.checkItemName,"checkListId":checkList._id})
|
||||
if(action.actionType === 'checkItem'){
|
||||
const checkList = Checklists.findOne({'title':action.checklistName, 'cardId':card._id});
|
||||
const checkItem = ChecklistItems.findOne({'title':action.checkItemName, 'checkListId':checkList._id});
|
||||
checkItem.check();
|
||||
}
|
||||
if(action.actionType == "uncheckItem"){
|
||||
const checkList = Checklists.findOne({"title":action.checklistName,"cardId":card._id});
|
||||
const checkItem = ChecklistItems.findOne({"title":action.checkItemName,"checkListId":checkList._id})
|
||||
if(action.actionType === 'uncheckItem'){
|
||||
const checkList = Checklists.findOne({'title':action.checklistName, 'cardId':card._id});
|
||||
const checkItem = ChecklistItems.findOne({'title':action.checkItemName, 'checkListId':checkList._id});
|
||||
checkItem.uncheck();
|
||||
}
|
||||
if(action.actionType == "addChecklist"){
|
||||
Checklists.insert({"title":action.checklistName,"cardId":card._id,"sort":0});
|
||||
if(action.actionType === 'addChecklist'){
|
||||
Checklists.insert({'title':action.checklistName, 'cardId':card._id, 'sort':0});
|
||||
}
|
||||
if(action.actionType == "removeChecklist"){
|
||||
Checklists.remove({"title":action.checklistName,"cardId":card._id,"sort":0});
|
||||
if(action.actionType === 'removeChecklist'){
|
||||
Checklists.remove({'title':action.checklistName, 'cardId':card._id, 'sort':0});
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,59 +1,58 @@
|
|||
TriggersDef = {
|
||||
createCard:{
|
||||
matchingFields: ["boardId", "listName"]
|
||||
matchingFields: ['boardId', 'listName'],
|
||||
},
|
||||
moveCard:{
|
||||
matchingFields: ["boardId", "listName", "oldListName"]
|
||||
matchingFields: ['boardId', 'listName', 'oldListName'],
|
||||
},
|
||||
archivedCard:{
|
||||
matchingFields: ["boardId"]
|
||||
matchingFields: ['boardId'],
|
||||
},
|
||||
restoredCard:{
|
||||
matchingFields: ["boardId"]
|
||||
matchingFields: ['boardId'],
|
||||
},
|
||||
joinMember:{
|
||||
matchingFields: ["boardId","memberId"]
|
||||
matchingFields: ['boardId', 'memberId'],
|
||||
},
|
||||
unjoinMember:{
|
||||
matchingFields: ["boardId","memberId"]
|
||||
matchingFields: ['boardId', 'memberId'],
|
||||
},
|
||||
addChecklist:{
|
||||
matchingFields: ["boardId","checklistName"]
|
||||
matchingFields: ['boardId', 'checklistName'],
|
||||
},
|
||||
removeChecklist:{
|
||||
matchingFields: ["boardId","checklistName"]
|
||||
matchingFields: ['boardId', 'checklistName'],
|
||||
},
|
||||
completeChecklist:{
|
||||
matchingFields: ["boardId","checklistName"]
|
||||
matchingFields: ['boardId', 'checklistName'],
|
||||
},
|
||||
uncompleteChecklist:{
|
||||
matchingFields: ["boardId","checklistName"]
|
||||
matchingFields: ['boardId', 'checklistName'],
|
||||
},
|
||||
addedChecklistItem:{
|
||||
matchingFields: ["boardId","checklistItemName"]
|
||||
matchingFields: ['boardId', 'checklistItemName'],
|
||||
},
|
||||
removedChecklistItem:{
|
||||
matchingFields: ["boardId","checklistItemName"]
|
||||
matchingFields: ['boardId', 'checklistItemName'],
|
||||
},
|
||||
checkedItem:{
|
||||
matchingFields: ["boardId","checklistItemName"]
|
||||
matchingFields: ['boardId', 'checklistItemName'],
|
||||
},
|
||||
uncheckedItem:{
|
||||
matchingFields: ["boardId","checklistItemName"]
|
||||
matchingFields: ['boardId', 'checklistItemName'],
|
||||
},
|
||||
addAttachment:{
|
||||
matchingFields: ["boardId"]
|
||||
matchingFields: ['boardId'],
|
||||
},
|
||||
deleteAttachment:{
|
||||
matchingFields: ["boardId"]
|
||||
matchingFields: ['boardId'],
|
||||
},
|
||||
addedLabel:{
|
||||
matchingFields: ["boardId","labelId"]
|
||||
matchingFields: ['boardId', 'labelId'],
|
||||
},
|
||||
removedLabel:{
|
||||
matchingFields: ["boardId","labelId"]
|
||||
}
|
||||
}
|
||||
|
||||
matchingFields: ['boardId', 'labelId'],
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue