mirror of
https://github.com/wekan/wekan.git
synced 2025-12-28 05:08:48 +01:00
add: export board/cards/lists to CSV/TSV
This commit is contained in:
parent
1742bcd9b1
commit
a570c4a861
9 changed files with 474 additions and 217 deletions
|
|
@ -128,10 +128,9 @@ export class CsvCreator {
|
|||
};
|
||||
|
||||
// create labels
|
||||
const labelsToCreate = new Set();
|
||||
for (let i = 1; i < csvData.length; i++) {
|
||||
//get the label column
|
||||
if (csvData[i][this.fieldIndex.labels]) {
|
||||
const labelsToCreate = new Set();
|
||||
for (const importedLabel of csvData[i][this.fieldIndex.labels].split(
|
||||
' ',
|
||||
)) {
|
||||
|
|
@ -139,23 +138,23 @@ export class CsvCreator {
|
|||
labelsToCreate.add(importedLabel);
|
||||
}
|
||||
}
|
||||
for (const label of labelsToCreate) {
|
||||
let labelName, labelColor;
|
||||
if (label.indexOf('-') > -1) {
|
||||
labelName = label.split('-')[0];
|
||||
labelColor = label.split('-')[1];
|
||||
} else {
|
||||
labelName = label;
|
||||
}
|
||||
const labelToCreate = {
|
||||
_id: Random.id(6),
|
||||
color: labelColor ? labelColor : 'black',
|
||||
name: labelName,
|
||||
};
|
||||
boardToCreate.labels.push(labelToCreate);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const label of labelsToCreate) {
|
||||
let labelName, labelColor;
|
||||
if (label.indexOf('-') > -1) {
|
||||
labelName = label.split('-')[0];
|
||||
labelColor = label.split('-')[1];
|
||||
} else {
|
||||
labelName = label;
|
||||
}
|
||||
const labelToCreate = {
|
||||
_id: Random.id(6),
|
||||
color: labelColor ? labelColor : 'black',
|
||||
name: labelName,
|
||||
};
|
||||
boardToCreate.labels.push(labelToCreate);
|
||||
}
|
||||
|
||||
const boardId = Boards.direct.insert(boardToCreate);
|
||||
Boards.direct.update(boardId, {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue