Import Users CSV Carriage Return Support #7398

## Description
The ImportUsersModal takes in a CSV file expecting each line to have a valid email address. When this file is created in Microsoft Excel, Windows in general, or a text editor that uses the carriage return character `\r`, the import fails. This is because the CSV string is split into an email list by `csvString.split("\n")` which fails to account for `\r\n` newlines. This PR changes the split to be the regex `/\r?\n/` which will split on either `\n` or `\r\n`.

Addresses: 
- Issue #7398
- Discussion #7397
This commit is contained in:
R2bEEaton 2022-08-22 07:59:05 -04:00 committed by GitHub
parent fe3d9f40f6
commit 6896488451
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -62,7 +62,7 @@
csvString = e.target.result
files = fileArray
userEmails = csvString.split("\n")
userEmails = csvString.split(/\r?\n/)
})
reader.readAsText(fileArray[0])
}