-
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: Distance - Start and Stop labels do not change when dragging one over another. #44748
fix: Distance - Start and Stop labels do not change when dragging one over another. #44748
Conversation
… over another. Signed-off-by: Krishna Gupta <[email protected]>
@hoangzinh 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] |
Signed-off-by: Krishna Gupta <[email protected]>
@@ -346,7 +361,9 @@ function IOURequestStepDistance({ | |||
data.forEach((waypoint, index) => { | |||
newWaypoints[`waypoint${index}`] = waypoints[waypoint] ?? {}; | |||
// Find waypoint that BECOMES empty after dragging | |||
if (isEmpty(newWaypoints[`waypoint${index}`]) && !isEmpty(waypoints[`waypoint${index}`] ?? {})) { | |||
const {keyForList, ...newWaypointsWithoutKey} = newWaypoints[`waypoint${index}`]; | |||
const {keyForList: waypointKey, ...waypointWithoutKey} = waypoints[`waypoint${index}`]; |
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.
Is it possible if waypoints[waypoint${index}
] empty here? I mean if there is any case that raise error here
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.
sorry for delay, I will confirm this 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.
@hoangzinh, I think there won't be any case when waypoints[waypoint${index}]
is empty but I have added a if block to make sure that it won't throw any error if there is edge case.
Signed-off-by: krishna2323 <[email protected]>
const {keyForList, ...waypointWithoutKey} = waypoints[key]; | ||
return !isEmpty(waypointWithoutKey); |
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 think we can split it into a shareable method, that can be used in the below changes as well. A method like isEmptyWaypoint
? (we should handle null/undefined inside that method as well)
const nonEmptyWaypointsCount = useMemo(() => Object.keys(waypoints).filter((key) => !isEmptyWaypoint(waypoints[key])).length, [waypoints]);
And
if (isEmptyWaypoint(newWaypoints[`waypoint${index}`]) && !isEmptyWaypoint(waypoints[`waypoint${index}`] ?? {})) {
emptyWaypointIndex = index;
}
What do you think?
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 will check this in few hours.
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.
@hoangzinh, suggestion looks good to me, code updated.
Signed-off-by: krishna2323 <[email protected]>
Signed-off-by: krishna2323 <[email protected]>
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-07-12.at.17.20.36.android.movAndroid: mWeb ChromeScreen.Recording.2024-07-12.at.17.09.33.android.chrome.moviOS: NativeScreen.Recording.2024-07-12.at.17.11.01.ios.moviOS: mWeb SafariScreen.Recording.2024-07-12.at.17.06.02.ios.safari.movMacOS: Chrome / SafariScreen.Recording.2024-07-12.at.16.54.19.web.movMacOS: DesktopScreen.Recording.2024-07-12.at.16.58.06.desktop.mov |
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!
✋ 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/MonilBhavsar in version: 9.0.7-3 🚀
|
🚀 Cherry-picked to staging by https://github.com/thienlnam in version: 9.0.7-4 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.7-8 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.0.8-6 🚀
|
This PR caused a regression. Quoting #45467 (comment):
|
Details
Fixed Issues
$ #44153
PROPOSAL: #44153 (comment)
Tests
Offline tests
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 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_native.mp4
Android: mWeb Chrome
android_chrome.mp4
iOS: Native
ios_native.mp4
iOS: mWeb Safari
ios_safari.mp4
MacOS: Chrome / Safari
web_chrome.mp4
MacOS: Desktop
desktop_app.mp4