From 9b6e8f86fc0fe3af51865391cf2a31915ba82995 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Tue, 12 Nov 2024 12:40:54 +0000 Subject: [PATCH] Revert "Merge pull request #51445 from Expensify/cmartins-showButtons" This reverts commit 286743d56dd66c6b031ff342ea06842c6f033d8a, reversing changes made to 124450fc1daec34f255e9a0729a5a2d3000d0e94. --- src/CONST.ts | 3 - src/components/Search/SearchPageHeader.tsx | 2 +- src/components/Search/types.ts | 8 -- .../SelectionList/Search/ActionCell.tsx | 40 +++---- .../Search/ExpenseItemHeaderNarrow.tsx | 3 - .../SelectionList/Search/ReportListItem.tsx | 7 +- .../Search/TransactionListItem.tsx | 6 +- .../Search/TransactionListItemRow.tsx | 4 - .../SelectionList/SearchTableHeaderColumn.tsx | 0 .../PayMoneyRequestOnSearchParams.ts | 5 +- src/libs/PolicyUtils.ts | 11 +- src/libs/ReportUtils.ts | 30 +++-- src/libs/SearchUIUtils.ts | 65 +---------- src/libs/TransactionUtils/index.ts | 3 +- src/libs/actions/IOU.ts | 27 ++--- src/libs/actions/Search.ts | 78 ++----------- src/types/onyx/Report.ts | 2 +- src/types/onyx/SearchResults.ts | 104 +----------------- 18 files changed, 67 insertions(+), 331 deletions(-) create mode 100644 src/components/SelectionList/SearchTableHeaderColumn.tsx diff --git a/src/CONST.ts b/src/CONST.ts index d93eb230f779..c38329924a16 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -5852,9 +5852,6 @@ const CONST = { ACTION_TYPES: { VIEW: 'view', REVIEW: 'review', - SUBMIT: 'submit', - APPROVE: 'approve', - PAY: 'pay', DONE: 'done', PAID: 'paid', }, diff --git a/src/components/Search/SearchPageHeader.tsx b/src/components/Search/SearchPageHeader.tsx index d73937aeadd9..a330be3d5ff6 100644 --- a/src/components/Search/SearchPageHeader.tsx +++ b/src/components/Search/SearchPageHeader.tsx @@ -182,7 +182,7 @@ function SearchPageHeader({queryJSON, hash}: SearchPageHeaderProps) { return; } - const reportIDList = selectedReports?.filter((report) => !!report) ?? []; + const reportIDList = (selectedReports?.filter((report) => !!report) as string[]) ?? []; SearchActions.exportSearchItemsToCSV( {query: status, jsonQuery: JSON.stringify(queryJSON), reportIDList, transactionIDList: selectedTransactionsKeys, policyIDs: [activeWorkspaceID ?? '']}, () => { diff --git a/src/components/Search/types.ts b/src/components/Search/types.ts index 130ad7ae6f6e..74bf7b16d020 100644 --- a/src/components/Search/types.ts +++ b/src/components/Search/types.ts @@ -24,13 +24,6 @@ type SelectedTransactionInfo = { /** Model of selected results */ type SelectedTransactions = Record; -/** Model of payment data used by Search bulk actions */ -type PaymentData = { - reportID: string; - amount: number; - paymentType: ValueOf; -}; - type SortOrder = ValueOf; type SearchColumnType = ValueOf; type ExpenseSearchStatus = ValueOf; @@ -124,6 +117,5 @@ export type { TripSearchStatus, ChatSearchStatus, SearchAutocompleteResult, - PaymentData, SearchAutocompleteQueryRange, }; diff --git a/src/components/SelectionList/Search/ActionCell.tsx b/src/components/SelectionList/Search/ActionCell.tsx index 55e2cf6f849d..faafa6159dc1 100644 --- a/src/components/SelectionList/Search/ActionCell.tsx +++ b/src/components/SelectionList/Search/ActionCell.tsx @@ -15,9 +15,6 @@ import type {SearchTransactionAction} from '@src/types/onyx/SearchResults'; const actionTranslationsMap: Record = { view: 'common.view', review: 'common.review', - submit: 'common.submit', - approve: 'iou.approve', - pay: 'iou.pay', done: 'common.done', paid: 'iou.settledExpensify', }; @@ -29,18 +26,9 @@ type ActionCellProps = { goToItem: () => void; isChildListItem?: boolean; parentAction?: string; - isLoading?: boolean; }; -function ActionCell({ - action = CONST.SEARCH.ACTION_TYPES.VIEW, - isLargeScreenWidth = true, - isSelected = false, - goToItem, - isChildListItem = false, - parentAction = '', - isLoading = false, -}: ActionCellProps) { +function ActionCell({action = CONST.SEARCH.ACTION_TYPES.VIEW, isLargeScreenWidth = true, isSelected = false, goToItem, isChildListItem = false, parentAction = ''}: ActionCellProps) { const {translate} = useLocalize(); const theme = useTheme(); const styles = useThemeStyles(); @@ -73,8 +61,9 @@ function ActionCell({ ); } + const buttonInnerStyles = isSelected ? styles.buttonDefaultHovered : {}; + if (action === CONST.SEARCH.ACTION_TYPES.VIEW || shouldUseViewAction) { - const buttonInnerStyles = isSelected ? styles.buttonDefaultHovered : {}; return isLargeScreenWidth ? (