Repository navigation
Update Workspace auto naming to include using First Name over the username of a public email - #44109
Conversation
|
Fixing some issue with my simulator will post over issue when the PR is ready for review |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-07-03.at.7.04.05.in.the.evening.movAndroid: mWeb ChromeScreen.Recording.2024-07-03.at.6.46.02.in.the.evening.moviOS: NativeScreen.Recording.2024-07-09.at.11.56.00.in.the.morning.moviOS: mWeb SafariScreen.Recording.2024-07-03.at.6.42.55.in.the.evening.movMacOS: Chrome / SafariScreen.Recording.2024-07-03.at.6.38.36.in.the.evening.movMacOS: DesktopScreen.Recording.2024-07-03.at.6.52.15.in.the.evening.mov |
There was a problem hiding this comment.
I think this is added by mistake
There was a problem hiding this comment.
opps my bad, will update in sometime
| defaultWorkspaceName = `${Str.UCFirst(username)}'s Workspace`; | ||
| } else { | ||
| defaultWorkspaceName = `${Str.UCFirst(domain.split('.')[0])}'s Workspace`; | ||
| defaultWorkspaceName = userDetails?.phoneNumber ?? ''; |
There was a problem hiding this comment.
actually is there any possible case where we use a phone number? there'll always be an email associated with the account.
There was a problem hiding this comment.
when you login via a new account with phone number, i guess at that time this case is used, I will confirm if that hypothesis is true in sometime
There was a problem hiding this comment.
Lets keep this code, The comment does say that we should have a phone number case so better to keep :)
|
We should add a test case where the first and last names are not set. wdyt? |
With the PR : #44375 There won't be a case where first name is not set, so i think the test case would not have significance, WDYT? |
|
We're good for the checklist @getusha 👍 |
|
friendly bump @getusha |
|
As this doesn't change any of the native files, i think it would be fine if you use my videos @getusha , but hope your simulator issues get solved at the earliest |
|
any update here @getusha ? |
getusha
left a comment
There was a problem hiding this comment.
lgtm, a couple of comments
| const username = emailParts[0]; | ||
| const domain = emailParts[1]; | ||
| const userDetails = PersonalDetailsUtils.getPersonalDetailByEmail(sessionEmail); | ||
| const displayName = `${userDetails?.firstName ?? ''}${userDetails?.lastName ? ` ${userDetails.lastName}` : ''}`; |
There was a problem hiding this comment.
| const displayName = `${userDetails?.firstName ?? ''}${userDetails?.lastName ? ` ${userDetails.lastName}` : ''}`; | |
| const displayName = userDetails?.displayName; |
There was a problem hiding this comment.
Are you sure that there is a displayName property ? and it would not add extra space if we do not have the last name?
There was a problem hiding this comment.
Yes, there is 😄
and it would not add extra space if we do not have the last name?
We can trim it if that's the case!
There was a problem hiding this comment.
umm, makes sense, i will update this PR by EOD.
| if (PUBLIC_DOMAINS.some((publicDomain) => publicDomain === domain.toLowerCase())) { | ||
| if (!PUBLIC_DOMAINS.some((publicDomain) => publicDomain === domain.toLowerCase())) { | ||
| defaultWorkspaceName = `${Str.UCFirst(domain.split('.')[0])}'s Workspace`; | ||
| } else if (displayName !== '') { |
There was a problem hiding this comment.
| } else if (displayName !== '') { | |
| } else if (!!displayName) { |
|
I updated the PR @getusha :) thanks |
|
@allgandalf we've got a couple of checks failing |
Co-authored-by: Getabalew <75031127+getusha@users.noreply.github.com>
|
Thanks for the suggestions, hope it fixes the issues :)) |
|
@getusha , can you please approve this |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/chiragsalian in version: 9.0.8-1 🚀
|
|
🚀 Cherry-picked to staging by https://github.com/Beamanator in version: 9.0.8-3 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.0.8-6 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.0.9-5 🚀
|

Details
This PR changes the naming workspace naming logic, the new logic is as follows:
Reference
Fixed Issues
$ #42677
PROPOSAL: #42677 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA steps (Note that creating a new account while offline is not possible so some of the below tests are not possible offline)
QA Steps
something elsein onboarding flow.Verify that the workspace created has the name:
first name + last name (if exist)'s Workspace.something elsein onboarding flow.Verify that the workspace created has the name:
(private domain)'s Workspace.PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2024-06-21.at.12.58.19.AM.mov
Android: mWeb Chrome
Screen.Recording.2024-06-21.at.1.21.25.AM.mov
iOS: Native
Screen.Recording.2024-06-21.at.1.35.15.AM.mov
iOS: mWeb Safari
Screen.Recording.2024-06-21.at.12.52.41.AM.mov
MacOS: Chrome / Safari
Screen.Recording.2024-06-21.at.12.46.23.AM.mov
MacOS: Desktop
Screen.Recording.2024-06-21.at.12.48.33.AM.mov