mirror of
https://github.com/wekan/wekan.git
synced 2025-12-19 17:00:13 +01:00
Outgoing Webhooks setCustomField: Add board name, card name, custom field name to be visible.
Still missing: custom field value, list name, swimlane name. Thanks to xet7 !
This commit is contained in:
parent
12795c5995
commit
2003d90467
3 changed files with 12 additions and 6 deletions
|
|
@ -189,7 +189,9 @@ if (Meteor.isServer) {
|
||||||
if (activity.customFieldId) {
|
if (activity.customFieldId) {
|
||||||
const customField = activity.customField();
|
const customField = activity.customField();
|
||||||
params.customField = customField.name;
|
params.customField = customField.name;
|
||||||
params.customFieldValue = customField.text;
|
params.customFieldValue = Activities.findOne({
|
||||||
|
customFieldId: customField._id,
|
||||||
|
}).value;
|
||||||
}
|
}
|
||||||
// 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) {
|
||||||
|
|
|
||||||
|
|
@ -1620,9 +1620,9 @@ if (Meteor.isServer) {
|
||||||
// With a huge database, this result in a very slow app and high CPU on the mongodb side.
|
// With a huge database, this result in a very slow app and high CPU on the mongodb side.
|
||||||
// To correct it, add Index to parentId:
|
// To correct it, add Index to parentId:
|
||||||
Cards._collection._ensureIndex({ parentId: 1 });
|
Cards._collection._ensureIndex({ parentId: 1 });
|
||||||
/*let notifydays = parseInt(process.env.NOTIFY_DUE_DAYS_BEFORE_AND_AFTER) || 2; // default as 2 days b4 and after
|
// let notifydays = parseInt(process.env.NOTIFY_DUE_DAYS_BEFORE_AND_AFTER) || 2; // default as 2 days b4 and after
|
||||||
let notifyitvl = parseInt(process.env.NOTIFY_DUE_AT_HOUR_OF_DAY) || 3600 * 24 * 1e3; // default interval as one day
|
// let notifyitvl = parseInt(process.env.NOTIFY_DUE_AT_HOUR_OF_DAY) || 3600 * 24 * 1e3; // default interval as one day
|
||||||
Meteor.call("findDueCards",notifydays,notifyitvl);*/
|
// Meteor.call("findDueCards",notifydays,notifyitvl);
|
||||||
Meteor.defer(() => {
|
Meteor.defer(() => {
|
||||||
addCronJob();
|
addCronJob();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -165,11 +165,15 @@ function customFieldDeletion(userId, doc) {
|
||||||
// instead it shows undefined, and no listId and swimlaneId.
|
// instead it shows undefined, and no listId and swimlaneId.
|
||||||
function customFieldEdit(userId, doc) {
|
function customFieldEdit(userId, doc) {
|
||||||
const card = Cards.findOne(doc.cardId);
|
const card = Cards.findOne(doc.cardId);
|
||||||
|
const customFieldValue = Activities.findOne({ customFieldId: doc._id }).value;
|
||||||
|
const boardId = card.boardId;
|
||||||
|
//boardId: doc.boardIds[0], // We are creating a customField, it has only one boardId
|
||||||
Activities.insert({
|
Activities.insert({
|
||||||
userId,
|
userId,
|
||||||
activityType: 'editCustomField',
|
activityType: 'setCustomField',
|
||||||
boardId: doc.boardIds[0], // We are creating a customField, it has only one boardId
|
boardId,
|
||||||
customFieldId: doc._id,
|
customFieldId: doc._id,
|
||||||
|
customFieldValue,
|
||||||
listId: card.listId,
|
listId: card.listId,
|
||||||
swimlaneId: card.swimlaneId,
|
swimlaneId: card.swimlaneId,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue