mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Fix missing member assignments when cloning board
This commit is contained in:
parent
7a08f42edb
commit
a3cd1b89ff
1 changed files with 17 additions and 3 deletions
|
|
@ -42,9 +42,23 @@ Meteor.methods({
|
||||||
check(currentBoardId, Match.Maybe(String));
|
check(currentBoardId, Match.Maybe(String));
|
||||||
const exporter = new Exporter(sourceBoardId);
|
const exporter = new Exporter(sourceBoardId);
|
||||||
const data = exporter.build();
|
const data = exporter.build();
|
||||||
const addData = {};
|
const additionalData = {};
|
||||||
addData.membersMapping = getMembersToMap(data);
|
|
||||||
const creator = new WekanCreator(addData);
|
//get the members to map
|
||||||
|
const membersMapping = getMembersToMap(data);
|
||||||
|
|
||||||
|
//now mirror the mapping done in finishImport in client/components/import/import.js:
|
||||||
|
if (membersMapping) {
|
||||||
|
const mappingById = {};
|
||||||
|
membersMapping.forEach(member => {
|
||||||
|
if (member.wekanId) {
|
||||||
|
mappingById[member.id] = member.wekanId;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
additionalData.membersMapping = mappingById;
|
||||||
|
}
|
||||||
|
|
||||||
|
const creator = new WekanCreator(additionalData);
|
||||||
//data.title = `${data.title } - ${ TAPi18n.__('copy-tag')}`;
|
//data.title = `${data.title } - ${ TAPi18n.__('copy-tag')}`;
|
||||||
data.title = `${data.title}`;
|
data.title = `${data.title}`;
|
||||||
return creator.create(data, currentBoardId);
|
return creator.create(data, currentBoardId);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue