-
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
[Wave 8 - ECard Transactions] Update Money Request View Fields to support Ecard transactions #29201
Conversation
Deploying with Cloudflare Pages
|
@ArekChr are you able to prioritize this? We have an external commit of Oct 22 for this project :) |
@ 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] |
@ 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] |
Hi @grgia, yes, I will do review today |
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.
Overall the code looks good to me. I’ve noted a few minor points for consideration in the inline comments.
} = ReportUtils.getTransactionDetails(transaction); | ||
const isEmptyMerchant = | ||
transactionMerchant === '' || transactionMerchant === CONST.TRANSACTION.UNKNOWN_MERCHANT || transactionMerchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT; | ||
const formattedTransactionAmount = transactionAmount && transactionCurrency && CurrencyUtils.convertToDisplayString(transactionAmount, transactionCurrency); | ||
const formattedOriginalAmount = transactionOriginalAmount && transactionOriginalCurrency && CurrencyUtils.convertToDisplayString(transactionOriginalAmount, transactionOriginalCurrency); | ||
const isExpensifyCardTransaction = true; // TransactionUtils.isExpensifyCardTransaction(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.
The value is hardcoded to true, it appears that the intention was to utilize the TransactionUtils.isExpensifyCardTransaction(transaction)
|
||
const isSettled = ReportUtils.isSettled(moneyRequestReport.reportID); | ||
const canEdit = ReportUtils.canEditMoneyRequest(parentReportAction); | ||
// NOTE: edit logic for card transactions will be handled in https://github.com/Expensify/App/issues/28836, for now disable editing. |
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.
This seems more like TODO
// NOTE: edit logic for card transactions will be handled in https://github.com/Expensify/App/issues/28836, for now disable editing. | |
// TODO: Temporarily disabling edit functionality for card transactions. | |
// The logic to handle edit operations for card transactions is pending development and will be addressed in: https://github.com/Expensify/App/issues/28836 |
src/libs/CardUtils.ts
Outdated
@@ -29,7 +29,7 @@ function getMonthFromExpirationDateString(expirationDateString: string) { | |||
* @param cardID | |||
* @returns boolean | |||
*/ | |||
function isExpensifyCard(cardID: string) { | |||
function isExpensifyCard(cardID: number) { |
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 noticed that the getCardDescription
function expects a cardID of type string. Should we also check and adjust the typing on line 44 to number?
src/libs/TransactionUtils.ts
Outdated
} | ||
|
||
/** | ||
* Return the original amount field from the 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.
* Return the original amount field from the transaction. | |
* Return the absolute value of the original amount field from the transaction. |
Reviewer Checklist
Screenshots/Videos
|
@ArekChr thank you for the review, will update tomorrow morning! |
@ArekChr, pushed changes! |
@grgia After simulating data, card data is not filled correctly. Could you provide more specific details on where you mocked Onyx? |
@ArekChr I fixed the data, it should be |
I changed to the type of number, but it still doesn't help. The card section is not visible; weird 🧐
|
@ArekChr why do you have a transaction with that cardID? Curious how you set it before since you have to manual set cardID for testing in general |
@grgia How do you mock data? I think this is essential |
@ArekChr I use the Onyx merges |
@grgia Yes, I see, but in which place? |
@ArekChr in the console |
@ArekChr here's an example of how I use merges to test in action: Screen.Recording.2023-10-13.at.12.55.15.PM.mov |
@marcochavezf 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] |
All good, updated checklist 👌 |
@marcochavezf please let me know if you're not able to prioritize this |
I will review it today |
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 code LGTM
return ( | ||
<View style={[styles.dFlex, styles.flexRow, styles.alignItemsCenter, styles.overflowHidden, styles.ph5, styles.pb3, styles.borderBottom, styles.w100]}> | ||
<View style={[styles.dFlex, styles.flexRow, styles.alignItemsCenter, styles.flexGrow1, styles.overflowHidden, styles.ph5, styles.pb3, borderBottomStyle]}> |
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 noticed there are no screenshots for mobile platforms, and I think we'd need to ensure there are no visual regressions introduced in this 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.
✋ 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/grgia in version: 1.3.84-0 🚀
|
shouldShowBorderBottom: PropTypes.bool.isRequired, | ||
}; | ||
|
||
function MoneyRequestHeaderStatusBar({title, description, shouldShowBorderBottom}) { |
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.
Heads up this broke the status bar in the split details page and I fixed it here fc1e3ff
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.84-10 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.84-10 🚀
|
🚀 Deployed to staging by https://github.com/grgia in version: 1.3.85-0 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.85-4 🚀
|
Details
Fixed Issues
$ #28835
Tests
We don't currently have card transactions in app, so I tested with mock data.
PENDING, with Original Currency
PENDING, with no Original Currency
PENDING, with Original Currency
PENDING, with no Original Currency
I also went through and verified that the border bottom works for all cases of scanning / posted transactions by manually setting to true/false:
NONE
SCANNING
PENDING
BOTH
Offline tests
QA Steps
Verify that no errors appear in the JS console
Create any kind of manual request, verify that 'Merchant' field is displayed under description.
NO QA for card transactions changes, as we have not started sending card transactions data to App.
PR Author Checklist
Tests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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