-
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
fix: BUG: [distance] request confirmation offline doesn't show TBD #26836
Conversation
- Add 'TBD' to pending fields
@Ollyws while working on this PR, I found 2 more issues with the distance flow (not regression, not caused by my changes). I'll try to fix one, but the other seems a bit complicated for me. Should I file both of them through the bug report? |
@paultsimura Yeah if they're out of scope for this issue then best to just report them. Thanks! |
@Ollyws they're kind-of related, but not directly. I will report them, tag you in threads, and let you decide what to do with it |
@paultsimura Where did you get the Spanish copy from here? If it's something you generated yourself could you please ask for confirmation that the copy is correct in Slack? Thanks. |
@Ollyws already done, the corresponding Slack thread is referenced in the PR checklist. Waiting for approval... |
@paultsimura does this PR also handles refetching of the route when the device comes back online? |
@hayata-suenaga yes, you can see the result in the attached screen recordings - it includes the route re-fetch. |
@hayata-suenaga @Ollyws could you guys please help with getting this tiny translation expedited? https://expensify.slack.com/archives/C01GTK53T8Q/p1693944607891839 It'd be nice to have enough time for testing this feature for regression before the merge freeze ends. |
@Ollyws the copies have been updated – this PR is ready for the final review |
src/components/DistanceRequest.js
Outdated
const waypointMarkers = useMemo( | ||
() => | ||
_.filter( | ||
_.map(waypoints, (waypoint, key) => { | ||
if (!waypoint || !lodashHas(waypoint, 'lat') || !lodashHas(waypoint, 'lng') || lodashIsNull(waypoint.lat) || lodashIsNull(waypoint.lng)) { | ||
if (!waypoint || lodashIsNil(lodashGet(waypoint, 'lng')) || lodashIsNil(lodashGet(waypoint, 'lat'))) { |
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 specific change is only for cosmetic purposes to reflect my changes in here:
App/src/components/ConfirmedRoute.js
Line 47 in 9ce8d13
if (!waypoint || lodashIsNil(lodashGet(waypoint, 'lng')) || lodashIsNil(lodashGet(waypoint, 'lat'))) { |
And that fix was related not only to non-existing address. Without my change, going back online on the confirmation screen after entering any address points would crash the mobile app.
mobile_crash.mp4
Reviewer Checklist
Screenshots/VideosWebMacOS_Chrome.movMobile Web - ChromeAndroid_Chrome.movMobile Web - SafariiOS_Safari.movDesktopMacOS_Desktop.moviOSiOS_Native.movAndroidAndroid_Native.mov |
One issue I've just come across, is that if you try to make an offline distance request to a workspace that you haven't previously accessed in this session (i.e has no saved onyx data for the milage rate), then come online when on the confirmation page the total will be $0 as the milage rate has not yet been fetched from the backend. Screen.Recording.2023-09-08.at.15.38.45.mov |
@Ollyws seems like I found the solution, though it was indeed a bit out of scope. Committed. workspace_rate_fixed.mp4 |
# Conflicts: # src/components/ConfirmedRoute.js
@Ollyws I think it is totally ok in this context for it to just say "Request". |
Updated with no "TBD" on the button |
Agree, just "Request" works for me! |
@@ -239,7 +239,7 @@ function MoneyRequestConfirmationList(props) { | |||
text = translate('iou.request'); | |||
} else { | |||
const translationKey = props.hasMultipleParticipants ? 'iou.splitAmount' : 'iou.requestAmount'; | |||
text = translate(translationKey, {amount: formattedAmount}); | |||
text = translate(translationKey, {amount: isDistanceRequestWithoutRoute ? '' : formattedAmount}); |
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.
@paultsimura Is there any point at which we have a distance request utilizing iou.splitAmount
, or could we just modify above to something like if (props.receiptPath || isDistanceRequestWithoutRoute) {
?
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.
You're right, at the moment the Distance request doesn't allow splitting the bill. Updated, ready for the final review.
# Conflicts: # src/components/DistanceRequest.js
@paultsimura Thanks for the changes, looks good but I think we have some merge conflicts. |
# Conflicts: # src/pages/iou/steps/MoneyRequestConfirmPage.js
These conflicts appear with the speed of light. |
@paultsimura Thanks but didn't that just overwrite these changes you made to the dependencies (isOffline and participants)? |
@Ollyws thanks man, won't happen again. |
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.
Great work everyone, thank you.
✋ 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/neil-marcellini in version: 1.3.72-0 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 1.3.72-11 🚀
|
I'm commenting for the checklist on this issue since we didn't catch something when merging main. Not a big deal. |
Details
Fixed Issues
$ #26537
PROPOSAL: #26537 (comment)
Tests
amount
anddistance
are filled as "TBD"amount
anddistance
are filled with valid valuesOffline tests
amount
anddistance
are filled as "TBD"QA Steps
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
3.New.Expensify.-.6.September.2023.mp4
Mobile Web - Chrome
chrome.mp4
Mobile Web - Safari
safari.mp4
Desktop
desktop.mp4
iOS
ios_success.mp4
Android
android.mp4