Przeglądaj źródła

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
Tyna William 3 lat temu
rodzic
commit
2c511c9a0d

+ 1 - 1
services/web/frontend/js/features/share-project-modal/components/select-collaborators.js

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

+ 2 - 1
services/web/test/frontend/features/share-project-modal/components/share-project-modal.test.js

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