mirror of
https://github.com/wekan/wekan.git
synced 2026-01-05 17:18:49 +01:00
Merge remote-tracking branch 'Angtrim/feature-duplicate' into edge
This commit is contained in:
commit
56cccc6781
15 changed files with 221 additions and 26 deletions
|
|
@ -169,6 +169,31 @@ export class WekanCreator {
|
|||
})]);
|
||||
}
|
||||
|
||||
getMembersToMap(data) {
|
||||
// we will work on the list itself (an ordered array of objects) when a
|
||||
// mapping is done, we add a 'wekan' field to the object representing the
|
||||
// imported member
|
||||
const membersToMap = data.members;
|
||||
const users = data.users;
|
||||
// auto-map based on username
|
||||
membersToMap.forEach((importedMember) => {
|
||||
importedMember.id = importedMember.userId;
|
||||
delete importedMember.userId;
|
||||
const user = users.filter((user) => {
|
||||
return user._id === importedMember.id;
|
||||
})[0];
|
||||
if (user.profile && user.profile.fullname) {
|
||||
importedMember.fullName = user.profile.fullname;
|
||||
}
|
||||
importedMember.username = user.username;
|
||||
const wekanUser = Users.findOne({ username: importedMember.username });
|
||||
if (wekanUser) {
|
||||
importedMember.wekanId = wekanUser._id;
|
||||
}
|
||||
});
|
||||
return membersToMap;
|
||||
}
|
||||
|
||||
checkActions(wekanActions) {
|
||||
// XXX More check based on action type
|
||||
check(wekanActions, [Match.ObjectIncluding({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue