-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Feat/Dupe detection review fields #42503
Merged
pecanoro
merged 50 commits into
Expensify:main
from
kubabutkiewicz:feat/dupe-detection-review-fields
Jul 5, 2024
Merged
Changes from 48 commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
59d4c25
feat: add review fields screens, add function to detect which fields …
kubabutkiewicz e51cccb
ref: did some cleaning
kubabutkiewicz bf5c4ba
feat: add review fields ui, create a hook to determine where to navig…
kubabutkiewicz 602ac8d
Merge branch 'feat/dupe-detection-initial' of github.com:kubabutkiewi…
kubabutkiewicz 1a6e6cd
feat: add new review fields pages
kubabutkiewicz 8d7177e
Merge branch 'feat/dupe-detection-initial' of github.com:kubabutkiewi…
kubabutkiewicz ec5fff0
fix: adding undefined to change object
kubabutkiewicz 8d3b086
Merge branch 'feat/dupe-detection-initial' of github.com:kubabutkiewi…
kubabutkiewicz d81ec66
fix: crash on review description
kubabutkiewicz 973512f
fix: wip
kubabutkiewicz 533555b
Merge branch 'feat/dupe-detection-initial' of github.com:kubabutkiewi…
kubabutkiewicz c7f2e3d
fix: added translations
kubabutkiewicz 1212907
fix: add english translations
kubabutkiewicz 411e1a4
fixes
kubabutkiewicz 5b3affd
Merge branch 'feat/dupe-detection-initial' of github.com:kubabutkiewi…
kubabutkiewicz c628016
fix: ts and lint issues
kubabutkiewicz 1cead1e
fix: ts issue
kubabutkiewicz 6de32f9
fix: simplify function comapreDuplicatedTransactions and resolve lint…
kubabutkiewicz c45ef8c
Merge branch 'feat/dupe-detection-initial' of github.com:kubabutkiewi…
kubabutkiewicz 8211628
Merge branch 'feat/dupe-detection-initial' of github.com:kubabutkiewi…
kubabutkiewicz 673b386
fixes
kubabutkiewicz 98986f3
fix: add comment to function compareDuplicateTransactionFields
kubabutkiewicz 9e5488b
fix: linter
kubabutkiewicz d39e238
Merge branch 'feat/dupe-detection-initial' of github.com:kubabutkiewi…
kubabutkiewicz 69f9d64
fix: resolve comments
kubabutkiewicz 03d31a5
fix
kubabutkiewicz 940c392
Merge branch 'feat/dupe-detection-initial' of github.com:kubabutkiewi…
kubabutkiewicz d802409
fix: added small fix to include only unique fields to change
kubabutkiewicz 2bcdadf
Merge branch 'feat/dupe-detection-initial' of github.com:kubabutkiewi…
kubabutkiewicz 1f9d158
Merge branch 'feat/dupe-detection-initial' of github.com:kubabutkiewi…
kubabutkiewicz 679cc5d
Merge branch 'feat/dupe-detection-initial' of github.com:kubabutkiewi…
kubabutkiewicz c865dab
Merge branch 'feat/dupe-detection-initial' of github.com:kubabutkiewi…
kubabutkiewicz 7dd92ef
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into f…
kubabutkiewicz 1e191f2
fix: formatting fixes
kubabutkiewicz ea828bf
fix: lint and typecheck
kubabutkiewicz a56946d
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into f…
kubabutkiewicz fb16076
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into f…
kubabutkiewicz 5d0c79b
fix: spanish transaltions
kubabutkiewicz 41f8648
fix: resolve comments
kubabutkiewicz 7ee779e
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into f…
kubabutkiewicz 7c8096e
fix: ts, resolve comments
kubabutkiewicz 2506c95
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into f…
kubabutkiewicz dd3b3f3
fix: too much space when there isnt stepper
kubabutkiewicz a88a444
fix: add margin
kubabutkiewicz 009800f
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into f…
kubabutkiewicz b3f4b20
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into f…
kubabutkiewicz 26fcf52
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into f…
kubabutkiewicz 6b0b42a
fix: spanish translations
kubabutkiewicz 13e6293
fix: checking for merchant field instead only for modifiedMerchant
kubabutkiewicz 05eb138
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into f…
kubabutkiewicz 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 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import {useEffect, useMemo, useState} from 'react'; | ||
import Navigation from '@libs/Navigation/Navigation'; | ||
import CONST from '@src/CONST'; | ||
import ROUTES from '@src/ROUTES'; | ||
|
||
type StepName = 'description' | 'merchant' | 'category' | 'billable' | 'tag' | 'taxCode' | 'reimbursable'; | ||
|
||
function useReviewDuplicatesNavigation(stepNames: string[], currentScreenName: StepName, threadReportID: string) { | ||
const [nextScreen, setNextScreen] = useState<StepName>(currentScreenName); | ||
const [currentScreenIndex, setCurrentScreenIndex] = useState(0); | ||
const intersection = useMemo(() => CONST.REVIEW_DUPLICATES_ORDER.filter((element) => stepNames.includes(element)), [stepNames]); | ||
|
||
useEffect(() => { | ||
const currentIndex = intersection.indexOf(currentScreenName); | ||
const nextScreenIndex = currentIndex + 1; | ||
setCurrentScreenIndex(currentIndex); | ||
setNextScreen(intersection[nextScreenIndex] ?? ''); | ||
}, [currentScreenName, intersection]); | ||
|
||
const navigateToNextScreen = () => { | ||
switch (nextScreen) { | ||
case 'merchant': | ||
Navigation.navigate(ROUTES.TRANSACTION_DUPLICATE_REVIEW_MERCHANT_PAGE.getRoute(threadReportID)); | ||
break; | ||
case 'category': | ||
Navigation.navigate(ROUTES.TRANSACTION_DUPLICATE_REVIEW_CATEGORY_PAGE.getRoute(threadReportID)); | ||
break; | ||
case 'tag': | ||
Navigation.navigate(ROUTES.TRANSACTION_DUPLICATE_REVIEW_TAG_PAGE.getRoute(threadReportID)); | ||
break; | ||
case 'description': | ||
Navigation.navigate(ROUTES.TRANSACTION_DUPLICATE_REVIEW_DESCRIPTION_PAGE.getRoute(threadReportID)); | ||
break; | ||
case 'taxCode': | ||
Navigation.navigate(ROUTES.TRANSACTION_DUPLICATE_REVIEW_TAX_CODE_PAGE.getRoute(threadReportID)); | ||
break; | ||
case 'reimbursable': | ||
Navigation.navigate(ROUTES.TRANSACTION_DUPLICATE_REVIEW_REIMBURSABLE_PAGE.getRoute(threadReportID)); | ||
break; | ||
case 'billable': | ||
Navigation.navigate(ROUTES.TRANSACTION_DUPLICATE_REVIEW_BILLABLE_PAGE.getRoute(threadReportID)); | ||
break; | ||
default: | ||
// Navigation to confirm screen will be done in seperate PR | ||
break; | ||
} | ||
}; | ||
|
||
return {navigateToNextScreen, currentScreenIndex}; | ||
} | ||
|
||
export default useReviewDuplicatesNavigation; |
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
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
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
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.
Technically, it is
getTransactionID
function but I think we should listen to onyx report which will render live updates to the component.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.
not sure if I understand correctly @parasharrajat, you mean that I should take this
iouTransactionID
fromuseOnyx
rather than from this 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.
I am not suggesting any change here. Just noting down why we should use Onyx values rather than getting the values from the util function.