diff options
author | Lauri Ojansivu <x@xet7.org> | 2019-03-04 12:04:12 +0200 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2019-03-04 12:04:12 +0200 |
commit | 763cf81c973d6e110a3a2102b7da454b7038facc (patch) | |
tree | 4ff7c10e2267d488acaa5f9851f23f5b13b6f648 /models/activities.js | |
parent | 0b64a46bdca257ed8fb8f320d8dd2f8fec994c89 (diff) | |
download | wekan-763cf81c973d6e110a3a2102b7da454b7038facc.tar.gz wekan-763cf81c973d6e110a3a2102b7da454b7038facc.tar.bz2 wekan-763cf81c973d6e110a3a2102b7da454b7038facc.zip |
[Fix Adding Labels to cards is not possible anymore](https://github.com/wekan/wekan/issues/2223).
Thanks to xet7 !
Closes #2223
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'); |