mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 00:48:25 +00:00
Fix/remove metadata ce (#12586)
* fix: removed metadata for ce * Fix: added metadata res for ee * fix: removed user metadata upload from ce, added bulkupload user in ee * fix: added csv for ce * fix: added sample_upload_ce csv download * fix: updated ee module user mapping * fix: updated invalid column error message * fix: conflict commit * fix: commit resolve
This commit is contained in:
parent
8ee3bca147
commit
0945eb8b65
3 changed files with 12 additions and 2 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit 1e9ecf7ea675a48622726c79e3382258701e3c14
|
||||
Subproject commit 04839761243719f881c4a9ebbb052fc09ab6b967
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 1d1c2c05b112e12f01a219567973a70ddf2935cb
|
||||
Subproject commit 2cd39bdde430a78b4d6ebcd119d02a6fda924739
|
||||
|
|
@ -193,10 +193,20 @@ export class OrganizationUsersService implements IOrganizationUsersService {
|
|||
let invalidGroups = [];
|
||||
const emailPattern = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;
|
||||
const invalidRoles = [];
|
||||
const allowedColumns = ['first name', 'last name', 'email', 'user role', 'group'];
|
||||
const groupPermissions = (
|
||||
await this.groupPermissionsUtilService.getAllGroupByOrganization(currentUser.organizationId)
|
||||
).groupPermissions?.filter((gp) => !gp.disabled);
|
||||
const existingGroups = groupPermissions.map((groupPermission) => groupPermission.name);
|
||||
|
||||
const csvData = fileStream.toString();
|
||||
const firstLine = csvData.split('\n')[0];
|
||||
const actualColumns = firstLine.split(',').map(col => col.trim().toLowerCase());
|
||||
const extraColumns = actualColumns.filter(col => !allowedColumns.includes(col));
|
||||
|
||||
if (extraColumns.length > 0) {
|
||||
throw new BadRequestException(`${extraColumns.join(', ')} ${extraColumns.length > 1 ? 'are' : 'is'} not allowed`);
|
||||
}
|
||||
csv
|
||||
.parseString(fileStream.toString(), {
|
||||
headers: ['first_name', 'last_name', 'email', 'user_role', 'groups'],
|
||||
|
|
|
|||
Loading…
Reference in a new issue