-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[TS migration] Migrate IOURequestStartPage, IOURequestRedirectToStartPage, IOURequestStepDistance and IOURequestStepAmount pages to TypeScript #39910
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
Merged
luacmartins
merged 21 commits into
Expensify:main
from
software-mansion-labs:ts-migration/IOURequestStartPage
Apr 12, 2024
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
532dcac
refactor all base pages to tsx
cdOut 9f68f82
add correct props for IOURequestStartPage
cdOut 8a5864a
Merge branch 'main' into ts-migration/IOURequestStartPage
cdOut 6f86eee
refactor IOURequest pages
cdOut 8e333dc
fix prettier
cdOut 476aceb
Merge branch 'main' into ts-migration/IOURequestStartPage
kosmydel 9e9ee8f
add prop comments
cdOut a08252a
Merge branch 'ts-migration/IOURequestStartPage' of https://github.com…
cdOut 59899dc
fix some types
kosmydel e5d00bf
fix types
kosmydel 1219412
address review
kosmydel 7a599c2
adress review
kosmydel 0196372
fix issues on distance page
kosmydel 9902923
address review
kosmydel e79c50a
Merge branch 'main' into ts-migration/IOURequestStartPage
kosmydel 0dac258
Merge branch 'main' into ts-migration/IOURequestStartPage
kosmydel d0f50ad
cast boolean
kosmydel 03def63
Merge branch 'main' into ts-migration/IOURequestStartPage
kosmydel 5fa6e38
fix types
kosmydel 0ee283b
Merge branch 'main' into ts-migration/IOURequestStartPage
kosmydel 24e637d
fix issue
kosmydel 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
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2177,15 +2177,24 @@ function updateMoneyRequestTaxRate( | |
API.write('UpdateMoneyRequestTaxRate', params, onyxData); | ||
} | ||
|
||
type UpdateMoneyRequestDistanceParams = { | ||
transactionID: string; | ||
transactionThreadReportID: string; | ||
waypoints: WaypointCollection; | ||
policy?: OnyxEntry<OnyxTypes.Policy>; | ||
policyTagList?: OnyxEntry<OnyxTypes.PolicyTagList>; | ||
policyCategories?: OnyxEntry<OnyxTypes.PolicyCategories>; | ||
}; | ||
|
||
/** Updates the waypoints of a distance money request */ | ||
function updateMoneyRequestDistance( | ||
transactionID: string, | ||
transactionThreadReportID: string, | ||
waypoints: WaypointCollection, | ||
policy: OnyxEntry<OnyxTypes.Policy>, | ||
policyTagList: OnyxEntry<OnyxTypes.PolicyTagList>, | ||
policyCategories: OnyxEntry<OnyxTypes.PolicyCategories>, | ||
) { | ||
function updateMoneyRequestDistance({ | ||
transactionID, | ||
transactionThreadReportID, | ||
waypoints, | ||
policy = {} as OnyxTypes.Policy, | ||
policyTagList = {}, | ||
policyCategories = {}, | ||
Comment on lines
+2194
to
+2196
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's avoid empty object default values, is this necessary? |
||
}: UpdateMoneyRequestDistanceParams) { | ||
const transactionChanges: TransactionChanges = { | ||
waypoints, | ||
}; | ||
|
@@ -3820,21 +3829,39 @@ function editMoneyRequest( | |
} | ||
} | ||
|
||
type UpdateMoneyRequestAmountAndCurrencyParams = { | ||
transactionID: string; | ||
transactionThreadReportID: string; | ||
currency: string; | ||
amount: number; | ||
policy?: OnyxEntry<OnyxTypes.Policy>; | ||
policyTagList?: OnyxEntry<OnyxTypes.PolicyTagList>; | ||
policyCategories?: OnyxEntry<OnyxTypes.PolicyCategories>; | ||
}; | ||
|
||
/** Updates the amount and currency fields of a money request */ | ||
function updateMoneyRequestAmountAndCurrency( | ||
transactionID: string, | ||
transactionThreadReportID: string, | ||
currency: string, | ||
amount: number, | ||
policy: OnyxEntry<OnyxTypes.Policy>, | ||
policyTagList: OnyxEntry<OnyxTypes.PolicyTagList>, | ||
policyCategories: OnyxEntry<OnyxTypes.PolicyCategories>, | ||
) { | ||
function updateMoneyRequestAmountAndCurrency({ | ||
transactionID, | ||
transactionThreadReportID, | ||
currency, | ||
amount, | ||
policy, | ||
policyTagList, | ||
policyCategories, | ||
}: UpdateMoneyRequestAmountAndCurrencyParams) { | ||
const transactionChanges = { | ||
amount, | ||
currency, | ||
}; | ||
const {params, onyxData} = getUpdateMoneyRequestParams(transactionID, transactionThreadReportID, transactionChanges, policy, policyTagList, policyCategories, true); | ||
const {params, onyxData} = getUpdateMoneyRequestParams( | ||
transactionID, | ||
transactionThreadReportID, | ||
transactionChanges, | ||
policy ?? null, | ||
policyTagList ?? null, | ||
policyCategories ?? null, | ||
true, | ||
); | ||
API.write(WRITE_COMMANDS.UPDATE_MONEY_REQUEST_AMOUNT_AND_CURRENCY, params, onyxData); | ||
} | ||
|
||
|
This file contains hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.