diff options
author | Lauri Ojansivu <x@xet7.org> | 2019-03-04 12:10:11 +0200 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2019-03-04 12:10:11 +0200 |
commit | 6c0df108c7f4a4f1793d4d49a3b808a340d9ff48 (patch) | |
tree | 950d413360a24de568b3cd329806e01008f15c80 /models/activities.js | |
parent | 5f3ffcb0eb0c844a34a285f82a6dc58379351e89 (diff) | |
parent | 9d6d5e1a14c2a3ef22d90eaccffd352d06253117 (diff) | |
download | wekan-6c0df108c7f4a4f1793d4d49a3b808a340d9ff48.tar.gz wekan-6c0df108c7f4a4f1793d4d49a3b808a340d9ff48.tar.bz2 wekan-6c0df108c7f4a4f1793d4d49a3b808a340d9ff48.zip |
Merge branch 'edge' into meteor-1.8
Diffstat (limited to 'models/activities.js')
-rw-r--r-- | models/activities.js | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/models/activities.js b/models/activities.js index b26278b1..84c45856 100644 --- a/models/activities.js +++ b/models/activities.js @@ -56,23 +56,22 @@ Activities.helpers({ customField() { return CustomFields.findOne(this.customFieldId); }, - label() { - return Labels.findOne(this.labelId); - }, + // Label activity did not work yet, unable to edit labels when tried this. + //label() { + // return Cards.findOne(this.labelId); + //}, }); Activities.before.insert((userId, doc) => { doc.createdAt = new Date(); }); - Activities.after.insert((userId, doc) => { const activity = Activities._transform(doc); RulesHelper.executeRules(activity); }); - if (Meteor.isServer) { // For efficiency create indexes on the date of creation, and on the date of // creation in conjunction with the card or board id, as corresponding views @@ -84,7 +83,9 @@ if (Meteor.isServer) { Activities._collection._ensureIndex({ commentId: 1 }, { partialFilterExpression: { commentId: { $exists: true } } }); Activities._collection._ensureIndex({ attachmentId: 1 }, { partialFilterExpression: { attachmentId: { $exists: true } } }); Activities._collection._ensureIndex({ customFieldId: 1 }, { partialFilterExpression: { customFieldId: { $exists: true } } }); - Activities._collection._ensureIndex({ labelId: 1 }, { partialFilterExpression: { labelId: { $exists: true } } }); + // Label activity did not work yet, unable to edit labels when tried this. + //Activities._collection._dropIndex({ labelId: 1 }, { "indexKey": -1 }); + //Activities._collection._dropIndex({ labelId: 1 }, { partialFilterExpression: { labelId: { $exists: true } } }); }); Activities.after.insert((userId, doc) => { @@ -173,11 +174,12 @@ if (Meteor.isServer) { const customField = activity.customField(); params.customField = customField.name; } - if (activity.labelId) { - const label = activity.label(); - params.label = label.name; - params.labelId = activity.labelId; - } + // Label activity did not work yet, unable to edit labels when tried this. + //if (activity.labelId) { + // const label = activity.label(); + // params.label = label.name; + // params.labelId = activity.labelId; + //} if (board) { const watchingUsers = _.pluck(_.where(board.watchers, {level: 'watching'}), 'userId'); const trackingUsers = _.pluck(_.where(board.watchers, {level: 'tracking'}), 'userId'); |