Make possible for lists to have different names at different swimlanes. Make possible to drag list from one swimlane to another swimlane.

Thanks to xet7 !
This commit is contained in:
Lauri Ojansivu 2025-10-10 21:14:44 +03:00
parent 39daf56811
commit 719ef87efc
5 changed files with 144 additions and 12 deletions

View file

@ -777,13 +777,22 @@ Boards.helpers({
{
boardId: this._id,
archived: false,
// Get lists for all swimlanes in this board
swimlaneId: { $in: this.swimlanes().map(s => s._id) },
},
{ sort: sortKey },
);
},
draggableLists() {
return ReactiveCache.getLists({ boardId: this._id }, { sort: { sort: 1 } });
return ReactiveCache.getLists(
{
boardId: this._id,
// Get lists for all swimlanes in this board
swimlaneId: { $in: this.swimlanes().map(s => s._id) }
},
{ sort: { sort: 1 } }
);
},
/** returns the last list
@ -1171,6 +1180,7 @@ Boards.helpers({
this.subtasksDefaultListId = Lists.insert({
title: TAPi18n.__('queue'),
boardId: this._id,
swimlaneId: this.getDefaultSwimline()._id, // Set default swimlane for subtasks list
});
this.setSubtasksDefaultListId(this.subtasksDefaultListId);
}
@ -1189,6 +1199,7 @@ Boards.helpers({
this.dateSettingsDefaultListId = Lists.insert({
title: TAPi18n.__('queue'),
boardId: this._id,
swimlaneId: this.getDefaultSwimline()._id, // Set default swimlane for date settings list
});
this.setDateSettingsDefaultListId(this.dateSettingsDefaultListId);
}

View file

@ -50,10 +50,10 @@ Lists.attachSchema(
},
swimlaneId: {
/**
* the swimlane associated to this list. Used for templates
* the swimlane associated to this list. Required for per-swimlane list titles
*/
type: String,
defaultValue: '',
// Remove defaultValue to make it required
},
createdAt: {
/**
@ -196,7 +196,7 @@ Lists.helpers({
_id = existingListWithSameName._id;
} else {
delete this._id;
delete this.swimlaneId;
this.swimlaneId = swimlaneId; // Set the target swimlane for the copied list
_id = Lists.insert(this);
}
@ -231,6 +231,7 @@ Lists.helpers({
type: this.type,
archived: false,
wipLimit: this.wipLimit,
swimlaneId: swimlaneId, // Set the target swimlane for the moved list
});
}
@ -585,6 +586,7 @@ if (Meteor.isServer) {
title: req.body.title,
boardId: paramBoardId,
sort: board.lists().length,
swimlaneId: req.body.swimlaneId || board.getDefaultSwimline()._id, // Use provided swimlaneId or default
});
JsonRoutes.sendResult(res, {
code: 200,

View file

@ -173,6 +173,7 @@ Swimlanes.helpers({
type: list.type,
archived: false,
wipLimit: list.wipLimit,
swimlaneId: toSwimlaneId, // Set the target swimlane for the copied list
});
}
@ -213,7 +214,7 @@ Swimlanes.helpers({
return ReactiveCache.getLists(
{
boardId: this.boardId,
swimlaneId: { $in: [this._id, ''] },
swimlaneId: this._id, // Only get lists that belong to this specific swimlane
archived: false,
},
{ sort: { modifiedAt: -1 } },
@ -223,7 +224,7 @@ Swimlanes.helpers({
return ReactiveCache.getLists(
{
boardId: this.boardId,
swimlaneId: { $in: [this._id, ''] },
swimlaneId: this._id, // Only get lists that belong to this specific swimlane
//archived: false,
},
{ sort: ['sort'] },