-
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
Merchant name of the deleted expense in OD report is still shown in ND report #42015
Conversation
Reviewing today. |
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / Safari41025-web.mp4 |
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.
LGTM.
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.
LGTM
Approved, but not merging since we're currently under a merge freeze.
✋ 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/chiragsalian in version: 1.4.76-0 🚀
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.4.76-7 🚀
|
Details
When the OD expense is deleted from the report, in ND nothing changes in the transaction object.
merchant
remains the initially assigned merchant andmodifiedMerchant
remains empty string""
.Because of this, the
TransactionUtils.getMerchant()
function always returns themerchant
, even when the expense is removed from the OD report since themodifiedMerchant
doesn't actually change in this case.One might wonder, how come the display amount changes if the transaction object does not change ?
It turns out that we're checking for the display amount using the
getDisplayAmount
function here, which extracts the display amount fromaction.message?.[0]?.text
which does change when the expense is removed from OD report.To fix this we created a new function named
isDisplayAmountZero
which will return a boolean determining if the givendisplayAmount
string value equals0
(works for any currency, eg. $0.00 or ₫0).With this new function we add the
!isDisplayAmountZero(getDisplayAmount())
following to the end of theshouldShowSubtitle
variable.By doing this, if the expense display amount equals
0
-> we won't show the report review subtitle (merchant or description) anymore, basically aligning thegetDisplayAmount
functionality with the subtitle (merchant or description) functionality.This means that when the expense is removed from the OD report and the display amount changes to $0.00 in ND report preview, the subtitle (merchant or description) will be hidden as long as the display amount equals
0
.Fixed Issues
$ #40980
PROPOSAL: #40980 (comment)
Tests
Employee - OldDot
Employee - NewDot
Employee - OldDot
Employee - NewDot
Note: If the change did not propagate yet, navigate to another LNH report then return back to the workspace chat in order for the report data to re-fetch (see videos below).
Offline tests
QA Steps
Employee - OldDot
Employee - NewDot
Employee - OldDot
Employee - NewDot
Note: If the change did not propagate yet, navigate to another LNH report then return back to the workspace chat in order for the report data to re-fetch (see videos below).
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.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.mov
Android: mWeb Chrome
android-mweb.mov
iOS: Native
ios.mov
iOS: mWeb Safari
ios-mweb.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov