-
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 send money show "$0.00" in preview card #18902
Conversation
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.
@mollfpr looking good, thanks for working on this over the weekend 🙇 When will this be ready for review?
src/libs/ReportUtils.js
Outdated
* @param {Number} reportAction.amount | ||
* @param {String} reportAction.currency | ||
* @param {String} reportAction.comment | ||
* @param {Object} reportAction.IOUDetails |
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.
to make sure its clear its not there every time
* @param {Object} reportAction.IOUDetails | |
* @param {Object} [reportAction.IOUDetails] |
@sobitneupane @MonilBhavsar One of you needs to 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] |
@luacmartins @mountiny Fix the conflict and address the commented JSDoc. |
We get it @luacmartins |
@mollfpr we just merged a PR to main which as a merge conflict not, can you please resolve the conflict now, thank you! |
lol Github was being slow so I spammed the button. oops |
Handle it now |
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.
Thanks @mollfpr
@mollfpr Can you merge in main again, I think that there were some small fixes in the flow I tested a bit and seems to work fine. @sobitneupane will you be able to go through the testing on Monday? |
Merged current main |
Yup. I will test it today. |
@mollfpr I am not seeing IOUPreview at all on |
@sobitneupane Yeah, it's not showing in me either. It's due to changes in here #18898 @mountiny Could you confirm if we intended not to show the IOUPreview on the settled money request? |
@sobitneupane @mollfpr yes that's intentional for deleted and pay messages |
@luacmartins So the issue isn’t valid anymore? 🥲 |
@mollfpr Yea, I think we don't need this anymore. Sorry! |
What do you think @mountiny? I think it's okay to close this. |
In the iouReport view, you would see a preview component wouldn't you? (once we move iouActions to the IOU report directly). So just checking we don't need to still merge this PR such that they don't show $0.00 there? |
the created previews will change design but we wont add a new preview for settled up I actually cant find a mocks of Send money flow so I am not sure cc @trjExpensify |
Looking that the send money will still add the |
Reviewer Checklist
Screenshots/Videos |
|
Shipping this I need it for another PR |
const requestCurrency = props.isIOUAction ? lodashGet(props.action, 'originalMessage.currency', CONST.CURRENCY.USD) : props.iouReport.currency; | ||
const requestAmount = props.isIOUAction ? moneyRequestAction.total : ReportUtils.getMoneyRequestTotal(props.iouReport); | ||
const requestCurrency = props.isIOUAction ? moneyRequestAction.currency : props.iouReport.currency; | ||
const requestComment = Str.htmlDecode(moneyRequestAction.comment).trim() |
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.
Fuuu why did the prettier not catch this 😡
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.
idk but it is creating some major weirdness for me locally. Is anyone fixing it?
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 wasnt CPed because of the linter issue so removed the label to make it clear |
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.15-0 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.3.15-12 🚀
|
@luacmartins @mountiny
Details
In the report actions list, we use the action data from
originalMessage
to provide the amount, currency, and comment to pass it toIOUPreview
.For request money and request money paid, the
originalMessage
has structured{..., amount: ..., currency: ..., comment: ...}
but for the send money, the object is put inIOUDetails
, so it will be{..., IOUDetails: {amount: ..., currency: ..., comment: ...}}
. In this case, the componentIOUPreview
failed to get the data because it's not expecting it to be in theIOUDetails
.As it's confirmed by @mountiny here that it's the correct structure, we need to make a new utils method to return the
{amount: ..., currency: ..., comment: ...}
with checking theIOUDetails
key if it's provided.Fixed Issues
$ #18881
Tests
Prerequisite
Send Money
Request Money
Offline tests
Send Money Offline
Request Money Offline
Requested Money from Account A
QA Steps
Same as the Tests
PR Author Checklist
### Fixed Issues
section aboveTests
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
Web
18881.Web.mov
Mobile Web - Chrome
18881.mWeb.Chrome.mp4
Mobile Web - Safari
18881.mWeb.Safari.mp4
Desktop
18881.Desktop.mov
iOS
18881.iOS.mp4
Android
18881.Android.mp4