-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Get distance from transaction vs route #40307
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
Conversation
No C+ needed for this simple change |
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.
Are other properties not available in the transaction.comment
, e.g. geometry
?
Yeah and those are fine because we only use them before the expense is created, as opposed to distance. |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
✋ 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/luacmartins in version: 1.4.69-0 🚀
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.4.69-2 🚀
|
function getDistance(transaction: Transaction): number { | ||
return transaction?.routes?.route0?.distance ?? 0; | ||
function getDistance(transaction: Transaction | null): number { | ||
return transaction?.comment?.customUnit?.quantity ?? 0; |
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.
Details
The distance is now stored on the transaction as soon as it's fetched with GetRouteForDraft, and after the request is created. Previously the backend did not store the distance on the transaction after GetRouteForDraft, which created a confusing inconsistency about where the source of truth is for distance.
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/388212
PROPOSAL: N/A
Tests
Offline tests
QA Steps
Same as tests
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
I only tested on Mac Chrome because the changes are platform independent.
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2024-04-30.at.8.16.10.AM.mov
MacOS: Desktop