-
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
fix: update how we show pending and scanning status #53112
base: main
Are you sure you want to change the base?
Conversation
I am a little stuck on the Android and iOS Native builds, will add later |
@@ -202,6 +202,10 @@ function MoneyRequestPreviewContent({ | |||
message = translate('iou.split'); | |||
} | |||
|
|||
if (TransactionUtils.isPending(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 have a small question: should we use isPending
or hasPendingUI
here? It depends on whether we want to display the Pending
field for the following cases (i.e., isReceiptBeingScanned
/isPending
/hasPendingRTERViolation
):
App/src/libs/TransactionUtils/index.ts
Lines 754 to 759 in 5bb0e9b
/** | |
* Check if the transaction is pending or has a pending rter violation. | |
*/ | |
function hasPendingUI(transaction: OnyxEntry<Transaction>, transactionViolations?: TransactionViolations | null): boolean { | |
return isReceiptBeingScanned(transaction) || isPending(transaction) || (!!transaction && hasPendingRTERViolation(transactionViolations)); | |
} |
BTW, we have removed the Receipt pending match with card transaction
message on line 259 in the PR.
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.
Curious what @grgia thinks about 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.
Since there is an isScanning
that returns early, we no longer need to consider isReceiptBeingScanned
.
App/src/components/ReportActionItem/MoneyRequestPreview/MoneyRequestPreviewContent.tsx
Lines 249 to 258 in cefad67
if (isScanning) { | |
return {shouldShow: true, messageIcon: ReceiptScan, messageDescription: translate('iou.receiptScanInProgress')}; | |
} | |
if (TransactionUtils.isPending(transaction)) { | |
return {shouldShow: true, messageIcon: Expensicons.CreditCardHourglass, messageDescription: translate('iou.transactionPending')}; | |
} | |
if (TransactionUtils.shouldShowBrokenConnectionViolation(transaction?.transactionID ?? '-1', iouReport, policy)) { | |
return {shouldShow: true, messageIcon: Expensicons.Hourglass, messageDescription: translate('violations.brokenConnection530Error')}; | |
} | |
if (TransactionUtils.hasPendingUI(transaction, TransactionUtils.getTransactionViolations(transaction?.transactionID ?? '-1', transactionViolations))) { |
only need to determine whether both
isPending
and hasPendingRTERViolation
should show "Pending". :)
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.
only need to determine whether both
isPending
andhasPendingRTERViolation
should show "Pending". :)
Hi, @grgia, any thoughts on the comment above? :)
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.
friendly bump @grgia
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.
Hmm if the receipt is just Scanning, it doesn't mean it's pending the same way that a credit card transaction would be pending. So for the scanning case, I don't think we should show that there.
Also, I thought the idea was to also remove the "Receipt scan in progress" small text from the bottom? cc @Expensify/design for a gut check there!
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.
^^ same, I thought so too!
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.
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.
Then, @nkdengineer, when you have time, can you please update the code according to the above comment?
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'll update soon
What's the latest on this one? Seems like we hit a slowdown. Let's keep the momentum going so we can get this merged! |
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 LGTM, I like your suggestion to change the name, could you push that? @nkdengineer
@ntdiary i fixed lint and updated |
@@ -401,7 +401,7 @@ function ReportPreview({ | |||
} | |||
} | |||
if (shouldShowScanningSubtitle) { | |||
return {shouldShow: true, messageIcon: Expensicons.ReceiptScan, messageDescription: translate('iou.receiptScanInProgress')}; | |||
return {shouldShow: false, messageIcon: Expensicons.ReceiptScan, messageDescription: translate('iou.receiptScanInProgress')}; |
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.
@Expensify/design, one more question: we only want to update the expense preview
, not the report preview
, right? If that's the case, then we don't need to update this ReportPreview
file.
But if we also want to update the report preview
, this line of code might not be enough, as its display rules are more complex.
Here’s an example of the report preview (mock data):
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.
Hmm interesting, I feel like we should also get rid of the Receipt scan in progress
text from the report preview given that you see (1 scanning)
in the title above. So yeah, let's update it here too.
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.
Hmm interesting, I feel like we should also get rid of the Receipt scan in progress text from the report preview given that you see (1 scanning) in the title above. So yeah, let's update it here too.
Got it. @nkdengineer, it seems like shouldShowScanningSubtitle
is no longer needed? It would be great if you could confirm this again, as the conditions for displayAmount/supportText/PendingMessage
are quite complex. 😅
Explanation of Change
Fixed Issues
$ #52921
PROPOSAL: #52921 (comment)
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
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
web.mov
MacOS: Desktop
desktop.mov