Fix bug with Payment option is not selected#49345
Conversation
|
@dukenv0307 Please 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] |
|
I'm reviewing... |
|
@ZhenjaHorbach Should we remove these lines? I see you mentioned it in your proposal. I notice that the initial App/src/components/SettlementButton/index.tsx Lines 152 to 155 in 266ad46 |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-09-18.at.10.55.30.movAndroid: mWeb ChromeScreen.Recording.2024-09-18.at.10.53.29.moviOS: NativeScreen.Recording.2024-09-18.at.10.56.36.moviOS: mWeb SafariScreen.Recording.2024-09-18.at.10.52.27.movMacOS: Chrome / SafariScreen.Recording.2024-09-18.at.10.49.37.movMacOS: DesktopScreen.Recording.2024-09-18.at.11.00.01.mov |
|
LGTM, just left one minor comment |
|
Besides, there's one ESlint failed, but I don't think we should fix here cc @mountiny |
I thought about it |
And I agree ! |
|
Thank you @ZhenjaHorbach, I've tested your PR and it looks good |
| const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${chatReportID || -1}`); | ||
| const [lastPaymentMethod = '-1'] = useOnyx(ONYXKEYS.NVP_LAST_PAYMENT_METHOD, {selector: (paymentMethod) => paymentMethod?.[policyID]}); | ||
| const [nvpLastPaymentMethod] = useOnyx(ONYXKEYS.NVP_LAST_PAYMENT_METHOD); | ||
| const nvpLastPaymentMethodIsInitialized = nvpLastPaymentMethod !== undefined; |
There was a problem hiding this comment.
Can you explain this change?
There was a problem hiding this comment.
The purpose of these changes was to make sure that we only update the Options list by PaymentMethod when we have a PaymentMethod initialized (when it changes from undefined to object )
Other times we don't do this
There was a problem hiding this comment.
I think we should use a build in feature of useOnyx to handle this if we want https://github.com/Expensify/App/blob/b7c0055c531f668c683cc048cb01f6f6afc33f97/src/pages/home/ReportScreen.tsx#L135C5-L135C66
There was a problem hiding this comment.
Yes
It works the same as comparing with undefined
But looks cleaner !
Thanks
|
@mountiny @dukenv0307 |
mountiny
left a comment
There was a problem hiding this comment.
Changes look good to me but if you are available, I would prefer to change this so we can use the built in onyx feature
| const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${chatReportID || -1}`); | ||
| const [lastPaymentMethod = '-1'] = useOnyx(ONYXKEYS.NVP_LAST_PAYMENT_METHOD, {selector: (paymentMethod) => paymentMethod?.[policyID]}); | ||
| const [nvpLastPaymentMethod] = useOnyx(ONYXKEYS.NVP_LAST_PAYMENT_METHOD); | ||
| const nvpLastPaymentMethodIsInitialized = nvpLastPaymentMethod !== undefined; |
There was a problem hiding this comment.
I think we should use a build in feature of useOnyx to handle this if we want https://github.com/Expensify/App/blob/b7c0055c531f668c683cc048cb01f6f6afc33f97/src/pages/home/ReportScreen.tsx#L135C5-L135C66
|
Not going to do the migration in this PR |
|
@mountiny looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
We opted not to migrate these files to |
|
✋ 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/mountiny in version: 9.0.38-0 🚀
|
|
🚀 Deployed to production by https://github.com/grgia in version: 9.0.38-4 🚀
|
Details
Fix bug with Payment option is not selected
Fixed Issues
$ #49331
PROPOSAL: #49331 (comment)
Tests
Precondition:
Workspace has set up bank account.
Offline tests
Precondition:
Workspace has set up bank account.
QA Steps
Precondition:
Workspace has set up bank account.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
android.mov
Android: mWeb Chrome
android-web.mov
iOS: Native
ios.mov
iOS: mWeb Safari
ios-web.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov