App: [Violations - Pending Receipts] Display the `rter` Violation with the Pending Pattern
Design Doc: https://docs.google.com/document/d/1zJqlTe_RajuBtfQYvbMx8PpXgA9CEnUGVyuqZihQ-ok/edit Tracking GH: https://github.com/Expensify/Expensify/issues/372206
HOLD ON https://github.com/Expensify/Expensify/issues/384996
Similar to how we have TransactionUtils.isPending and TransactionUtils.isReceiptBeingScanned in NewDot to help us with other pending UI flows, we’ll add a new method: TransactionUtils.hasPendingRTERViolation:
TransactionUtils.hasPendingRTERViolation
This will have a similar structure to the current TransactionUtils methods that check for / retrieve violations.
- Params:
transactionID:stringtransactionViolations:TransactionViolation[]- the set of violations for that specific transaction. For components where we are subscribing to all violations we can use the output of TransactionUtils.getTransactionViolations
- Returns:
- A boolean: If any of the violations for that
transactionIDin Onyx are therterviolation, withpendingPatternset totrue
- A boolean: If any of the violations for that
Additionally, because this will be called frequently with TransactionUtils.isPending and TransactionUtils.isReceiptBeingScanned let’s also make and utilize a method that returns true if any of those return true: hasPendingUI()
We’ll outline this in further detail below, but we’ll call this method in:
The first two already have access to the transactionViolations onyx collection key. However, we will need to add it to MoneyRequestHeader.tsx.
Updates to ReportActionItems: MoneyRequestPreview / ReportPreview
Now that we know if our transaction has the “7-Day Hold” rter violation, we can adjust the UI to reflect that it’s “Pending”. For ReportActionItem rows, we will do the same thing that was outlined for pending transactions and scanning receipts in the Update how we display / report expenses doc.
We will show the “pending” hover/message/icon UI for these two cases:
- if the action is a Money Request Action and the linked Transaction has the rter violation (
hasPendingRTERViolation- in addition to possibly beingisScanning || isPendingas outlined in that doc).- We’ll also get the proper preview header text as part of getPreviewHeaderText in the MoneyRequestPreviewContent component.
- if the action is a Report Preview containing a single transaction with the rter violation (
hasPendingRTERViolationor similarly,isScanning || isPending).- We’ll also get the proper message “Receipt pending match with credit card”, with the hourglass icon as well, as part of the logic in the ReportPreview component:
- Additionally, we’ll set shouldShowSubmitButton to
falsein this case.
- We’ll also get the proper message “Receipt pending match with credit card”, with the hourglass icon as well, as part of the logic in the ReportPreview component:
Updates to MoneyReportHeader
Similar to what we’re doing for the Report Preview above, if the report contains only transactions with the rter violation (which again, we’ll alias as hasPendingRTERViolation) we’ll show the Next Steps banner indicating that the receipts are pending match with a credit card.
We’ll also hide the Submit/Approve/Pay buttons in this case as well (i.e. all transactions are pending).
In the case of the “One-Expense” Chat, we’ll use the same pattern as the MoneyRequestHeader as described below.
Updates to MoneyRequestHeader
If hasPendingRTERViolation is true, we’ll show a MoneyRequestHeaderStatusBar in the MoneyRequestHeader here. This will be similar to what we already do for isPending and isScanning. The message will utilize the same hourglass icon and have the copy as seen below.
Let’s also refactor this to be a bit less repetitive. We can create a getPendingType() method that checks if the transaction is RTER vs SCANNING vs PENDING and returns the translations keyed by that type.
“Mark as cash” Button
This will be covered in a separate issue
Issue Owner
Current Issue Owner: @smelaaAbout this issue
- Original URL
- State: open
- Created 3 months ago
- Comments: 33 (26 by maintainers)
We are OOO till Monday due to a national holiday. The PR is almost ready, it just needs to be checked whether everything is in line with the design. I will do this first thing on Monday, is it okay?
Thanks Yuwen!
Yeah we definitely want the little pending status at the bottom of the report preview. (I can’t speak to how we should accomplish that from a technical standpoint.)
And can we double check the sizes and spacings of the little statuses? It looks like maybe some of them are not quite right.
Here’s a mockup to check out:
And here are the specs for that little status:
Hi, thank you for all the information! The PR is in draft but I still need to:
I will be back on Tuesday so in case you need something before that date please ping @BrtqKr, as he is familiar with this issue as well.