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:
Devanshu Gupta 2025-04-15 18:15:46 +05:30 committed by GitHub
parent 8ee3bca147
commit 0945eb8b65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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

View file

@ -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'],