Skip to content
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

Password Error message Translation on Language change #4880

Merged
merged 7 commits into from
Aug 27, 2021

Conversation

mananjadhav
Copy link
Collaborator

@mananjadhav mananjadhav commented Aug 27, 2021

@Jag96 Can you please review this?

Details

  • Changed error translation on language change
  • Also added onBlur to the forms
  • Hide API error if formError exists

Fixed Issues

$ #4663

Tests

  1. Checked error messages translation on changing the language after the error is shown
  2. Ensure that error hides if the value is entered and textinput is blurred

QA Steps

  1. Go to the Login Form, press the button and the error is shown
  2. After that if the language is changed, then the translation for the password should also be changed

This has to be tested for LoginForm as well as PasswordForm

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

https://user-images.githubusercontent.com/3069065/131161002-8b8e6295-d164-4eab-8443-66e11dcc25a3.mp4
https://user-images.githubusercontent.com/3069065/131161028-b7838053-9e1a-49b6-a92b-39931c55c6c4.mp4

Mobile Web

https://user-images.githubusercontent.com/3069065/131161480-d7740257-a2ec-474a-a1c6-7ecfdbb11d8d.mp4
https://user-images.githubusercontent.com/3069065/131161519-9d5d35e6-d41b-436e-ae2b-e62ce202c3c7.mp4

Desktop

https://user-images.githubusercontent.com/3069065/131161556-e09b9c9f-dc50-45f6-a86b-3d27dc478a38.mp4
https://user-images.githubusercontent.com/3069065/131161563-5c2a0277-714c-473c-985d-9ff8de724ef3.mp4

iOS

https://user-images.githubusercontent.com/3069065/131163340-d6da9bef-def5-4005-bb06-313ac3f9ab6d.mp4
https://user-images.githubusercontent.com/3069065/131163367-6ceffb31-f3d5-46d6-a693-e1192693ee53.mp4

Android

https://user-images.githubusercontent.com/3069065/131163437-40bfd47e-5b54-4a79-9d94-0f6a47c44719.mp4
https://user-images.githubusercontent.com/3069065/131163469-a44dbf84-1a5f-4abb-832b-15ae0b5abebc.mp4

@mananjadhav mananjadhav requested a review from a team as a code owner August 27, 2021 16:49
@MelvinBot MelvinBot requested review from nickmurray47 and removed request for a team August 27, 2021 16:49
@mananjadhav
Copy link
Collaborator Author

@Jag96 In addition to the translation error, I've also fixed two minor UI issues. Updated in the GH body. Please check.

@mananjadhav
Copy link
Collaborator Author

mananjadhav commented Aug 27, 2021

@Jag96 @nickmurray47 Do you guys notice that the iOS signing screen is broken on language change? Earlier I thought it was because of my change but it seems to exist on the main branch too.

Update: I've added a fix for the same and pushed it. Attached are the videos for the same. Should we be tracking it outside this PR scope?

https://user-images.githubusercontent.com/3069065/131166578-c94a300f-67c7-44e0-b403-4e8c67153c21.mp4
https://user-images.githubusercontent.com/3069065/131166584-0093ac24-0aa3-4c6e-9f35-61a26cbf6973.mp4


Also, do you think the error message in the PasswordForm should come before the Forgot? link.

Copy link
Contributor

@Jag96 Jag96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: I've added a fix for the same and pushed it. Attached are the videos for the same. Should we be tracking it outside this PR scope?

Good find! I think it's fine to keep this in this PR if it resolves the issue on all platforms since it's fairly straightforward. If it turns out to be a more complicated issue during testing or if it has other side effects we can move it to its own issue.

*/
validateAndSubmitForm() {

isFormValid() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this function and the onBlur for both forms? I don't think it makes sense to add it here because in the case that the user has 2fa, when they click outside of the password field into the 2fa field they will see an error before they even submit the form. Additionally, on the loginForm there is only one input field so it doesn't make sense to onBlur there until the user submits the form. We also don't have this functionality for all inputs across the app, so I think we can just stick to the previous functionality of waiting to verify after submit is clicked.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I’ll remove onBlur from both the forms

@@ -20,7 +20,7 @@ const TermsWithLicenses = ({translate}) => (
styles.justifyContentCenter,
]}
>
<View style={[styles.dFlex, styles.flexRow, styles.alignItemsCenter]}>
<View style={[styles.dFlex, styles.flexRow, styles.flexWrap, styles.alignItemsCenter]}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job finding this one!

@mananjadhav
Copy link
Collaborator Author

@Jag96 PR Updated.

Copy link
Contributor

@Jag96 Jag96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, works well!

@Jag96 Jag96 merged commit b9300c7 into Expensify:main Aug 27, 2021
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @Jag96 in version: 1.0.88-3 🚀

platform result
🤖 android 🤖 cancelled 🔪
🖥 desktop 🖥 cancelled 🔪
🍎 iOS 🍎 cancelled 🔪
🕸 web 🕸 success ✅

@roryabraham
Copy link
Contributor

Looks like this might've been involved with a deploy blocker

@roryabraham
Copy link
Contributor

I do notice for sure that errors from the API signin method are not translated.

@Jag96
Copy link
Contributor

Jag96 commented Aug 31, 2021

I do notice for sure that errors from the API signin method are not translated.

This was not part of the change or requirements for this one, translating errors from the API will have to be a separate issue.

@OSBotify
Copy link
Contributor

OSBotify commented Sep 1, 2021

🚀 Deployed to production by @roryabraham in version: 1.0.90-2 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 failure ❌
🕸 web 🕸 success ✅

@mananjadhav
Copy link
Collaborator Author

@roryabraham I saw the marked issue was unrelated to this one and resolved. Let me know if you still need help.

@roryabraham
Copy link
Contributor

Thanks @mananjadhav, this PR didn't cause any regressions, so all good here 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants