-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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: approve button appears for scan failure transaction #58195
base: main
Are you sure you want to change the base?
Conversation
@shubham1206agra 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] |
@@ -8247,8 +8247,7 @@ function canApproveIOU( | |||
reportTransactions.every( | |||
(transaction) => | |||
(isExpensifyCardTransaction(transaction) && isPending(transaction)) || | |||
(isPartialMerchant(getMerchant(transaction)) && isAmountMissing(transaction)) || | |||
(isScanRequestTransactionUtils(transaction) && isReceiptBeingScannedTransactionUtils(transaction)), | |||
(isScanRequestTransactionUtils(transaction) && (isAmountMissing(transaction) || isReceiptBeingScannedTransactionUtils(transaction))), |
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 am sorry, but this will not be correct solution. What if the merchant is missing but amount is not?
cc @luacmartins
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 only missing merchant is fine.
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.
@nkdengineer this is the logic used in the backend and I think we should follow it here too:
allReportTransactions.every( | ||
(t) => (isExpensifyCardTransaction(t) && isPending(t)) || (isPartialMerchant(getMerchant(t)) && isAmountMissing(t)) || (isScanRequest(t) && isReceiptBeingScanned(t)), | ||
); | ||
allReportTransactions.every((t) => (isExpensifyCardTransaction(t) && isPending(t)) || (isScanRequest(t) && (isAmountMissing(t) || isReceiptBeingScanned(t)))); |
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.
Can we just create an util function to check this and use it in both places?
Explanation of Change
fix: approve button appears for scan failure transaction
Fixed Issues
$ #54996
PROPOSAL:
Tests
Precondition: The workspace has enabled the workflow,s and the current user is the approval
Offline tests
None
QA Steps
Precondition: The workspace has enabled the workflow,s and the current user is the approval
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop
Screen.Recording.2025-03-11.at.16.22.27.mov