-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
19 additions
and
19 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,20 +74,20 @@ function MoneyRequestPreviewContent({ | |
const route = useRoute<PlatformStackRouteProp<TransactionDuplicateNavigatorParamList, typeof SCREENS.TRANSACTION_DUPLICATE.REVIEW>>(); | ||
const {shouldUseNarrowLayout} = useResponsiveLayout(); | ||
const [personalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST); | ||
const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${chatReportID || '-1'}`); | ||
const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${chatReportID || undefined}`); | ||
const [session] = useOnyx(ONYXKEYS.SESSION); | ||
const [iouReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${iouReportID || '-1'}`); | ||
const [iouReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${iouReportID || undefined}`); | ||
|
||
const policy = PolicyUtils.getPolicy(iouReport?.policyID); | ||
const isMoneyRequestAction = ReportActionsUtils.isMoneyRequestAction(action); | ||
const transactionID = isMoneyRequestAction ? ReportActionsUtils.getOriginalMessage(action)?.IOUTransactionID : '-1'; | ||
const transactionID = isMoneyRequestAction ? ReportActionsUtils.getOriginalMessage(action)?.IOUTransactionID : undefined; | ||
const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`); | ||
const [walletTerms] = useOnyx(ONYXKEYS.WALLET_TERMS); | ||
const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS); | ||
|
||
const sessionAccountID = session?.accountID; | ||
const managerID = iouReport?.managerID ?? -1; | ||
const ownerAccountID = iouReport?.ownerAccountID ?? -1; | ||
const managerID = iouReport?.managerID ?? CONST.DEFAULT_NUMBER_ID; | ||
const ownerAccountID = iouReport?.ownerAccountID ?? CONST.DEFAULT_NUMBER_ID; | ||
const isPolicyExpenseChat = ReportUtils.isPolicyExpenseChat(chatReport); | ||
|
||
const participantAccountIDs = | ||
|
@@ -117,12 +117,12 @@ function MoneyRequestPreviewContent({ | |
const isOnHold = TransactionUtils.isOnHold(transaction); | ||
const isSettlementOrApprovalPartial = !!iouReport?.pendingFields?.partial; | ||
const isPartialHold = isSettlementOrApprovalPartial && isOnHold; | ||
const hasViolations = TransactionUtils.shouldShowViolation({transactionID: transaction?.transactionID ?? '-1', transactionViolations, showInReview: true, parentReportAction: action}); | ||
const hasViolations = TransactionUtils.shouldShowViolation({transactionID: transaction?.transactionID, transactionViolations, showInReview: true, parentReportAction: action}); | ||
const hasNoticeTypeViolations = | ||
TransactionUtils.shouldShowNoticeTypeViolation({transactionID: transaction?.transactionID ?? '-1', transactionViolations, showInReview: true, parentReportAction: action}) && | ||
TransactionUtils.shouldShowNoticeTypeViolation({transactionID: transaction?.transactionID, transactionViolations, showInReview: true, parentReportAction: action}) && | ||
ReportUtils.isPaidGroupPolicy(iouReport); | ||
const hasWarningTypeViolations = TransactionUtils.shouldShowWarningTypeViolation({ | ||
transactionID: transaction?.transactionID ?? '-1', | ||
transactionID: transaction?.transactionID, | ||
transactionViolations, | ||
showInReview: true, | ||
parentReportAction: action, | ||
|
@@ -163,7 +163,7 @@ function MoneyRequestPreviewContent({ | |
|
||
const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${route.params?.threadReportID}`); | ||
const parentReportAction = ReportActionsUtils.getReportAction(report?.parentReportID ?? '', report?.parentReportActionID ?? ''); | ||
Check failure on line 165 in src/components/ReportActionItem/MoneyRequestPreview/MoneyRequestPreviewContent.tsx GitHub Actions / Changed files ESLint check
Check failure on line 165 in src/components/ReportActionItem/MoneyRequestPreview/MoneyRequestPreviewContent.tsx GitHub Actions / Changed files ESLint check
|
||
const reviewingTransactionID = ReportActionsUtils.isMoneyRequestAction(parentReportAction) ? ReportActionsUtils.getOriginalMessage(parentReportAction)?.IOUTransactionID ?? '-1' : '-1'; | ||
const reviewingTransactionID = ReportActionsUtils.isMoneyRequestAction(parentReportAction) ? ReportActionsUtils.getOriginalMessage(parentReportAction)?.IOUTransactionID : undefined; | ||
|
||
/* | ||
Show the merchant for IOUs and expenses only if: | ||
|
@@ -260,10 +260,10 @@ function MoneyRequestPreviewContent({ | |
if (TransactionUtils.isPending(transaction)) { | ||
return {shouldShow: true, messageIcon: Expensicons.CreditCardHourglass, messageDescription: translate('iou.transactionPending')}; | ||
} | ||
if (TransactionUtils.shouldShowBrokenConnectionViolation(transaction?.transactionID ?? '-1', iouReport, policy)) { | ||
if (TransactionUtils.shouldShowBrokenConnectionViolation(transaction?.transactionID, iouReport, policy)) { | ||
return {shouldShow: true, messageIcon: Expensicons.Hourglass, messageDescription: translate('violations.brokenConnection530Error')}; | ||
} | ||
if (TransactionUtils.hasPendingUI(transaction, TransactionUtils.getTransactionViolations(transaction?.transactionID ?? '-1', transactionViolations))) { | ||
if (TransactionUtils.hasPendingUI(transaction, TransactionUtils.getTransactionViolations(transaction?.transactionID, transactionViolations))) { | ||
return {shouldShow: true, messageIcon: Expensicons.Hourglass, messageDescription: translate('iou.pendingMatchWithCreditCard')}; | ||
} | ||
return {shouldShow: false}; | ||
|
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