-
Notifications
You must be signed in to change notification settings - Fork 3.5k
PasswordForm Function Migration #20515
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
Conversation
|
@yuwenmemon @fedirjh 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] |
|
@yuwenmemon @fedirjh I have been testing this by setting |
|
@esh-g Can you please include all screenshots.
As for testing steps , for local dev testing we can include that. For QA, I think we can just require an account with |
Yes, just wanted to make sure I had the right steps... I'll edit and add the steps |
|
@fedirjh Updated the steps and added videos for each platform. |
|
@fedirjh @yuwenmemon Is there something else that needs to be done on my end? |
|
@esh-g Can you please take a look at this console error, It happen when we click
|
fedirjh
left a comment
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.
Code looks good , left few comments about eslint and little bug , maybe caused by disabling eslint.
src/pages/signin/PasswordForm.js
Outdated
| clearPassword(); | ||
| } | ||
| // We cannot add password to the dependency list because it will clear every time it updates | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps |
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.
@esh-g We shouldn’t disable eslint for react-hooks/exhaustive-deps . Actually, since password is not included in the deps array this hook will always run with the initial password's value. Finally, the autofill feature is broken, when you select a saved login with password , both login and password should be filled.
src/pages/signin/PasswordForm.js
Outdated
| return; | ||
| } | ||
| validateAndSubmitForm(); | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps -- We don't need to call this when the function changes. |
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.
We shouldn’t disable eslint here as well ,
We don't need to call this when the function changes.
can you please explain this comment ? what happens if we call the hook when the function changes ?
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.
Well it was more of an optimisation tweak to make sure that we are not running this on any unintentional changes, but I don't think it will matter if we include it or not. So anyway, I'll include it.
|
@fedirjh This error is occurring in the App/src/pages/signin/SignInPage.js Line 115 in 23978e4
Here first it was not set to empty string and was undefined. In the latest main, it will not occur |
|
Autofill I think is working on my end... Screen.Recording.2023-06-14.at.1.27.01.PM.mov |
@esh-g I am referring to the password manager , the saved password should be filled. the video you shared is password autosuggestion, here is expected behaviour pass.mov |
|
@fedirjh Strange.. It seems to add it only on clicking.. Are you aware of any reason that it should happen? Screen.Recording.2023-06-14.at.2.29.13.PM.mov |
Before we remove it, we need to determine the reason behind its addition. Additionally, I have noticed a slight difference between the old implementation and the new one. Previously, we were checking both // old check
if (prevProps.isVisible && !this.props.isVisible && this.state.password) {
// actual check
if (!props.isVisible && password) { |
|
@fedirjh I don't think we can access previous props in functional components unless we create a new hook ourselves. function usePrevious(value) {
const ref = useRef();
useEffect(() => {
ref.current = value;
});
return ref.current;
}Moreover, this code is running when |
Co-authored-by: Fedi Rajhi <fedirjh@gmail.com>
|
@fedirjh Added your suggestion! 👍 |
|
@esh-g Can you please merge main |
|
@fedirjh Done! |
Reviewer Checklist
Screenshots/VideosMobile Web - ChromeChrome.movMobile Web - SafariSafari.movDesktopDesktop.moviOSIOS.movAndroidScreen.Recording.2023-06-15.at.8.43.15.AM.movScreen.Recording.2023-06-15.at.8.43.47.AM.mov |
fedirjh
left a comment
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 and tests well
cc @yuwenmemon
|
✋ 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/yuwenmemon in version: 1.3.29-0 🚀
|
|
@yuwenmemon @fedirjh We don't have account with |
|
@kavimuru We can't test this page without disabling |
|
@kavimuru just make sure the 2FA flow works and we should be good. |
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.3.29-11 🚀
|
|
@rayane-djouah You can enable disable |






Details
Fixed Issues
$ #16300
PROPOSAL: #16300 (comment)
Tests
For Local Testing
Passwordlesslogin by returningfalsefrom the functioncanUsePasswordlessLogininPermissions.js.Offline tests
QA Steps
passwordlesslogin disabled.PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)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
Web
Screen.Recording.2023-06-09.at.6.31.51.PM.mov
Mobile Web - Chrome
Screen.Recording.2023-06-10.at.8.42.40.AM.mov
Screen.Recording.2023-06-10.at.8.28.09.AM.mov
Mobile Web - Safari
Screen.Recording.2023-06-10.at.8.12.51.AM.mov
Desktop
Screen.Recording.2023-06-10.at.8.19.28.AM-1.mov
iOS
Screen.Recording.2023-06-10.at.8.11.36.AM.mov
Android
Screen.Recording.2023-06-10.at.8.26.22.AM.mov