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": {
|
"rules": {
|
||||||
"strict": 0,
|
"strict": 0,
|
||||||
"no-undef": 2,
|
"no-undef": 0,
|
||||||
"accessor-pairs": 2,
|
"accessor-pairs": 2,
|
||||||
"comma-dangle": [2, "always-multiline"],
|
"comma-dangle": [2, "always-multiline"],
|
||||||
"consistent-return": 2,
|
"consistent-return": 2,
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ BlazeComponent.extendComponent({
|
||||||
this.loadNextPageLocked = true;
|
this.loadNextPageLocked = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
checkItem(){
|
checkItem(){
|
||||||
const checkItemId = this.currentData().checklistItemId;
|
const checkItemId = this.currentData().checklistItemId;
|
||||||
const checkItem = ChecklistItems.findOne({_id:checkItemId});
|
const checkItem = ChecklistItems.findOne({_id:checkItemId});
|
||||||
|
|
@ -75,7 +75,7 @@ BlazeComponent.extendComponent({
|
||||||
lastLabel(){
|
lastLabel(){
|
||||||
const lastLabelId = this.currentData().labelId;
|
const lastLabelId = this.currentData().labelId;
|
||||||
const lastLabel = Boards.findOne(Session.get('currentBoard')).getLabelById(lastLabelId);
|
const lastLabel = Boards.findOne(Session.get('currentBoard')).getLabelById(lastLabelId);
|
||||||
if(lastLabel.name == undefined || lastLabel.name == ""){
|
if(lastLabel.name === undefined || lastLabel.name === ''){
|
||||||
return lastLabel.color;
|
return lastLabel.color;
|
||||||
}else{
|
}else{
|
||||||
return lastLabel.name;
|
return lastLabel.name;
|
||||||
|
|
|
||||||
|
|
@ -2,28 +2,28 @@ template(name="boardActions")
|
||||||
div.trigger-item
|
div.trigger-item
|
||||||
div.trigger-content
|
div.trigger-content
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-move-card-to'}}}
|
| {{_'r-move-card-to'}}
|
||||||
div.trigger-dropdown
|
div.trigger-dropdown
|
||||||
select(id="move-gen-action")
|
select(id="move-gen-action")
|
||||||
option(value="top") {{{_'r-top-of'}}}
|
option(value="top") {{_'r-top-of'}}
|
||||||
option(value="bottom") {{{_'r-bottom-of'}}}
|
option(value="bottom") {{_'r-bottom-of'}}
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-its-list'}}}
|
| {{_'r-its-list'}}
|
||||||
div.trigger-button.js-add-gen-move-action.js-goto-rules
|
div.trigger-button.js-add-gen-move-action.js-goto-rules
|
||||||
i.fa.fa-plus
|
i.fa.fa-plus
|
||||||
|
|
||||||
div.trigger-item
|
div.trigger-item
|
||||||
div.trigger-content
|
div.trigger-content
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-move-card-to'}}}
|
| {{_'r-move-card-to'}}
|
||||||
div.trigger-dropdown
|
div.trigger-dropdown
|
||||||
select(id="move-spec-action")
|
select(id="move-spec-action")
|
||||||
option(value="top") {{{_'r-top-of'}}}
|
option(value="top") {{_'r-top-of'}}
|
||||||
option(value="bottom") {{{_'r-bottom-of'}}}
|
option(value="bottom") {{_'r-bottom-of'}}
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-list'}}}
|
| {{_'r-list'}}
|
||||||
div.trigger-dropdown
|
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
|
div.trigger-button.js-add-spec-move-action.js-goto-rules
|
||||||
i.fa.fa-plus
|
i.fa.fa-plus
|
||||||
|
|
||||||
|
|
@ -31,10 +31,10 @@ template(name="boardActions")
|
||||||
div.trigger-content
|
div.trigger-content
|
||||||
div.trigger-dropdown
|
div.trigger-dropdown
|
||||||
select(id="arch-action")
|
select(id="arch-action")
|
||||||
option(value="archive") {{{_'r-archive'}}}
|
option(value="archive") {{_'r-archive'}}
|
||||||
option(value="unarchive") {{{_'r-unarchive'}}}
|
option(value="unarchive") {{_'r-unarchive'}}
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-card'}}}
|
| {{_'r-card'}}
|
||||||
div.trigger-button.js-add-arch-action.js-goto-rules
|
div.trigger-button.js-add-arch-action.js-goto-rules
|
||||||
i.fa.fa-plus
|
i.fa.fa-plus
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,34 +12,34 @@ BlazeComponent.extendComponent({
|
||||||
const listTitle = this.find('#listName').value;
|
const listTitle = this.find('#listName').value;
|
||||||
const boardId = Session.get('currentBoard');
|
const boardId = Session.get('currentBoard');
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
if (actionSelected == "top") {
|
if (actionSelected === 'top') {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({
|
const actionId = Actions.insert({
|
||||||
actionType: "moveCardToTop",
|
actionType: 'moveCardToTop',
|
||||||
"listTitle": listTitle,
|
listTitle,
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
Rules.insert({
|
Rules.insert({
|
||||||
title: ruleName,
|
title: ruleName,
|
||||||
triggerId: triggerId,
|
triggerId,
|
||||||
actionId: actionId,
|
actionId,
|
||||||
"boardId": boardId
|
boardId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "bottom") {
|
if (actionSelected === 'bottom') {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({
|
const actionId = Actions.insert({
|
||||||
actionType: "moveCardToBottom",
|
actionType: 'moveCardToBottom',
|
||||||
"listTitle": listTitle,
|
listTitle,
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
Rules.insert({
|
Rules.insert({
|
||||||
title: ruleName,
|
title: ruleName,
|
||||||
triggerId: triggerId,
|
triggerId,
|
||||||
actionId: actionId,
|
actionId,
|
||||||
"boardId": boardId
|
boardId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -49,34 +49,34 @@ BlazeComponent.extendComponent({
|
||||||
const ruleName = this.data().ruleName.get();
|
const ruleName = this.data().ruleName.get();
|
||||||
const trigger = this.data().triggerVar.get();
|
const trigger = this.data().triggerVar.get();
|
||||||
const actionSelected = this.find('#move-gen-action').value;
|
const actionSelected = this.find('#move-gen-action').value;
|
||||||
if (actionSelected == "top") {
|
if (actionSelected === 'top') {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({
|
const actionId = Actions.insert({
|
||||||
actionType: "moveCardToTop",
|
actionType: 'moveCardToTop',
|
||||||
"listTitle": "*",
|
'listTitle': '*',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
Rules.insert({
|
Rules.insert({
|
||||||
title: ruleName,
|
title: ruleName,
|
||||||
triggerId: triggerId,
|
triggerId,
|
||||||
actionId: actionId,
|
actionId,
|
||||||
"boardId": boardId
|
boardId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "bottom") {
|
if (actionSelected === 'bottom') {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({
|
const actionId = Actions.insert({
|
||||||
actionType: "moveCardToBottom",
|
actionType: 'moveCardToBottom',
|
||||||
"listTitle": "*",
|
'listTitle': '*',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
Rules.insert({
|
Rules.insert({
|
||||||
title: ruleName,
|
title: ruleName,
|
||||||
triggerId: triggerId,
|
triggerId,
|
||||||
actionId: actionId,
|
actionId,
|
||||||
"boardId": boardId
|
boardId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -86,36 +86,37 @@ BlazeComponent.extendComponent({
|
||||||
const ruleName = this.data().ruleName.get();
|
const ruleName = this.data().ruleName.get();
|
||||||
const trigger = this.data().triggerVar.get();
|
const trigger = this.data().triggerVar.get();
|
||||||
const actionSelected = this.find('#arch-action').value;
|
const actionSelected = this.find('#arch-action').value;
|
||||||
if (actionSelected == "archive") {
|
if (actionSelected === 'archive') {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({
|
const actionId = Actions.insert({
|
||||||
actionType: "archive",
|
actionType: 'archive',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
Rules.insert({
|
Rules.insert({
|
||||||
title: ruleName,
|
title: ruleName,
|
||||||
triggerId: triggerId,
|
triggerId,
|
||||||
actionId: actionId,
|
actionId,
|
||||||
"boardId": boardId
|
boardId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "unarchive") {
|
if (actionSelected === 'unarchive') {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({
|
const actionId = Actions.insert({
|
||||||
actionType: "unarchive",
|
actionType: 'unarchive',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
Rules.insert({
|
Rules.insert({
|
||||||
title: ruleName,
|
title: ruleName,
|
||||||
triggerId: triggerId,
|
triggerId,
|
||||||
actionId: actionId,
|
actionId,
|
||||||
"boardId": boardId
|
boardId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}];
|
}];
|
||||||
},
|
},
|
||||||
|
|
||||||
}).register('boardActions');
|
}).register('boardActions');
|
||||||
|
/* eslint-no-undef */
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,10 @@ BlazeComponent.extendComponent({
|
||||||
labels() {
|
labels() {
|
||||||
const labels = Boards.findOne(Session.get('currentBoard')).labels;
|
const labels = Boards.findOne(Session.get('currentBoard')).labels;
|
||||||
for (let i = 0; i < labels.length; i++) {
|
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();
|
labels[i].name = labels[i].color.toUpperCase();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(labels);
|
|
||||||
return labels;
|
return labels;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -23,34 +22,34 @@ BlazeComponent.extendComponent({
|
||||||
const labelId = this.find('#label-id').value;
|
const labelId = this.find('#label-id').value;
|
||||||
const boardId = Session.get('currentBoard');
|
const boardId = Session.get('currentBoard');
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
if (actionSelected == "add") {
|
if (actionSelected === 'add') {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({
|
const actionId = Actions.insert({
|
||||||
actionType: "addLabel",
|
actionType: 'addLabel',
|
||||||
"labelId": labelId,
|
labelId,
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
Rules.insert({
|
Rules.insert({
|
||||||
title: ruleName,
|
title: ruleName,
|
||||||
triggerId: triggerId,
|
triggerId,
|
||||||
actionId: actionId,
|
actionId,
|
||||||
"boardId": boardId
|
boardId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "remove") {
|
if (actionSelected === 'remove') {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({
|
const actionId = Actions.insert({
|
||||||
actionType: "removeLabel",
|
actionType: 'removeLabel',
|
||||||
"labelId": labelId,
|
labelId,
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
Rules.insert({
|
Rules.insert({
|
||||||
title: ruleName,
|
title: ruleName,
|
||||||
triggerId: triggerId,
|
triggerId,
|
||||||
actionId: actionId,
|
actionId,
|
||||||
"boardId": boardId
|
boardId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -62,35 +61,35 @@ BlazeComponent.extendComponent({
|
||||||
const memberName = this.find('#member-name').value;
|
const memberName = this.find('#member-name').value;
|
||||||
const boardId = Session.get('currentBoard');
|
const boardId = Session.get('currentBoard');
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
if (actionSelected == "add") {
|
if (actionSelected === 'add') {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({
|
const actionId = Actions.insert({
|
||||||
actionType: "addMember",
|
actionType: 'addMember',
|
||||||
"memberName": memberName,
|
memberName,
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
Rules.insert({
|
Rules.insert({
|
||||||
title: ruleName,
|
title: ruleName,
|
||||||
triggerId: triggerId,
|
triggerId,
|
||||||
actionId: actionId,
|
actionId,
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "remove") {
|
if (actionSelected === 'remove') {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({
|
const actionId = Actions.insert({
|
||||||
actionType: "removeMember",
|
actionType: 'removeMember',
|
||||||
"memberName": memberName,
|
memberName,
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
Rules.insert({
|
Rules.insert({
|
||||||
title: ruleName,
|
title: ruleName,
|
||||||
triggerId: triggerId,
|
triggerId,
|
||||||
actionId: actionId,
|
actionId,
|
||||||
"boardId": boardId
|
boardId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -101,19 +100,19 @@ BlazeComponent.extendComponent({
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
const boardId = Session.get('currentBoard');
|
const boardId = Session.get('currentBoard');
|
||||||
const actionId = Actions.insert({
|
const actionId = Actions.insert({
|
||||||
actionType: "removeMember",
|
actionType: 'removeMember',
|
||||||
"memberName": "*",
|
'memberName': '*',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
Rules.insert({
|
Rules.insert({
|
||||||
title: ruleName,
|
title: ruleName,
|
||||||
triggerId: triggerId,
|
triggerId,
|
||||||
actionId: actionId,
|
actionId,
|
||||||
"boardId": boardId
|
boardId,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
}];
|
}];
|
||||||
},
|
},
|
||||||
|
|
||||||
}).register('cardActions');
|
}).register('cardActions');
|
||||||
|
|
|
||||||
|
|
@ -11,34 +11,34 @@ BlazeComponent.extendComponent({
|
||||||
const checklistName = this.find('#checklist-name').value;
|
const checklistName = this.find('#checklist-name').value;
|
||||||
const boardId = Session.get('currentBoard');
|
const boardId = Session.get('currentBoard');
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
if (actionSelected == "add") {
|
if (actionSelected === 'add') {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({
|
const actionId = Actions.insert({
|
||||||
actionType: "addChecklist",
|
actionType: 'addChecklist',
|
||||||
"checklistName": checklistName,
|
checklistName,
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
Rules.insert({
|
Rules.insert({
|
||||||
title: ruleName,
|
title: ruleName,
|
||||||
triggerId: triggerId,
|
triggerId,
|
||||||
actionId: actionId,
|
actionId,
|
||||||
"boardId": boardId
|
boardId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "remove") {
|
if (actionSelected === 'remove') {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({
|
const actionId = Actions.insert({
|
||||||
actionType: "removeChecklist",
|
actionType: 'removeChecklist',
|
||||||
"checklistName": checklistName,
|
checklistName,
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
Rules.insert({
|
Rules.insert({
|
||||||
title: ruleName,
|
title: ruleName,
|
||||||
triggerId: triggerId,
|
triggerId,
|
||||||
actionId: actionId,
|
actionId,
|
||||||
"boardId": boardId
|
boardId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -50,79 +50,79 @@ BlazeComponent.extendComponent({
|
||||||
const checklistName = this.find('#checklist-name2').value;
|
const checklistName = this.find('#checklist-name2').value;
|
||||||
const boardId = Session.get('currentBoard');
|
const boardId = Session.get('currentBoard');
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
if (actionSelected == "check") {
|
if (actionSelected === 'check') {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({
|
const actionId = Actions.insert({
|
||||||
actionType: "checkAll",
|
actionType: 'checkAll',
|
||||||
"checklistName": checklistName,
|
checklistName,
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
Rules.insert({
|
Rules.insert({
|
||||||
title: ruleName,
|
title: ruleName,
|
||||||
triggerId: triggerId,
|
triggerId,
|
||||||
actionId: actionId,
|
actionId,
|
||||||
"boardId": boardId
|
boardId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "uncheck") {
|
if (actionSelected === 'uncheck') {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({
|
const actionId = Actions.insert({
|
||||||
actionType: "uncheckAll",
|
actionType: 'uncheckAll',
|
||||||
"checklistName": checklistName,
|
checklistName,
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
Rules.insert({
|
Rules.insert({
|
||||||
title: ruleName,
|
title: ruleName,
|
||||||
triggerId: triggerId,
|
triggerId,
|
||||||
actionId: actionId,
|
actionId,
|
||||||
"boardId": boardId
|
boardId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-add-check-item-action' (event) {
|
'click .js-add-check-item-action' (event) {
|
||||||
const ruleName = this.data().ruleName.get();
|
const ruleName = this.data().ruleName.get();
|
||||||
const trigger = this.data().triggerVar.get();
|
const trigger = this.data().triggerVar.get();
|
||||||
const checkItemName = this.find("#checkitem-name");
|
const checkItemName = this.find('#checkitem-name');
|
||||||
const checklistName = this.find("#checklist-name3");
|
const checklistName = this.find('#checklist-name3');
|
||||||
const actionSelected = this.find('#check-item-action').value;
|
const actionSelected = this.find('#check-item-action').value;
|
||||||
const boardId = Session.get('currentBoard');
|
const boardId = Session.get('currentBoard');
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
if (actionSelected == "check") {
|
if (actionSelected === 'check') {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({
|
const actionId = Actions.insert({
|
||||||
actionType: "checkItem",
|
actionType: 'checkItem',
|
||||||
"checklistName": checklistName,
|
checklistName,
|
||||||
"checkItemName": checkItemName,
|
checkItemName,
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
Rules.insert({
|
Rules.insert({
|
||||||
title: ruleName,
|
title: ruleName,
|
||||||
triggerId: triggerId,
|
triggerId,
|
||||||
actionId: actionId,
|
actionId,
|
||||||
"boardId": boardId
|
boardId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "uncheck") {
|
if (actionSelected === 'uncheck') {
|
||||||
const triggerId = Triggers.insert(trigger);
|
const triggerId = Triggers.insert(trigger);
|
||||||
const actionId = Actions.insert({
|
const actionId = Actions.insert({
|
||||||
actionType: "uncheckItem",
|
actionType: 'uncheckItem',
|
||||||
"checklistName": checklistName,
|
checklistName,
|
||||||
"checkItemName": checkItemName,
|
checkItemName,
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
Rules.insert({
|
Rules.insert({
|
||||||
title: ruleName,
|
title: ruleName,
|
||||||
triggerId: triggerId,
|
triggerId,
|
||||||
actionId: actionId,
|
actionId,
|
||||||
"boardId": boardId
|
boardId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}];
|
}];
|
||||||
},
|
},
|
||||||
|
|
||||||
}).register('checklistActions');
|
}).register('checklistActions');
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@ template(name="mailActions")
|
||||||
div.trigger-item.trigger-item-mail
|
div.trigger-item.trigger-item-mail
|
||||||
div.trigger-content.trigger-content-mail
|
div.trigger-content.trigger-content-mail
|
||||||
div.trigger-text.trigger-text-email
|
div.trigger-text.trigger-text-email
|
||||||
| {{{_'r-send-email'}}}
|
| {{_'r-send-email'}}
|
||||||
div.trigger-dropdown-mail
|
div.trigger-dropdown-mail
|
||||||
input(id="email-to",type=text,placeholder="{{{_'r-to'}}}")
|
input(id="email-to",type=text,placeholder="{{_'r-to'}}")
|
||||||
input(id="email-subject",type=text,placeholder="{{{_'r-subject'}}}")
|
input(id="email-subject",type=text,placeholder="{{_'r-subject'}}")
|
||||||
textarea(id="email-msg")
|
textarea(id="email-msg")
|
||||||
div.trigger-button.trigger-button-email.js-mail-action.js-goto-rules
|
div.trigger-button.trigger-button-email.js-mail-action.js-goto-rules
|
||||||
i.fa.fa-plus
|
i.fa.fa-plus
|
||||||
|
|
|
||||||
|
|
@ -15,21 +15,21 @@ BlazeComponent.extendComponent({
|
||||||
const boardId = Session.get('currentBoard');
|
const boardId = Session.get('currentBoard');
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
const actionId = Actions.insert({
|
const actionId = Actions.insert({
|
||||||
actionType: "sendEmail",
|
actionType: 'sendEmail',
|
||||||
"emailTo": emailTo,
|
emailTo,
|
||||||
"emailSubject": emailSubject,
|
emailSubject,
|
||||||
"emailMsg": emailMsg,
|
emailMsg,
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
Rules.insert({
|
Rules.insert({
|
||||||
title: ruleName,
|
title: ruleName,
|
||||||
triggerId: triggerId,
|
triggerId,
|
||||||
actionId: actionId,
|
actionId,
|
||||||
"boardId": boardId
|
boardId,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
}];
|
}];
|
||||||
},
|
},
|
||||||
|
|
||||||
}).register('mailActions');
|
}).register('mailActions');
|
||||||
|
|
|
||||||
|
|
@ -9,23 +9,21 @@ BlazeComponent.extendComponent({
|
||||||
trigger() {
|
trigger() {
|
||||||
const ruleId = this.data().ruleId;
|
const ruleId = this.data().ruleId;
|
||||||
const rule = Rules.findOne({
|
const rule = Rules.findOne({
|
||||||
_id: ruleId.get()
|
_id: ruleId.get(),
|
||||||
});
|
});
|
||||||
const trigger = Triggers.findOne({
|
const trigger = Triggers.findOne({
|
||||||
_id: rule.triggerId
|
_id: rule.triggerId,
|
||||||
});
|
});
|
||||||
console.log(trigger);
|
|
||||||
return trigger.description();
|
return trigger.description();
|
||||||
},
|
},
|
||||||
action() {
|
action() {
|
||||||
const ruleId = this.data().ruleId;
|
const ruleId = this.data().ruleId;
|
||||||
const rule = Rules.findOne({
|
const rule = Rules.findOne({
|
||||||
_id: ruleId.get()
|
_id: ruleId.get(),
|
||||||
});
|
});
|
||||||
const action = Actions.findOne({
|
const action = Actions.findOne({
|
||||||
_id: rule.actionId
|
_id: rule.actionId,
|
||||||
});
|
});
|
||||||
console.log(action);
|
|
||||||
return action.description();
|
return action.description();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -33,4 +31,4 @@ BlazeComponent.extendComponent({
|
||||||
return [{}];
|
return [{}];
|
||||||
},
|
},
|
||||||
|
|
||||||
}).register('ruleDetails');
|
}).register('ruleDetails');
|
||||||
|
|
|
||||||
|
|
@ -1,31 +1,31 @@
|
||||||
BlazeComponent.extendComponent({
|
BlazeComponent.extendComponent({
|
||||||
onCreated() {
|
onCreated() {
|
||||||
this.currentActions = new ReactiveVar("board");
|
this.currentActions = new ReactiveVar('board');
|
||||||
},
|
},
|
||||||
|
|
||||||
setBoardActions() {
|
setBoardActions() {
|
||||||
this.currentActions.set("board");
|
this.currentActions.set('board');
|
||||||
$('.js-set-card-actions').removeClass('active');
|
$('.js-set-card-actions').removeClass('active');
|
||||||
$('.js-set-board-actions').addClass('active');
|
$('.js-set-board-actions').addClass('active');
|
||||||
$('.js-set-checklist-actions').removeClass('active');
|
$('.js-set-checklist-actions').removeClass('active');
|
||||||
$('.js-set-mail-actions').removeClass('active');
|
$('.js-set-mail-actions').removeClass('active');
|
||||||
},
|
},
|
||||||
setCardActions() {
|
setCardActions() {
|
||||||
this.currentActions.set("card");
|
this.currentActions.set('card');
|
||||||
$('.js-set-card-actions').addClass('active');
|
$('.js-set-card-actions').addClass('active');
|
||||||
$('.js-set-board-actions').removeClass('active');
|
$('.js-set-board-actions').removeClass('active');
|
||||||
$('.js-set-checklist-actions').removeClass('active');
|
$('.js-set-checklist-actions').removeClass('active');
|
||||||
$('.js-set-mail-actions').removeClass('active');
|
$('.js-set-mail-actions').removeClass('active');
|
||||||
},
|
},
|
||||||
setChecklistActions() {
|
setChecklistActions() {
|
||||||
this.currentActions.set("checklist");
|
this.currentActions.set('checklist');
|
||||||
$('.js-set-card-actions').removeClass('active');
|
$('.js-set-card-actions').removeClass('active');
|
||||||
$('.js-set-board-actions').removeClass('active');
|
$('.js-set-board-actions').removeClass('active');
|
||||||
$('.js-set-checklist-actions').addClass('active');
|
$('.js-set-checklist-actions').addClass('active');
|
||||||
$('.js-set-mail-actions').removeClass('active');
|
$('.js-set-mail-actions').removeClass('active');
|
||||||
},
|
},
|
||||||
setMailActions() {
|
setMailActions() {
|
||||||
this.currentActions.set("mail");
|
this.currentActions.set('mail');
|
||||||
$('.js-set-card-actions').removeClass('active');
|
$('.js-set-card-actions').removeClass('active');
|
||||||
$('.js-set-board-actions').removeClass('active');
|
$('.js-set-board-actions').removeClass('active');
|
||||||
$('.js-set-checklist-actions').removeClass('active');
|
$('.js-set-checklist-actions').removeClass('active');
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,10 @@ BlazeComponent.extendComponent({
|
||||||
rules() {
|
rules() {
|
||||||
const boardId = Session.get('currentBoard');
|
const boardId = Session.get('currentBoard');
|
||||||
return Rules.find({
|
return Rules.find({
|
||||||
"boardId": boardId
|
boardId,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
events() {
|
events() {
|
||||||
return [{}];
|
return [{}];
|
||||||
},
|
},
|
||||||
}).register('rulesList');
|
}).register('rulesList');
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,25 @@
|
||||||
BlazeComponent.extendComponent({
|
BlazeComponent.extendComponent({
|
||||||
onCreated() {
|
onCreated() {
|
||||||
this.rulesCurrentTab = new ReactiveVar("rulesList")
|
this.rulesCurrentTab = new ReactiveVar('rulesList');
|
||||||
this.ruleName = new ReactiveVar("");
|
this.ruleName = new ReactiveVar('');
|
||||||
this.triggerVar = new ReactiveVar();
|
this.triggerVar = new ReactiveVar();
|
||||||
this.ruleId = new ReactiveVar();
|
this.ruleId = new ReactiveVar();
|
||||||
},
|
},
|
||||||
|
|
||||||
setTrigger() {
|
setTrigger() {
|
||||||
this.rulesCurrentTab.set("trigger")
|
this.rulesCurrentTab.set('trigger');
|
||||||
},
|
},
|
||||||
|
|
||||||
setRulesList() {
|
setRulesList() {
|
||||||
this.rulesCurrentTab.set("rulesList")
|
this.rulesCurrentTab.set('rulesList');
|
||||||
},
|
},
|
||||||
|
|
||||||
setAction() {
|
setAction() {
|
||||||
this.rulesCurrentTab.set("action")
|
this.rulesCurrentTab.set('action');
|
||||||
},
|
},
|
||||||
|
|
||||||
setRuleDetails() {
|
setRuleDetails() {
|
||||||
this.rulesCurrentTab.set("ruleDetails")
|
this.rulesCurrentTab.set('ruleDetails');
|
||||||
},
|
},
|
||||||
|
|
||||||
events() {
|
events() {
|
||||||
|
|
@ -33,8 +34,8 @@ BlazeComponent.extendComponent({
|
||||||
'click .js-goto-trigger' (event) {
|
'click .js-goto-trigger' (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const ruleTitle = this.find('#ruleTitle').value;
|
const ruleTitle = this.find('#ruleTitle').value;
|
||||||
this.find('#ruleTitle').value = "";
|
this.find('#ruleTitle').value = '';
|
||||||
this.ruleName.set(ruleTitle)
|
this.ruleName.set(ruleTitle);
|
||||||
this.setTrigger();
|
this.setTrigger();
|
||||||
},
|
},
|
||||||
'click .js-goto-action' (event) {
|
'click .js-goto-action' (event) {
|
||||||
|
|
@ -48,11 +49,11 @@ BlazeComponent.extendComponent({
|
||||||
'click .js-goto-details' (event) {
|
'click .js-goto-details' (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const rule = this.currentData();
|
const rule = this.currentData();
|
||||||
this.ruleId.set(rule._id)
|
this.ruleId.set(rule._id);
|
||||||
this.setRuleDetails();
|
this.setRuleDetails();
|
||||||
},
|
},
|
||||||
|
|
||||||
}];
|
}];
|
||||||
},
|
},
|
||||||
|
|
||||||
}).register('rulesMain');
|
}).register('rulesMain');
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
|
|
||||||
name() {
|
name() {
|
||||||
console.log(this.data());
|
// console.log(this.data());
|
||||||
},
|
},
|
||||||
events() {
|
events() {
|
||||||
return [{
|
return [{
|
||||||
|
|
@ -50,4 +50,4 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
}];
|
}];
|
||||||
},
|
},
|
||||||
}).register('rulesTriggers');
|
}).register('rulesTriggers');
|
||||||
|
|
|
||||||
|
|
@ -2,54 +2,54 @@ template(name="boardTriggers")
|
||||||
div.trigger-item
|
div.trigger-item
|
||||||
div.trigger-content
|
div.trigger-content
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-when-a-card-is'}}}
|
| {{_'r-when-a-card-is'}}
|
||||||
div.trigger-dropdown
|
div.trigger-dropdown
|
||||||
select(id="gen-action")
|
select(id="gen-action")
|
||||||
option(value="created") {{{_'r-added-to'}}}
|
option(value="created") {{_'r-added-to'}}
|
||||||
option(value="removed") {{{_'r-removed-from'}}}
|
option(value="removed") {{_'r-removed-from'}}
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-the-board'}}}
|
| {{_'r-the-board'}}
|
||||||
div.trigger-button.js-add-gen-trigger.js-goto-action
|
div.trigger-button.js-add-gen-trigger.js-goto-action
|
||||||
i.fa.fa-plus
|
i.fa.fa-plus
|
||||||
|
|
||||||
div.trigger-item
|
div.trigger-item
|
||||||
div.trigger-content
|
div.trigger-content
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-when-a-card-is'}}}
|
| {{_'r-when-a-card-is'}}
|
||||||
div.trigger-dropdown
|
div.trigger-dropdown
|
||||||
select(id="create-action")
|
select(id="create-action")
|
||||||
option(value="created") {{{_'r-added-to'}}}
|
option(value="created") {{_'r-added-to'}}
|
||||||
option(value="removed") {{{_'r-removed-from'}}}
|
option(value="removed") {{_'r-removed-from'}}
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-list'}}}
|
| {{_'r-list'}}
|
||||||
div.trigger-dropdown
|
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
|
div.trigger-button.js-add-create-trigger.js-goto-action
|
||||||
i.fa.fa-plus
|
i.fa.fa-plus
|
||||||
|
|
||||||
div.trigger-item
|
div.trigger-item
|
||||||
div.trigger-content
|
div.trigger-content
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-when-a-card-is'}}}
|
| {{_'r-when-a-card-is'}}
|
||||||
div.trigger-dropdown
|
div.trigger-dropdown
|
||||||
select(id="move-action")
|
select(id="move-action")
|
||||||
option(value="moved-to") {{{_'r-moved-to'}}}
|
option(value="moved-to") {{_'r-moved-to'}}
|
||||||
option(value="moved-from") {{{_'r-moved-from'}}}
|
option(value="moved-from") {{_'r-moved-from'}}
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-list'}}}
|
| {{_'r-list'}}
|
||||||
div.trigger-dropdown
|
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
|
div.trigger-button.js-add-moved-trigger.js-goto-action
|
||||||
i.fa.fa-plus
|
i.fa.fa-plus
|
||||||
|
|
||||||
div.trigger-item
|
div.trigger-item
|
||||||
div.trigger-content
|
div.trigger-content
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-when-a-card-is'}}}
|
| {{_'r-when-a-card-is'}}
|
||||||
div.trigger-dropdown
|
div.trigger-dropdown
|
||||||
select(id="arch-action")
|
select(id="arch-action")
|
||||||
option(value="archived") {{{_'r-archived'}}}
|
option(value="archived") {{_'r-archived'}}
|
||||||
option(value="unarchived") {{{_'r-unarchived'}}}
|
option(value="unarchived") {{_'r-unarchived'}}
|
||||||
div.trigger-button.js-add-arch-trigger.js-goto-action
|
div.trigger-button.js-add-arch-trigger.js-goto-action
|
||||||
i.fa.fa-plus
|
i.fa.fa-plus
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,97 +7,97 @@ BlazeComponent.extendComponent({
|
||||||
return [{
|
return [{
|
||||||
'click .js-add-gen-trigger' (event) {
|
'click .js-add-gen-trigger' (event) {
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
let datas = this.data();
|
const datas = this.data();
|
||||||
const actionSelected = this.find('#gen-action').value;
|
const actionSelected = this.find('#gen-action').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard');
|
||||||
if (actionSelected == "created") {
|
if (actionSelected === 'created') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "createCard",
|
activityType: 'createCard',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"listName": "*",
|
'listName': '*',
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "removed") {
|
if (actionSelected === 'removed') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "removeCard",
|
activityType: 'removeCard',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
'click .js-add-create-trigger' (event) {
|
'click .js-add-create-trigger' (event) {
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
let datas = this.data();
|
const datas = this.data();
|
||||||
const actionSelected = this.find('#create-action').value;
|
const actionSelected = this.find('#create-action').value;
|
||||||
const listName = this.find('#create-list-name').value;
|
const listName = this.find('#create-list-name').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard');
|
||||||
if (actionSelected == "created") {
|
if (actionSelected === 'created') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "createCard",
|
activityType: 'createCard',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"listName": listName,
|
listName,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "removed") {
|
if (actionSelected === 'removed') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "removeCard",
|
activityType: 'removeCard',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"listName": listName,
|
listName,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-add-moved-trigger' (event) {
|
'click .js-add-moved-trigger' (event) {
|
||||||
let datas = this.data();
|
const datas = this.data();
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
|
|
||||||
const actionSelected = this.find('#move-action').value;
|
const actionSelected = this.find('#move-action').value;
|
||||||
const listName = this.find('#move-list-name').value;
|
const listName = this.find('#move-list-name').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard');
|
||||||
if (actionSelected == "moved-to") {
|
if (actionSelected === 'moved-to') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "moveCard",
|
activityType: 'moveCard',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"listName": listName,
|
listName,
|
||||||
"oldListName": "*",
|
'oldListName': '*',
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "moved-from") {
|
if (actionSelected === 'moved-from') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "moveCard",
|
activityType: 'moveCard',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"listName": "*",
|
'listName': '*',
|
||||||
"oldListName": listName,
|
'oldListName': listName,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-add-arc-trigger' (event) {
|
'click .js-add-arc-trigger' (event) {
|
||||||
let datas = this.data();
|
const datas = this.data();
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
const actionSelected = this.find('#arch-action').value;
|
const actionSelected = this.find('#arch-action').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard');
|
||||||
if (actionSelected == "archived") {
|
if (actionSelected === 'archived') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "archivedCard",
|
activityType: 'archivedCard',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "unarchived") {
|
if (actionSelected === 'unarchived') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "restoredCard",
|
activityType: 'restoredCard',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
}];
|
}];
|
||||||
},
|
},
|
||||||
|
|
||||||
}).register('boardTriggers');
|
}).register('boardTriggers');
|
||||||
|
|
|
||||||
|
|
@ -2,46 +2,46 @@ template(name="cardTriggers")
|
||||||
div.trigger-item
|
div.trigger-item
|
||||||
div.trigger-content
|
div.trigger-content
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-when-a-label-is'}}}
|
| {{_'r-when-a-label-is'}}
|
||||||
div.trigger-dropdown
|
div.trigger-dropdown
|
||||||
select(id="label-action")
|
select(id="label-action")
|
||||||
option(value="added") {{{_'r-added-to'}}}
|
option(value="added") {{_'r-added-to'}}
|
||||||
option(value="removed") {{{_'r-removed-from'}}}
|
option(value="removed") {{_'r-removed-from'}}
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-a-card'}}}
|
| {{_'r-a-card'}}
|
||||||
div.trigger-button.js-add-gen-label-trigger.js-goto-action
|
div.trigger-button.js-add-gen-label-trigger.js-goto-action
|
||||||
i.fa.fa-plus
|
i.fa.fa-plus
|
||||||
|
|
||||||
div.trigger-item
|
div.trigger-item
|
||||||
div.trigger-content
|
div.trigger-content
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-when-the-label-is'}}}
|
| {{_'r-when-the-label-is'}}
|
||||||
div.trigger-dropdown
|
div.trigger-dropdown
|
||||||
select(id="spec-label")
|
select(id="spec-label")
|
||||||
each labels
|
each labels
|
||||||
option(value="#{_id}")
|
option(value="#{_id}")
|
||||||
= name
|
= name
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-is'}}}
|
| {{_'r-is'}}
|
||||||
div.trigger-dropdown
|
div.trigger-dropdown
|
||||||
select(id="spec-label-action")
|
select(id="spec-label-action")
|
||||||
option(value="added") {{{_'r-added-to'}}}
|
option(value="added") {{_'r-added-to'}}
|
||||||
option(value="removed") {{{_'r-removed-from'}}}
|
option(value="removed") {{_'r-removed-from'}}
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-a-card'}}}
|
| {{_'r-a-card'}}
|
||||||
div.trigger-button.js-add-spec-label-trigger.js-goto-action
|
div.trigger-button.js-add-spec-label-trigger.js-goto-action
|
||||||
i.fa.fa-plus
|
i.fa.fa-plus
|
||||||
|
|
||||||
div.trigger-item
|
div.trigger-item
|
||||||
div.trigger-content
|
div.trigger-content
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-when-a-member'}}}
|
| {{_'r-when-a-member'}}
|
||||||
div.trigger-dropdown
|
div.trigger-dropdown
|
||||||
select(id="gen-member-action")
|
select(id="gen-member-action")
|
||||||
option(value="added") {{{_'r-added-to'}}}
|
option(value="added") {{_'r-added-to'}}
|
||||||
option(value="removed") {{{_'r-removed-from'}}}
|
option(value="removed") {{_'r-removed-from'}}
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-a-card'}}}
|
| {{_'r-a-card'}}
|
||||||
div.trigger-button.js-add-gen-member-trigger.js-goto-action
|
div.trigger-button.js-add-gen-member-trigger.js-goto-action
|
||||||
i.fa.fa-plus
|
i.fa.fa-plus
|
||||||
|
|
||||||
|
|
@ -49,31 +49,31 @@ template(name="cardTriggers")
|
||||||
div.trigger-item
|
div.trigger-item
|
||||||
div.trigger-content
|
div.trigger-content
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-when-the-member'}}}
|
| {{_'r-when-the-member'}}
|
||||||
div.trigger-dropdown
|
div.trigger-dropdown
|
||||||
input(id="spec-member",type=text,placeholder="{{{_'r-name'}}}")
|
input(id="spec-member",type=text,placeholder="{{_'r-name'}}")
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-is'}}}
|
| {{_'r-is'}}
|
||||||
div.trigger-dropdown
|
div.trigger-dropdown
|
||||||
select(id="spec-member-action")
|
select(id="spec-member-action")
|
||||||
option(value="added") {{{_'r-added-to'}}}
|
option(value="added") {{_'r-added-to'}}
|
||||||
option(value="removed") {{{_'r-removed-from'}}}
|
option(value="removed") {{_'r-removed-from'}}
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-a-card'}}}
|
| {{_'r-a-card'}}
|
||||||
div.trigger-button.js-add-spec-member-trigger.js-goto-action
|
div.trigger-button.js-add-spec-member-trigger.js-goto-action
|
||||||
i.fa.fa-plus
|
i.fa.fa-plus
|
||||||
|
|
||||||
div.trigger-item
|
div.trigger-item
|
||||||
div.trigger-content
|
div.trigger-content
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-when-a-attach'}}}
|
| {{_'r-when-a-attach'}}
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-is'}}}
|
| {{_'r-is'}}
|
||||||
div.trigger-dropdown
|
div.trigger-dropdown
|
||||||
select(id="attach-action")
|
select(id="attach-action")
|
||||||
option(value="added") {{{_'r-added-to'}}}
|
option(value="added") {{_'r-added-to'}}
|
||||||
option(value="removed") {{{_'r-removed-from'}}}
|
option(value="removed") {{_'r-removed-from'}}
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-a-card'}}}
|
| {{_'r-a-card'}}
|
||||||
div.trigger-button.js-add-attachment-trigger.js-goto-action
|
div.trigger-button.js-add-attachment-trigger.js-goto-action
|
||||||
i.fa.fa-plus
|
i.fa.fa-plus
|
||||||
|
|
|
||||||
|
|
@ -4,127 +4,125 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
labels() {
|
labels() {
|
||||||
const labels = Boards.findOne(Session.get('currentBoard')).labels;
|
const labels = Boards.findOne(Session.get('currentBoard')).labels;
|
||||||
console.log(labels);
|
|
||||||
for (let i = 0; i < labels.length; i++) {
|
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();
|
labels[i].name = labels[i].color.toUpperCase();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(labels);
|
|
||||||
return labels;
|
return labels;
|
||||||
},
|
},
|
||||||
events() {
|
events() {
|
||||||
return [{
|
return [{
|
||||||
'click .js-add-gen-label-trigger' (event) {
|
'click .js-add-gen-label-trigger' (event) {
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
let datas = this.data();
|
const datas = this.data();
|
||||||
const actionSelected = this.find('#label-action').value;
|
const actionSelected = this.find('#label-action').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard');
|
||||||
if (actionSelected == "added") {
|
if (actionSelected === 'added') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "addedLabel",
|
activityType: 'addedLabel',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"labelId": "*",
|
'labelId': '*',
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "removed") {
|
if (actionSelected === 'removed') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "removedLabel",
|
activityType: 'removedLabel',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"labelId": "*",
|
'labelId': '*',
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-add-spec-label-trigger' (event) {
|
'click .js-add-spec-label-trigger' (event) {
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
let datas = this.data();
|
const datas = this.data();
|
||||||
const actionSelected = this.find('#spec-label-action').value;
|
const actionSelected = this.find('#spec-label-action').value;
|
||||||
const labelId = this.find('#spec-label').value;
|
const labelId = this.find('#spec-label').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard');
|
||||||
if (actionSelected == "added") {
|
if (actionSelected === 'added') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "addedLabel",
|
activityType: 'addedLabel',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"labelId": labelId,
|
labelId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "removed") {
|
if (actionSelected === 'removed') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "removedLabel",
|
activityType: 'removedLabel',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"labelId": labelId,
|
labelId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-add-gen-member-trigger' (event) {
|
'click .js-add-gen-member-trigger' (event) {
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
let datas = this.data();
|
const datas = this.data();
|
||||||
const actionSelected = this.find('#gen-member-action').value;
|
const actionSelected = this.find('#gen-member-action').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard');
|
||||||
if (actionSelected == "added") {
|
if (actionSelected === 'added') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "joinMember",
|
activityType: 'joinMember',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"memberId": "*",
|
'memberId': '*',
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "removed") {
|
if (actionSelected === 'removed') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "unjoinMember",
|
activityType: 'unjoinMember',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"memberId": "*",
|
'memberId': '*',
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-add-spec-member-trigger' (event) {
|
'click .js-add-spec-member-trigger' (event) {
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
let datas = this.data();
|
const datas = this.data();
|
||||||
const actionSelected = this.find('#spec-member-action').value;
|
const actionSelected = this.find('#spec-member-action').value;
|
||||||
const memberId = this.find('#spec-member').value;
|
const memberId = this.find('#spec-member').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard');
|
||||||
if (actionSelected == "added") {
|
if (actionSelected === 'added') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "joinMember",
|
activityType: 'joinMember',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"memberId": memberId,
|
memberId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "removed") {
|
if (actionSelected === 'removed') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "unjoinMember",
|
activityType: 'unjoinMember',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"memberId": memberId,
|
memberId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-add-attachment-trigger' (event) {
|
'click .js-add-attachment-trigger' (event) {
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
let datas = this.data();
|
const datas = this.data();
|
||||||
const actionSelected = this.find('#attach-action').value;
|
const actionSelected = this.find('#attach-action').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard');
|
||||||
if (actionSelected == "added") {
|
if (actionSelected === 'added') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "addAttachment",
|
activityType: 'addAttachment',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "removed") {
|
if (actionSelected === 'removed') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "deleteAttachment",
|
activityType: 'deleteAttachment',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}];
|
}];
|
||||||
},
|
},
|
||||||
}).register('cardTriggers');
|
}).register('cardTriggers');
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,13 @@ template(name="checklistTriggers")
|
||||||
div.trigger-item
|
div.trigger-item
|
||||||
div.trigger-content
|
div.trigger-content
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-when-a-checklist'}}}
|
| {{_'r-when-a-checklist'}}
|
||||||
div.trigger-dropdown
|
div.trigger-dropdown
|
||||||
select(id="gen-check-action")
|
select(id="gen-check-action")
|
||||||
option(value="created") {{{_'r-added-to'}}}
|
option(value="created") {{_'r-added-to'}}
|
||||||
option(value="removed") {{{_'r-removed-from'}}}
|
option(value="removed") {{_'r-removed-from'}}
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-a-card'}}}
|
| {{_'r-a-card'}}
|
||||||
div.trigger-button.js-add-gen-check-trigger.js-goto-action
|
div.trigger-button.js-add-gen-check-trigger.js-goto-action
|
||||||
i.fa.fa-plus
|
i.fa.fa-plus
|
||||||
|
|
||||||
|
|
@ -16,68 +16,68 @@ template(name="checklistTriggers")
|
||||||
div.trigger-item
|
div.trigger-item
|
||||||
div.trigger-content
|
div.trigger-content
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-when-the-checklist'}}}
|
| {{_'r-when-the-checklist'}}
|
||||||
div.trigger-dropdown
|
div.trigger-dropdown
|
||||||
input(id="check-name",type=text,placeholder="{{{_'r-name'}}}")
|
input(id="check-name",type=text,placeholder="{{_'r-name'}}")
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-is'}}}
|
| {{_'r-is'}}
|
||||||
div.trigger-dropdown
|
div.trigger-dropdown
|
||||||
select(id="spec-check-action")
|
select(id="spec-check-action")
|
||||||
option(value="created") {{{_'r-added-to'}}}
|
option(value="created") {{_'r-added-to'}}
|
||||||
option(value="removed") {{{_'r-removed-from'}}}
|
option(value="removed") {{_'r-removed-from'}}
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-a-card'}}}
|
| {{_'r-a-card'}}
|
||||||
div.trigger-button.js-add-spec-check-trigger.js-goto-action
|
div.trigger-button.js-add-spec-check-trigger.js-goto-action
|
||||||
i.fa.fa-plus
|
i.fa.fa-plus
|
||||||
|
|
||||||
div.trigger-item
|
div.trigger-item
|
||||||
div.trigger-content
|
div.trigger-content
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-when-a-checklist'}}}
|
| {{_'r-when-a-checklist'}}
|
||||||
div.trigger-dropdown
|
div.trigger-dropdown
|
||||||
select(id="gen-comp-check-action")
|
select(id="gen-comp-check-action")
|
||||||
option(value="completed") {{{_'r-completed'}}}
|
option(value="completed") {{_'r-completed'}}
|
||||||
option(value="uncompleted") {{{_'r-made-incomplete'}}}
|
option(value="uncompleted") {{_'r-made-incomplete'}}
|
||||||
div.trigger-button.js-add-gen-comp-trigger.js-goto-action
|
div.trigger-button.js-add-gen-comp-trigger.js-goto-action
|
||||||
i.fa.fa-plus
|
i.fa.fa-plus
|
||||||
|
|
||||||
div.trigger-item
|
div.trigger-item
|
||||||
div.trigger-content
|
div.trigger-content
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-when-the-checklist'}}}
|
| {{_'r-when-the-checklist'}}
|
||||||
div.trigger-dropdown
|
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
|
div.trigger-text
|
||||||
| {{{_'r-is'}}}
|
| {{_'r-is'}}
|
||||||
div.trigger-dropdown
|
div.trigger-dropdown
|
||||||
select(id="spec-comp-check-action")
|
select(id="spec-comp-check-action")
|
||||||
option(value="completed") {{{_'r-completed'}}}
|
option(value="completed") {{_'r-completed'}}
|
||||||
option(value="uncompleted") {{{_'r-made-incomplete'}}}
|
option(value="uncompleted") {{_'r-made-incomplete'}}
|
||||||
div.trigger-button.js-add-spec-comp-trigger.js-goto-action
|
div.trigger-button.js-add-spec-comp-trigger.js-goto-action
|
||||||
i.fa.fa-plus
|
i.fa.fa-plus
|
||||||
|
|
||||||
div.trigger-item
|
div.trigger-item
|
||||||
div.trigger-content
|
div.trigger-content
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-when-a-item'}}}
|
| {{_'r-when-a-item'}}
|
||||||
div.trigger-dropdown
|
div.trigger-dropdown
|
||||||
select(id="check-item-gen-action")
|
select(id="check-item-gen-action")
|
||||||
option(value="checked") {{{_'r-checked'}}}
|
option(value="checked") {{_'r-checked'}}
|
||||||
option(value="unchecked") {{{_'r-unchecked'}}}
|
option(value="unchecked") {{_'r-unchecked'}}
|
||||||
div.trigger-button.js-add-gen-check-item-trigger.js-goto-action
|
div.trigger-button.js-add-gen-check-item-trigger.js-goto-action
|
||||||
i.fa.fa-plus
|
i.fa.fa-plus
|
||||||
|
|
||||||
div.trigger-item
|
div.trigger-item
|
||||||
div.trigger-content
|
div.trigger-content
|
||||||
div.trigger-text
|
div.trigger-text
|
||||||
| {{{_'r-when-the-item'}}}
|
| {{_'r-when-the-item'}}
|
||||||
div.trigger-dropdown
|
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
|
div.trigger-text
|
||||||
| {{{_'r-is'}}}
|
| {{_'r-is'}}
|
||||||
div.trigger-dropdown
|
div.trigger-dropdown
|
||||||
select(id="check-item-spec-action")
|
select(id="check-item-spec-action")
|
||||||
option(value="checked") {{{_'r-checked'}}}
|
option(value="checked") {{_'r-checked'}}
|
||||||
option(value="unchecked") {{{_'r-unchecked'}}}
|
option(value="unchecked") {{_'r-unchecked'}}
|
||||||
div.trigger-button.js-add-spec-check-item-trigger.js-goto-action
|
div.trigger-button.js-add-spec-check-item-trigger.js-goto-action
|
||||||
i.fa.fa-plus
|
i.fa.fa-plus
|
||||||
|
|
|
||||||
|
|
@ -6,141 +6,141 @@ BlazeComponent.extendComponent({
|
||||||
return [{
|
return [{
|
||||||
'click .js-add-gen-check-trigger' (event) {
|
'click .js-add-gen-check-trigger' (event) {
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
let datas = this.data();
|
const datas = this.data();
|
||||||
const actionSelected = this.find('#gen-check-action').value;
|
const actionSelected = this.find('#gen-check-action').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard');
|
||||||
if (actionSelected == "created") {
|
if (actionSelected === 'created') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "addChecklist",
|
activityType: 'addChecklist',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"checklistName": "*",
|
'checklistName': '*',
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "removed") {
|
if (actionSelected === 'removed') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "removeChecklist",
|
activityType: 'removeChecklist',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"checklistName": "*",
|
'checklistName': '*',
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-add-spec-check-trigger' (event) {
|
'click .js-add-spec-check-trigger' (event) {
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
let datas = this.data();
|
const datas = this.data();
|
||||||
const actionSelected = this.find('#spec-check-action').value;
|
const actionSelected = this.find('#spec-check-action').value;
|
||||||
const checklistId = this.find('#check-name').value;
|
const checklistId = this.find('#check-name').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard');
|
||||||
if (actionSelected == "created") {
|
if (actionSelected === 'created') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "addChecklist",
|
activityType: 'addChecklist',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"checklistName": checklistId,
|
'checklistName': checklistId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "removed") {
|
if (actionSelected === 'removed') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "removeChecklist",
|
activityType: 'removeChecklist',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"checklistName": checklistId,
|
'checklistName': checklistId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-add-gen-comp-trigger' (event) {
|
'click .js-add-gen-comp-trigger' (event) {
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
|
|
||||||
let datas = this.data();
|
const datas = this.data();
|
||||||
const actionSelected = this.find('#gen-comp-check-action').value;
|
const actionSelected = this.find('#gen-comp-check-action').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard');
|
||||||
if (actionSelected == "completed") {
|
if (actionSelected === 'completed') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "completeChecklist",
|
activityType: 'completeChecklist',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"checklistName": "*",
|
'checklistName': '*',
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "uncompleted") {
|
if (actionSelected === 'uncompleted') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "uncompleteChecklist",
|
activityType: 'uncompleteChecklist',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"checklistName": "*",
|
'checklistName': '*',
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-add-spec-comp-trigger' (event) {
|
'click .js-add-spec-comp-trigger' (event) {
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
let datas = this.data();
|
const datas = this.data();
|
||||||
const actionSelected = this.find('#spec-comp-check-action').value;
|
const actionSelected = this.find('#spec-comp-check-action').value;
|
||||||
const checklistId = this.find('#spec-comp-check-name').value;
|
const checklistId = this.find('#spec-comp-check-name').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard');
|
||||||
if (actionSelected == "added") {
|
if (actionSelected === 'added') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "completeChecklist",
|
activityType: 'completeChecklist',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"checklistName": checklistId,
|
'checklistName': checklistId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "removed") {
|
if (actionSelected === 'removed') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "uncompleteChecklist",
|
activityType: 'uncompleteChecklist',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"checklistName": checklistId,
|
'checklistName': checklistId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-add-gen-check-item-trigger' (event) {
|
'click .js-add-gen-check-item-trigger' (event) {
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
let datas = this.data();
|
const datas = this.data();
|
||||||
const actionSelected = this.find('#check-item-gen-action').value;
|
const actionSelected = this.find('#check-item-gen-action').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard');
|
||||||
if (actionSelected == "checked") {
|
if (actionSelected === 'checked') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "checkedItem",
|
activityType: 'checkedItem',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"checklistItemName": "*",
|
'checklistItemName': '*',
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "unchecked") {
|
if (actionSelected === 'unchecked') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "uncheckedItem",
|
activityType: 'uncheckedItem',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"checklistItemName": "*",
|
'checklistItemName': '*',
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-add-spec-check-item-trigger' (event) {
|
'click .js-add-spec-check-item-trigger' (event) {
|
||||||
const desc = Utils.getTriggerActionDesc(event, this);
|
const desc = Utils.getTriggerActionDesc(event, this);
|
||||||
let datas = this.data();
|
const datas = this.data();
|
||||||
const actionSelected = this.find('#check-item-spec-action').value;
|
const actionSelected = this.find('#check-item-spec-action').value;
|
||||||
const checklistItemId = this.find('#check-item-name').value;
|
const checklistItemId = this.find('#check-item-name').value;
|
||||||
const boardId = Session.get('currentBoard')
|
const boardId = Session.get('currentBoard');
|
||||||
if (actionSelected == "checked") {
|
if (actionSelected === 'checked') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "checkedItem",
|
activityType: 'checkedItem',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"checklistItemName": checklistItemId,
|
'checklistItemName': checklistItemId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (actionSelected == "unchecked") {
|
if (actionSelected === 'unchecked') {
|
||||||
datas.triggerVar.set({
|
datas.triggerVar.set({
|
||||||
activityType: "uncheckedItem",
|
activityType: 'uncheckedItem',
|
||||||
"boardId": boardId,
|
boardId,
|
||||||
"checklistItemName": checklistItemId,
|
'checklistItemName': checklistItemId,
|
||||||
"desc": desc
|
desc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}];
|
}];
|
||||||
},
|
},
|
||||||
|
|
||||||
}).register('checklistTriggers');
|
}).register('checklistTriggers');
|
||||||
|
|
|
||||||
|
|
@ -188,23 +188,24 @@ Utils = {
|
||||||
} else if (matomo) {
|
} else if (matomo) {
|
||||||
window._paq.push(['trackPageView']);
|
window._paq.push(['trackPageView']);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
getTriggerActionDesc(event, tempInstance) {
|
getTriggerActionDesc(event, tempInstance) {
|
||||||
const jqueryEl = tempInstance.$(event.currentTarget.parentNode);
|
const jqueryEl = tempInstance.$(event.currentTarget.parentNode);
|
||||||
const triggerEls = jqueryEl.find(".trigger-content").children();
|
const triggerEls = jqueryEl.find('.trigger-content').children();
|
||||||
let finalString = "";
|
let finalString = '';
|
||||||
for (let i = 0; i < triggerEls.length; i++) {
|
for (let i = 0; i < triggerEls.length; i++) {
|
||||||
const element = tempInstance.$(triggerEls[i]);
|
const element = tempInstance.$(triggerEls[i]);
|
||||||
if (element.hasClass("trigger-text")) {
|
if (element.hasClass('trigger-text')) {
|
||||||
finalString += element.text().toLowerCase();
|
finalString += element.text().toLowerCase();
|
||||||
} else if (element.find("select").length > 0) {
|
} else if (element.find('select').length > 0) {
|
||||||
finalString += element.find("select option:selected").text().toLowerCase();
|
finalString += element.find('select option:selected').text().toLowerCase();
|
||||||
} else if (element.find("input").length > 0) {
|
} else if (element.find('input').length > 0) {
|
||||||
finalString += element.find("input").val();
|
finalString += element.find('input').val();
|
||||||
}
|
}
|
||||||
// Add space
|
// Add space
|
||||||
if (i != length - 1) {
|
if (i !== length - 1) {
|
||||||
finalString += " ";
|
finalString += ' ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return finalString;
|
return finalString;
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,19 @@
|
||||||
Actions = new Mongo.Collection('actions');
|
Actions = new Mongo.Collection('actions');
|
||||||
|
|
||||||
Actions.allow({
|
Actions.allow({
|
||||||
insert(userId, doc) {
|
insert(userId, doc) {
|
||||||
return allowIsBoardAdmin(userId, Boards.findOne(doc.boardId));
|
return allowIsBoardAdmin(userId, Boards.findOne(doc.boardId));
|
||||||
},
|
},
|
||||||
update(userId, doc) {
|
update(userId, doc) {
|
||||||
return allowIsBoardAdmin(userId, Boards.findOne(doc.boardId));
|
return allowIsBoardAdmin(userId, Boards.findOne(doc.boardId));
|
||||||
},
|
},
|
||||||
remove(userId, doc) {
|
remove(userId, doc) {
|
||||||
return allowIsBoardAdmin(userId, Boards.findOne(doc.boardId));
|
return allowIsBoardAdmin(userId, Boards.findOne(doc.boardId));
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Actions.helpers({
|
Actions.helpers({
|
||||||
description() {
|
description() {
|
||||||
return this.desc;
|
return this.desc;
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -57,16 +57,13 @@ Activities.before.insert((userId, doc) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Activities.after.insert((userId, doc) => {
|
Activities.after.insert((userId, doc) => {
|
||||||
const activity = Activities._transform(doc);
|
const activity = Activities._transform(doc);
|
||||||
RulesHelper.executeRules(activity);
|
RulesHelper.executeRules(activity);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (Meteor.isServer) {
|
if (Meteor.isServer) {
|
||||||
// For efficiency create indexes on the date of creation, and on the date of
|
// 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
|
// creation in conjunction with the card or board id, as corresponding views
|
||||||
|
|
|
||||||
|
|
@ -87,11 +87,11 @@ if (Meteor.isServer) {
|
||||||
attachmentId: doc._id,
|
attachmentId: doc._id,
|
||||||
});
|
});
|
||||||
Activities.insert({
|
Activities.insert({
|
||||||
userId,
|
userId,
|
||||||
type: 'card',
|
type: 'card',
|
||||||
activityType: 'deleteAttachment',
|
activityType: 'deleteAttachment',
|
||||||
boardId: doc.boardId,
|
boardId: doc.boardId,
|
||||||
cardId: doc.cardId,
|
cardId: doc.cardId,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
168
models/cards.js
168
models/cards.js
|
|
@ -278,8 +278,8 @@ Cards.helpers({
|
||||||
archived: false,
|
archived: false,
|
||||||
}, {
|
}, {
|
||||||
sort: {
|
sort: {
|
||||||
sort: 1
|
sort: 1,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -289,8 +289,8 @@ Cards.helpers({
|
||||||
archived: false,
|
archived: false,
|
||||||
}, {
|
}, {
|
||||||
sort: {
|
sort: {
|
||||||
sort: 1
|
sort: 1,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -304,7 +304,7 @@ Cards.helpers({
|
||||||
subtasksFinishedCount() {
|
subtasksFinishedCount() {
|
||||||
return Cards.find({
|
return Cards.find({
|
||||||
parentId: this._id,
|
parentId: this._id,
|
||||||
archived: true
|
archived: true,
|
||||||
}).count();
|
}).count();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -365,7 +365,7 @@ Cards.helpers({
|
||||||
|
|
||||||
canBeRestored() {
|
canBeRestored() {
|
||||||
const list = Lists.findOne({
|
const list = Lists.findOne({
|
||||||
_id: this.listId
|
_id: this.listId,
|
||||||
});
|
});
|
||||||
if (!list.getWipLimit('soft') && list.getWipLimit('enabled') && list.getWipLimit('value') === list.cards().count()) {
|
if (!list.getWipLimit('soft') && list.getWipLimit('enabled') && list.getWipLimit('value') === list.cards().count()) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -835,7 +835,7 @@ Cards.helpers({
|
||||||
Cards.mutations({
|
Cards.mutations({
|
||||||
applyToChildren(funct) {
|
applyToChildren(funct) {
|
||||||
Cards.find({
|
Cards.find({
|
||||||
parentId: this._id
|
parentId: this._id,
|
||||||
}).forEach((card) => {
|
}).forEach((card) => {
|
||||||
funct(card);
|
funct(card);
|
||||||
});
|
});
|
||||||
|
|
@ -847,8 +847,8 @@ Cards.mutations({
|
||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
$set: {
|
$set: {
|
||||||
archived: true
|
archived: true,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -858,40 +858,40 @@ Cards.mutations({
|
||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
$set: {
|
$set: {
|
||||||
archived: false
|
archived: false,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
setTitle(title) {
|
setTitle(title) {
|
||||||
return {
|
return {
|
||||||
$set: {
|
$set: {
|
||||||
title
|
title,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
setDescription(description) {
|
setDescription(description) {
|
||||||
return {
|
return {
|
||||||
$set: {
|
$set: {
|
||||||
description
|
description,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
setRequestedBy(requestedBy) {
|
setRequestedBy(requestedBy) {
|
||||||
return {
|
return {
|
||||||
$set: {
|
$set: {
|
||||||
requestedBy
|
requestedBy,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
setAssignedBy(assignedBy) {
|
setAssignedBy(assignedBy) {
|
||||||
return {
|
return {
|
||||||
$set: {
|
$set: {
|
||||||
assignedBy
|
assignedBy,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -905,23 +905,23 @@ Cards.mutations({
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
$set: mutatedFields
|
$set: mutatedFields,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
addLabel(labelId) {
|
addLabel(labelId) {
|
||||||
return {
|
return {
|
||||||
$addToSet: {
|
$addToSet: {
|
||||||
labelIds: labelId
|
labelIds: labelId,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
removeLabel(labelId) {
|
removeLabel(labelId) {
|
||||||
return {
|
return {
|
||||||
$pull: {
|
$pull: {
|
||||||
labelIds: labelId
|
labelIds: labelId,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -936,16 +936,16 @@ Cards.mutations({
|
||||||
assignMember(memberId) {
|
assignMember(memberId) {
|
||||||
return {
|
return {
|
||||||
$addToSet: {
|
$addToSet: {
|
||||||
members: memberId
|
members: memberId,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
unassignMember(memberId) {
|
unassignMember(memberId) {
|
||||||
return {
|
return {
|
||||||
$pull: {
|
$pull: {
|
||||||
members: memberId
|
members: memberId,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -962,9 +962,9 @@ Cards.mutations({
|
||||||
$addToSet: {
|
$addToSet: {
|
||||||
customFields: {
|
customFields: {
|
||||||
_id: customFieldId,
|
_id: customFieldId,
|
||||||
value: null
|
value: null,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -972,9 +972,9 @@ Cards.mutations({
|
||||||
return {
|
return {
|
||||||
$pull: {
|
$pull: {
|
||||||
customFields: {
|
customFields: {
|
||||||
_id: customFieldId
|
_id: customFieldId,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -991,7 +991,7 @@ Cards.mutations({
|
||||||
const index = this.customFieldIndex(customFieldId);
|
const index = this.customFieldIndex(customFieldId);
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
const update = {
|
const update = {
|
||||||
$set: {}
|
$set: {},
|
||||||
};
|
};
|
||||||
update.$set[`customFields.${index}.value`] = value;
|
update.$set[`customFields.${index}.value`] = value;
|
||||||
return update;
|
return update;
|
||||||
|
|
@ -1004,96 +1004,96 @@ Cards.mutations({
|
||||||
setCover(coverId) {
|
setCover(coverId) {
|
||||||
return {
|
return {
|
||||||
$set: {
|
$set: {
|
||||||
coverId
|
coverId,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
unsetCover() {
|
unsetCover() {
|
||||||
return {
|
return {
|
||||||
$unset: {
|
$unset: {
|
||||||
coverId: ''
|
coverId: '',
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
setReceived(receivedAt) {
|
setReceived(receivedAt) {
|
||||||
return {
|
return {
|
||||||
$set: {
|
$set: {
|
||||||
receivedAt
|
receivedAt,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
unsetReceived() {
|
unsetReceived() {
|
||||||
return {
|
return {
|
||||||
$unset: {
|
$unset: {
|
||||||
receivedAt: ''
|
receivedAt: '',
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
setStart(startAt) {
|
setStart(startAt) {
|
||||||
return {
|
return {
|
||||||
$set: {
|
$set: {
|
||||||
startAt
|
startAt,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
unsetStart() {
|
unsetStart() {
|
||||||
return {
|
return {
|
||||||
$unset: {
|
$unset: {
|
||||||
startAt: ''
|
startAt: '',
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
setDue(dueAt) {
|
setDue(dueAt) {
|
||||||
return {
|
return {
|
||||||
$set: {
|
$set: {
|
||||||
dueAt
|
dueAt,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
unsetDue() {
|
unsetDue() {
|
||||||
return {
|
return {
|
||||||
$unset: {
|
$unset: {
|
||||||
dueAt: ''
|
dueAt: '',
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
setEnd(endAt) {
|
setEnd(endAt) {
|
||||||
return {
|
return {
|
||||||
$set: {
|
$set: {
|
||||||
endAt
|
endAt,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
unsetEnd() {
|
unsetEnd() {
|
||||||
return {
|
return {
|
||||||
$unset: {
|
$unset: {
|
||||||
endAt: ''
|
endAt: '',
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
setOvertime(isOvertime) {
|
setOvertime(isOvertime) {
|
||||||
return {
|
return {
|
||||||
$set: {
|
$set: {
|
||||||
isOvertime
|
isOvertime,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
setSpentTime(spentTime) {
|
setSpentTime(spentTime) {
|
||||||
return {
|
return {
|
||||||
$set: {
|
$set: {
|
||||||
spentTime
|
spentTime,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -1101,16 +1101,16 @@ Cards.mutations({
|
||||||
return {
|
return {
|
||||||
$unset: {
|
$unset: {
|
||||||
spentTime: '',
|
spentTime: '',
|
||||||
isOvertime: false
|
isOvertime: false,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
setParentId(parentId) {
|
setParentId(parentId) {
|
||||||
return {
|
return {
|
||||||
$set: {
|
$set: {
|
||||||
parentId
|
parentId,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
@ -1206,7 +1206,7 @@ function cardLabels(userId, doc, fieldNames, modifier) {
|
||||||
activityType: 'addedLabel',
|
activityType: 'addedLabel',
|
||||||
boardId: doc.boardId,
|
boardId: doc.boardId,
|
||||||
cardId: doc._id,
|
cardId: doc._id,
|
||||||
}
|
};
|
||||||
Activities.insert(act);
|
Activities.insert(act);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1313,7 +1313,7 @@ if (Meteor.isServer) {
|
||||||
data: Cards.find({
|
data: Cards.find({
|
||||||
boardId: paramBoardId,
|
boardId: paramBoardId,
|
||||||
listId: paramListId,
|
listId: paramListId,
|
||||||
archived: false
|
archived: false,
|
||||||
}).map(function(doc) {
|
}).map(function(doc) {
|
||||||
return {
|
return {
|
||||||
_id: doc._id,
|
_id: doc._id,
|
||||||
|
|
@ -1335,7 +1335,7 @@ if (Meteor.isServer) {
|
||||||
_id: paramCardId,
|
_id: paramCardId,
|
||||||
listId: paramListId,
|
listId: paramListId,
|
||||||
boardId: paramBoardId,
|
boardId: paramBoardId,
|
||||||
archived: false
|
archived: false,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -1345,7 +1345,7 @@ if (Meteor.isServer) {
|
||||||
const paramBoardId = req.params.boardId;
|
const paramBoardId = req.params.boardId;
|
||||||
const paramListId = req.params.listId;
|
const paramListId = req.params.listId;
|
||||||
const check = Users.findOne({
|
const check = Users.findOne({
|
||||||
_id: req.body.authorId
|
_id: req.body.authorId,
|
||||||
});
|
});
|
||||||
const members = req.body.members || [req.body.authorId];
|
const members = req.body.members || [req.body.authorId];
|
||||||
if (typeof check !== 'undefined') {
|
if (typeof check !== 'undefined') {
|
||||||
|
|
@ -1367,7 +1367,7 @@ if (Meteor.isServer) {
|
||||||
});
|
});
|
||||||
|
|
||||||
const card = Cards.findOne({
|
const card = Cards.findOne({
|
||||||
_id: id
|
_id: id,
|
||||||
});
|
});
|
||||||
cardCreation(req.body.authorId, card);
|
cardCreation(req.body.authorId, card);
|
||||||
|
|
||||||
|
|
@ -1390,11 +1390,11 @@ if (Meteor.isServer) {
|
||||||
_id: paramCardId,
|
_id: paramCardId,
|
||||||
listId: paramListId,
|
listId: paramListId,
|
||||||
boardId: paramBoardId,
|
boardId: paramBoardId,
|
||||||
archived: false
|
archived: false,
|
||||||
}, {
|
}, {
|
||||||
$set: {
|
$set: {
|
||||||
title: newTitle
|
title: newTitle,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (req.body.hasOwnProperty('listId')) {
|
if (req.body.hasOwnProperty('listId')) {
|
||||||
|
|
@ -1403,18 +1403,18 @@ if (Meteor.isServer) {
|
||||||
_id: paramCardId,
|
_id: paramCardId,
|
||||||
listId: paramListId,
|
listId: paramListId,
|
||||||
boardId: paramBoardId,
|
boardId: paramBoardId,
|
||||||
archived: false
|
archived: false,
|
||||||
}, {
|
}, {
|
||||||
$set: {
|
$set: {
|
||||||
listId: newParamListId
|
listId: newParamListId,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const card = Cards.findOne({
|
const card = Cards.findOne({
|
||||||
_id: paramCardId
|
_id: paramCardId,
|
||||||
});
|
});
|
||||||
cardMove(req.body.authorId, card, {
|
cardMove(req.body.authorId, card, {
|
||||||
fieldName: 'listId'
|
fieldName: 'listId',
|
||||||
}, paramListId);
|
}, paramListId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1424,11 +1424,11 @@ if (Meteor.isServer) {
|
||||||
_id: paramCardId,
|
_id: paramCardId,
|
||||||
listId: paramListId,
|
listId: paramListId,
|
||||||
boardId: paramBoardId,
|
boardId: paramBoardId,
|
||||||
archived: false
|
archived: false,
|
||||||
}, {
|
}, {
|
||||||
$set: {
|
$set: {
|
||||||
description: newDescription
|
description: newDescription,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (req.body.hasOwnProperty('labelIds')) {
|
if (req.body.hasOwnProperty('labelIds')) {
|
||||||
|
|
@ -1437,11 +1437,11 @@ if (Meteor.isServer) {
|
||||||
_id: paramCardId,
|
_id: paramCardId,
|
||||||
listId: paramListId,
|
listId: paramListId,
|
||||||
boardId: paramBoardId,
|
boardId: paramBoardId,
|
||||||
archived: false
|
archived: false,
|
||||||
}, {
|
}, {
|
||||||
$set: {
|
$set: {
|
||||||
labelIds: newlabelIds
|
labelIds: newlabelIds,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (req.body.hasOwnProperty('requestedBy')) {
|
if (req.body.hasOwnProperty('requestedBy')) {
|
||||||
|
|
@ -1506,10 +1506,10 @@ if (Meteor.isServer) {
|
||||||
Cards.direct.remove({
|
Cards.direct.remove({
|
||||||
_id: paramCardId,
|
_id: paramCardId,
|
||||||
listId: paramListId,
|
listId: paramListId,
|
||||||
boardId: paramBoardId
|
boardId: paramBoardId,
|
||||||
});
|
});
|
||||||
const card = Cards.find({
|
const card = Cards.find({
|
||||||
_id: paramCardId
|
_id: paramCardId,
|
||||||
});
|
});
|
||||||
cardRemover(req.body.authorId, card);
|
cardRemover(req.body.authorId, card);
|
||||||
JsonRoutes.sendResult(res, {
|
JsonRoutes.sendResult(res, {
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ function itemCreation(userId, doc) {
|
||||||
boardId,
|
boardId,
|
||||||
checklistId: doc.checklistId,
|
checklistId: doc.checklistId,
|
||||||
checklistItemId: doc._id,
|
checklistItemId: doc._id,
|
||||||
checklistItemName:doc.title
|
checklistItemName:doc.title,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -90,66 +90,66 @@ function itemRemover(userId, doc) {
|
||||||
boardId,
|
boardId,
|
||||||
checklistId: doc.checklistId,
|
checklistId: doc.checklistId,
|
||||||
checklistItemId: doc._id,
|
checklistItemId: doc._id,
|
||||||
checklistItemName:doc.title
|
checklistItemName:doc.title,
|
||||||
});
|
});
|
||||||
Activities.remove({
|
Activities.remove({
|
||||||
checklistItemId: doc._id,
|
checklistItemId: doc._id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function publishCheckActivity(userId,doc){
|
function publishCheckActivity(userId, doc){
|
||||||
const card = Cards.findOne(doc.cardId);
|
const card = Cards.findOne(doc.cardId);
|
||||||
const boardId = card.boardId;
|
const boardId = card.boardId;
|
||||||
let activityType;
|
let activityType;
|
||||||
if(doc.isFinished){
|
if(doc.isFinished){
|
||||||
activityType = "checkedItem";
|
activityType = 'checkedItem';
|
||||||
}else{
|
}else{
|
||||||
activityType = "uncheckedItem";
|
activityType = 'uncheckedItem';
|
||||||
}
|
}
|
||||||
let act = {
|
const act = {
|
||||||
userId,
|
userId,
|
||||||
activityType: activityType,
|
activityType,
|
||||||
cardId: doc.cardId,
|
cardId: doc.cardId,
|
||||||
boardId,
|
boardId,
|
||||||
checklistId: doc.checklistId,
|
checklistId: doc.checklistId,
|
||||||
checklistItemId: doc._id,
|
checklistItemId: doc._id,
|
||||||
checklistItemName:doc.title
|
checklistItemName:doc.title,
|
||||||
}
|
};
|
||||||
Activities.insert(act);
|
Activities.insert(act);
|
||||||
}
|
}
|
||||||
|
|
||||||
function publishChekListCompleted(userId,doc,fieldNames,modifier){
|
function publishChekListCompleted(userId, doc, fieldNames, modifier){
|
||||||
const card = Cards.findOne(doc.cardId);
|
const card = Cards.findOne(doc.cardId);
|
||||||
const boardId = card.boardId;
|
const boardId = card.boardId;
|
||||||
const checklistId = doc.checklistId;
|
const checklistId = doc.checklistId;
|
||||||
const checkList = Checklists.findOne({_id:checklistId});
|
const checkList = Checklists.findOne({_id:checklistId});
|
||||||
if(checkList.isFinished()){
|
if(checkList.isFinished()){
|
||||||
let act = {
|
const act = {
|
||||||
userId,
|
userId,
|
||||||
activityType: "checklistCompleted",
|
activityType: 'checklistCompleted',
|
||||||
cardId: doc.cardId,
|
cardId: doc.cardId,
|
||||||
boardId,
|
boardId,
|
||||||
checklistId: doc.checklistId,
|
checklistId: doc.checklistId,
|
||||||
checklistName:doc.title
|
checklistName:doc.title,
|
||||||
}
|
};
|
||||||
Activities.insert(act);
|
Activities.insert(act);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function publishChekListUncompleted(userId,doc,fieldNames,modifier){
|
function publishChekListUncompleted(userId, doc, fieldNames, modifier){
|
||||||
const card = Cards.findOne(doc.cardId);
|
const card = Cards.findOne(doc.cardId);
|
||||||
const boardId = card.boardId;
|
const boardId = card.boardId;
|
||||||
const checklistId = doc.checklistId;
|
const checklistId = doc.checklistId;
|
||||||
const checkList = Checklists.findOne({_id:checklistId});
|
const checkList = Checklists.findOne({_id:checklistId});
|
||||||
if(checkList.isFinished()){
|
if(checkList.isFinished()){
|
||||||
let act = {
|
const act = {
|
||||||
userId,
|
userId,
|
||||||
activityType: "checklistUncompleted",
|
activityType: 'checklistUncompleted',
|
||||||
cardId: doc.cardId,
|
cardId: doc.cardId,
|
||||||
boardId,
|
boardId,
|
||||||
checklistId: doc.checklistId,
|
checklistId: doc.checklistId,
|
||||||
checklistName:doc.title
|
checklistName:doc.title,
|
||||||
}
|
};
|
||||||
Activities.insert(act);
|
Activities.insert(act);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -161,16 +161,15 @@ if (Meteor.isServer) {
|
||||||
});
|
});
|
||||||
|
|
||||||
ChecklistItems.after.update((userId, doc, fieldNames, modifier) => {
|
ChecklistItems.after.update((userId, doc, fieldNames, modifier) => {
|
||||||
publishCheckActivity(userId,doc);
|
publishCheckActivity(userId, doc);
|
||||||
publishChekListCompleted(userId,doc,fieldNames,modifier)
|
publishChekListCompleted(userId, doc, fieldNames, modifier);
|
||||||
});
|
});
|
||||||
|
|
||||||
ChecklistItems.before.update((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) => {
|
ChecklistItems.after.insert((userId, doc) => {
|
||||||
itemCreation(userId, doc);
|
itemCreation(userId, doc);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ if (Meteor.isServer) {
|
||||||
cardId: doc.cardId,
|
cardId: doc.cardId,
|
||||||
boardId: Cards.findOne(doc.cardId).boardId,
|
boardId: Cards.findOne(doc.cardId).boardId,
|
||||||
checklistId: doc._id,
|
checklistId: doc._id,
|
||||||
checklistName:doc.title
|
checklistName:doc.title,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -120,7 +120,7 @@ if (Meteor.isServer) {
|
||||||
cardId: doc.cardId,
|
cardId: doc.cardId,
|
||||||
boardId: Cards.findOne(doc.cardId).boardId,
|
boardId: Cards.findOne(doc.cardId).boardId,
|
||||||
checklistId: doc._id,
|
checklistId: doc._id,
|
||||||
checklistName:doc.title
|
checklistName:doc.title,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ if (Meteor.isServer) {
|
||||||
if (exporter.canExport(user)) {
|
if (exporter.canExport(user)) {
|
||||||
JsonRoutes.sendResult(res, {
|
JsonRoutes.sendResult(res, {
|
||||||
code: 200,
|
code: 200,
|
||||||
data: exporter.build()
|
data: exporter.build(),
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// we could send an explicit error message, but on the other hand the only
|
// 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
|
// we do not want to retrieve boardId in related elements
|
||||||
const noBoardId = {
|
const noBoardId = {
|
||||||
fields: {
|
fields: {
|
||||||
boardId: 0
|
boardId: 0,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
const result = {
|
const result = {
|
||||||
_format: 'wekan-board-1.0.0',
|
_format: 'wekan-board-1.0.0',
|
||||||
};
|
};
|
||||||
_.extend(result, Boards.findOne(this._boardId, {
|
_.extend(result, Boards.findOne(this._boardId, {
|
||||||
fields: {
|
fields: {
|
||||||
stars: 0
|
stars: 0,
|
||||||
}
|
},
|
||||||
}));
|
}));
|
||||||
result.lists = Lists.find(byBoard, noBoardId).fetch();
|
result.lists = Lists.find(byBoard, noBoardId).fetch();
|
||||||
result.cards = Cards.find(byBoardNoLinked, noBoardId).fetch();
|
result.cards = Cards.find(byBoardNoLinked, noBoardId).fetch();
|
||||||
|
|
@ -77,21 +77,21 @@ class Exporter {
|
||||||
result.actions = [];
|
result.actions = [];
|
||||||
result.cards.forEach((card) => {
|
result.cards.forEach((card) => {
|
||||||
result.checklists.push(...Checklists.find({
|
result.checklists.push(...Checklists.find({
|
||||||
cardId: card._id
|
cardId: card._id,
|
||||||
}).fetch());
|
}).fetch());
|
||||||
result.checklistItems.push(...ChecklistItems.find({
|
result.checklistItems.push(...ChecklistItems.find({
|
||||||
cardId: card._id
|
cardId: card._id,
|
||||||
}).fetch());
|
}).fetch());
|
||||||
result.subtaskItems.push(...Cards.find({
|
result.subtaskItems.push(...Cards.find({
|
||||||
parentid: card._id
|
parentid: card._id,
|
||||||
}).fetch());
|
}).fetch());
|
||||||
});
|
});
|
||||||
result.rules.forEach((rule) => {
|
result.rules.forEach((rule) => {
|
||||||
result.triggers.push(...Triggers.find({
|
result.triggers.push(...Triggers.find({
|
||||||
_id: rule.triggerId
|
_id: rule.triggerId,
|
||||||
}, noBoardId).fetch());
|
}, noBoardId).fetch());
|
||||||
result.actions.push(...Actions.find({
|
result.actions.push(...Actions.find({
|
||||||
_id: rule.actionId
|
_id: rule.actionId,
|
||||||
}, noBoardId).fetch());
|
}, noBoardId).fetch());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -154,8 +154,8 @@ class Exporter {
|
||||||
});
|
});
|
||||||
const byUserIds = {
|
const byUserIds = {
|
||||||
_id: {
|
_id: {
|
||||||
$in: Object.getOwnPropertyNames(users)
|
$in: Object.getOwnPropertyNames(users),
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
// we use whitelist to be sure we do not expose inadvertently
|
// we use whitelist to be sure we do not expose inadvertently
|
||||||
// some secret fields that gets added to User later.
|
// some secret fields that gets added to User later.
|
||||||
|
|
|
||||||
|
|
@ -31,11 +31,10 @@ Rules.helpers({
|
||||||
},
|
},
|
||||||
getTrigger(){
|
getTrigger(){
|
||||||
return Triggers.findOne({_id:this.triggerId});
|
return Triggers.findOne({_id:this.triggerId});
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Rules.allow({
|
Rules.allow({
|
||||||
insert(userId, doc) {
|
insert(userId, doc) {
|
||||||
return allowIsBoardAdmin(userId, Boards.findOne(doc.boardId));
|
return allowIsBoardAdmin(userId, Boards.findOne(doc.boardId));
|
||||||
|
|
@ -45,5 +44,5 @@ Rules.allow({
|
||||||
},
|
},
|
||||||
remove(userId, doc) {
|
remove(userId, doc) {
|
||||||
return allowIsBoardAdmin(userId, Boards.findOne(doc.boardId));
|
return allowIsBoardAdmin(userId, Boards.findOne(doc.boardId));
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ Triggers.mutations({
|
||||||
rename(description) {
|
rename(description) {
|
||||||
return {
|
return {
|
||||||
$set: {
|
$set: {
|
||||||
description
|
description,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
@ -19,7 +19,7 @@ Triggers.allow({
|
||||||
},
|
},
|
||||||
remove(userId, doc) {
|
remove(userId, doc) {
|
||||||
return allowIsBoardAdmin(userId, Boards.findOne(doc.boardId));
|
return allowIsBoardAdmin(userId, Boards.findOne(doc.boardId));
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Triggers.helpers({
|
Triggers.helpers({
|
||||||
|
|
@ -30,7 +30,7 @@ Triggers.helpers({
|
||||||
|
|
||||||
getRule() {
|
getRule() {
|
||||||
return Rules.findOne({
|
return Rules.findOne({
|
||||||
triggerId: this._id
|
triggerId: this._id,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -44,7 +44,7 @@ Triggers.helpers({
|
||||||
|
|
||||||
findList(title) {
|
findList(title) {
|
||||||
return Lists.findOne({
|
return Lists.findOne({
|
||||||
title: title
|
title,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -54,5 +54,5 @@ Triggers.helpers({
|
||||||
return _.contains(this.labelIds, label._id);
|
return _.contains(this.labelIds, label._id);
|
||||||
});
|
});
|
||||||
return cardLabels;
|
return cardLabels;
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -224,8 +224,8 @@ export class WekanCreator {
|
||||||
const boardId = Boards.direct.insert(boardToCreate);
|
const boardId = Boards.direct.insert(boardToCreate);
|
||||||
Boards.direct.update(boardId, {
|
Boards.direct.update(boardId, {
|
||||||
$set: {
|
$set: {
|
||||||
modifiedAt: this._now()
|
modifiedAt: this._now(),
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
// log activity
|
// log activity
|
||||||
Activities.direct.insert({
|
Activities.direct.insert({
|
||||||
|
|
@ -373,15 +373,15 @@ export class WekanCreator {
|
||||||
if (wekanCoverId === att._id) {
|
if (wekanCoverId === att._id) {
|
||||||
Cards.direct.update(cardId, {
|
Cards.direct.update(cardId, {
|
||||||
$set: {
|
$set: {
|
||||||
coverId: wekanAtt._id
|
coverId: wekanAtt._id,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (att.file) {
|
} else if (att.file) {
|
||||||
file.attachData(new Buffer(att.file, 'base64'), {
|
file.attachData(new Buffer(att.file, 'base64'), {
|
||||||
type: att.type
|
type: att.type,
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
file.name(att.name);
|
file.name(att.name);
|
||||||
file.boardId = boardId;
|
file.boardId = boardId;
|
||||||
|
|
@ -401,8 +401,8 @@ export class WekanCreator {
|
||||||
if (wekanCoverId === att._id) {
|
if (wekanCoverId === att._id) {
|
||||||
Cards.direct.update(cardId, {
|
Cards.direct.update(cardId, {
|
||||||
$set: {
|
$set: {
|
||||||
coverId: wekanAtt._id
|
coverId: wekanAtt._id,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -448,8 +448,8 @@ export class WekanCreator {
|
||||||
const listId = Lists.direct.insert(listToCreate);
|
const listId = Lists.direct.insert(listToCreate);
|
||||||
Lists.direct.update(listId, {
|
Lists.direct.update(listId, {
|
||||||
$set: {
|
$set: {
|
||||||
'updatedAt': this._now()
|
'updatedAt': this._now(),
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
this.lists[list._id] = listId;
|
this.lists[list._id] = listId;
|
||||||
// // log activity
|
// // log activity
|
||||||
|
|
@ -485,8 +485,8 @@ export class WekanCreator {
|
||||||
const swimlaneId = Swimlanes.direct.insert(swimlaneToCreate);
|
const swimlaneId = Swimlanes.direct.insert(swimlaneToCreate);
|
||||||
Swimlanes.direct.update(swimlaneId, {
|
Swimlanes.direct.update(swimlaneId, {
|
||||||
$set: {
|
$set: {
|
||||||
'updatedAt': this._now()
|
'updatedAt': this._now(),
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
this.swimlanes[swimlane._id] = swimlaneId;
|
this.swimlanes[swimlane._id] = swimlaneId;
|
||||||
});
|
});
|
||||||
|
|
@ -512,13 +512,13 @@ export class WekanCreator {
|
||||||
createTriggers(wekanTriggers, boardId) {
|
createTriggers(wekanTriggers, boardId) {
|
||||||
wekanTriggers.forEach((trigger, ruleIndex) => {
|
wekanTriggers.forEach((trigger, ruleIndex) => {
|
||||||
if (trigger.hasOwnProperty('labelId')) {
|
if (trigger.hasOwnProperty('labelId')) {
|
||||||
trigger['labelId'] = this.labels[trigger['labelId']]
|
trigger.labelId = this.labels[trigger.labelId];
|
||||||
}
|
}
|
||||||
if (trigger.hasOwnProperty('memberId')) {
|
if (trigger.hasOwnProperty('memberId')) {
|
||||||
trigger['memberId'] = this.members[trigger['memberId']]
|
trigger.memberId = this.members[trigger.memberId];
|
||||||
}
|
}
|
||||||
trigger['boardId'] = boardId;
|
trigger.boardId = boardId;
|
||||||
const oldId = trigger['_id'];
|
const oldId = trigger._id;
|
||||||
delete trigger._id;
|
delete trigger._id;
|
||||||
this.triggers[oldId] = Triggers.direct.insert(trigger);
|
this.triggers[oldId] = Triggers.direct.insert(trigger);
|
||||||
});
|
});
|
||||||
|
|
@ -527,13 +527,13 @@ export class WekanCreator {
|
||||||
createActions(wekanActions, boardId) {
|
createActions(wekanActions, boardId) {
|
||||||
wekanActions.forEach((action, ruleIndex) => {
|
wekanActions.forEach((action, ruleIndex) => {
|
||||||
if (action.hasOwnProperty('labelId')) {
|
if (action.hasOwnProperty('labelId')) {
|
||||||
action['labelId'] = this.labels[action['labelId']]
|
action.labelId = this.labels[action.labelId];
|
||||||
}
|
}
|
||||||
if (action.hasOwnProperty('memberId')) {
|
if (action.hasOwnProperty('memberId')) {
|
||||||
action['memberId'] = this.members[action['memberId']]
|
action.memberId = this.members[action.memberId];
|
||||||
}
|
}
|
||||||
action['boardId'] = boardId;
|
action.boardId = boardId;
|
||||||
const oldId = action['_id'];
|
const oldId = action._id;
|
||||||
delete action._id;
|
delete action._id;
|
||||||
this.actions[oldId] = Actions.direct.insert(action);
|
this.actions[oldId] = Actions.direct.insert(action);
|
||||||
});
|
});
|
||||||
|
|
@ -542,9 +542,9 @@ export class WekanCreator {
|
||||||
createRules(wekanRules, boardId) {
|
createRules(wekanRules, boardId) {
|
||||||
wekanRules.forEach((rule, ruleIndex) => {
|
wekanRules.forEach((rule, ruleIndex) => {
|
||||||
// Create the rule
|
// Create the rule
|
||||||
rule['boardId'] = boardId;
|
rule.boardId = boardId;
|
||||||
rule['triggerId'] = this.triggers[rule['triggerId']];
|
rule.triggerId = this.triggers[rule.triggerId];
|
||||||
rule['actionId'] = this.actions[rule['actionId']];
|
rule.actionId = this.actions[rule.actionId];
|
||||||
delete rule._id;
|
delete rule._id;
|
||||||
Rules.direct.insert(rule);
|
Rules.direct.insert(rule);
|
||||||
});
|
});
|
||||||
|
|
@ -568,64 +568,64 @@ export class WekanCreator {
|
||||||
parseActivities(wekanBoard) {
|
parseActivities(wekanBoard) {
|
||||||
wekanBoard.activities.forEach((activity) => {
|
wekanBoard.activities.forEach((activity) => {
|
||||||
switch (activity.activityType) {
|
switch (activity.activityType) {
|
||||||
case 'addAttachment':
|
case 'addAttachment':
|
||||||
{
|
{
|
||||||
// We have to be cautious, because the attachment could have been removed later.
|
// We have to be cautious, because the attachment could have been removed later.
|
||||||
// In that case Wekan still reports its addition, but removes its 'url' field.
|
// In that case Wekan still reports its addition, but removes its 'url' field.
|
||||||
// So we test for that
|
// So we test for that
|
||||||
const wekanAttachment = wekanBoard.attachments.filter((attachment) => {
|
const wekanAttachment = wekanBoard.attachments.filter((attachment) => {
|
||||||
return attachment._id === activity.attachmentId;
|
return attachment._id === activity.attachmentId;
|
||||||
})[0];
|
})[0];
|
||||||
|
|
||||||
if (typeof wekanAttachment !== 'undefined' && wekanAttachment) {
|
if (typeof wekanAttachment !== 'undefined' && wekanAttachment) {
|
||||||
if (wekanAttachment.url || wekanAttachment.file) {
|
if (wekanAttachment.url || wekanAttachment.file) {
|
||||||
// we cannot actually create the Wekan attachment, because we don't yet
|
// we cannot actually create the Wekan attachment, because we don't yet
|
||||||
// have the cards to attach it to, so we store it in the instance variable.
|
// have the cards to attach it to, so we store it in the instance variable.
|
||||||
const wekanCardId = activity.cardId;
|
const wekanCardId = activity.cardId;
|
||||||
if (!this.attachments[wekanCardId]) {
|
if (!this.attachments[wekanCardId]) {
|
||||||
this.attachments[wekanCardId] = [];
|
this.attachments[wekanCardId] = [];
|
||||||
}
|
|
||||||
this.attachments[wekanCardId].push(wekanAttachment);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
this.attachments[wekanCardId].push(wekanAttachment);
|
||||||
}
|
|
||||||
case 'addComment':
|
|
||||||
{
|
|
||||||
const wekanComment = wekanBoard.comments.filter((comment) => {
|
|
||||||
return comment._id === activity.commentId;
|
|
||||||
})[0];
|
|
||||||
const id = activity.cardId;
|
|
||||||
if (!this.comments[id]) {
|
|
||||||
this.comments[id] = [];
|
|
||||||
}
|
|
||||||
this.comments[id].push(wekanComment);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'createBoard':
|
|
||||||
{
|
|
||||||
this.createdAt.board = activity.createdAt;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'createCard':
|
|
||||||
{
|
|
||||||
const cardId = activity.cardId;
|
|
||||||
this.createdAt.cards[cardId] = activity.createdAt;
|
|
||||||
this.createdBy.cards[cardId] = activity.userId;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'createList':
|
|
||||||
{
|
|
||||||
const listId = activity.listId;
|
|
||||||
this.createdAt.lists[listId] = activity.createdAt;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'createSwimlane':
|
|
||||||
{
|
|
||||||
const swimlaneId = activity.swimlaneId;
|
|
||||||
this.createdAt.swimlanes[swimlaneId] = activity.createdAt;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'addComment':
|
||||||
|
{
|
||||||
|
const wekanComment = wekanBoard.comments.filter((comment) => {
|
||||||
|
return comment._id === activity.commentId;
|
||||||
|
})[0];
|
||||||
|
const id = activity.cardId;
|
||||||
|
if (!this.comments[id]) {
|
||||||
|
this.comments[id] = [];
|
||||||
|
}
|
||||||
|
this.comments[id].push(wekanComment);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'createBoard':
|
||||||
|
{
|
||||||
|
this.createdAt.board = activity.createdAt;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'createCard':
|
||||||
|
{
|
||||||
|
const cardId = activity.cardId;
|
||||||
|
this.createdAt.cards[cardId] = activity.createdAt;
|
||||||
|
this.createdBy.cards[cardId] = activity.userId;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'createList':
|
||||||
|
{
|
||||||
|
const listId = activity.listId;
|
||||||
|
this.createdAt.lists[listId] = activity.createdAt;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'createSwimlane':
|
||||||
|
{
|
||||||
|
const swimlaneId = activity.swimlaneId;
|
||||||
|
this.createdAt.swimlanes[swimlaneId] = activity.createdAt;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -633,116 +633,116 @@ export class WekanCreator {
|
||||||
importActivities(activities, boardId) {
|
importActivities(activities, boardId) {
|
||||||
activities.forEach((activity) => {
|
activities.forEach((activity) => {
|
||||||
switch (activity.activityType) {
|
switch (activity.activityType) {
|
||||||
// Board related activities
|
// Board related activities
|
||||||
// TODO: addBoardMember, removeBoardMember
|
// TODO: addBoardMember, removeBoardMember
|
||||||
case 'createBoard':
|
case 'createBoard':
|
||||||
{
|
{
|
||||||
Activities.direct.insert({
|
Activities.direct.insert({
|
||||||
userId: this._user(activity.userId),
|
userId: this._user(activity.userId),
|
||||||
type: 'board',
|
type: 'board',
|
||||||
activityTypeId: boardId,
|
activityTypeId: boardId,
|
||||||
activityType: activity.activityType,
|
activityType: activity.activityType,
|
||||||
boardId,
|
boardId,
|
||||||
createdAt: this._now(activity.createdAt),
|
createdAt: this._now(activity.createdAt),
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// List related activities
|
// List related activities
|
||||||
// TODO: removeList, archivedList
|
// TODO: removeList, archivedList
|
||||||
case 'createList':
|
case 'createList':
|
||||||
{
|
{
|
||||||
Activities.direct.insert({
|
Activities.direct.insert({
|
||||||
userId: this._user(activity.userId),
|
userId: this._user(activity.userId),
|
||||||
type: 'list',
|
type: 'list',
|
||||||
activityType: activity.activityType,
|
activityType: activity.activityType,
|
||||||
listId: this.lists[activity.listId],
|
listId: this.lists[activity.listId],
|
||||||
boardId,
|
boardId,
|
||||||
createdAt: this._now(activity.createdAt),
|
createdAt: this._now(activity.createdAt),
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Card related activities
|
// Card related activities
|
||||||
// TODO: archivedCard, restoredCard, joinMember, unjoinMember
|
// TODO: archivedCard, restoredCard, joinMember, unjoinMember
|
||||||
case 'createCard':
|
case 'createCard':
|
||||||
{
|
{
|
||||||
Activities.direct.insert({
|
Activities.direct.insert({
|
||||||
userId: this._user(activity.userId),
|
userId: this._user(activity.userId),
|
||||||
activityType: activity.activityType,
|
activityType: activity.activityType,
|
||||||
listId: this.lists[activity.listId],
|
listId: this.lists[activity.listId],
|
||||||
cardId: this.cards[activity.cardId],
|
cardId: this.cards[activity.cardId],
|
||||||
boardId,
|
boardId,
|
||||||
createdAt: this._now(activity.createdAt),
|
createdAt: this._now(activity.createdAt),
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'moveCard':
|
case 'moveCard':
|
||||||
{
|
{
|
||||||
Activities.direct.insert({
|
Activities.direct.insert({
|
||||||
userId: this._user(activity.userId),
|
userId: this._user(activity.userId),
|
||||||
oldListId: this.lists[activity.oldListId],
|
oldListId: this.lists[activity.oldListId],
|
||||||
activityType: activity.activityType,
|
activityType: activity.activityType,
|
||||||
listId: this.lists[activity.listId],
|
listId: this.lists[activity.listId],
|
||||||
cardId: this.cards[activity.cardId],
|
cardId: this.cards[activity.cardId],
|
||||||
boardId,
|
boardId,
|
||||||
createdAt: this._now(activity.createdAt),
|
createdAt: this._now(activity.createdAt),
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Comment related activities
|
// Comment related activities
|
||||||
case 'addComment':
|
case 'addComment':
|
||||||
{
|
{
|
||||||
Activities.direct.insert({
|
Activities.direct.insert({
|
||||||
userId: this._user(activity.userId),
|
userId: this._user(activity.userId),
|
||||||
activityType: activity.activityType,
|
activityType: activity.activityType,
|
||||||
cardId: this.cards[activity.cardId],
|
cardId: this.cards[activity.cardId],
|
||||||
commentId: this.commentIds[activity.commentId],
|
commentId: this.commentIds[activity.commentId],
|
||||||
boardId,
|
boardId,
|
||||||
createdAt: this._now(activity.createdAt),
|
createdAt: this._now(activity.createdAt),
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Attachment related activities
|
// Attachment related activities
|
||||||
case 'addAttachment':
|
case 'addAttachment':
|
||||||
{
|
{
|
||||||
Activities.direct.insert({
|
Activities.direct.insert({
|
||||||
userId: this._user(activity.userId),
|
userId: this._user(activity.userId),
|
||||||
type: 'card',
|
type: 'card',
|
||||||
activityType: activity.activityType,
|
activityType: activity.activityType,
|
||||||
attachmentId: this.attachmentIds[activity.attachmentId],
|
attachmentId: this.attachmentIds[activity.attachmentId],
|
||||||
cardId: this.cards[activity.cardId],
|
cardId: this.cards[activity.cardId],
|
||||||
boardId,
|
boardId,
|
||||||
createdAt: this._now(activity.createdAt),
|
createdAt: this._now(activity.createdAt),
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Checklist related activities
|
// Checklist related activities
|
||||||
case 'addChecklist':
|
case 'addChecklist':
|
||||||
{
|
{
|
||||||
Activities.direct.insert({
|
Activities.direct.insert({
|
||||||
userId: this._user(activity.userId),
|
userId: this._user(activity.userId),
|
||||||
activityType: activity.activityType,
|
activityType: activity.activityType,
|
||||||
cardId: this.cards[activity.cardId],
|
cardId: this.cards[activity.cardId],
|
||||||
checklistId: this.checklists[activity.checklistId],
|
checklistId: this.checklists[activity.checklistId],
|
||||||
boardId,
|
boardId,
|
||||||
createdAt: this._now(activity.createdAt),
|
createdAt: this._now(activity.createdAt),
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'addChecklistItem':
|
case 'addChecklistItem':
|
||||||
{
|
{
|
||||||
Activities.direct.insert({
|
Activities.direct.insert({
|
||||||
userId: this._user(activity.userId),
|
userId: this._user(activity.userId),
|
||||||
activityType: activity.activityType,
|
activityType: activity.activityType,
|
||||||
cardId: this.cards[activity.cardId],
|
cardId: this.cards[activity.cardId],
|
||||||
checklistId: this.checklists[activity.checklistId],
|
checklistId: this.checklists[activity.checklistId],
|
||||||
checklistItemId: activity.checklistItemId.replace(
|
checklistItemId: activity.checklistItemId.replace(
|
||||||
activity.checklistId,
|
activity.checklistId,
|
||||||
this.checklists[activity.checklistId]),
|
this.checklists[activity.checklistId]),
|
||||||
boardId,
|
boardId,
|
||||||
createdAt: this._now(activity.createdAt),
|
createdAt: this._now(activity.createdAt),
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -790,4 +790,4 @@ export class WekanCreator {
|
||||||
// XXX add members
|
// XXX add members
|
||||||
return boardId;
|
return boardId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
allowIsBoardAdmin = function(userId, board) {
|
allowIsBoardAdmin = function(userId, board) {
|
||||||
return board && board.hasAdmin(userId);
|
return board && board.hasAdmin(userId);
|
||||||
};
|
};
|
||||||
|
|
||||||
allowIsBoardMember = function(userId, board) {
|
allowIsBoardMember = function(userId, board) {
|
||||||
return board && board.hasMember(userId);
|
return board && board.hasMember(userId);
|
||||||
};
|
};
|
||||||
|
|
||||||
allowIsBoardMemberCommentOnly = function(userId, board) {
|
allowIsBoardMemberCommentOnly = function(userId, board) {
|
||||||
|
|
@ -15,6 +15,6 @@ allowIsBoardMemberNoComments = function(userId, board) {
|
||||||
};
|
};
|
||||||
|
|
||||||
allowIsBoardMemberByCard = function(userId, card) {
|
allowIsBoardMemberByCard = function(userId, card) {
|
||||||
const board = card.board();
|
const board = card.board();
|
||||||
return board && board.hasMember(userId);
|
return board && board.hasMember(userId);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
Meteor.publish('rules', (ruleId) => {
|
Meteor.publish('rules', (ruleId) => {
|
||||||
check(ruleId, String);
|
check(ruleId, String);
|
||||||
return Rules.find({
|
return Rules.find({
|
||||||
_id: ruleId
|
_id: ruleId,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
Meteor.publish('allRules', () => {
|
Meteor.publish('allRules', () => {
|
||||||
return Rules.find({});
|
return Rules.find({});
|
||||||
});
|
});
|
||||||
|
|
||||||
Meteor.publish('allTriggers', () => {
|
Meteor.publish('allTriggers', () => {
|
||||||
return Triggers.find({});
|
return Triggers.find({});
|
||||||
});
|
});
|
||||||
|
|
||||||
Meteor.publish('allActions', () => {
|
Meteor.publish('allActions', () => {
|
||||||
return Actions.find({});
|
return Actions.find({});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,131 +1,131 @@
|
||||||
RulesHelper = {
|
RulesHelper = {
|
||||||
executeRules(activity){
|
executeRules(activity){
|
||||||
const matchingRules = this.findMatchingRules(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();
|
const action = matchingRules[i].getAction();
|
||||||
this.performAction(activity,action);
|
this.performAction(activity, action);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
findMatchingRules(activity){
|
findMatchingRules(activity){
|
||||||
const activityType = activity.activityType;
|
const activityType = activity.activityType;
|
||||||
if(TriggersDef[activityType] == undefined){
|
if(TriggersDef[activityType] === undefined){
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
const matchingFields = TriggersDef[activityType].matchingFields;
|
const matchingFields = TriggersDef[activityType].matchingFields;
|
||||||
const matchingMap = this.buildMatchingFieldsMap(activity,matchingFields);
|
const matchingMap = this.buildMatchingFieldsMap(activity, matchingFields);
|
||||||
let matchingTriggers = Triggers.find(matchingMap);
|
const matchingTriggers = Triggers.find(matchingMap);
|
||||||
let matchingRules = [];
|
const matchingRules = [];
|
||||||
matchingTriggers.forEach(function(trigger){
|
matchingTriggers.forEach(function(trigger){
|
||||||
matchingRules.push(trigger.getRule());
|
matchingRules.push(trigger.getRule());
|
||||||
});
|
});
|
||||||
return matchingRules;
|
return matchingRules;
|
||||||
},
|
},
|
||||||
buildMatchingFieldsMap(activity, matchingFields){
|
buildMatchingFieldsMap(activity, matchingFields){
|
||||||
let matchingMap = {"activityType":activity.activityType};
|
const matchingMap = {'activityType':activity.activityType};
|
||||||
for(let i = 0;i< matchingFields.length;i++){
|
for(let i = 0; i< matchingFields.length; i++){
|
||||||
// Creating a matching map with the actual field of the activity
|
// Creating a matching map with the actual field of the activity
|
||||||
// and with the wildcard (for example: trigger when a card is added
|
// and with the wildcard (for example: trigger when a card is added
|
||||||
// in any [*] board
|
// in any [*] board
|
||||||
matchingMap[matchingFields[i]] = { $in: [activity[matchingFields[i]],"*"]};
|
matchingMap[matchingFields[i]] = { $in: [activity[matchingFields[i]], '*']};
|
||||||
}
|
}
|
||||||
return matchingMap;
|
return matchingMap;
|
||||||
},
|
},
|
||||||
performAction(activity,action){
|
performAction(activity, action){
|
||||||
const card = Cards.findOne({_id:activity.cardId});
|
const card = Cards.findOne({_id:activity.cardId});
|
||||||
const boardId = activity.boardId;
|
const boardId = activity.boardId;
|
||||||
if(action.actionType == "moveCardToTop"){
|
if(action.actionType === 'moveCardToTop'){
|
||||||
let listId;
|
let listId;
|
||||||
let list;
|
let list;
|
||||||
if(activity.listTitle == "*"){
|
if(activity.listTitle === '*'){
|
||||||
listId = card.swimlaneId;
|
listId = card.swimlaneId;
|
||||||
list = card.list();
|
list = card.list();
|
||||||
}else{
|
}else{
|
||||||
list = Lists.findOne({title: action.listTitle, boardId:boardId });;
|
list = Lists.findOne({title: action.listTitle, boardId });
|
||||||
listId = list._id;
|
listId = list._id;
|
||||||
}
|
}
|
||||||
const minOrder = _.min(list.cards(card.swimlaneId).map((c) => c.sort));
|
const minOrder = _.min(list.cards(card.swimlaneId).map((c) => c.sort));
|
||||||
card.move(card.swimlaneId, listId, minOrder - 1);
|
card.move(card.swimlaneId, listId, minOrder - 1);
|
||||||
}
|
}
|
||||||
if(action.actionType == "moveCardToBottom"){
|
if(action.actionType === 'moveCardToBottom'){
|
||||||
let listId;
|
let listId;
|
||||||
let list;
|
let list;
|
||||||
if(activity.listTitle == "*"){
|
if(activity.listTitle === '*'){
|
||||||
listId = card.swimlaneId;
|
listId = card.swimlaneId;
|
||||||
list = card.list();
|
list = card.list();
|
||||||
}else{
|
}else{
|
||||||
list = Lists.findOne({title: action.listTitle, boardId:boardId});
|
list = Lists.findOne({title: action.listTitle, boardId});
|
||||||
listId = list._id;
|
listId = list._id;
|
||||||
}
|
}
|
||||||
const maxOrder = _.max(list.cards(card.swimlaneId).map((c) => c.sort));
|
const maxOrder = _.max(list.cards(card.swimlaneId).map((c) => c.sort));
|
||||||
card.move(card.swimlaneId, listId, maxOrder + 1);
|
card.move(card.swimlaneId, listId, maxOrder + 1);
|
||||||
}
|
}
|
||||||
if(action.actionType == "sendEmail"){
|
if(action.actionType === 'sendEmail'){
|
||||||
const emailTo = action.emailTo;
|
const emailTo = action.emailTo;
|
||||||
const emailMsg = action.emailMsg;
|
const emailMsg = action.emailMsg;
|
||||||
const emailSubject = action.emailSubject;
|
const emailSubject = action.emailSubject;
|
||||||
try {
|
try {
|
||||||
Email.send({
|
Email.send({
|
||||||
to: to,
|
to,
|
||||||
from: Accounts.emailTemplates.from,
|
from: Accounts.emailTemplates.from,
|
||||||
subject: subject,
|
subject,
|
||||||
text,
|
text,
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(action.actionType == "archive"){
|
if(action.actionType === 'archive'){
|
||||||
card.archive();
|
card.archive();
|
||||||
}
|
}
|
||||||
if(action.actionType == "unarchive"){
|
if(action.actionType === 'unarchive'){
|
||||||
card.restore();
|
card.restore();
|
||||||
}
|
}
|
||||||
if(action.actionType == "addLabel"){
|
if(action.actionType === 'addLabel'){
|
||||||
card.addLabel(action.labelId);
|
card.addLabel(action.labelId);
|
||||||
}
|
}
|
||||||
if(action.actionType == "removeLabel"){
|
if(action.actionType === 'removeLabel'){
|
||||||
card.removeLabel(action.labelId);
|
card.removeLabel(action.labelId);
|
||||||
}
|
}
|
||||||
if(action.actionType == "addMember"){
|
if(action.actionType === 'addMember'){
|
||||||
const memberId = Users.findOne({username:action.memberName})._id;
|
const memberId = Users.findOne({username:action.memberName})._id;
|
||||||
card.assignMember(memberId);
|
card.assignMember(memberId);
|
||||||
}
|
}
|
||||||
if(action.actionType == "removeMember"){
|
if(action.actionType === 'removeMember'){
|
||||||
if(action.memberName == "*"){
|
if(action.memberName === '*'){
|
||||||
const members = card.members;
|
const members = card.members;
|
||||||
for(let i = 0;i< members.length;i++){
|
for(let i = 0; i< members.length; i++){
|
||||||
card.unassignMember(members[i]);
|
card.unassignMember(members[i]);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
const memberId = Users.findOne({username:action.memberName})._id;
|
const memberId = Users.findOne({username:action.memberName})._id;
|
||||||
card.unassignMember(memberId);
|
card.unassignMember(memberId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(action.actionType == "checkAll"){
|
if(action.actionType === 'checkAll'){
|
||||||
const checkList = Checklists.findOne({"title":action.checklistName,"cardId":card._id});
|
const checkList = Checklists.findOne({'title':action.checklistName, 'cardId':card._id});
|
||||||
checkList.checkAllItems();
|
checkList.checkAllItems();
|
||||||
}
|
}
|
||||||
if(action.actionType == "uncheckAll"){
|
if(action.actionType === 'uncheckAll'){
|
||||||
const checkList = Checklists.findOne({"title":action.checklistName,"cardId":card._id});
|
const checkList = Checklists.findOne({'title':action.checklistName, 'cardId':card._id});
|
||||||
checkList.uncheckAllItems();
|
checkList.uncheckAllItems();
|
||||||
}
|
}
|
||||||
if(action.actionType == "checkItem"){
|
if(action.actionType === 'checkItem'){
|
||||||
const checkList = Checklists.findOne({"title":action.checklistName,"cardId":card._id});
|
const checkList = Checklists.findOne({'title':action.checklistName, 'cardId':card._id});
|
||||||
const checkItem = ChecklistItems.findOne({"title":action.checkItemName,"checkListId":checkList._id})
|
const checkItem = ChecklistItems.findOne({'title':action.checkItemName, 'checkListId':checkList._id});
|
||||||
checkItem.check();
|
checkItem.check();
|
||||||
}
|
}
|
||||||
if(action.actionType == "uncheckItem"){
|
if(action.actionType === 'uncheckItem'){
|
||||||
const checkList = Checklists.findOne({"title":action.checklistName,"cardId":card._id});
|
const checkList = Checklists.findOne({'title':action.checklistName, 'cardId':card._id});
|
||||||
const checkItem = ChecklistItems.findOne({"title":action.checkItemName,"checkListId":checkList._id})
|
const checkItem = ChecklistItems.findOne({'title':action.checkItemName, 'checkListId':checkList._id});
|
||||||
checkItem.uncheck();
|
checkItem.uncheck();
|
||||||
}
|
}
|
||||||
if(action.actionType == "addChecklist"){
|
if(action.actionType === 'addChecklist'){
|
||||||
Checklists.insert({"title":action.checklistName,"cardId":card._id,"sort":0});
|
Checklists.insert({'title':action.checklistName, 'cardId':card._id, 'sort':0});
|
||||||
}
|
}
|
||||||
if(action.actionType == "removeChecklist"){
|
if(action.actionType === 'removeChecklist'){
|
||||||
Checklists.remove({"title":action.checklistName,"cardId":card._id,"sort":0});
|
Checklists.remove({'title':action.checklistName, 'cardId':card._id, 'sort':0});
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,59 +1,58 @@
|
||||||
TriggersDef = {
|
TriggersDef = {
|
||||||
createCard:{
|
createCard:{
|
||||||
matchingFields: ["boardId", "listName"]
|
matchingFields: ['boardId', 'listName'],
|
||||||
},
|
},
|
||||||
moveCard:{
|
moveCard:{
|
||||||
matchingFields: ["boardId", "listName", "oldListName"]
|
matchingFields: ['boardId', 'listName', 'oldListName'],
|
||||||
},
|
},
|
||||||
archivedCard:{
|
archivedCard:{
|
||||||
matchingFields: ["boardId"]
|
matchingFields: ['boardId'],
|
||||||
},
|
},
|
||||||
restoredCard:{
|
restoredCard:{
|
||||||
matchingFields: ["boardId"]
|
matchingFields: ['boardId'],
|
||||||
},
|
},
|
||||||
joinMember:{
|
joinMember:{
|
||||||
matchingFields: ["boardId","memberId"]
|
matchingFields: ['boardId', 'memberId'],
|
||||||
},
|
},
|
||||||
unjoinMember:{
|
unjoinMember:{
|
||||||
matchingFields: ["boardId","memberId"]
|
matchingFields: ['boardId', 'memberId'],
|
||||||
},
|
},
|
||||||
addChecklist:{
|
addChecklist:{
|
||||||
matchingFields: ["boardId","checklistName"]
|
matchingFields: ['boardId', 'checklistName'],
|
||||||
},
|
},
|
||||||
removeChecklist:{
|
removeChecklist:{
|
||||||
matchingFields: ["boardId","checklistName"]
|
matchingFields: ['boardId', 'checklistName'],
|
||||||
},
|
},
|
||||||
completeChecklist:{
|
completeChecklist:{
|
||||||
matchingFields: ["boardId","checklistName"]
|
matchingFields: ['boardId', 'checklistName'],
|
||||||
},
|
},
|
||||||
uncompleteChecklist:{
|
uncompleteChecklist:{
|
||||||
matchingFields: ["boardId","checklistName"]
|
matchingFields: ['boardId', 'checklistName'],
|
||||||
},
|
},
|
||||||
addedChecklistItem:{
|
addedChecklistItem:{
|
||||||
matchingFields: ["boardId","checklistItemName"]
|
matchingFields: ['boardId', 'checklistItemName'],
|
||||||
},
|
},
|
||||||
removedChecklistItem:{
|
removedChecklistItem:{
|
||||||
matchingFields: ["boardId","checklistItemName"]
|
matchingFields: ['boardId', 'checklistItemName'],
|
||||||
},
|
},
|
||||||
checkedItem:{
|
checkedItem:{
|
||||||
matchingFields: ["boardId","checklistItemName"]
|
matchingFields: ['boardId', 'checklistItemName'],
|
||||||
},
|
},
|
||||||
uncheckedItem:{
|
uncheckedItem:{
|
||||||
matchingFields: ["boardId","checklistItemName"]
|
matchingFields: ['boardId', 'checklistItemName'],
|
||||||
},
|
},
|
||||||
addAttachment:{
|
addAttachment:{
|
||||||
matchingFields: ["boardId"]
|
matchingFields: ['boardId'],
|
||||||
},
|
},
|
||||||
deleteAttachment:{
|
deleteAttachment:{
|
||||||
matchingFields: ["boardId"]
|
matchingFields: ['boardId'],
|
||||||
},
|
},
|
||||||
addedLabel:{
|
addedLabel:{
|
||||||
matchingFields: ["boardId","labelId"]
|
matchingFields: ['boardId', 'labelId'],
|
||||||
},
|
},
|
||||||
removedLabel:{
|
removedLabel:{
|
||||||
matchingFields: ["boardId","labelId"]
|
matchingFields: ['boardId', 'labelId'],
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue