mirror of
https://github.com/wekan/wekan.git
synced 2026-01-04 16:48:49 +01:00
Fix list view issues. Allow creation of boards from templates
This commit is contained in:
parent
13c2157e36
commit
dc7286a0ef
12 changed files with 122 additions and 35 deletions
|
|
@ -139,20 +139,24 @@ Lists.allow({
|
|||
Lists.helpers({
|
||||
copy(swimlaneId) {
|
||||
const oldId = this._id;
|
||||
const oldSwimlaneId = this.swimlaneId || null;
|
||||
let _id = null;
|
||||
existingListWithSameName = Lists.findOne({
|
||||
boardId: this.boardId,
|
||||
title: this.title,
|
||||
archived: false,
|
||||
});
|
||||
if (existingListWithSameName) {
|
||||
_id = existingListWithSameName._id;
|
||||
} else {
|
||||
this._id = null;
|
||||
delete this._id;
|
||||
delete this.swimlaneId;
|
||||
_id = Lists.insert(this);
|
||||
}
|
||||
|
||||
// Copy all cards in list
|
||||
Cards.find({
|
||||
swimlaneId: oldSwimlaneId,
|
||||
listId: oldId,
|
||||
archived: false,
|
||||
}).forEach((card) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue