Per-User and Board-level data save fixes. Per-User is collapse, width, height. Per-Board is Swimlanes, Lists, Cards etc.

Thanks to xet7 !

Fixes #5997
This commit is contained in:
Lauri Ojansivu 2025-12-23 07:49:37 +02:00
parent 2e0e1e56b5
commit 414b8dbf41
11 changed files with 2273 additions and 57 deletions

View file

@ -2061,6 +2061,14 @@ Cards.mutations({
},
move(boardId, swimlaneId, listId, sort = null) {
// Capture previous state for history tracking
const previousState = {
boardId: this.boardId,
swimlaneId: this.swimlaneId,
listId: this.listId,
sort: this.sort,
};
const mutatedFields = {
boardId,
swimlaneId,
@ -2108,6 +2116,28 @@ Cards.mutations({
$set: mutatedFields,
});
// Track position change in user history (server-side only)
if (Meteor.isServer && Meteor.userId() && typeof UserPositionHistory !== 'undefined') {
try {
UserPositionHistory.trackChange({
userId: Meteor.userId(),
boardId: this.boardId,
entityType: 'card',
entityId: this._id,
actionType: 'move',
previousState,
newState: {
boardId,
swimlaneId,
listId,
sort: sort !== null ? sort : this.sort,
},
});
} catch (e) {
console.warn('Failed to track card move in history:', e);
}
}
// Ensure attachments follow the card to its new board/list/swimlane
if (Meteor.isServer) {
const updateMeta = {};