wekan/models/triggers.js

58 lines
909 B
JavaScript
Raw Normal View History

2018-08-03 19:47:20 +02:00
Triggers = new Mongo.Collection('triggers');
Triggers.mutations({
rename(description) {
return { $set: { description } };
},
});
Triggers.allow({
update: function () {
// add custom authentication code here
return true;
},
insert: function () {
// add custom authentication code here
return true;
2018-08-16 00:42:14 +02:00
},
remove: function () {
// add custom authentication code here
return true;
2018-08-03 19:47:20 +02:00
}
});
Triggers.helpers({
2018-08-16 00:32:31 +02:00
getRule(){
return Rules.findOne({triggerId:this._id});
},
2018-08-03 19:47:20 +02:00
fromList() {
return Lists.findOne(this.fromId);
},
toList() {
return Lists.findOne(this.toId);
},
findList(title) {
return Lists.findOne({title:title});
},
labels() {
const boardLabels = this.board().labels;
const cardLabels = _.filter(boardLabels, (label) => {
return _.contains(this.labelIds, label._id);
});
return cardLabels;
2018-08-15 18:47:09 +02:00
}});
2018-08-03 19:47:20 +02:00