-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Migrate SignInPage to functional component #19498
Conversation
# Conflicts: # src/pages/signin/SignInPage.js
@sobitneupane @jasperhuangg One of you needs to 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] |
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.
Screenshots/Videos
Web
Screen.Recording.2023-06-05.at.17.05.34.mov
Screen.Recording.2023-06-05.at.17.02.38.mov
clipped.mov
Screen.Recording.2023-06-05.at.17.18.57.mov
Mobile Web - Chrome
Screen.Recording.2023-06-05.at.17.48.23.mov
Screen.Recording.2023-06-05.at.17.45.24.mov
Screen.Recording.2023-06-05.at.17.52.29.mov
Mobile Web - Safari
Screen.Recording.2023-06-05.at.17.39.06.mov
Screen.Recording.2023-06-05.at.17.43.19.mov
Desktop
Screen.Recording.2023-06-05.at.17.27.31.mov
Screen.Recording.2023-06-05.at.17.25.28.mov
Screen.Recording.2023-06-05.at.17.24.02.mov
iOS
Screen.Recording.2023-06-05.at.17.35.52.mov
Screen.Recording.2023-06-05.at.17.32.24.mov
Android
Screen.Recording.2023-06-05.at.18.05.06.mov
Screen.Recording.2023-06-05.at.18.02.08.mov
_.reduce( | ||
Permissions, | ||
(memo, checkerFunction, beta) => { | ||
// eslint-disable-next-line no-param-reassign | ||
memo[beta] = checkerFunction(betas); | ||
return memo; | ||
}, | ||
{}, | ||
), |
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.
IMO, it will be cleaner to break this into statements.
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 thought about that, but it would be a lot more verbose, and anyone adding or removing betas would also have to remember to update the hook. This way, you just have to add a new function to libs/Permissions
and the hook will automatically handle that. This seems more robust to me.
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.
Yeah, that is fine. I was just saying to break this nested logic into multiple statements. It is hard to read.
Using PullerBear to get another Expensify reviewer since @jasperhuangg is OOO until next week. |
This comment was marked as resolved.
This comment was marked as resolved.
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 just questioning useMemo
usage
✋ 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/arosiclair in version: 1.3.27-0 🚀
|
🚀 Deployed to staging by https://github.com/arosiclair in version: 1.3.27-0 🚀
|
This has introduced a regression where its not possible to log into NewDot with unvalidated accounts (new accounts) #20676 since its quite a big PR but there shouldnt be conflicts I am going to create a revert to get this out sooner to increase chances of daily deploy |
// - AND the login is not the primary login | ||
// - AND the login is not validated | ||
const showUnlinkLoginForm = | ||
Boolean(this.props.credentials.login && this.props.account.primaryLogin) && this.props.account.primaryLogin !== this.props.credentials.login && !this.props.account.validated; |
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.
here we also check for the this.props.account.primaryLogin
shouldShowWelcomeHeader, | ||
shouldShowWelcomeText, | ||
} = getRenderOptions({ | ||
hasLogin: Boolean(credentials.login), |
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.
but here we dont have it, I have tried changing this to Boolean(credentials.login && account.primaryLogin)
, but it did not fix the issue on its own and because its a deploy blocker and there is couple more I have went with revert.
hasLogin: Boolean(credentials.login), | ||
hasPassword: Boolean(credentials.password), | ||
hasValidateCode: Boolean(credentials.validateCode), | ||
isPrimaryLogin: account.primaryLogin && account.primaryLogin === credentials.login, |
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.
Suggestion
isPrimaryLogin: !account.primaryLogin || account.primaryLogin === credentials.login,
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.3.27-7 🚀
|
let welcomeHeader; | ||
let welcomeText; |
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.
Seems like this has caused a console warning #22923. welcomeHeader and welcomeText are required props in SigninPage layout, and not initialzing them as empty string displays an error. Yes, in unlinklogin form case, it is also not initialized in the condition below
Details
Migrating SignInPage to functional component.
Fixed Issues
$ #16301
Tests
Offline tests
n/a – sign in flows are online-only.
QA Steps
Same as tests.
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
web.mov
Mobile Web - Chrome
screen-20230601-151350.mp4
Mobile Web - Safari
iOSWeb.MP4
Desktop
desktop.mov
iOS
Full iOS testing blocked by unrelated bug.
Android
screen-20230601-152134.mp4