Skip to content
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: [Auth Violations] Support isDismissed on newDot to hide violations. #54455

Open
wants to merge 38 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
6463ecf
feat: [Auth Violations] Support isDismissed on newDot to hide violati…
Krishna2323 Dec 23, 2024
6166bb7
Merge branch 'main' into krishna2323/issue/53398
Krishna2323 Jan 5, 2025
2a179a2
fix eslint.
Krishna2323 Jan 5, 2025
cd59a56
fix eslint.
Krishna2323 Jan 5, 2025
5682ae0
fix eslint.
Krishna2323 Jan 5, 2025
1016065
fix eslint.
Krishna2323 Jan 6, 2025
a2d0da6
fix ESLint.
Krishna2323 Jan 6, 2025
ee414e3
fix ESLint.
Krishna2323 Jan 6, 2025
82877a6
Merge branch 'Expensify:main' into krishna2323/issue/53398
Krishna2323 Jan 9, 2025
18f9c6f
fix ESlint issues.
Krishna2323 Jan 9, 2025
40c5559
fix ESlint issues.
Krishna2323 Jan 9, 2025
3f4dd02
Merge branch 'main' into krishna2323/issue/53398
Krishna2323 Jan 13, 2025
7eb5639
Merge branch 'Expensify:main' into krishna2323/issue/53398
Krishna2323 Jan 14, 2025
593f497
fix ESlint.
Krishna2323 Jan 15, 2025
825c4be
fix ESlint.
Krishna2323 Jan 15, 2025
969623b
Merge branch 'main' into krishna2323/issue/53398
Krishna2323 Jan 15, 2025
486acb5
revert unnecessary changes.
Krishna2323 Jan 15, 2025
0a0cbc3
fix ESLint.
Krishna2323 Jan 15, 2025
55f73fa
fix ESLint.
Krishna2323 Jan 15, 2025
a5194c8
minor update.
Krishna2323 Jan 15, 2025
332efdf
fix merge conflicts.
Krishna2323 Jan 16, 2025
1ef4be5
minor import fix.
Krishna2323 Jan 16, 2025
afe362c
Merge branch 'main' into krishna2323/issue/53398
Krishna2323 Jan 16, 2025
6abedea
remove duplicate imports.
Krishna2323 Jan 16, 2025
05747b2
minor fix.
Krishna2323 Jan 16, 2025
d870956
fix typescript issue.
Krishna2323 Jan 16, 2025
2774880
minor updates.
Krishna2323 Jan 20, 2025
078b3fc
fix merge conflicts.
Krishna2323 Jan 20, 2025
3970b9d
Merge branch 'main' into krishna2323/issue/53398
Krishna2323 Jan 20, 2025
a39a2f5
minor import names update.
Krishna2323 Jan 20, 2025
789b51d
Merge branch 'main' into krishna2323/issue/53398
Krishna2323 Jan 21, 2025
f9e3e7e
Merge branch 'main' into krishna2323/issue/53398
Krishna2323 Jan 24, 2025
93d33a2
add unit tests for violation util functions.
Krishna2323 Jan 24, 2025
156a3aa
minor NAB fixes.
Krishna2323 Jan 28, 2025
d477565
Merge branch 'main' into krishna2323/issue/53398
Krishna2323 Jan 28, 2025
ed89588
fix ESLint.
Krishna2323 Jan 28, 2025
79b012f
Merge branch 'main' into krishna2323/issue/53398
Krishna2323 Jan 29, 2025
65cb691
minor fix.
Krishna2323 Jan 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/components/BrokenConnectionDescription.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import React from 'react';
import type {OnyxEntry} from 'react-native-onyx';
import {useOnyx} from 'react-native-onyx';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import * as PolicyUtils from '@libs/PolicyUtils';
import * as ReportUtils from '@libs/ReportUtils';
import * as TransactionUtils from '@libs/TransactionUtils';
import Navigation from '@navigation/Navigation';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import type {Policy, Report} from '@src/types/onyx';
import TextLink from './TextLink';

