Repository navigation
fix: Distance - Start and Stop labels do not change when dragging one over another. - #44748
Conversation
… over another. Signed-off-by: Krishna Gupta <belivethatkg@gmail.com>
|
@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 <belivethatkg@gmail.com>
| // 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.
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.
sorry for delay, I will confirm this today.
There was a problem hiding this comment.
@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 <belivethatkg@gmail.com>
| const {keyForList, ...waypointWithoutKey} = waypoints[key]; | ||
| return !isEmpty(waypointWithoutKey); |
There was a problem hiding this comment.
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.
I will check this in few hours.
There was a problem hiding this comment.
@hoangzinh, suggestion looks good to me, code updated.
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
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 |
|
✋ 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 Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.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