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

refactor checkbox with label #7750

Merged
merged 12 commits into from
Mar 10, 2022
Merged

refactor checkbox with label #7750

merged 12 commits into from
Mar 10, 2022

Conversation

thesahindia
Copy link
Member

@thesahindia thesahindia commented Feb 14, 2022

Details

Fixed Issues

$ #7531

Tests

  1. Run npm run storybook
  2. Try submitting the form
  3. Check if shows error
  • Verify that no errors appear in the JS console

QA Steps

  • Verify that no errors appear in the JS console

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

Screen.Recording.2022-02-15.at.2.34.31.AM.mov

without margin left-
Screenshot 2022-02-15 at 2 38 34 AM

with margin left-

Screen.Recording.2022-02-15.at.2.37.02.AM.mov

Mobile Web

Screenshot 2022-02-15 at 2 47 34 AM

Desktop

Screenshot 2022-03-01 at 10 09 20 PM

iOS

Screenshot 2022-02-15 at 2 59 53 AM

Android

Screenshot 2022-02-15 at 2 58 18 AM

@thesahindia thesahindia requested a review from a team as a code owner February 14, 2022 22:36
@MelvinBot MelvinBot requested review from rushatgabhane and tgolen and removed request for a team February 14, 2022 22:36
@thesahindia
Copy link
Member Author

Still having issues with desktop app. Will try again after sometime.

@rushatgabhane
Copy link
Member

@thesahindia to test on desktop, merge main from upstream into your branch.

And temporarily create a .env file with USE_WEB_PROXY= true and USE_NRGOK=false

@thesahindia
Copy link
Member Author

@rushatgabhane, tried both but still it's not showing anything.

@rushatgabhane
Copy link
Member

rushatgabhane commented Feb 15, 2022

@thesahindia i can't toggle the checkbox. Maybe it's because of regression in TextInput #7318 (comment)

@thesahindia
Copy link
Member Author

@rushatgabhane, hadn't implemented that because of getting error while testing due to the regression. It should work now.

@rushatgabhane
Copy link
Member

hadn't implemented that because of getting error while testing due to the regression. It should work now.

Nope, it doesn't work. I'm unable to toggle checkbox in storybook.
Are you sure it's not due to the regression in TextInput #7318 (comment)

@thesahindia
Copy link
Member Author

Nope, it doesn't work. I'm unable to toggle checkbox in storybook. Are you sure it's not due to the regression in TextInput #7318 (comment)

Yeah I think it might be due to the regression as I had tested and it was working fine.

Copy link
Contributor

@tgolen tgolen left a comment

Choose a reason for hiding this comment

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

Looks like this is still needing desktop testing.

@rushatgabhane
Copy link
Member

@thesahindia please merge main before you work on the changes requested. Thanks so much

@thesahindia
Copy link
Member Author

@thesahindia please merge main before you work on the changes requested. Thanks so much

@rushatgabhane, sure and sorry for the delay. I was waiting to get clarification about adding translation but didn't see it was resolved (don't know why I didn't get a notification for it 🤷‍♂️)

rushatgabhane
rushatgabhane previously approved these changes Mar 9, 2022
Copy link
Member

@rushatgabhane rushatgabhane left a comment

Choose a reason for hiding this comment

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

@tgolen LGTM! 🎉

@rushatgabhane
Copy link
Member

rushatgabhane commented Mar 9, 2022

Commenting since I can't edit the PR

PR Reviewer Checklist

  • I verified the PR has a small number of commits behind main
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the testing environment is mentioned in the test steps
  • I verified testing steps cover success & fail scenarios (if applicable)
  • I checked that screenshots or videos are included for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • MacOS / Desktop
  • I verified there are no console errors related to changes in this PR
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified comments were added when the code was not self explanatory
    • I verified any copy / text shown in the product was added in all src/languages/* files (if applicable)
    • I verified proper naming convention for platform-specific files was followed (if applicable)
    • I verified style guidelines were followed
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components are not impacted by changes in this PR (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified the UI performance was not affected (the performance is the same than main branch)
  • If a new component is created I verified that a similar component doesn't exist in the codebase

Copy link
Contributor

@tgolen tgolen left a comment

Choose a reason for hiding this comment

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

Just noticed this one last thing before merging.

@@ -13,27 +13,35 @@ const propTypes = {
onPress: PropTypes.func.isRequired,

/** Should the input be styled for errors */
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this comment is out-of-date

Copy link
Member Author

@thesahindia thesahindia Mar 9, 2022

Choose a reason for hiding this comment

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

Earlier we were applying the error styles when hasError was true, now we are just checking if errorText is present, so the functionality hasn't change and I think we can keep this comment.

Copy link
Member

@rushatgabhane rushatgabhane Mar 9, 2022

Choose a reason for hiding this comment

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

@thesahindia "Should the input be styled for errors" gives the impression that it's a boolean.
And we're displaying whatever error is passed.

Suggested change
/** Should the input be styled for errors */
/** Error text to display */

Copy link
Member Author

Choose a reason for hiding this comment

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

@rushatgabhane, Yes makes sense, but now I think a better way would be to keep it as hasError since we are only going to use it as boolean and I will pass it like this -

              <Checkbox
                   hasError={!!props.errorText}

the errorText that we get in CheckboxWithLabel is to show the error message and for checkbox component we only need a boolean value

Copy link
Member

Choose a reason for hiding this comment

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

@thesahindia good call. I agree, let's do that.

hasError={Boolean(props.errorText)}

Copy link
Member Author

Choose a reason for hiding this comment

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

Done ✔️

Copy link
Member

Choose a reason for hiding this comment

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

@tgolen all yours! LGTM

Copy link
Contributor

@tgolen tgolen left a comment

Choose a reason for hiding this comment

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

Thanks for that change. I love the removal of hasError!

@tgolen tgolen merged commit f0a4118 into Expensify:main Mar 10, 2022
@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.

@rushatgabhane
Copy link
Member

rushatgabhane commented Mar 10, 2022

⚠️ @thesahindia we have an issue. getInputIDPropTypes needs to be renamed to validateInputIDProps

Please create a follow-up PR.

Edit: I've created a PR to fix this because it's 3 AM for you

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @tgolen in version: 1.1.42-0 🚀

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

@thesahindia
Copy link
Member Author

Edit: I've created a PR to fix this because it's 3 AM for you

Thanks for the help 😃

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @chiragsalian in version: 1.1.42-6 🚀

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

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.

5 participants