mirror of
https://github.com/wekan/wekan.git
synced 2025-12-18 00:10:13 +01:00
Fix import Trello board without swimlanes
This commit is contained in:
parent
fcebb2a537
commit
5871a478e1
1 changed files with 20 additions and 0 deletions
|
|
@ -23,6 +23,8 @@ export class TrelloCreator {
|
||||||
|
|
||||||
// Map of labels Trello ID => Wekan ID
|
// Map of labels Trello ID => Wekan ID
|
||||||
this.labels = {};
|
this.labels = {};
|
||||||
|
// Default swimlane
|
||||||
|
this.swimlane = null;
|
||||||
// Map of lists Trello ID => Wekan ID
|
// Map of lists Trello ID => Wekan ID
|
||||||
this.lists = {};
|
this.lists = {};
|
||||||
// Map of cards Trello ID => Wekan ID
|
// Map of cards Trello ID => Wekan ID
|
||||||
|
|
@ -230,6 +232,7 @@ export class TrelloCreator {
|
||||||
dateLastActivity: this._now(),
|
dateLastActivity: this._now(),
|
||||||
description: card.desc,
|
description: card.desc,
|
||||||
listId: this.lists[card.idList],
|
listId: this.lists[card.idList],
|
||||||
|
swimlaneId: this.swimlane,
|
||||||
sort: card.pos,
|
sort: card.pos,
|
||||||
title: card.name,
|
title: card.name,
|
||||||
// we attribute the card to its creator if available
|
// we attribute the card to its creator if available
|
||||||
|
|
@ -397,6 +400,22 @@ export class TrelloCreator {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
createSwimlanes(boardId) {
|
||||||
|
const swimlaneToCreate = {
|
||||||
|
archived: false,
|
||||||
|
boardId,
|
||||||
|
// We are being defensing here by providing a default date (now) if the
|
||||||
|
// creation date wasn't found on the action log. This happen on old
|
||||||
|
// Wekan boards (eg from 2013) that didn't log the 'createList' action
|
||||||
|
// we require.
|
||||||
|
createdAt: this._now(),
|
||||||
|
title: 'Default',
|
||||||
|
};
|
||||||
|
const swimlaneId = Swimlanes.direct.insert(swimlaneToCreate);
|
||||||
|
Swimlanes.direct.update(swimlaneId, {$set: {'updatedAt': this._now()}});
|
||||||
|
this.swimlane = swimlaneId;
|
||||||
|
}
|
||||||
|
|
||||||
createChecklists(trelloChecklists) {
|
createChecklists(trelloChecklists) {
|
||||||
trelloChecklists.forEach((checklist) => {
|
trelloChecklists.forEach((checklist) => {
|
||||||
if (this.cards[checklist.idCard]) {
|
if (this.cards[checklist.idCard]) {
|
||||||
|
|
@ -607,6 +626,7 @@ export class TrelloCreator {
|
||||||
this.parseActions(board.actions);
|
this.parseActions(board.actions);
|
||||||
const boardId = this.createBoardAndLabels(board);
|
const boardId = this.createBoardAndLabels(board);
|
||||||
this.createLists(board.lists, boardId);
|
this.createLists(board.lists, boardId);
|
||||||
|
this.createSwimlanes(boardId);
|
||||||
this.createCards(board.cards, boardId);
|
this.createCards(board.cards, boardId);
|
||||||
this.createChecklists(board.checklists);
|
this.createChecklists(board.checklists);
|
||||||
this.importActions(board.actions, boardId);
|
this.importActions(board.actions, boardId);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue