Repository navigation
Fix Move Expense check #72366
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
Fix Move Expense check #72366
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
262961a
use snapshot data
luacmartins b1e80ec
Merge branch 'main' into cmartins-useSaerchReportActions
luacmartins 98df80f
fix ts
luacmartins b5a5d4c
resolve conflicts
luacmartins c92a707
update function signature
luacmartins 67b07b5
gst
luacmartins f662310
refactor usages of canEditFieldOfMoneyRequest
luacmartins ceb3c92
refactor more code
luacmartins b8239d6
fix conditional
luacmartins ccb6872
update map
luacmartins 9eb946d
revert chants
luacmartins 5eab236
refacor data
luacmartins 14347c7
rm searchreportaction
luacmartins 52aa166
rm unused code
luacmartins 8d5314a
fix prettier, eslint
luacmartins a51d9ed
fix tests
luacmartins 521716e
fix eslint
luacmartins 983d131
fix more tests
luacmartins 897e082
fix more tests
luacmartins e196d55
rm const
luacmartins 1fe0630
resolve conflicts
luacmartins 2926684
resolve conflicts
luacmartins b68301f
fix test
luacmartins 7b550d6
fix eslint
luacmartins e477f73
resolve conflicts
luacmartins 1d9983c
resolve conflicts
luacmartins f354f08
resolve conflicts
luacmartins 3b9ee76
resolve conflicts
luacmartins 44d9762
resolve conflicts
luacmartins fe98197
resolve conflcits
luacmartins 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ import Text from '@components/Text'; | |
| import TransactionPreviewSkeletonView from '@components/TransactionPreviewSkeletonView'; | ||
| import useLocalize from '@hooks/useLocalize'; | ||
| import useOnyx from '@hooks/useOnyx'; | ||
| import useReportIsArchived from '@hooks/useReportIsArchived'; | ||
| import useTheme from '@hooks/useTheme'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import {convertToDisplayString} from '@libs/CurrencyUtils'; | ||
|
|
@@ -72,6 +73,7 @@ function TransactionPreviewContent({ | |
| const ownerAccountID = report?.ownerAccountID ?? reportPreviewAction?.childOwnerAccountID ?? CONST.DEFAULT_NUMBER_ID; | ||
| const isReportAPolicyExpenseChat = isPolicyExpenseChat(chatReport); | ||
| const [reportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${getNonEmptyStringOnyxID(report?.reportID)}`, {canBeMissing: true}); | ||
| const isChatReportArchived = useReportIsArchived(chatReport?.reportID); | ||
|
|
||
| const transactionPreviewCommonArguments = useMemo( | ||
| () => ({ | ||
|
|
@@ -99,7 +101,7 @@ function TransactionPreviewContent({ | |
|
|
||
| const firstViolation = violations.at(0); | ||
| const isIOUActionType = isMoneyRequestAction(action); | ||
| const canEdit = isIOUActionType && canEditMoneyRequest(action, transaction); | ||
| const canEdit = isIOUActionType && canEditMoneyRequest(action, isChatReportArchived, report, policy, transaction); | ||
|
luacmartins marked this conversation as resolved.
Resolved
Contributor
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. Coming from #73516, the report passed to canEditMoneyRequest should be iouReport |
||
| const violationMessage = firstViolation ? ViolationsUtils.getViolationTranslation(firstViolation, translate, canEdit) : undefined; | ||
|
|
||
| const previewText = useMemo( | ||
|
|
||
Large diffs are not rendered by default.
Oops, something went wrong.
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.
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.