mirror of
https://github.com/wekan/wekan.git
synced 2026-01-23 09:46:09 +01:00
- 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:
parent
7c89336ea9
commit
5283ba9ebb
6 changed files with 82 additions and 19 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue