mirror of
https://github.com/wekan/wekan.git
synced 2025-12-18 00:10:13 +01:00
Correctly import Trello dropdown custom fields
This commit is contained in:
parent
b793716e85
commit
e463f79532
1 changed files with 15 additions and 3 deletions
|
|
@ -248,6 +248,18 @@ export class TrelloCreator {
|
||||||
settings: {},
|
settings: {},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (field.type === 'list') {
|
||||||
|
fieldToCreate.type = 'dropdown';
|
||||||
|
fieldToCreate.settings = {
|
||||||
|
dropdownItems: field.options.map(opt => {
|
||||||
|
return {
|
||||||
|
_id: opt.id,
|
||||||
|
name: opt.value.text,
|
||||||
|
};
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// We need to remember them by Trello ID, as this is the only ref we have
|
// We need to remember them by Trello ID, as this is the only ref we have
|
||||||
// when importing cards.
|
// when importing cards.
|
||||||
this.customFields[field.id] = CustomFields.direct.insert(fieldToCreate);
|
this.customFields[field.id] = CustomFields.direct.insert(fieldToCreate);
|
||||||
|
|
@ -336,7 +348,9 @@ export class TrelloCreator {
|
||||||
const custom = {
|
const custom = {
|
||||||
_id: this.customFields[item.idCustomField],
|
_id: this.customFields[item.idCustomField],
|
||||||
};
|
};
|
||||||
if (item.value.hasOwnProperty('checked')) {
|
if (item.idValue) {
|
||||||
|
custom.value = item.idValue;
|
||||||
|
} else if (item.value.hasOwnProperty('checked')) {
|
||||||
custom.value = item.value.checked === 'true';
|
custom.value = item.value.checked === 'true';
|
||||||
} else if (item.value.hasOwnProperty('text')) {
|
} else if (item.value.hasOwnProperty('text')) {
|
||||||
custom.value = item.value.text;
|
custom.value = item.value.text;
|
||||||
|
|
@ -344,8 +358,6 @@ export class TrelloCreator {
|
||||||
custom.value = item.value.date;
|
custom.value = item.value.date;
|
||||||
} else if (item.value.hasOwnProperty('number')) {
|
} else if (item.value.hasOwnProperty('number')) {
|
||||||
custom.value = item.value.number;
|
custom.value = item.value.number;
|
||||||
} else if (item.value.hasOwnProperty('dropdown')) {
|
|
||||||
custom.value = item.value.dropdown;
|
|
||||||
}
|
}
|
||||||
cardToCreate.customFields.push(custom);
|
cardToCreate.customFields.push(custom);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue