-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Fix computing receiver and payer for IOU transaction preview #64228
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
Changes from all commits
0823ea5
7204740
70045d3
deeddcb
b6c9fce
d9dc921
c5ce6a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -11,7 +11,7 @@ type TransactionPreviewStyleType = { | |||||
| }; | ||||||
|
|
||||||
| type TransactionPreviewProps = { | ||||||
| /** The active IOUReport, used for Onyx subscription */ | ||||||
| /** The active reportID linked to the transaction */ | ||||||
| iouReportID: string | undefined; | ||||||
|
|
||||||
| /** The associated chatReport */ | ||||||
|
|
@@ -65,7 +65,7 @@ type TransactionPreviewProps = { | |||||
| reportPreviewAction?: ReportAction; | ||||||
|
|
||||||
| /** Whether to show payer/receiver data in the preview */ | ||||||
| shouldShowIOUData?: boolean; | ||||||
| shouldShowPayerAndReceiver?: boolean; | ||||||
|
|
||||||
| /** In case we want to override context menu action */ | ||||||
| contextAction?: OnyxEntry<ReportAction>; | ||||||
|
|
@@ -93,15 +93,19 @@ type TransactionPreviewContentProps = { | |||||
| /** Records any errors related to wallet terms. */ | ||||||
| walletTermsErrors: Errors | undefined; | ||||||
|
|
||||||
| /** Represents the IOU report entry from Onyx */ | ||||||
| iouReport: OnyxEntry<Report>; | ||||||
| /** Represents the report linked to the transaction */ | ||||||
| report: OnyxEntry<Report>; | ||||||
|
|
||||||
| /** Flag to determine if a transaction involves a bill split among multiple parties. */ | ||||||
| isBillSplit: boolean; | ||||||
|
|
||||||
| /** Holds the transaction data entry from Onyx */ | ||||||
| transaction: OnyxEntry<Transaction>; | ||||||
|
|
||||||
| /** The original amount value on the transaction. This is used to deduce who is the sender and who is the receiver of the money request | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not like the word
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good. We a few different versions of the amount so the nomenclature is tricky.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI corrected here: 389f7f9 |
||||||
| * In case of Splits the property `transaction` is actually an original transaction (for the whole split) and it does not have the data required to deduce who is the sender */ | ||||||
| transactionRawAmount: number; | ||||||
|
|
||||||
| /** Represents the action entry from Onyx */ | ||||||
| action: OnyxEntry<ReportAction>; | ||||||
|
|
||||||
|
|
@@ -130,7 +134,7 @@ type TransactionPreviewContentProps = { | |||||
| reportPreviewAction?: ReportAction; | ||||||
|
|
||||||
| /** Whether to show payer/receiver data in the preview */ | ||||||
| shouldShowIOUData?: boolean; | ||||||
| shouldShowPayerAndReceiver?: boolean; | ||||||
|
|
||||||
| /** Is this component used during duplicate review flow */ | ||||||
| isReviewDuplicateTransactionPage?: boolean; | ||||||
|
|
||||||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
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 I renamed this prop?
The name
iouReportsuggests that the report that gets passed is of type IOU. That is not true for the previews and was a source of confusion for me.Both
MoneyRequestReportPreview, and it's childrenTransactionPreview's can be rendered for bothIOUandEXPENSEreport.So in reality this variable can be either
expenseReportoriouReport. To make it simpler I just used the namereport.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 like this change.