-
Notifications
You must be signed in to change notification settings - Fork 3k
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
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 |
src/libs/actions/Policy/test.md
Outdated
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 think this is added by mistake
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 ? |
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.
lgtm, a couple of comments
src/libs/actions/Policy/Policy.ts
Outdated
@@ -1355,11 +1356,17 @@ function generateDefaultWorkspaceName(email = ''): string { | |||
} | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const displayName = `${userDetails?.firstName ?? ''}${userDetails?.lastName ? ` ${userDetails.lastName}` : ''}`; | |
const displayName = userDetails?.displayName; |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
umm, makes sense, i will update this PR by EOD.
src/libs/actions/Policy/Policy.ts
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} 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 <[email protected]>
Thanks for the suggestions, hope it fixes the issues :)) |
@getusha , can you please approve this |
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.
LGTM
✋ 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 else
in onboarding flow.Verify that the workspace created has the name:
first name + last name (if exist)'s Workspace
.something else
in onboarding flow.Verify that the workspace created has the name:
(private domain)'s Workspace
.PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.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
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