-
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
Allow Editing Distance Requests #26141
Merged
+569
−165
Merged
Changes from 1 commit
Commits
Show all changes
167 commits
Select commit
Hold shift + click to select a range
b75f0c6
Merge branch 'hayata-map-on-confirmation-screen' of github.com:Expens…
jasperhuangg 43a7296
add distance request consts
jasperhuangg 28c293e
add DISTANCE_REQUEST ONYXKEY
jasperhuangg 322504a
add routes for editdistancerequest and editrequestwaypoint
jasperhuangg c5c72a5
add distance translations
jasperhuangg 85ac77d
add editDistanceRequest actions
jasperhuangg 4cac094
add new pages for editing distance requests
jasperhuangg ec14060
simplify DistanceRequest to just take a transactionID, modify to hand…
jasperhuangg 94e0137
setup navigation
jasperhuangg 1bfff19
updates
jasperhuangg c55dcab
setup nav for moneyrequesteditwaypointpage
jasperhuangg 3dced83
fix merge conficts
jasperhuangg aac0217
remove unused
jasperhuangg b868243
remove unused
jasperhuangg 2f63e7b
remove unused
jasperhuangg f6637d5
remove unused
jasperhuangg 5944e01
remove unused
jasperhuangg 89dbc2d
remove unused
jasperhuangg aa0ef77
remove unused
jasperhuangg 8ad2b54
remove unused
jasperhuangg f594b64
remove unused
jasperhuangg 0585fbd
remove unused
jasperhuangg b3eb1c5
remove unused
jasperhuangg 3263467
remove unused
jasperhuangg 211cb93
remove unused
jasperhuangg 9da21a7
remove unused
jasperhuangg fda8d5e
Merge branch 'main' of github.com:Expensify/App into jasper-editDista…
jasperhuangg 9d416c8
rename variable
jasperhuangg 2782890
fix params
jasperhuangg 6245d61
Merge branch 'main' of github.com:Expensify/App into jasper-editDista…
jasperhuangg 8071cba
rename WaypointEditorPage => NewDistanceRequestWaypointEditorPage
jasperhuangg 0bd1ed8
Add save button to distance requests
jasperhuangg c2c8cff
fix propTypes
jasperhuangg 6cf1bfb
remove debug log
jasperhuangg 123dd88
remove debug log
jasperhuangg e750b6b
save waypoints correctly under comment for optimistic data
jasperhuangg 97be8c7
add pending actions for optimistic waypoints
jasperhuangg a1474f9
wip
jasperhuangg f34e1d8
grab transaction from transactionID
jasperhuangg 39ce2a1
add getParentTransaction
jasperhuangg 547f52b
pass transactionID
jasperhuangg cec90f0
resolve conflicts
jasperhuangg 9e7b0ff
resolve conflicts
jasperhuangg 5c8b46f
resolve conflicts
jasperhuangg 46305e2
remove unused
jasperhuangg ec2f771
remove unused
jasperhuangg 74265a4
revert
jasperhuangg de24926
revert
jasperhuangg eaa720c
remove unused
jasperhuangg c0782ca
remove unused
jasperhuangg b4379e1
revert
jasperhuangg 1604a43
revert
jasperhuangg 72bbd71
show loader
jasperhuangg 3d2b367
style
jasperhuangg 33da5a5
allow EditDistanceRequest to be called for editing other types of fields
jasperhuangg bc43cb1
allow other fields to be edited in with EditDistanceRequest
jasperhuangg e0378cc
style
jasperhuangg d36fec6
style
jasperhuangg a1404f1
send waypoints back even when editing other fields
jasperhuangg c2a563d
fix conflicts
jasperhuangg 8fb24f6
update JS doc, pass optimistic report action ID
jasperhuangg a6f214b
update JS doc, pass optimistic report action ID
jasperhuangg 01e450b
rename to updateDistanceRequest
jasperhuangg ae1cb17
style
jasperhuangg f933bc5
resolve conflicts
jasperhuangg 9165224
remove unused
jasperhuangg 2bf9c29
style
jasperhuangg eb67082
merge main
jasperhuangg 494a72c
remove unused
jasperhuangg 654087e
remove unused
jasperhuangg 72a0244
hide modal after successfully updating distance
jasperhuangg be082f6
style
jasperhuangg e8afc78
remove unused
jasperhuangg c49aef8
resolve conflicts with main
jasperhuangg edfc0cb
remove unused
jasperhuangg a5fe4bd
resolve conflicts
jasperhuangg 8622d09
resolve conflicts
jasperhuangg b3c569f
Merge branch 'main' into jasper-editDistanceRequests
tgolen 5ff8528
Remove not found page
tgolen 5a8fa8c
Fix proptype warning
tgolen 7e0934f
Remove unused prop
tgolen af3c5d7
Fix issue with advancing to confirmation
tgolen 1f5b8a0
WIP trying to keep waypoints when going back
tgolen ee4ec75
Keep transaction data from being lost
tgolen 12b445a
Fix proptype warnings
tgolen 6c7b9ad
Merge branch 'main' into jasper-editDistanceRequests
tgolen 5aa28ce
Fix a proptype warning
tgolen 0ade1ed
Merge branch 'main' into jasper-editDistanceRequests
tgolen 3f6b37a
Fix lint
tgolen 39874fe
Fix more lint
tgolen 61ccb9e
Prevent from getting full report collection
tgolen b11c990
Use proper hook dependency
tgolen 7c002bc
Merge branch 'main' into jasper-editDistanceRequests
tgolen e1de60e
Add full page not found, remove extra brackets, cleanup default props
tgolen 44a740f
Remove extra props
tgolen da16447
Clean up navigator
tgolen a3df3c6
Remove unused parameter
tgolen 21285c6
Fix the confirmation page for updating waypoints
tgolen 0b87b2b
Revert "Fix the confirmation page for updating waypoints"
tgolen c1039c8
Revert "Clean up navigator"
tgolen 1c10cbd
Have participant auto-selected
tgolen d902063
Pass route to edit page
tgolen 41d1eed
Merge branch 'main' into jasper-editDistanceRequests
tgolen 38d0684
Merge branch 'main' into jasper-editDistanceRequests
tgolen bd249cf
Merge branch 'main' into jasper-editDistanceRequests
tgolen b467e29
Merge branch 'main' into jasper-editDistanceRequests
tgolen f462092
WIP on building proper optimistic IDs
tgolen 07606c0
Apply missing optimistic data to updated money request report
tgolen 724e565
Fix lint
tgolen 050708b
Remove unused var
tgolen c2cf599
Merge branch 'main' into jasper-editDistanceRequests
tgolen b94bba3
Remove empty space
tgolen befe5d8
Reset waypoints when canceling out of waypoint editor
tgolen e0c66ec
lint
tgolen 6722163
lint
tgolen e6ab909
Merge branch 'main' into jasper-editDistanceRequests
tgolen efd9353
Edit a cloned transaction instead of the original
tgolen cb7a27c
Remove temporary transaction on unmount, remove previous code for ini…
tgolen 29de8fa
Pass transactionID in the URL
tgolen 1f826a4
Move loading and pending fields to temporary transaction
tgolen 1a9da5c
Add code comments
tgolen 94f6137
Start adding code for syncing temporary expense
tgolen 6a994ff
Have errors synced between transactions
tgolen 811ade4
Merge branch 'main' into jasper-editDistanceRequests
tgolen fe04c77
Keep waypoints correct on original transaction
tgolen 92c1cc2
Merge branch 'main' into jasper-editDistanceRequests
tgolen b41f5fe
Lint
tgolen c26c40e
Fix waypoint editor
tgolen 5cf2039
Add curly braces
tgolen 0d178e3
Remove redundant spacer and unused param
tgolen 7b0fb85
Use the params object as intended
tgolen ec9876e
Merge branch 'main' into jasper-editDistanceRequests
tgolen d3b31ad
Reduce variables
tgolen da2a13e
Simplify data formats
tgolen 82dcecb
Remove temporary transaction and use a backup instead
tgolen ee506cd
Remove debug
tgolen e628aeb
Remove unnecessary success data
tgolen bb155e3
Backup pending fields too
tgolen 0a21e09
Update optimistic data
tgolen 5d52826
Discard changes if a transaction was saved with errors
tgolen cc38439
Discard errors properly when canceling edit flow
tgolen 3c90ddf
Revert "Discard errors properly when canceling edit flow"
tgolen bf27ba8
Reset transaction if there are errors
tgolen ed70fde
Update src/pages/EditRequestDistancePage.js
tgolen 78e7220
Update src/pages/EditRequestDistancePage.js
tgolen a6b4943
Update src/libs/actions/IOU.js
tgolen ed1722d
Update src/libs/TransactionUtils.js
tgolen 059e5fb
Merge branch 'main' into jasper-editDistanceRequests
tgolen b563c63
Dismiss modal
tgolen a1b1cb6
Merge branch 'main' into jasper-editDistanceRequests
tgolen c2f2f9b
Merge branch 'main' into jasper-editDistanceRequests
tgolen 8f0d1c5
Merge branch 'main' into jasper-editDistanceRequests
tgolen 445c5d2
Merge branch 'main' into jasper-editDistanceRequests
tgolen 78cd200
Add pending fields to transaction type
tgolen 255b88c
Merge branch 'main' into jasper-editDistanceRequests
tgolen b143bad
lint
tgolen eb66d14
Merge branch 'main' into jasper-editDistanceRequests
tgolen 9a36822
Add empty line
tgolen 9ec7713
Merge branch 'main' into jasper-editDistanceRequests
tgolen b06d26d
Rename route
tgolen 8dabf81
Remove unused onyx key
tgolen 2451096
Remove omitted fields
tgolen f84362e
Remove comment
tgolen 6fbf067
lint and improve modal behavior, clarify comments
tgolen 0869c9d
Delete the backup transaction in success data
tgolen ad21933
Merge branch 'main' into jasper-editDistanceRequests
tgolen 64b5073
Merge branch 'main' into jasper-editDistanceRequests
tgolen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Discard errors properly when canceling edit flow
- Loading branch information
commit cc38439257630b4af453e595ec348a95b8554991
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 should either restore the original transaction when we have any error related to waypoints or route , or we should close the modal instantly and implement the RBR.
The problem with the current implementation, if you select an invalid route and press save , the waypoints (including invalid one) will be saved to original transaction.
To restore the transaction when an error occur we can do :
This should fix the 2nd bug I mentioned in #26141 (comment)
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.
Ah, excellent solution. I was going to do something similar, but your solution is more simple that what I was going to do.