diff --git a/src/CONST/index.ts b/src/CONST/index.ts index ca292aafea3f..0864e02e7dfe 100644 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -1309,6 +1309,7 @@ const CONST = { MAX_COUNT_BEFORE_FOCUS_UPDATE: 30, MIN_INITIAL_REPORT_ACTION_COUNT: 15, UNREPORTED_REPORT_ID: '0', + TRASH_REPORT_ID: '-1', SPLIT_REPORT_ID: '-2', SECONDARY_ACTIONS: { SUBMIT: 'submit', @@ -7486,6 +7487,7 @@ const CONST = { DONE: 'done', EXPORT_TO_ACCOUNTING: 'exportToAccounting', PAID: 'paid', + UNDELETE: 'undelete', }, HAS_VALUES: { RECEIPT: 'receipt', @@ -7509,6 +7511,7 @@ const CONST = { CHANGE_REPORT: 'changeReport', SPLIT: 'split', DUPLICATE: 'duplicate', + UNDELETE: 'undelete', }, TRANSACTION_TYPE: { CASH: 'cash', @@ -7747,6 +7750,7 @@ const CONST = { APPROVED: 'approved', DONE: 'done', PAID: 'paid', + DELETED: 'deleted', }, EXPENSE_REPORT: { ALL: '', diff --git a/src/components/Search/SearchList/ListItem/ActionCell/actionTranslationsMap.ts b/src/components/Search/SearchList/ListItem/ActionCell/actionTranslationsMap.ts index d1d96ce43458..c1da181721ef 100644 --- a/src/components/Search/SearchList/ListItem/ActionCell/actionTranslationsMap.ts +++ b/src/components/Search/SearchList/ListItem/ActionCell/actionTranslationsMap.ts @@ -11,6 +11,7 @@ const actionTranslationsMap: Record = [CONST.SEARCH.ACTION_TYPES.EXPORT_TO_ACCOUNTING]: 'common.export', [CONST.SEARCH.ACTION_TYPES.DONE]: 'common.done', [CONST.SEARCH.ACTION_TYPES.PAID]: 'iou.settledExpensify', + [CONST.SEARCH.ACTION_TYPES.UNDELETE]: 'search.bulkActions.undelete', }; export default actionTranslationsMap; diff --git a/src/components/Search/SearchList/ListItem/ActionCell/index.tsx b/src/components/Search/SearchList/ListItem/ActionCell/index.tsx index 1ab70eeac6ea..edf8e5814401 100644 --- a/src/components/Search/SearchList/ListItem/ActionCell/index.tsx +++ b/src/components/Search/SearchList/ListItem/ActionCell/index.tsx @@ -11,7 +11,7 @@ import PayActionCell from './PayActionCell'; type ActionCellProps = { action?: SearchTransactionAction; isSelected?: boolean; - goToItem: () => void; + onButtonPress: () => void; isChildListItem?: boolean; isLoading?: boolean; policyID?: string; @@ -25,7 +25,7 @@ type ActionCellProps = { function ActionCell({ action = CONST.SEARCH.ACTION_TYPES.VIEW, isSelected = false, - goToItem, + onButtonPress, isChildListItem = false, isLoading = false, policyID = '', @@ -41,7 +41,7 @@ function ActionCell({ const shouldUseViewAction = action === CONST.SEARCH.ACTION_TYPES.VIEW || action === CONST.SEARCH.ACTION_TYPES.PAID || action === CONST.SEARCH.ACTION_TYPES.DONE; - if (shouldUseViewAction || isChildListItem) { + if (shouldUseViewAction || (isChildListItem && action !== CONST.SEARCH.ACTION_TYPES.UNDELETE)) { const text = translate(actionTranslationsMap[CONST.SEARCH.ACTION_TYPES.VIEW]); const buttonInnerStyles = isSelected ? styles.buttonDefaultSelected : {}; @@ -49,7 +49,7 @@ function ActionCell({