- Fix Outgoing Webhook messages for Checlists, Checklist Items, Card comments, Add/Remove CustomField to board.

Not yet fixed is Outgoing Webhook message about setting CustomField value.

Thanks to xet7 !

Related #1969
This commit is contained in:
Lauri Ojansivu 2019-06-27 04:06:21 +03:00
parent 7c89336ea9
commit 5283ba9ebb
6 changed files with 82 additions and 19 deletions

View file

@ -81,14 +81,15 @@ CardComments.helpers({
CardComments.hookOptions.after.update = { fetchPrevious: false };
function commentCreation(userId, doc){
const card = Cards.findOne(doc.cardId);
Activities.insert({
userId,
activityType: 'addComment',
boardId: doc.boardId,
cardId: doc.cardId,
commentId: doc._id,
listId: doc.listId,
swimlaneId: doc.swimlaneId,
listId: card.listId,
swimlaneId: card.swimlaneId,
});
}
@ -103,6 +104,34 @@ if (Meteor.isServer) {
commentCreation(userId, doc);
});
CardComments.after.update((userId, doc) => {
const activity = Activities.findOne({ commentId: doc._id });
const card = Cards.findOne(doc.cardId);
Activities.insert({
userId,
activityType: 'editComment',
boardId: doc.boardId,
cardId: doc.cardId,
commentId: doc._id,
listId: card.listId,
swimlaneId: card.swimlaneId,
});
});
CardComments.before.remove((userId, doc) => {
const activity = Activities.findOne({ commentId: doc._id });
const card = Cards.findOne(doc.cardId);
Activities.insert({
userId,
activityType: 'deleteComment',
boardId: doc.boardId,
cardId: doc.cardId,
commentId: doc._id,
listId: card.listId,
swimlaneId: card.swimlaneId,
});
});
CardComments.after.remove((userId, doc) => {
const activity = Activities.findOne({ commentId: doc._id });
if (activity) {