mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 18:10:06 -05:00
Remove the progressive HTML4/Legacy Omi middleware, cookieless sessions, page controllers, assets, parity refactors, design documents and associated tests. Restore the standard Meteor interface and operations from before the HTML4 work began. Preserve intervening translations, backup screenshots, session upgrades, cryptographic test identifiers, local image storage, document previews and lazy browser loading. Extract the GIF utilities still required by image features into imageGif. Validate the Node suites and add standard-interface and GIF regressions. Two existing failures remain in docsLinksResolve and ruleDetailsLocalization; browser regressions are registered but require a running server. Thanks to xet7 !
40 lines
1.1 KiB
JavaScript
40 lines
1.1 KiB
JavaScript
import { ReactiveCache } from '/imports/reactiveCache';
|
|
|
|
export function csvGetMembersToMap(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 = [];
|
|
const importedMembers = [];
|
|
let membersIndex;
|
|
|
|
for (let i = 0; i < data[0].length; i++) {
|
|
if (data[0][i].toLowerCase() === 'members') {
|
|
membersIndex = i;
|
|
}
|
|
}
|
|
|
|
for (let i = 1; i < data.length; i++) {
|
|
if (data[i][membersIndex]) {
|
|
for (const importedMember of data[i][membersIndex].split(' ')) {
|
|
if (importedMember && importedMembers.indexOf(importedMember) === -1) {
|
|
importedMembers.push(importedMember);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
for (let importedMember of importedMembers) {
|
|
importedMember = {
|
|
username: importedMember,
|
|
id: importedMember,
|
|
};
|
|
const wekanUser = ReactiveCache.getUser({ username: importedMember.username });
|
|
if (wekanUser) importedMember.wekanId = wekanUser._id;
|
|
membersToMap.push(importedMember);
|
|
}
|
|
|
|
return membersToMap;
|
|
}
|