-
Notifications
You must be signed in to change notification settings - Fork 3k
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 IOUCurrencySelection class to use hooks #20579
Conversation
@narefyev91 @youssef-lr 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] |
Hey both, I'm struggling to figure out why this lint change is necessary. |
</ScreenWrapper> | ||
); | ||
} | ||
}, [searchValue, currencyData, props.translate]); |
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.
Surely it's better to just pass props.translate
rather than props
?
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.
for sure - props.translate should be in 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.
@Julesssss We have similar case before , we fixed that by a partial props destructing , check full thread here https://expensify.slack.com/archives/C01GTK53T8Q/p1684969645381109
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.
Thanks. I've read up on prop destructuring, is this how it's supposed to be done?
const { translate } = props;
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 think I've done this correctly: https://github.com/Expensify/App/pull/20579/files#diff-496700da68574808c5981ac4884e39d73ea02df4aa59bd5869e0c9227defe4c2R94
I think I have successfully merged the updates to a single |
], | ||
headerMessage: isEmpty ? translate('common.noResultsFound') : '', | ||
}; | ||
}, [props.currencyList, searchValue, selectedCurrencyCode, translate]); |
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.
maybe we can also add currencyList at line 78?
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.
Nice work , LGTM 🚀
Reviewer Checklist
Screenshots/VideosWebweb2.movweb1.movMobile Web - Chromeandroid-web2.movandroid-web1.movMobile Web - Safariios-web2.movios-web1.movDesktopdesktop-2.movdesktop-1.moviOSios-2.movios-1.movAndroidandroid-2.movandroid-1.mov |
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.
Nice work! LGTM!
Thanks both. All yours @youssef-lr |
Bumping for final review @youssef-lr |
# Conflicts: # src/pages/iou/IOUCurrencySelection.js
Hi @fedirjh, I forgot about this one and had to resolve a conflict. Would you mind one final review of the changes since you last approved please? |
@youssef-lr is OOO, so I will reassign once this is ready for internal review. |
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 @Julesssss
We did not find an internal engineer to review this PR, trying to assign a random engineer to #16274... Please reach out for help on Slack if no one gets assigned! |
Hey @srikarparsi, pullerbear is broken, but you won the reviewer lottery. Assigning you for the code review, C+ has already approved |
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 to me!
✋ 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/srikarparsi in version: 1.3.36-0 🚀
|
Haven't confirmed yet but it's looking like this caused #22130, I'll look into it and see if I can figure out a fix but wanted to ping early. |
<> | ||
<HeaderWithBackButton | ||
title={translate('iOUCurrencySelection.selectCurrency')} | ||
onBackButtonPress={() => Navigation.goBack(ROUTES.getIouRequestRoute(Navigation.getTopmostReportId()))} |
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.
ROUTES.getIouRequestRoute()
doesn't currently exist which is causing the regression I commented on, will see if I can figure out what this is supposed to be and add it.
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.
@dangrous I think it should be :
onBackButtonPress={() => Navigation.goBack(ROUTES.getMoneyRequestRoute(iouType, reportID))}
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.
Yep! That's what I ended up going with - https://github.com/Expensify/App/pull/22135/files#diff-496700da68574808c5981ac4884e39d73ea02df4aa59bd5869e0c9227defe4c2R119 - it's weird, I looked through every commit in this PR and it never actually changed away from that in any of them. But it ends up being different in the end. I'm not sure how that happened
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 think maybe it's merging main into this branch, This PR was created while another PR that refactors the IOU modal is open, At some point the other PR was merged with new code, and I think upon merging the main we didn’t accept the new 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.
ahh that makes sense.
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.
Thanks both, Yeah my first guess was the merge as I recall some conflicts. I must have missed one when resolving.
🚀 Deployed to production by https://github.com/Julesssss in version: 1.3.36-5 🚀
|
CC @marcaaron
Details
Simply refactors the IOUCurrencySelection file away from class and introduces hooks.
Fixed Issues
$ #16274
Tests
Request Money
Split Bill
Send Money
Offline tests
Request Money
Split Bill
Send Money
QA Steps
Request Money
Split Bill
Send Money
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
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android