-
Notifications
You must be signed in to change notification settings - Fork 3.7k
refactor requestMoney to use transaction drafts data from useOnyx #79948
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
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
bf908ec
refactor duplicateExpenseTransaction and handleFileRetry
dukenv0307 bb74529
update removeDraftTransactions
dukenv0307 e3f522c
merge main
dukenv0307 2215c88
merge main
dukenv0307 4d660bd
lint fix
dukenv0307 59ab70a
merge main
dukenv0307 c4addc1
update requestMoney
dukenv0307 d254d1b
merge main
dukenv0307 593a1d2
lint fix
dukenv0307 9547a8c
merge main
dukenv0307 5f9f68f
merge main
dukenv0307 85af208
Merge branch 'main' into fix/67778-part-3
dukenv0307 179ecb2
add tests
dukenv0307 fa6a592
ts fix
dukenv0307 b4be10b
add test
dukenv0307 d4b8352
merge main
dukenv0307 c6f2422
add tests
dukenv0307 4b25708
add tests
dukenv0307 3118e30
merge main
dukenv0307 a3cab53
refactor useOptimisticDraftTransactions
dukenv0307 76b710e
merge main
dukenv0307 5b216b0
merge main
dukenv0307 2bd1260
refactor
dukenv0307 1b74c12
lint fix
dukenv0307 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
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
Oops, something went wrong.
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.
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.
@dukenv0307 Could you explain this change?
removeDraftTransactions() will remove all draft transactions
removeDraftTransactionsByIDs(draftTransactionIDs)); only reset some draft transactions
Uh oh!
There was an error while loading. Please reload this page.
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.
@DylanDylann but the
draftTransactionIDsare taken from allTransactionDraft. I don't want to pass the wholeallTransactionDraftsto removeDraftTransactionsThere 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.
Looks like we need to pass all draft transactions, but we only need the IDs, not the full objects.
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.
@DylanDylann Why do we need to pass all draft transactions?
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.
@dukenv0307 Isn't this the original implementation (that removeDraftTransactions function did)? I think in this refactor we should keep the existing behavior and only focus on removing the Onyx.connect method
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.
@DylanDylann Hmm, I don't change the original behavior, in removeDraftTransactions we just use the transactionID, so we don't need to pass all transactionDrafts
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.
@dukenv0307 This is the original removeDraftTransactions. In case we don't pass any params, it loops through all draft transactions
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.
@DylanDylann
In this case, we just use
item.transactionIDto compare with OPTIMISTIC_TRANSACTION_ID, then return acc, so we don't modify this transaction.Otherwise, we'll clear the transaction by assigning it to null, we also just use
item.transactionID.So passing the transactionIDs is enough
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.
Nope, I agree that we only need to pass the ID. But we should pass all draft transaction IDs
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.
looks like all IDs are already being passed. I recall we had some filtering before, but it seems that's no longer the case