1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-24 15:49:46 +02:00

feat: Persist closed state per card

This commit is contained in:
Maksim Eltyshev 2025-07-09 17:45:47 +02:00
parent 69c75a03b1
commit 709a0d1758
19 changed files with 163 additions and 71 deletions

View file

@ -67,6 +67,10 @@ module.exports = {
delete values.position;
}
if (values.list.type === List.Types.CLOSED) {
values.isClosed = true;
}
const card = await Card.qm.createOne({
...values,
boardId: values.board.id,

View file

@ -91,6 +91,7 @@ module.exports = {
'description',
'dueDate',
'stopwatch',
'isClosed',
]),
...values,
creatorUserId: values.creatorUser.id,

View file

@ -378,8 +378,6 @@ module.exports = {
}
if (values.list) {
values.listChangedAt = new Date().toISOString();
if (values.board || inputs.list.type === List.Types.TRASH) {
values.prevListId = null;
} else if (sails.helpers.lists.isArchiveOrTrash(values.list)) {
@ -387,6 +385,16 @@ module.exports = {
} else if (inputs.list.type === List.Types.ARCHIVE) {
values.prevListId = null;
}
if (inputs.record.isClosed) {
if (values.list.type === List.Types.ACTIVE) {
values.isClosed = false;
}
} else if (values.list.type === List.Types.CLOSED) {
values.isClosed = true;
}
values.listChangedAt = new Date().toISOString();
}
card = await Card.qm.updateOne(inputs.record.id, values);