mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
feat: Log actions when task completion status changes
This commit is contained in:
parent
5d53f44fe8
commit
d5fd2fd33b
6 changed files with 64 additions and 0 deletions
|
@ -132,6 +132,22 @@ module.exports = {
|
|||
}),
|
||||
user: inputs.actorUser,
|
||||
});
|
||||
|
||||
if (inputs.record.isCompleted !== task.isCompleted) {
|
||||
await sails.helpers.actions.createOne.with({
|
||||
values: {
|
||||
type: task.isCompleted ? Action.Types.COMPLETE_TASK : Action.Types.UNCOMPLETE_TASK,
|
||||
data: {
|
||||
task: _.pick(task, ['id', 'name']),
|
||||
},
|
||||
user: inputs.actorUser,
|
||||
card: inputs.card,
|
||||
},
|
||||
project: inputs.project,
|
||||
board: inputs.board,
|
||||
list: inputs.list,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return task;
|
||||
|
|
|
@ -15,6 +15,8 @@ const Types = {
|
|||
MOVE_CARD: 'moveCard',
|
||||
ADD_MEMBER_TO_CARD: 'addMemberToCard',
|
||||
REMOVE_MEMBER_FROM_CARD: 'removeMemberFromCard',
|
||||
COMPLETE_TASK: 'completeTask',
|
||||
UNCOMPLETE_TASK: 'uncompleteTask',
|
||||
};
|
||||
|
||||
const INTERNAL_NOTIFIABLE_TYPES = [Types.MOVE_CARD, Types.ADD_MEMBER_TO_CARD];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue