Skip to content
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

Refactor the money request creation flow #28618

Merged
merged 282 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
282 commits
Select commit Hold shift + click to select a range
5419e47
Remove weird props
tgolen Sep 28, 2023
100cf3c
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Sep 29, 2023
d58ec44
Finish participant selector
tgolen Sep 29, 2023
293f393
Rename things to be steps instead of fields
tgolen Sep 29, 2023
2e4cd78
More step renaming
tgolen Sep 29, 2023
04f0265
Fix a missing constant name
tgolen Sep 29, 2023
ed3ed9b
Add skeleton confirm page
tgolen Sep 29, 2023
b41b910
WIP on building confirmation page
tgolen Sep 29, 2023
f738843
Finish adding the pieces for the confirmation flow
tgolen Sep 30, 2023
7b9c7a1
Introduce backTo param to confirmation step
tgolen Sep 30, 2023
7788e70
Add confirmation page to routes
tgolen Sep 30, 2023
f82892b
Auto assign participants from report
tgolen Sep 30, 2023
35b380f
Remove backto prop
tgolen Sep 30, 2023
a28025f
Work on confirmation page
tgolen Sep 30, 2023
6450c27
Get the comment and description fields working
tgolen Sep 30, 2023
722a55a
Get distance step built
tgolen Oct 1, 2023
187fabd
Get description step working
tgolen Oct 1, 2023
17bf4b0
Clean up imports
tgolen Oct 1, 2023
386de4f
Build the date step
tgolen Oct 1, 2023
3c24286
Build the row for distance confirmation
tgolen Oct 1, 2023
d8576d8
Get the category row working
tgolen Oct 1, 2023
3caa941
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Oct 2, 2023
8526f16
Implement new transactionutils methods
tgolen Oct 2, 2023
c568fdd
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Oct 2, 2023
90b9f49
Make a copy of the confirmation list
tgolen Oct 2, 2023
6412175
Fix policy props
tgolen Oct 2, 2023
8ed97c0
Properly set the reportID for confirmation step
tgolen Oct 2, 2023
c25ee81
WIP on adding the new tag page
tgolen Oct 2, 2023
97954fc
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Oct 3, 2023
cc4abe7
Apply style changes
tgolen Oct 3, 2023
9bce13f
Get tag step implemented
tgolen Oct 3, 2023
9aad4e1
Add some cleanup comments
tgolen Oct 3, 2023
aeed0ab
WIP on navigating back to confirmation
tgolen Oct 3, 2023
328a423
Add some WIP reminders
tgolen Oct 3, 2023
ed1b6ae
Change optimistic ID
tgolen Oct 3, 2023
409bafb
Pass the route using context API
tgolen Oct 3, 2023
6db7d0e
WIP on removing the CreateTab components
tgolen Oct 3, 2023
eed6583
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Oct 5, 2023
8b71fb5
Implement draggable list into distance screen
tgolen Oct 5, 2023
1ffcbcc
Rename file and remove unused components
tgolen Oct 5, 2023
97994ab
Refactor how the steps are rendered
tgolen Oct 5, 2023
43ef40e
Add a screen wrapper component
tgolen Oct 5, 2023
de60721
Use the screen wrapper on the distance step
tgolen Oct 5, 2023
79db914
WIP on trying to get participants to work
tgolen Oct 5, 2023
374b199
Only store a subset of the participant data
tgolen Oct 6, 2023
8dbb294
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Oct 6, 2023
22bc057
Start working on displaying the amount step
tgolen Oct 6, 2023
678c94a
Build out the currency selection step
tgolen Oct 6, 2023
12ff7dd
Get the initial currency selection page working
tgolen Oct 6, 2023
b773de4
Get back navigation working from currency selection
tgolen Oct 6, 2023
a554d6f
Use the current route instead
tgolen Oct 6, 2023
d5943c6
Refactor button label
tgolen Oct 6, 2023
b483c6f
Remove unused libs
tgolen Oct 6, 2023
66089d6
Have tabs properly reset the type of request
tgolen Oct 6, 2023
c2d59a5
Implement the confirmation page for amount
tgolen Oct 6, 2023
d413621
Clear transaction when cancelling out of modal
tgolen Oct 6, 2023
72a9918
Remove route context
tgolen Oct 6, 2023
4aa9646
Clear out unused variables
tgolen Oct 6, 2023
48c93e7
Remove more context provider
tgolen Oct 6, 2023
6589b05
Fix logic
tgolen Oct 6, 2023
1139a59
Add the initial scan page
tgolen Oct 6, 2023
c2642f4
Rebuild the receipt selector page
tgolen Oct 6, 2023
15514d9
Make similar changes to native file
tgolen Oct 6, 2023
c30aafb
Rename the waypoint index
tgolen Oct 6, 2023
e4333a2
Navigate to the participant page
tgolen Oct 6, 2023
2efaa42
Build out the merchant page
tgolen Oct 6, 2023
0de7c4a
Use step screen wrapper in most steps
tgolen Oct 6, 2023
453e6b8
DRY up the route prop types
tgolen Oct 6, 2023
5333c4d
Fix a few little errors
tgolen Oct 6, 2023
155d13f
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Oct 9, 2023
6efd975
Cleanup some consts and proptypes
tgolen Oct 9, 2023
6cd5204
Remove a bunch of TODOs and record them in an issue instead
tgolen Oct 9, 2023
7e43f80
Remove extra not found component
tgolen Oct 9, 2023
0317dbc
Use DRY prop types
tgolen Oct 9, 2023
c35d0dc
Remove unused module
tgolen Oct 9, 2023
c8b5899
Make code consistent
tgolen Oct 9, 2023
f12a0c5
Give utility method positive framing
tgolen Oct 9, 2023
193da0d
Check write actions for report
tgolen Oct 9, 2023
bb77d23
Make prop destructuring consistent
tgolen Oct 9, 2023
e4bc8af
Get the add receipt step working
tgolen Oct 9, 2023
a4abf65
Handle auto participants better
tgolen Oct 9, 2023
6760c12
Create distance requests
tgolen Oct 9, 2023
af34c53
Remove debug
tgolen Oct 9, 2023
85856ca
Set min and max date
tgolen Oct 10, 2023
fcf4377
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Oct 10, 2023
90a18ff
Remove todo
tgolen Oct 10, 2023
befff2e
Remove extra params and let money requests be created
tgolen Oct 10, 2023
26935d7
Get smartscan working
tgolen Oct 10, 2023
49d49c6
Finish the split flow
tgolen Oct 10, 2023
11fe0f0
Clean up request creation
tgolen Oct 10, 2023
d63fd90
Make sure the billable flag works
tgolen Oct 10, 2023
d8486fc
Make sure editing receipt images will still work
tgolen Oct 10, 2023
053c8ab
Remove todo about splits
tgolen Oct 10, 2023
524636b
Remove unnecessary TODO
tgolen Oct 10, 2023
e9c60fe
Get image options working
tgolen Oct 10, 2023
6bae517
Rename constants
tgolen Oct 10, 2023
a9c3824
More renaming of constants
tgolen Oct 10, 2023
0eedab8
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Oct 11, 2023
b23fd32
Apply changes from existing components to copied components
tgolen Oct 11, 2023
d832bc7
Apply changes from main
tgolen Oct 11, 2023
d5f78da
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Oct 12, 2023
c50f553
Copy changes from main
tgolen Oct 12, 2023
d83122c
Copy changes from main
tgolen Oct 12, 2023
0391d71
Fix errors while creating requests
tgolen Oct 12, 2023
3e82cd2
Fix splits
tgolen Oct 12, 2023
8a151ae
Remove patch changes
tgolen Oct 12, 2023
44d7f55
Put back some pages that weren't supposed to be removed
tgolen Oct 12, 2023
dfd3a31
Fix style
tgolen Oct 12, 2023
906f9e1
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Oct 13, 2023
44b101a
Readd style to file from main
tgolen Oct 13, 2023
ad3c794
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Oct 13, 2023
8da6202
Reorganize files to create less conflicts
tgolen Oct 13, 2023
a78616b
Rename temporary refactor methods
tgolen Oct 13, 2023
060b3ab
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Oct 18, 2023
d7990a3
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Oct 31, 2023
fac2d89
Fix constant and use new method for getting URL
tgolen Oct 31, 2023
1da3fee
Remove extra space and clean up comments
tgolen Oct 31, 2023
fdcc21c
Remove unused translation
tgolen Oct 31, 2023
ddf5cd6
Fix import paths
tgolen Nov 1, 2023
5705811
Fix missing parenthesis
tgolen Nov 1, 2023
78afd93
Include changes from main
tgolen Nov 1, 2023
f028249
Copy changes from main
tgolen Nov 1, 2023
1cde38c
Copy changes from main
tgolen Nov 1, 2023
80dd8af
Copy changes from main
tgolen Nov 1, 2023
cfe14ec
Remove unused imports
tgolen Nov 1, 2023
0af0542
Copy changes from main
tgolen Nov 1, 2023
f07b292
Copy changes from main
tgolen Nov 1, 2023
acac7e5
Copy changes from main
tgolen Nov 1, 2023
77d27d4
Copy changes from main
tgolen Nov 1, 2023
25d0248
Remove redundant code
tgolen Nov 1, 2023
777f0cd
Fixing lint
tgolen Nov 1, 2023
dd8ff74
Run prettier on everything
tgolen Nov 1, 2023
dd7bad6
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Nov 2, 2023
ad67201
Rename some of the route stuff
tgolen Nov 2, 2023
db26078
Remove withreportornotfound
tgolen Nov 2, 2023
ac423e4
Rename route and fix participant step
tgolen Nov 2, 2023
92ee191
More renaming routes
tgolen Nov 2, 2023
0a1fb85
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Nov 2, 2023
0d4ddde
Store filename and source properly on transaction
tgolen Nov 2, 2023
254cf6f
Get the file upload working properly
tgolen Nov 2, 2023
7c490fc
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Nov 6, 2023
81dc694
Update component from main
tgolen Nov 6, 2023
29bfe11
Get the distance flow working
tgolen Nov 6, 2023
04ec59f
Remove old param
tgolen Nov 6, 2023
b086765
Rename to use a temporary collection
tgolen Nov 6, 2023
6238dd9
Get participants working
tgolen Nov 6, 2023
ac94cde
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Nov 7, 2023
b5271c3
Change the name of the onyx collection
tgolen Nov 7, 2023
4b36b05
Improve comment
tgolen Nov 7, 2023
7050ad5
Rename methods
tgolen Nov 7, 2023
254383b
Add comment and change method for generating report ID
tgolen Nov 7, 2023
241051d
Use a specific method for clearing a money request
tgolen Nov 7, 2023
28eeedb
Use date-fns instead of moment
tgolen Nov 7, 2023
f03619f
Use form provider
tgolen Nov 7, 2023
5ed5e2f
Rename method
tgolen Nov 7, 2023
0caf279
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Nov 7, 2023
1840f43
Clear the request if the reportID changes
tgolen Nov 7, 2023
0f754ca
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Nov 8, 2023
0ccb8ad
Updating comments mostly
tgolen Nov 8, 2023
90c69ee
Refactored to destructure props
tgolen Nov 8, 2023
2e6ac79
Fix navigation when going back from the participants step
tgolen Nov 8, 2023
5388eb6
Fix merchant text field
tgolen Nov 8, 2023
fd38907
Fix undefined const reference
tgolen Nov 8, 2023
e0a238e
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Nov 13, 2023
a96c7e6
Redirect to start step if image doesn't exist
tgolen Nov 13, 2023
8cad1cb
Store routes on draft transaction
tgolen Nov 13, 2023
8011081
Fix TS error
tgolen Nov 13, 2023
7917175
Put back in the old components so things can be edited
tgolen Nov 13, 2023
5383afd
Use last accessed report ID
tgolen Nov 13, 2023
aae45d4
Remove unused import
tgolen Nov 13, 2023
17e36a2
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Nov 14, 2023
1344392
Update src/libs/actions/IOU.js
tgolen Nov 14, 2023
5605c99
DRY up code for refreshing during new scan request
tgolen Nov 14, 2023
eb769cb
Fix the header title
tgolen Nov 14, 2023
9dc3c3b
Move refresh code to the right component
tgolen Nov 14, 2023
271fee3
Pass transaction instead of loading it
tgolen Nov 14, 2023
d7e2597
Fix back navigation from confirmation step
tgolen Nov 14, 2023
14455ab
Properly set the participants of a distance request
tgolen Nov 14, 2023
a19d1cc
Clear draft transaction in optimistic data
tgolen Nov 14, 2023
e41b210
Define function type and fix lint
tgolen Nov 14, 2023
c86b7a7
Fix some navigation animations
tgolen Nov 14, 2023
a5461f9
Fix the redirection to new user report
tgolen Nov 14, 2023
e30077a
Fix back navigation
tgolen Nov 14, 2023
10eec00
Fix animation direction
tgolen Nov 14, 2023
a03d794
Split out routes
tgolen Nov 15, 2023
e9f1b49
Export the current path
tgolen Nov 15, 2023
a28cf1c
Remove unused file and constant
tgolen Nov 15, 2023
b1305b3
Create HOC to check permissions
tgolen Nov 15, 2023
18c3fec
Implement new HOC on all steps
tgolen Nov 15, 2023
bd1905b
Make back navigation consistent
tgolen Nov 15, 2023
025530b
Go to distance step directly
tgolen Nov 15, 2023
07db437
Remove unused constant
tgolen Nov 15, 2023
0e596ca
Remove temporary name from routes
tgolen Nov 15, 2023
751f7b6
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Nov 15, 2023
040a53b
Remove betas
tgolen Nov 15, 2023
c2c568c
Remove unused import
tgolen Nov 15, 2023
c5fe5ee
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Nov 16, 2023
98c6711
Copy changes from main
tgolen Nov 16, 2023
253fabf
Copy changes from main
tgolen Nov 16, 2023
c6f64ce
Copy changes from main
tgolen Nov 16, 2023
f35dfc3
Copy changes from main
tgolen Nov 16, 2023
54fc262
Copy changes from main
tgolen Nov 16, 2023
280c36e
Copy changes from main
tgolen Nov 16, 2023
fe619c5
Copy changes from main
tgolen Nov 16, 2023
d1b3a0a
Copy changes from main
tgolen Nov 16, 2023
25738e7
Copy changes from main
tgolen Nov 16, 2023
e0db3cb
Copy changes from main
tgolen Nov 16, 2023
448fae0
Copy changes from main
tgolen Nov 16, 2023
0677e57
Copy changes from main
tgolen Nov 16, 2023
5a6434c
Copy changes from main
tgolen Nov 16, 2023
29adc2d
Copy changes from main
tgolen Nov 16, 2023
ae0a23c
Clean up param
tgolen Nov 16, 2023
fc4531b
Cleaning up library refs
tgolen Nov 16, 2023
541c008
Add dependent variables to array
tgolen Nov 16, 2023
860c6f9
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Nov 16, 2023
bf04cd7
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Nov 21, 2023
b0eaeac
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Nov 27, 2023
807676b
Use proper method for getting the active route
tgolen Nov 27, 2023
25bb617
Copy changes from main
tgolen Nov 27, 2023
8c38b6d
Fix Expense - App crashes when opening Category list in confirmation …
tgolen Nov 27, 2023
5a1e22b
Remove unused beta reference
tgolen Nov 27, 2023
9b8cf0f
Fix Expense - 'Amount' header disappears after selecting currency in …
tgolen Nov 27, 2023
f4a57f5
Fix Expense - Previously entered amount is not preserved after changi…
tgolen Nov 27, 2023
b0e14ea
Fix Expense - Missing header in Add receipt modal
tgolen Nov 27, 2023
9439da4
Fix Expense - Description input field does not expand when adding mul…
tgolen Nov 27, 2023
e437327
Fix Expense - Opening IOU preview in IOU report page redirects user b…
tgolen Nov 27, 2023
d7d650f
Fix Distance - iou.error.duplicateWaypointsErrorMessage when proceedi…
tgolen Nov 27, 2023
5d3b797
Fix Distance - Addresses in Recent destinations show one-line format
tgolen Nov 27, 2023
d1ec9ee
Distance - Unable to delete a waypoint
tgolen Nov 27, 2023
c20ea70
Fix Distance - Red dot briefly appears next to Amount in distance det…
tgolen Nov 27, 2023
3846589
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Nov 28, 2023
24e39fa
Fix console error
tgolen Nov 28, 2023
f53fa56
Fix Request - User is redirected to participant selection page after …
tgolen Nov 28, 2023
0116a1f
Fix Request Money - Tag is not being deselected
tgolen Nov 28, 2023
6cff8ba
Fix Send money - Send money in 1:1 DM opens Request money RHP
tgolen Nov 28, 2023
968f39f
Fix - IOU - To field is empty and Amount is $NaN when opening confirm…
tgolen Nov 28, 2023
459c2df
Fix Request – User can drag & drop file on the Distance page. The map…
tgolen Nov 29, 2023
e48b513
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Nov 29, 2023
7a4c276
Add "as const" to fix TS errors
tgolen Nov 29, 2023
4c61f05
Add missing hook dependency
tgolen Nov 29, 2023
bfb2a30
Fix the reordering of waypoints
tgolen Nov 29, 2023
8d14eff
Update MoneyTemporaryForRefactorRequestParticipantsSelector.js
tgolen Dec 4, 2023
6eef6b5
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Dec 4, 2023
41c9252
Remove extra import
tgolen Dec 4, 2023
c04ca80
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Dec 5, 2023
b884e29
Fix component reference
tgolen Dec 5, 2023
ecd5bf3
Fix scan page loading indefinitely
tgolen Dec 5, 2023
923b452
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Dec 5, 2023
91c4ee1
Merge branch 'main' into tgolen-refactor-request-navigation2
tgolen Dec 7, 2023
e153f6c
Implement screen refactoring
tgolen Dec 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1134,6 +1134,8 @@ const CONST = {
},

IOU: {
// This is the transactionID used when going through the create money request flow so that it mimics a real transaction (like the edit flow)
OPTIMISTIC_TRANSACTION_ID: '1',
// Note: These payment types are used when building IOU reportAction message values in the server and should
// not be changed.
PAYMENT_TYPE: {
Expand All @@ -1146,6 +1148,11 @@ const CONST = {
SPLIT: 'split',
REQUEST: 'request',
},
REQUEST_TYPE: {
DISTANCE: 'distance',
MANUAL: 'manual',
SCAN: 'scan',
},
REPORT_ACTION_TYPE: {
PAY: 'pay',
CREATE: 'create',
Expand Down Expand Up @@ -2754,6 +2761,9 @@ const CONST = {
NEW_CHAT: 'chat',
NEW_ROOM: 'room',
RECEIPT_TAB_ID: 'ReceiptTab',
IOU_REQUEST_TYPE: 'iouRequestType',
},
TAB_REQUEST: {
MANUAL: 'manual',
SCAN: 'scan',
DISTANCE: 'distance',
Expand Down
80 changes: 79 additions & 1 deletion src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ function getUrlWithBackToParam<TUrl extends string>(url: TUrl, backTo?: string):

const ROUTES = {
HOME: '',
/** This is a utility route used to go to the user's concierge chat, or the sign-in page if the user's not authenticated */

// This is a utility route used to go to the user's concierge chat, or the sign-in page if the user's not authenticated
CONCIERGE: 'concierge',
FLAG_COMMENT: {
route: 'flag/:reportID/:reportActionID',
Expand Down Expand Up @@ -306,6 +307,82 @@ const ROUTES = {
MONEY_REQUEST_MANUAL_TAB: ':iouType/new/:reportID?/manual',
MONEY_REQUEST_SCAN_TAB: ':iouType/new/:reportID?/scan',

MONEY_REQUEST_CREATE: {
route: 'create/:iouType/start/:transactionID/:reportID',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string) => `create/${iouType}/start/${transactionID}/${reportID}` as const,
},
MONEY_REQUEST_STEP_CONFIRMATION: {
route: 'create/:iouType/confirmation/:transactionID/:reportID/',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string) => `create/${iouType}/confirmation/${transactionID}/${reportID}/` as const,
},
MONEY_REQUEST_STEP_AMOUNT: {
route: 'create/:iouType/amount/:transactionID/:reportID/',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coming from #33205 (comment)

The routes added here have a trailing /. It lead to inconsistenecy because our routes don't have trailing slashes.

There was also a bug that broke "go back" because our code didn't handle trailing slashes.

getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string, backTo = '') =>
getUrlWithBackToParam(`create/${iouType}/amount/${transactionID}/${reportID}/`, backTo),
},
MONEY_REQUEST_STEP_CATEGORY: {
route: 'create/:iouType/category/:transactionID/:reportID/',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string, backTo = '') =>
getUrlWithBackToParam(`create/${iouType}/category/${transactionID}/${reportID}/`, backTo),
},
MONEY_REQUEST_STEP_CURRENCY: {
route: 'create/:iouType/currency/:transactionID/:reportID/:pageIndex?/',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string, pageIndex = '', backTo = '') =>
getUrlWithBackToParam(`create/${iouType}/currency/${transactionID}/${reportID}/${pageIndex}`, backTo),
},
MONEY_REQUEST_STEP_DATE: {
route: 'create/:iouType/date/:transactionID/:reportID/',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string, backTo = '') =>
getUrlWithBackToParam(`create/${iouType}/date/${transactionID}/${reportID}/`, backTo),
},
MONEY_REQUEST_STEP_DESCRIPTION: {
route: 'create/:iouType/description/:transactionID/:reportID/',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string, backTo = '') =>
getUrlWithBackToParam(`create/${iouType}/description/${transactionID}/${reportID}/`, backTo),
},
MONEY_REQUEST_STEP_DISTANCE: {
route: 'create/:iouType/distance/:transactionID/:reportID/',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string, backTo = '') =>
getUrlWithBackToParam(`create/${iouType}/distance/${transactionID}/${reportID}/`, backTo),
},
MONEY_REQUEST_STEP_MERCHANT: {
route: 'create/:iouType/merchante/:transactionID/:reportID/',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string, backTo = '') =>
getUrlWithBackToParam(`create/${iouType}/merchante/${transactionID}/${reportID}/`, backTo),
},
MONEY_REQUEST_STEP_PARTICIPANTS: {
route: 'create/:iouType/participants/:transactionID/:reportID/',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string, backTo = '') =>
getUrlWithBackToParam(`create/${iouType}/participants/${transactionID}/${reportID}/`, backTo),
},
MONEY_REQUEST_STEP_SCAN: {
route: 'create/:iouType/scan/:transactionID/:reportID/',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string, backTo = '') =>
getUrlWithBackToParam(`create/${iouType}/scan/${transactionID}/${reportID}/`, backTo),
},
MONEY_REQUEST_STEP_TAG: {
route: 'create/:iouType/tag/:transactionID/:reportID/',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string, backTo = '') =>
getUrlWithBackToParam(`create/${iouType}/tag/${transactionID}/${reportID}/`, backTo),
},
MONEY_REQUEST_STEP_WAYPOINT: {
route: 'create/:iouType/waypoint/:transactionID/:reportID/:pageIndex/',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string, pageIndex = '', backTo = '') =>
getUrlWithBackToParam(`create/${iouType}/waypoint/${transactionID}/${reportID}/${pageIndex}`, backTo),
},
MONEY_REQUEST_CREATE_TAB_DISTANCE: {
route: 'create/:iouType/start/:transactionID/:reportID/distance',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string) => `create/${iouType}/start/${transactionID}/${reportID}/distance` as const,
},
MONEY_REQUEST_CREATE_TAB_MANUAL: {
route: 'create/:iouType/start/:transactionID/:reportID/manual',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string) => `create/${iouType}/start/${transactionID}/${reportID}/manual` as const,
},
MONEY_REQUEST_CREATE_TAB_SCAN: {
route: 'create/:iouType/start/:transactionID/:reportID/scan',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string) => `create/${iouType}/start/${transactionID}/${reportID}/scan` as const,
},

