-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[TS Migration] Migrate EditSplitBillPage to typescript #35053
[TS Migration] Migrate EditSplitBillPage to typescript #35053
Conversation
src/pages/EditSplitBillPage.tsx
Outdated
|
||
const defaultCurrency = lodashGet(route, 'params.currency', '') || transactionCurrency; | ||
const defaultCurrency = transactionCurrency; |
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.
why currency from route was removed?
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 removed it because currency was never in params of route, also it was never passed through these params, so lodashGet would always return ''
src/pages/EditSplitBillPage.tsx
Outdated
onSubmit={(transactionChanges) => { | ||
setDraftSplitTransaction({merchant: transactionChanges.merchant.trim()}); | ||
}} | ||
isPolicyExpenseChat={false} |
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.
why this is added?
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.
Component EditRequestMerchantPage requires isPolicyExpenseChat and typescript is showing errors when I don't pass this param. And isPolicyExpenseChat={false} is in this case an equivalent of not passing this param, so the logic stays the same.
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.
So maybe its better to adjust type of this component so this param will be optional, wydt?
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.
makes sense, adjusting type in EditRequestMerchantPage
src/pages/EditSplitBillPage.tsx
Outdated
onSubmit={(transactionChanges) => { | ||
setDraftSplitTransaction({tag: transactionChanges.tag.trim()}); | ||
}} | ||
tagName="" |
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.
why this? should we just adjust type in EditRequestTagPage
?
}, | ||
}), | ||
// eslint-disable-next-line rulesdir/no-multiple-onyx-in-file | ||
withOnyx({ |
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.
make sure that if we remove this second withOnyx
it will not cause any reggressions
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.
Double checked if everything works. reportActions will almost always be present in component to fetch transactions, but in case when it's not present in the first render then onyx is going to fetch reportActions, which will cause rerender and then reportActions will be present and finally onyx call will fetch transaction and draftTransaction correctly, so everything is alright 😄
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.
approving , but left one more comment but dont want to hold this 😄
Sorry ran out of time for today, will review on Monday! |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid-native-2024-02-13_12.51.34.mp4Android: mWeb Chromeandroid-chrome-2024-02-13_12.44.56.mp4iOS: Nativeios-native-2024-02-13_12.38.36.mp4iOS: mWeb Safariios-safari-2024-02-13_12.19.58.mp4MacOS: Chrome / Safaridesktop-chrome-2024-02-12_17.20.54.mp4MacOS: Desktopdesktop-app-2024-02-12_17.22.47.mp4 |
This comment was marked as resolved.
This comment was marked as resolved.
Good catch @jjcoffee! I've just fixed this and another bug I found. Please check if everything works just to be sure 😅 |
@SzymczakJ Thanks! Out of curiosity, what was the other bug? |
Couldn't edit currency when the amount was 0. It was caused by redundant if statement and js evaluating 0 to false 😄 |
Haha a classic, good spot! |
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!
We did not find an internal engineer to review this PR, trying to assign a random engineer to #31990 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
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
✋ 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.4.42-0 🚀
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 1.4.42-5 🚀
|
Details
Fixed Issues
$ #31990
PROPOSAL: N/A
Tests
Offline tests
N/A
QA Steps
Same as tests
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)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.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
Android: Native
android.mov
Android: mWeb Chrome
androidweb.mov
iOS: Native
ios.mov
iOS: mWeb Safari
iosweb2.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov