Try to get some label outgoing webhooks working.

Thanks to xet7 !

Related #4898
This commit is contained in:
Lauri Ojansivu 2023-09-15 21:34:31 +03:00
parent b64715f70a
commit b40654cdfe
3 changed files with 23 additions and 11 deletions

View file

@ -58,10 +58,10 @@ Activities.helpers({
customField() { customField() {
return ReactiveCache.getCustomField(this.customFieldId); return ReactiveCache.getCustomField(this.customFieldId);
}, },
// Label activity did not work yet, unable to edit labels when tried this. label() {
//label() { // Label activity did not work yet, unable to edit labels when tried this.
// return ReactiveCache.getCard(this.labelId); return ReactiveCache.getCard(this.labelId);
//}, },
}); });
Activities.before.update((userId, doc, fieldNames, modifier) => { Activities.before.update((userId, doc, fieldNames, modifier) => {
@ -101,8 +101,8 @@ if (Meteor.isServer) {
{ partialFilterExpression: { customFieldId: { $exists: true } } }, { partialFilterExpression: { customFieldId: { $exists: true } } },
); );
// Label activity did not work yet, unable to edit labels when tried this. // 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 }, { "indexKey": -1 });
//Activities._collection._dropIndex({ labelId: 1 }, { partialFilterExpression: { labelId: { $exists: true } } }); //Activities._collection.dropIndex({ labelId: 1 }, { partialFilterExpression: { labelId: { $exists: true } } });
}); });
Activities.after.insert((userId, doc) => { Activities.after.insert((userId, doc) => {
@ -280,11 +280,19 @@ if (Meteor.isServer) {
} }
} }
// Label activity did not work yet, unable to edit labels when tried this. // Label activity did not work yet, unable to edit labels when tried this.
//if (activity.labelId) { if (activity.labelId) {
// const label = activity.label(); const label = activity.label();
// params.label = label.name; if (label) {
// params.labelId = activity.labelId; if (label.name) {
//} params.label = label.name;
} else if (label.color) {
params.label = label.color;
}
if (label._id) {
params.labelId = label._id;
}
}
}
if ( if (
(!activity.timeKey || activity.timeKey === 'dueAt') && (!activity.timeKey || activity.timeKey === 'dueAt') &&
activity.timeValue activity.timeValue

View file

@ -2820,6 +2820,7 @@ function cardLabels(userId, doc, fieldNames, modifier) {
// Say hello to the new label // Say hello to the new label
if (modifier.$addToSet && modifier.$addToSet.labelIds) { if (modifier.$addToSet && modifier.$addToSet.labelIds) {
labelId = modifier.$addToSet.labelIds; labelId = modifier.$addToSet.labelIds;
//const label = labels(labelId).name;
if (!_.contains(doc.labelIds, labelId)) { if (!_.contains(doc.labelIds, labelId)) {
const act = { const act = {
userId, userId,

View file

@ -66,6 +66,8 @@ if (Meteor.isServer) {
'swimlaneId', 'swimlaneId',
'customField', 'customField',
'customFieldValue', 'customFieldValue',
'labelId',
'label',
'attachmentId', 'attachmentId',
]; ];
const responseFunc = data => { const responseFunc = data => {
@ -126,6 +128,7 @@ if (Meteor.isServer) {
'checklist', 'checklist',
'swimlane', 'swimlane',
'oldSwimlane', 'oldSwimlane',
'labelId',
'label', 'label',
'attachment', 'attachment',
'attachmentId', 'attachmentId',