mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-25 02:00:10 +02:00
add support for newline character and semicolon seperated emails when… (#14092)
* add support for newline character and semicolon seperated emails when sharing with collaborators * edited existing paste event to check for (and replace) white space, comma, new line and semi colon seperated emails GitOrigin-RevId: 53eadd0ca662a2f54312294f6779cfcf3f0f2fd7
This commit is contained in:
@@ -215,7 +215,7 @@ export default function SelectCollaborators({
|
||||
|
||||
if (data) {
|
||||
const emails = data
|
||||
.split(/\s*,\s*/)
|
||||
.split(/[\r\n,; ]+/)
|
||||
.filter(item => item.includes('@'))
|
||||
|
||||
if (emails.length) {
|
||||
|
||||
@@ -595,7 +595,8 @@ describe('<ShareProjectModal/>', function () {
|
||||
fireEvent.paste(inputElement, {
|
||||
clipboardData: {
|
||||
getData: () =>
|
||||
'test@example.com, foo@example.com, bar@example.com, a@b.c',
|
||||
`test@example.com; foo@example.com
|
||||
bar@example.com, a@b.c`,
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user