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

[No QA] Code cleanup / Add story for OptionRow #8016

Merged
merged 7 commits into from
Mar 8, 2022

Conversation

marcaaron
Copy link
Contributor

Details

  • OptionRow is a fairly commonly used component, but for some reason was in /sidebar/ directory instead of components
  • There were also propTypes in that directory getting used in various places and another propTypes file (optionPropTypes.js) that shared many overlapping props with a file of the same name in /components.
  • Consolidated everything, moved it all into /components and created a story for the OptionRow so it is easier to see when to use it vs. something like MenuItem

Fixed Issues

No issue in particular just adding a story for OptionRow / cleaning stuff up

Tests

npm run storybook and verify the OptionRow appears

  • Verify that no errors appear in the JS console

QA Steps

Screenshots

2022-03-04_15-49-50

@marcaaron marcaaron self-assigned this Mar 5, 2022
@marcaaron marcaaron changed the title [WIP] [No QA] Code cleanup / Add story for OptionRow [No QA] Code cleanup / Add story for OptionRow Mar 7, 2022
@marcaaron marcaaron marked this pull request as ready for review March 7, 2022 18:47
@marcaaron marcaaron requested a review from a team as a code owner March 7, 2022 18:47
@marcaaron marcaaron requested review from roryabraham and removed request for a team March 7, 2022 18:47
@MelvinBot MelvinBot requested a review from amyevans March 7, 2022 18:48
roryabraham
roryabraham previously approved these changes Mar 7, 2022
Copy link
Contributor

@roryabraham roryabraham left a comment

Choose a reason for hiding this comment

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

This is all good cleanup, so LGTM 👍 . Whether or not you want to take the time to address the other comments is up to you.

@@ -33,4 +34,16 @@ export default PropTypes.shape({

// Whether the report corresponds to a chat room
isChatRoom: PropTypes.bool,

Copy link
Contributor

Choose a reason for hiding this comment

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

I see that OptionRow's memo function references option.hasOutstandingIOU, but that seems missing here. Do we need to add it, or has it been removed at some point?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like we need to add it! On it!

@@ -77,7 +77,7 @@ const defaultProps = {
forceTextUnreadStyle: false,
showTitleTooltip: false,
mode: 'default',
onSelectRow: null,
onSelectRow: () => {},
isDisabled: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

I've looked into it, and it seems like the isDisabled prop of this component is never used. Furthermore, it's pretty similar to disableRowInteractivity – looks like isDisabled only affects the cursor style on hover, while disableRowInteractivity actually disables pressing on the row.

In my opinion, it would be good cleanup to rename disableRowInteractivity to isDisabled, and then make the single isDisabled prop both change the cursor style on hover and disable the TouchableOpacity.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice. I think that makes sense to me. disableRowInteractivity doesn't really fit our other naming conventions and isDisabled is a much better name.

Copy link
Contributor

@amyevans amyevans left a comment

Choose a reason for hiding this comment

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

lgtm, verified the OptionRow appears and no JS errors in the console as well

@amyevans amyevans merged commit 67f26ba into main Mar 8, 2022
@amyevans amyevans deleted the marcaaron-optionRowStory branch March 8, 2022 01:24
@OSBotify
Copy link
Contributor

OSBotify commented Mar 8, 2022

✋ 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 @amyevans in version: 1.1.42-0 🚀

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

@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.

4 participants