type BrokenConnectionDescriptionProps = {
/** Transaction id of the corresponding report */
transactionID: string;
transactionID?: string;

/** Current report */
report: OnyxEntry<Report>;
Expand All @@ -26,7 +25,7 @@ type BrokenConnectionDescriptionProps = {
function BrokenConnectionDescription({transactionID, policy, report}: BrokenConnectionDescriptionProps) {
const styles = useThemeStyles();
const {translate} = useLocalize();
const [transactionViolations] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`);
const transactionViolations = TransactionUtils.getTransactionViolations(transactionID);

const brokenConnection530Error = transactionViolations?.find((violation) => violation.data?.rterType === CONST.RTER_VIOLATION_TYPES.BROKEN_CARD_CONNECTION_530);
const brokenConnectionError = transactionViolations?.find((violation) => violation.data?.rterType === CONST.RTER_VIOLATION_TYPES.BROKEN_CARD_CONNECTION);
Expand All @@ -40,13 +39,18 @@ function BrokenConnectionDescription({transactionID, policy, report}: BrokenConn
return translate('violations.brokenConnection530Error');
}

if (isPolicyAdmin && !ReportUtils.isCurrentUserSubmitter(report?.reportID ?? '')) {
if (isPolicyAdmin && !ReportUtils.isCurrentUserSubmitter(report?.reportID)) {
return (
<>
{`${translate('violations.adminBrokenConnectionError')}`}
<TextLink
style={[styles.textLabelSupporting, styles.link]}
onPress={() => Navigation.navigate(ROUTES.WORKSPACE_COMPANY_CARDS.getRoute(policy?.id ?? '-1'))}
onPress={() => {
if (!policy?.id) {
return;
}
Navigation.navigate(ROUTES.WORKSPACE_COMPANY_CARDS.getRoute(policy?.id));
}}
>{`${translate('workspace.common.companyCards')}`}</TextLink>
.
</>
Expand Down
22 changes: 12 additions & 10 deletions src/components/MoneyRequestHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import variables from '@styles/variables';
import * as IOU from '@userActions/IOU';
import * as TransactionActions from '@userActions/Transaction';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import SCREENS from '@src/SCREENS';
Expand Down Expand Up @@ -50,35 +51,36 @@
// eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
const {shouldUseNarrowLayout, isSmallScreenWidth} = useResponsiveLayout();
const route = useRoute();
const [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${report?.parentReportID ?? '-1'}`);
const [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${report?.parentReportID ?? CONST.DEFAULT_NUMBER_ID}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let us use || instead of ?? as that will help address empty strings as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use ?? everywhere in the app, otherwise we would need to disable eslint.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it’s fine to leave it as that is the more widely accepted pattern. Maybe this can be taken up later when it is considered in its entirety.

const [transaction] = useOnyx(
`${ONYXKEYS.COLLECTION.TRANSACTION}${
ReportActionsUtils.isMoneyRequestAction(parentReportAction) ? ReportActionsUtils.getOriginalMessage(parentReportAction)?.IOUTransactionID ?? -1 : -1
ReportActionsUtils.isMoneyRequestAction(parentReportAction)
? ReportActionsUtils.getOriginalMessage(parentReportAction)?.IOUTransactionID ?? CONST.DEFAULT_NUMBER_ID
: CONST.DEFAULT_NUMBER_ID
}`,
);
const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS);
const [dismissedHoldUseExplanation, dismissedHoldUseExplanationResult] = useOnyx(ONYXKEYS.NVP_DISMISSED_HOLD_USE_EXPLANATION, {initialValue: true});
const isLoadingHoldUseExplained = isLoadingOnyxValue(dismissedHoldUseExplanationResult);
const styles = useThemeStyles();
const theme = useTheme();
const {translate} = useLocalize();
const [shouldShowHoldMenu, setShouldShowHoldMenu] = useState(false);
const isOnHold = TransactionUtils.isOnHold(transaction);
const isDuplicate = TransactionUtils.isDuplicate(transaction?.transactionID ?? '');
const isDuplicate = TransactionUtils.isDuplicate(transaction?.transactionID);
const reportID = report?.reportID;

const isReportInRHP = route.name === SCREENS.SEARCH.REPORT_RHP;
const shouldDisplaySearchRouter = !isReportInRHP || isSmallScreenWidth;

const hasAllPendingRTERViolations = TransactionUtils.allHavePendingRTERViolation([transaction?.transactionID ?? '-1']);
const hasAllPendingRTERViolations = TransactionUtils.allHavePendingRTERViolation(transaction?.transactionID ? [transaction?.transactionID] : []);

const shouldShowBrokenConnectionViolation = TransactionUtils.shouldShowBrokenConnectionViolation(transaction?.transactionID ?? '-1', parentReport, policy);
const shouldShowBrokenConnectionViolation = TransactionUtils.shouldShowBrokenConnectionViolation(transaction?.transactionID, parentReport, policy);

const shouldShowMarkAsCashButton =
hasAllPendingRTERViolations || (shouldShowBrokenConnectionViolation && (!PolicyUtils.isPolicyAdmin(policy) || ReportUtils.isCurrentUserSubmitter(parentReport?.reportID ?? '')));
hasAllPendingRTERViolations || (shouldShowBrokenConnectionViolation && (!PolicyUtils.isPolicyAdmin(policy) || ReportUtils.isCurrentUserSubmitter(parentReport?.reportID)));

const markAsCash = useCallback(() => {
TransactionActions.markAsCash(transaction?.transactionID ?? '-1', reportID ?? '');
TransactionActions.markAsCash(transaction?.transactionID, reportID);
}, [reportID, transaction?.transactionID]);

const isScanning = TransactionUtils.hasReceipt(transaction) && TransactionUtils.isReceiptBeingScanned(transaction);
Expand All @@ -105,14 +107,14 @@
icon: getStatusIcon(Expensicons.Hourglass),
description: (
<BrokenConnectionDescription
transactionID={transaction?.transactionID ?? '-1'}
transactionID={transaction?.transactionID}
report={report}
policy={policy}
/>
),
};
}
if (TransactionUtils.hasPendingRTERViolation(TransactionUtils.getTransactionViolations(transaction?.transactionID ?? '-1', transactionViolations))) {
if (TransactionUtils.hasPendingRTERViolation(TransactionUtils.getTransactionViolations(transaction?.transactionID))) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rojiphil, could you please check the ESLint failures below? I have already resolved dozens of those but it keeps increasing everytime I push a commit. I want your help especially in resolving the warning just below this comment and when we use ?? while getting a route, I have no idea how to deal with that, please let me know if you are familiar with that. Thanks 🙏🏻

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the case of calling route, can we not do an early return as shown below? It does not seem correct to call navigate with an invalid report id anyway.

The guidelines for the fix of the ESlint failures is already mentioned here. Please look for similar handling for ESlint failures elsewhere in code as that can help. But let me know if you get stuck otherwise.

if(!reportID) {
  return;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rojiphil thanks for the help 🙇🏻.

return {icon: getStatusIcon(Expensicons.Hourglass), description: translate('iou.pendingMatchWithCreditCardDescription')};
}
if (isScanning) {
Expand Down Expand Up @@ -157,7 +159,7 @@
shouldShowPinButton={false}
report={{
...report,
reportID: reportID ?? '',

Check failure on line 162 in src/components/MoneyRequestHeader.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

ownerAccountID: parentReport?.ownerAccountID,
}}
policy={policy}
Expand All @@ -179,7 +181,7 @@
text={translate('iou.reviewDuplicates')}
style={[styles.p0, styles.ml2]}
onPress={() => {
Navigation.navigate(ROUTES.TRANSACTION_DUPLICATE_REVIEW_PAGE.getRoute(reportID ?? '', Navigation.getReportRHPActiveRoute()));

Check failure on line 184 in src/components/MoneyRequestHeader.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

}}
/>
)}
Expand All @@ -201,7 +203,7 @@
text={translate('iou.reviewDuplicates')}
style={[styles.w100, styles.pr0]}
onPress={() => {
Navigation.navigate(ROUTES.TRANSACTION_DUPLICATE_REVIEW_PAGE.getRoute(reportID ?? '', Navigation.getReportRHPActiveRoute()));

Check failure on line 206 in src/components/MoneyRequestHeader.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

}}
/>
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ function MoneyRequestPreviewContent({
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 [allViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS);
const transactionViolations = TransactionUtils.getTransactionViolations(transaction?.transactionID);

const sessionAccountID = session?.accountID;
const managerID = iouReport?.managerID ?? CONST.DEFAULT_NUMBER_ID;
Expand Down Expand Up @@ -117,9 +118,9 @@ function MoneyRequestPreviewContent({
const isOnHold = TransactionUtils.isOnHold(transaction);
const isSettlementOrApprovalPartial = !!iouReport?.pendingFields?.partial;
const isPartialHold = isSettlementOrApprovalPartial && isOnHold;
const hasViolations = TransactionUtils.hasViolation(transaction?.transactionID, transactionViolations, true);
const hasNoticeTypeViolations = TransactionUtils.hasNoticeTypeViolation(transaction?.transactionID, transactionViolations, true) && ReportUtils.isPaidGroupPolicy(iouReport);
const hasWarningTypeViolations = TransactionUtils.hasWarningTypeViolation(transaction?.transactionID, transactionViolations, true);
const hasViolations = TransactionUtils.hasViolation(transaction?.transactionID, allViolations, true);
const hasNoticeTypeViolations = TransactionUtils.hasNoticeTypeViolation(transaction?.transactionID, allViolations, true) && ReportUtils.isPaidGroupPolicy(iouReport);
const hasWarningTypeViolations = TransactionUtils.hasWarningTypeViolation(transaction?.transactionID, allViolations, true);
const hasFieldErrors = TransactionUtils.hasMissingSmartscanFields(transaction);
const isDistanceRequest = TransactionUtils.isDistanceRequest(transaction);
const isFetchingWaypointsFromServer = TransactionUtils.isFetchingWaypointsFromServer(transaction);
Expand All @@ -134,11 +135,8 @@ function MoneyRequestPreviewContent({

// Get transaction violations for given transaction id from onyx, find duplicated transactions violations and get duplicates
const allDuplicates = useMemo(
() =>
transactionViolations?.[`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transaction?.transactionID}`]?.find(
(violation) => violation.name === CONST.VIOLATIONS.DUPLICATED_TRANSACTION,
)?.data?.duplicates ?? [],
[transaction?.transactionID, transactionViolations],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we have to keep transactionID as dependency so that allDuplicates can be updated when it becomes available? Also, I think we can remove transactionViolations and use getTransactionViolations directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const transactionViolations = getTransactionViolations(transaction?.transactionID);

transactionViolations will we updated when transaction?.transactionID is changed.

Also, I think we can remove transactionViolations and use getTransactionViolations directly.

Just updated the code, now we are using transactionViolations in 3 places.

() => transactionViolations?.find((violation) => violation.name === CONST.VIOLATIONS.DUPLICATED_TRANSACTION)?.data?.duplicates ?? [],
[transactionViolations],
);

// Remove settled transactions from duplicates
Expand Down Expand Up @@ -209,7 +207,7 @@ function MoneyRequestPreviewContent({
}

if (shouldShowRBR && transaction) {
const violations = TransactionUtils.getTransactionViolations(transaction.transactionID, transactionViolations);
const violations = TransactionUtils.getTransactionViolations(transaction.transactionID);
if (shouldShowHoldMessage) {
return `${message} ${CONST.DOT_SEPARATOR} ${translate('violations.hold')}`;
}
Expand Down Expand Up @@ -256,7 +254,7 @@ function MoneyRequestPreviewContent({
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, transactionViolations))) {
if (TransactionUtils.hasPendingUI(transaction, TransactionUtils.getTransactionViolations(transaction?.transactionID))) {
return {shouldShow: true, messageIcon: Expensicons.Hourglass, messageDescription: translate('iou.pendingMatchWithCreditCard')};
}
return {shouldShow: false};
Expand Down
6 changes: 3 additions & 3 deletions src/components/ReportActionItem/MoneyRequestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@
const receiptFieldViolationNames: OnyxTypes.ViolationName[] = [CONST.VIOLATIONS.MODIFIED_AMOUNT, CONST.VIOLATIONS.MODIFIED_DATE];

const getTransactionID = (report: OnyxEntry<OnyxTypes.Report>, parentReportActions: OnyxEntry<OnyxTypes.ReportActions>) => {
const parentReportAction = parentReportActions?.[report?.parentReportActionID ?? '-1'];
const parentReportAction = parentReportActions?.[report?.parentReportActionID ?? CONST.DEFAULT_NUMBER_ID];
Krishna2323 marked this conversation as resolved.
Show resolved Hide resolved
const originalMessage = parentReportAction && ReportActionsUtils.isMoneyRequestAction(parentReportAction) ? ReportActionsUtils.getOriginalMessage(parentReportAction) : undefined;
return originalMessage?.IOUTransactionID ?? -1;
return originalMessage?.IOUTransactionID ?? undefined;
};

function MoneyRequestView({report, shouldShowAnimatedBackground, readonly = false, updatedTransaction, isFromReviewDuplicates = false}: MoneyRequestViewProps) {
Expand All @@ -81,8 +81,8 @@
const session = useSession();
const {isOffline} = useNetwork();
const {translate, toLocaleDigit} = useLocalize();
const parentReportID = report?.parentReportID ?? '-1';

Check failure on line 84 in src/components/ReportActionItem/MoneyRequestView.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

const policyID = report?.policyID ?? '-1';

Check failure on line 85 in src/components/ReportActionItem/MoneyRequestView.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

const [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${parentReportID}`);
const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${parentReport?.parentReportID}`, {
selector: (chatReportValue) => chatReportValue && {reportID: chatReportValue.reportID, errorFields: chatReportValue.errorFields},
Expand All @@ -95,14 +95,14 @@
const [parentReportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${parentReportID}`, {
canEvict: false,
});
const [transactionViolations] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${getTransactionID(report, parentReportActions)}`);
const transactionViolations = TransactionUtils.getTransactionViolations(getTransactionID(report, parentReportActions) ?? undefined);

const parentReportAction = parentReportActions?.[report?.parentReportActionID ?? '-1'];

Check failure on line 100 in src/components/ReportActionItem/MoneyRequestView.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

const isTrackExpense = ReportUtils.isTrackExpenseReport(report);
const moneyRequestReport = parentReport;
const linkedTransactionID = useMemo(() => {
const originalMessage = parentReportAction && ReportActionsUtils.isMoneyRequestAction(parentReportAction) ? ReportActionsUtils.getOriginalMessage(parentReportAction) : undefined;
return originalMessage?.IOUTransactionID ?? '-1';

Check failure on line 105 in src/components/ReportActionItem/MoneyRequestView.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

}, [parentReportAction]);

const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${linkedTransactionID}`);
Expand Down Expand Up @@ -227,7 +227,7 @@
if (newBillable === TransactionUtils.getBillable(transaction)) {
return;
}
IOU.updateMoneyRequestBillable(transaction?.transactionID ?? '-1', report?.reportID ?? '-1', newBillable, policy, policyTagList, policyCategories);

Check failure on line 230 in src/components/ReportActionItem/MoneyRequestView.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Check failure on line 230 in src/components/ReportActionItem/MoneyRequestView.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

},
[transaction, report, policy, policyTagList, policyCategories],
);
Expand Down Expand Up @@ -323,7 +323,7 @@
ROUTES.MONEY_REQUEST_STEP_DISTANCE.getRoute(
CONST.IOU.ACTION.EDIT,
iouType,
transaction?.transactionID ?? '-1',

Check failure on line 326 in src/components/ReportActionItem/MoneyRequestView.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

report?.reportID ?? '-1',
Navigation.getReportRHPActiveRoute(),
),
Expand Down
6 changes: 3 additions & 3 deletions src/components/ReportActionItem/ReportPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ function ReportPreview({
const lastThreeTransactions = allTransactions.slice(-3);
const lastThreeReceipts = lastThreeTransactions.map((transaction) => ({...ReceiptUtils.getThumbnailAndImageURIs(transaction), transaction}));
const showRTERViolationMessage =
numberOfRequests === 1 &&
TransactionUtils.hasPendingUI(allTransactions.at(0), TransactionUtils.getTransactionViolations(allTransactions.at(0)?.transactionID, transactionViolations));
const shouldShowBrokenConnectionViolation = numberOfRequests === 1 && TransactionUtils.shouldShowBrokenConnectionViolation(allTransactions.at(0)?.transactionID, iouReport, policy);
numberOfRequests === 1 && TransactionUtils.hasPendingUI(allTransactions.at(0), TransactionUtils.getTransactionViolations(allTransactions.at(0)?.transactionID ?? '-1'));
const shouldShowBrokenConnectionViolation =
numberOfRequests === 1 && TransactionUtils.shouldShowBrokenConnectionViolation(allTransactions.at(0)?.transactionID ?? '-1', iouReport, policy);
let formattedMerchant = numberOfRequests === 1 ? TransactionUtils.getMerchant(allTransactions.at(0)) : null;
const formattedDescription = numberOfRequests === 1 ? TransactionUtils.getDescription(allTransactions.at(0)) : null;

Expand Down
Loading
Loading