IOU_REQUEST: 'request/new',
IOU_SEND: 'send/new',
IOU_SEND_ADD_BANK_ACCOUNT: 'send/new/add-bank-account',
Expand Down Expand Up @@ -391,6 +468,7 @@ const ROUTES = {
MONEY2020: 'money2020',
} as const;

export {getUrlWithBackToParam};
export default ROUTES;

// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
13 changes: 13 additions & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,19 @@ const SCREENS = {
SAML_SIGN_IN: 'SAMLSignIn',

MONEY_REQUEST: {
CREATE: 'Money_Request_Create',
STEP_CONFIRMATION: 'Money_Request_Step_Confirmation',
STEP_AMOUNT: 'Money_Request_Step_Amount',
STEP_CATEGORY: 'Money_Request_Step_Category',
STEP_CURRENCY: 'Money_Request_Step_Currency',
STEP_DATE: 'Money_Request_Step_Date',
STEP_DESCRIPTION: 'Money_Request_Step_Description',
STEP_DISTANCE: 'Money_Request_Step_Distance',
STEP_MERCHANT: 'Money_Request_Step_Merchant',
STEP_PARTICIPANTS: 'Money_Request_Step_Participants',
STEP_SCAN: 'Money_Request_Step_Scan',
STEP_TAG: 'Money_Request_Step_Tag',
STEP_WAYPOINT: 'Money_Request_Step_Waypoint',
ROOT: 'Money_Request',
AMOUNT: 'Money_Request_Amount',
PARTICIPANTS: 'Money_Request_Participants',
Expand Down
3 changes: 0 additions & 3 deletions src/components/ConfirmedRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ function ConfirmedRoute({mapboxAccessToken, transaction}) {
}

export default withOnyx({
transaction: {
key: ({transactionID}) => `${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`,
},
mapboxAccessToken: {
key: ONYXKEYS.MAPBOX_ACCESS_TOKEN,
},
Expand Down
5 changes: 1 addition & 4 deletions src/components/DistanceRequest/DistanceRequestFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const propTypes = {
expiration: PropTypes.string,
}),

/* Onyx Props */
/** The transaction being interacted with */
transaction: transactionPropTypes,
};

Expand Down Expand Up @@ -135,9 +135,6 @@ DistanceRequestFooter.propTypes = propTypes;
DistanceRequestFooter.defaultProps = defaultProps;

export default withOnyx({
transaction: {
key: ({transactionID}) => `${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`,
},
mapboxAccessToken: {
key: ONYXKEYS.MAPBOX_ACCESS_TOKEN,
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/DistanceRequest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function DistanceRequest({transactionID, report, transaction, route, isEditingRe
waypoints={waypoints}
hasRouteError={hasRouteError}
navigateToWaypointEditPage={navigateToWaypointEditPage}
transactionID={transactionID}
transaction={transaction}
/>
}
/>
Expand Down
11 changes: 4 additions & 7 deletions src/components/MoneyRequestConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ function MoneyRequestConfirmationList(props) {
// Prop functions pass props itself as a "this" value to the function which means they change every time props change.
const {onSendMoney, onConfirm, onSelectParticipant} = props;
const {translate, toLocaleDigit} = useLocalize();
const transaction = props.isEditingSplitBill ? props.draftTransaction || props.transaction : props.transaction;
const transaction = props.transaction;
const {canUseViolations} = usePermissions();

const isTypeRequest = props.iouType === CONST.IOU.TYPE.REQUEST;
Expand Down Expand Up @@ -409,8 +409,8 @@ function MoneyRequestConfirmationList(props) {
return;
}
const distanceMerchant = DistanceRequestUtils.getDistanceMerchant(hasRoute, distance, unit, rate, currency, translate, toLocaleDigit);
IOU.setMoneyRequestMerchant(distanceMerchant);
}, [hasRoute, distance, unit, rate, currency, translate, toLocaleDigit, props.isDistanceRequest]);
IOU.setMoneyRequestMerchant_temporaryForRefactor(props.transactionID, distanceMerchant);
}, [hasRoute, distance, unit, rate, currency, translate, toLocaleDigit, props.isDistanceRequest, props.transactionID]);

/**
* @param {Object} option
Expand Down Expand Up @@ -579,7 +579,7 @@ function MoneyRequestConfirmationList(props) {
>
{props.isDistanceRequest && (
<View style={styles.confirmationListMapItem}>
<ConfirmedRoute transactionID={props.transactionID} />
<ConfirmedRoute transaction={props.transaction} />
</View>
)}
{(receiptImage || receiptThumbnail) && (
Expand Down Expand Up @@ -772,9 +772,6 @@ export default compose(
draftTransaction: {
key: ({transactionID}) => `${ONYXKEYS.COLLECTION.SPLIT_TRANSACTION_DRAFT}${transactionID}`,
},
transaction: {
key: ({transactionID}) => `${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`,
},
policy: {
key: ({policyID}) => `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
},
Expand Down
Loading
Loading