From ab5907a0c3a94ce27f73a6e5b531775c8d40bea9 Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Wed, 1 Jan 2025 23:35:17 +0300 Subject: [PATCH 01/17] fix: revert changes for report list item --- src/components/SelectionList/Search/ReportListItem.tsx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/components/SelectionList/Search/ReportListItem.tsx b/src/components/SelectionList/Search/ReportListItem.tsx index 73d0ec8f8c10..e721fde89771 100644 --- a/src/components/SelectionList/Search/ReportListItem.tsx +++ b/src/components/SelectionList/Search/ReportListItem.tsx @@ -14,7 +14,6 @@ import useThemeStyles from '@hooks/useThemeStyles'; import {handleActionButtonPress} from '@libs/actions/Search'; import * as CurrencyUtils from '@libs/CurrencyUtils'; import Navigation from '@libs/Navigation/Navigation'; -import * as ReportUtils from '@libs/ReportUtils'; import variables from '@styles/variables'; import CONST from '@src/CONST'; import ROUTES from '@src/ROUTES'; @@ -110,8 +109,6 @@ function ReportListItem({ return null; } - const hasHeldExpenses = ReportUtils.hasHeldExpenses('', reportItem.transactions); - const participantFrom = reportItem.from; const participantTo = reportItem.to; @@ -173,7 +170,6 @@ function ReportListItem({ onButtonPress={handleOnButtonPress} containerStyle={[styles.ph3, styles.pt1half, styles.mb1half]} isLoading={reportItem.isActionLoading} - shouldUseSuccessStyle={!hasHeldExpenses} /> )} @@ -206,7 +202,6 @@ function ReportListItem({ Date: Wed, 1 Jan 2025 23:39:53 +0300 Subject: [PATCH 02/17] fix: revert changes for transaction, header and report preview --- src/components/MoneyReportHeader.tsx | 3 --- src/components/ReportActionItem/ReportPreview.tsx | 2 -- .../SelectionList/Search/TransactionListItemRow.tsx | 6 +----- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx index 36310e4eb588..6f47ad19239f 100644 --- a/src/components/MoneyReportHeader.tsx +++ b/src/components/MoneyReportHeader.tsx @@ -111,7 +111,6 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea const isDraft = ReportUtils.isOpenExpenseReport(moneyRequestReport); const connectedIntegration = PolicyUtils.getConnectedIntegration(policy); const navigateBackToAfterDelete = useRef(); - const hasHeldExpenses = ReportUtils.hasHeldExpenses(moneyRequestReport?.reportID); const hasScanningReceipt = ReportUtils.getTransactionsWithReceipts(moneyRequestReport?.reportID).some((t) => TransactionUtils.isReceiptBeingScanned(t)); const hasOnlyPendingTransactions = allTransactions.length > 0 && allTransactions.every((t) => TransactionUtils.isExpensifyCardTransaction(t) && TransactionUtils.isPending(t)); const transactionIDs = allTransactions.map((t) => t.transactionID); @@ -362,7 +361,6 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea {shouldShowSettlementButton && !shouldUseNarrowLayout && ( {shouldShowSettlementButton && ( TransactionUtils.isOnHold(item), [item]); - if (!isLargeScreenWidth) { return ( @@ -280,7 +278,6 @@ function TransactionListItemRow({ onButtonPress={onButtonPress} canSelectMultiple={canSelectMultiple} action={item.action} - shouldUseSuccessStyle={!isOnHold} isSelected={item.isSelected} isDisabled={item.isDisabled} isDisabledCheckbox={item.isDisabledCheckbox} @@ -447,7 +444,6 @@ function TransactionListItemRow({ Date: Fri, 3 Jan 2025 17:15:46 +0300 Subject: [PATCH 03/17] Revert "Merge pull request #53117 from NJ-2020/fix/52569" This reverts commit d0077855145f79028ea6dd7acefa90dd5a8850fd, reversing changes made to a6fc5ecb8f42d3b88ff73d9fdf303cf5f02c5c23. --- .../ReportActionItem/ReportPreview.tsx | 1 + .../SelectionList/Search/ActionCell.tsx | 23 +++++-------------- .../Search/ExpenseItemHeaderNarrow.tsx | 3 --- src/components/SettlementButton/index.tsx | 2 -- src/components/SettlementButton/types.ts | 3 --- 5 files changed, 7 insertions(+), 25 deletions(-) diff --git a/src/components/ReportActionItem/ReportPreview.tsx b/src/components/ReportActionItem/ReportPreview.tsx index b17fb7d6ca74..09bfb87ecf5f 100644 --- a/src/components/ReportActionItem/ReportPreview.tsx +++ b/src/components/ReportActionItem/ReportPreview.tsx @@ -127,6 +127,7 @@ function ReportPreview({ const [isApprovedAnimationRunning, setIsApprovedAnimationRunning] = useState(false); const [isHoldMenuVisible, setIsHoldMenuVisible] = useState(false); const [requestType, setRequestType] = useState(); + const [paymentType, setPaymentType] = useState(); const getCanIOUBePaid = useCallback( diff --git a/src/components/SelectionList/Search/ActionCell.tsx b/src/components/SelectionList/Search/ActionCell.tsx index 6e0270c37e29..92c7cda3d790 100644 --- a/src/components/SelectionList/Search/ActionCell.tsx +++ b/src/components/SelectionList/Search/ActionCell.tsx @@ -1,4 +1,4 @@ -import React, {useCallback} from 'react'; +import React from 'react'; import {View} from 'react-native'; import Badge from '@components/Badge'; import Button from '@components/Button'; @@ -25,7 +25,6 @@ const actionTranslationsMap: Record = type ActionCellProps = { action?: SearchTransactionAction; - shouldUseSuccessStyle?: boolean; isLargeScreenWidth?: boolean; isSelected?: boolean; goToItem: () => void; @@ -36,7 +35,6 @@ type ActionCellProps = { function ActionCell({ action = CONST.SEARCH.ACTION_TYPES.VIEW, - shouldUseSuccessStyle: shouldUseSuccessStyleProp = true, isLargeScreenWidth = true, isSelected = false, goToItem, @@ -51,17 +49,6 @@ function ActionCell({ const {isOffline} = useNetwork(); const text = isChildListItem ? translate(actionTranslationsMap[CONST.SEARCH.ACTION_TYPES.VIEW]) : translate(actionTranslationsMap[action]); - - const getButtonInnerStyles = useCallback( - (shouldUseSuccessStyle: boolean) => { - if (!isSelected) { - return {}; - } - return shouldUseSuccessStyle ? styles.buttonSuccessHovered : styles.buttonDefaultHovered; - }, - [isSelected, styles], - ); - const shouldUseViewAction = action === CONST.SEARCH.ACTION_TYPES.VIEW || (parentAction === CONST.SEARCH.ACTION_TYPES.PAID && action === CONST.SEARCH.ACTION_TYPES.PAID); if ((parentAction !== CONST.SEARCH.ACTION_TYPES.PAID && action === CONST.SEARCH.ACTION_TYPES.PAID) || action === CONST.SEARCH.ACTION_TYPES.DONE) { @@ -88,13 +75,14 @@ function ActionCell({ } if (action === CONST.SEARCH.ACTION_TYPES.VIEW || action === CONST.SEARCH.ACTION_TYPES.REVIEW || shouldUseViewAction) { + const buttonInnerStyles = isSelected ? styles.buttonDefaultHovered : {}; return isLargeScreenWidth ? (