-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
fix: card error not show and cannot dismiss in report fraud page #49292
Conversation
@jayeshmangwani 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] |
@jayeshmangwani I cannot reproduce the exact error message in OP. I can only reproduce Whatever, I think the main problem here is that any BE errors do not show and cannot be dismissed. We need to fixed them regardless of the content of the error. |
Thanks for the thorough testing steps. I tested it by reproducing the |
@dominictb Can we please fix the lint failing ? |
@dominictb friendly bump for this #49292 (comment) |
@jayeshmangwani I'm unsure if we should address the lint error in this PR, as the PaymentMethodList page contains a lot of logic. I don't feel confident that all test cases will be properly covered after fixing the lint issues. I as mentioned here, do you think we should ignore the fix lint in this PR? @cead22
|
Let's give it a try, this is my first review that involves the withOnyx migration, but looking at PaymentMethodList, it doesn't look that complex, and it has default values for the props. For For For I imagine testing this component shouldn't be too hard. We can add a payment method or two and make sure the list displays correctly. Please let me know if I'm overlooking omething |
@jayeshmangwani I updated PR. Please help review again. |
@dominictb Could you please merge the latest main branch and push it? The Tests are failing on the PR. |
@jayeshmangwani I merged main |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid.movAndroid: mWeb Chromemweb-chrome.moviOS: Nativeios.moviOS: mWeb SafarimWeb-safari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
@@ -399,7 +409,7 @@ function PaymentMethodList({ | |||
icon={Expensicons.CreditCard} | |||
onPress={onPress} | |||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | |||
isDisabled={isLoadingPaymentMethods || isFormOffline} | |||
isDisabled={isLoadingPaymentMethods || isFormOffline || isLoadingPaymentMethodsOnyx} |
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.
@dominictb Why do we need isLoadingPaymentMethodsOnyx? isLoadingPaymentMethods should do the work here, right or am i missing something?
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.
@dominictb Same thing for the isLoadingCardList
and isLoadingBankAccountList
, do we really need that?
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 do we need isLoadingPaymentMethodsOnyx? isLoadingPaymentMethods should do the work here, right or am i missing something?
The || isLoadingPaymentMethodsOnyx
was added in this commit to remove withOnyx. Previously, when using withOnyx, isLoadingPaymentMethods had a default value of true. So, when switching to useOnyx, we needed to include || isLoadingPaymentMethodsOnyx
wherever isLoadingPaymentMethods
is used to ensure everything continues to function correctly
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.
The same approach should be applied in the case isLoadingCardList and isLoadingBankAccountList. When using withOnyx, isLoadingCardList
has default value is {}
. So we need to use const assignedCards = Object.values(isLoadingCardList ? {} : cardList ?? {})
.
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 for the details @dominictb.
I noticed an issue on the Expensify cards page within the workspaces—pressing the close icon doesn’t clear the error message. Although it's not related to the current issue but we had fixed a similar problem here in this PR.so, Just to confirm, @dominictb @cead22 should we address it as part of this task, or create a separate bug for it?
card-error-doesnt-go-away.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.
Hi! Coming in here as assigned - if it's going to be a pretty similar solution let's knock it out in this PR as well. I realize it's a different page but still card-related error I guess, and if we already have done the work we need to adjust, let's do 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.
Great, Let's do this.
@dominictb We need to add the onClose here and set the errors null like we do in the clearDeletePaymentMethodError
<OfflineWithFeedback | |
key={`${item.nameValuePairs?.cardTitle}_${index}`} |
Onyx.merge(paymentListKey, {
[paymentMethodID]: {
pendingAction: null,
errors: null,
},
});
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.
Changes work well. I've added a comment regarding the unrelated bug here: #49292 (comment)
@dominictb Please merge the main branch and resolve any conflicts. I've bumped this on Slack to get someone from the internal team assigned, since @cead22 is OOO. |
@jayeshmangwani Done. |
@jayeshmangwani Done and retested well. Please retest on your side. |
@dominictb Are you sure, you have tested and works well ?? |
For me its not working |
Please upload a video, so that I can confirm |
@dominictb Don't you think you've passed the wrong key here? You've passed Please correct me if I am wrong |
@jayeshmangwani My bad I pushed the wrong code changes. I updated the code, test steps and added video: Screen.Recording.2024-10-03.at.11.30.25.mov |
@dangrous code looks good and is ready for your approval |
@dangrous Whenever you can, please check the PR. It looks good to me. |
Thanks for your patience, I was OOO - this 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/dangrous in version: 9.0.46-0 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.46-5 🚀
|
Details
Fixed Issues
$ #49010
PROPOSAL: #49010 (comment)
Tests
Precondition: Have a workspace with Expensify Card enabled
Verify an error shows above Deactivate Card button
Verify the error and RBR next to Wallet are dismissed
Verify the error below the card can be closed
Verify the error is not there anymore
Offline tests
QA Steps
Note: See MacOS: Chrome / Safari recordings for full test steps.
Precondition: Have a workspace with Expensify Card enabled
Verify an error shows above Deactivate Card button
Verify the error and RBR next to Wallet are dismissed
Verify the error below the card can be closed
Verify the error is not there anymore
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.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 and/or tagged@Expensify/design
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
Screen.Recording.2024-09-18.at.00.44.00.mov
Android: mWeb Chrome
Screen.Recording.2024-09-18.at.00.38.01.mov
iOS: Native
Screen.Recording.2024-09-18.at.00.31.08.mov
iOS: mWeb Safari
Screen.Recording.2024-09-18.at.00.32.40.mov
MacOS: Chrome / Safari
screen-recording-2024-09-18-at-001947_2YmlKm43.mp4
Screen.Recording.2024-10-03.at.11.30.25.mov
MacOS: Desktop
Screen.Recording.2024-09-18.at.00.34.01.mov