-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow multiple emails to be added when inviting members to workspace #29044
Conversation
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
@mananjadhav Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@Samueljh1 I started testing this but if I have consecutive comma it still won't show the valid emails. Also when I have spaces in between as an invalid email, it will still filter out the correct email. |
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
@mananjadhav Thanks for this. I have added a new commit to make the email parsing more strict. |
Reviewer Checklist
Screenshots/VideosWebweb-multiple-emails.movMobile Web - Chromemweb-chrome-multiple-emails.movMobile Web - Safarimweb-safari-multiple-emails.movDesktopdesktop-multiple-emails.moviOSios-multiple-emails.movAndroidandroid-multiple-emails.mov |
Thanks for the patience here @Samueljh1. It was related to Workspace, so needed more time. @francoisl All yours. 🎀 👀 🎀 C+ reviewed. |
@francoisl fixed prettier issues, should be good to ship |
All done @francoisl |
let emails = searchTerm.replace(/\s,\s/g, ',').split(','); | ||
emails = _.filter( | ||
_.map(emails, (word) => word.trim()), | ||
(email) => email !== '', | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplification suggestion:
- If we change the regex to search for any number of spaces around the comma (with
\s*
), then we don't need thetrim()
- We can use
_.compact(<values>)
to remove falsy values (e.g.''
)
let emails = searchTerm.replace(/\s,\s/g, ',').split(','); | |
emails = _.filter( | |
_.map(emails, (word) => word.trim()), | |
(email) => email !== '', | |
); | |
const emails = _.compact(searchTerm.replace(/\s*,\s*/g, ',').split(',')); |
› _.compact("aaa , bbb, cccc , ".replace(/\s*,\s*/g, ',').split(','));
// ['aaa', 'bbb', 'cccc']
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only issue with this is that the leading and trailing spaces will not be removed. E.g. " aaaa,bbbb,ccc "
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change it to const emails = _.compact(searchTerm.trim().replace(/\s*,\s*/g, ',').split(','));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah good point, your change works!
Use `each` instead of `forEach`
@francoisl changes made, let me know if you're happy |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Performance Comparison Report 📊Significant Changes To Duration
Show details
Meaningless Changes To DurationShow entries
Show details
|
@Expensify/mobile-deployers 📣 Please look into this performance regression as it's a deploy blocker. |
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.83-11 🚀
|
1 similar comment
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.83-11 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.83-11 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.83-11 🚀
|
Weird, it looks like this caused a regression, I didn't initially catch it here, via scrolling up from the bottom on this PR, not sure how I would have, @mananjadhav , @Samueljh1 , any idea how I would? |
Details
Allow multiple emails to be added when inviting members to workspace. Previously, only one email could be added at a time.
Fixed Issues
$ #26242
PROPOSAL: #26242 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
proof_web.mov
Mobile Web - Chrome
proof_android_web.mov
Mobile Web - Safari
proof_ios_web.mov
Desktop
proof_desktop.mov
iOS
proof_ios.mov
Android
proof_android.mov