diff options
author | Angelo Gallarello <angelo.gallarell@gmail.com> | 2018-08-15 18:47:09 +0200 |
---|---|---|
committer | Angelo Gallarello <angelo.gallarell@gmail.com> | 2018-08-15 18:47:09 +0200 |
commit | 9b0eb0a9f1973e05df7199cf2bff7518f2fa98dc (patch) | |
tree | a8a8aac97c9c8103f30d9ec2cd0c4cb0c0fc2396 /models/actions.js | |
parent | 93cc7f0232ee456aff07e456b9c4601264f47ab4 (diff) | |
download | wekan-9b0eb0a9f1973e05df7199cf2bff7518f2fa98dc.tar.gz wekan-9b0eb0a9f1973e05df7199cf2bff7518f2fa98dc.tar.bz2 wekan-9b0eb0a9f1973e05df7199cf2bff7518f2fa98dc.zip |
Almost full circle
Diffstat (limited to 'models/actions.js')
-rw-r--r-- | models/actions.js | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/models/actions.js b/models/actions.js new file mode 100644 index 00000000..0961abbb --- /dev/null +++ b/models/actions.js @@ -0,0 +1,62 @@ +Actions = new Mongo.Collection('actions'); + + + +Actions.mutations({ + rename(description) { + return { $set: { description } }; + }, +}); + +Actions.allow({ + update: function () { + // add custom authentication code here + return true; + }, + insert: function () { + // add custom authentication code here + return true; + } +}); + + +Actions.helpers({ + 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; + }}); + + + +if (Meteor.isServer) { + Meteor.startup(() => { + const rules = Triggers.findOne({}); + if(!rules){ + Actions.insert({actionType: "moveCardToTop"}); + } + }); +} + + + + + + + + + |