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:
Tyna William 2023-08-07 10:53:14 -04:00 committed by Copybot
parent 646d2fa901
commit 2c511c9a0d
2 changed files with 3 additions and 2 deletions

View file

@ -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) {

View file

@ -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`,
},
})