Skip to content

Add New Task Section to Reports #59672

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

Merged
merged 48 commits into from
Apr 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
1367f0a
add task to ui
JS00001 Apr 2, 2025
e472331
add more filters and task page
JS00001 Apr 2, 2025
4bd881f
add new fields title, createdBy, assignee to the search autocomplete,…
JS00001 Apr 4, 2025
25848cd
Add createdBy, title, assignee to the autocomplete and advanced searc…
JS00001 Apr 4, 2025
eb30e53
fix autocomplete
JS00001 Apr 4, 2025
b056fd5
begin task list item
JS00001 Apr 4, 2025
49f85c2
Merge branch 'main' of github.com:Expensify/App into jsenyitko-task-c…
JS00001 Apr 7, 2025
d1820ef
add new header
JS00001 Apr 7, 2025
7ecba84
add new task items
JS00001 Apr 7, 2025
eb39920
start adding rooms
JS00001 Apr 7, 2025
25b748d
add action button to tasks
JS00001 Apr 7, 2025
655efc8
finalize responsive design
JS00001 Apr 7, 2025
1ea325e
fix type errors, add sorting to some task fields
JS00001 Apr 7, 2025
4d61dc7
fix filters, update header
JS00001 Apr 8, 2025
49e4a87
update table header for tasks and fix sorting
JS00001 Apr 8, 2025
2871fc8
fix header and multiselect
JS00001 Apr 8, 2025
62f39c3
fix multiselect, fix assigned & createdBy as filters, fix unit tests
JS00001 Apr 8, 2025
e72d77a
fix eslint, fix header not showing up on mobile, fix new liens in des…
JS00001 Apr 8, 2025
4f301b2
Merge branch 'main' of github.com:Expensify/App into jsenyitko-task-c…
JS00001 Apr 9, 2025
2b7a2cd
review PR and add DRY, and cleanup code
JS00001 Apr 9, 2025
1dfdda5
Merge branch 'main' of github.com:Expensify/App into jsenyitko-task-c…
JS00001 Apr 11, 2025
0984fb9
fix table sizing, fix fallthrough for switch
JS00001 Apr 11, 2025
13be6ed
fix parser & comments
JS00001 Apr 14, 2025
bef7fe0
Merge branch 'main' of github.com:Expensify/App into jsenyitko-task-c…
JS00001 Apr 14, 2025
ff3a08f
reusable date cell
JS00001 Apr 14, 2025
066a841
update returned data to be the correct data, no logic in components
JS00001 Apr 14, 2025
10b0228
eslint fix
JS00001 Apr 14, 2025
64986af
Merge branch 'main' of github.com:Expensify/App into jsenyitko-task-c…
JS00001 Apr 14, 2025
6e57848
re-generate parsers after merge conflicts
JS00001 Apr 14, 2025
305c514
fix typescript issues
JS00001 Apr 14, 2025
09e09b7
Merge branch 'main' of github.com:Expensify/App into jsenyitko-task-c…
JS00001 Apr 14, 2025
f505b3f
Merge branch 'main' of github.com:Expensify/App into jsenyitko-task-c…
JS00001 Apr 14, 2025
4ea4805
unify types! Fix components to less business logic
JS00001 Apr 14, 2025
6fa8460
Merge branch 'main' of github.com:Expensify/App into jsenyitko-task-c…
JS00001 Apr 17, 2025
fd22489
Merge branch 'main' of github.com:Expensify/App into jsenyitko-task-c…
JS00001 Apr 18, 2025
99b634c
fix onyx keys
JS00001 Apr 18, 2025
a96543b
Merge branch 'main' of github.com:Expensify/App into jsenyitko-task-c…
JS00001 Apr 21, 2025
7122036
fix crashing when editing user
JS00001 Apr 22, 2025
8c53144
Ensure the user cant edit archived reports
JS00001 Apr 22, 2025
29edcf2
Merge branch 'main' of github.com:Expensify/App into jsenyitko-task-c…
JS00001 Apr 22, 2025
7d6a8b2
Add fallback to fix submit being disabled
JS00001 Apr 22, 2025
600c792
fix markdown issues
JS00001 Apr 22, 2025
63a040a
Merge branch 'main' of github.com:Expensify/App into jsenyitko-task-c…
JS00001 Apr 23, 2025
e8e7232
fix disabled button & fix autocomplete
JS00001 Apr 23, 2025
65a881c
Merge branch 'main' of github.com:Expensify/App into jsenyitko-task-c…
JS00001 Apr 23, 2025
4e0ba63
Merge branch 'main' of github.com:Expensify/App into jsenyitko-task-c…
JS00001 Apr 24, 2025
d139ab9
Merge branch 'main' of github.com:Expensify/App into jsenyitko-task-c…
JS00001 Apr 24, 2025
88dc19a
Merge branch 'main' of github.com:Expensify/App into jsenyitko-task-c…
JS00001 Apr 24, 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: 16 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6419,6 +6419,7 @@ const CONST = {
DATA_TYPES: {
EXPENSE: 'expense',
INVOICE: 'invoice',
TASK: 'task',
TRIP: 'trip',
CHAT: 'chat',
},
Expand Down Expand Up @@ -6487,6 +6488,11 @@ const CONST = {
LINKS: 'links',
PINNED: 'pinned',
},
TASK: {
ALL: 'all',
OUTSTANDING: 'outstanding',
COMPLETED: 'completed',
},
},
TABLE_COLUMNS: {
RECEIPT: 'receipt',
Expand All @@ -6501,6 +6507,10 @@ const CONST = {
TYPE: 'type',
ACTION: 'action',
TAX_AMOUNT: 'taxAmount',
TITLE: 'title',
ASSIGNEE: 'assignee',
CREATED_BY: 'createdBy',
IN: 'in',
},
SYNTAX_OPERATORS: {
AND: 'and',
Expand Down Expand Up @@ -6541,6 +6551,9 @@ const CONST = {
PAID: 'paid',
EXPORTED: 'exported',
POSTED: 'posted',
TITLE: 'title',
ASSIGNEE: 'assignee',
CREATED_BY: 'createdBy',
REIMBURSABLE: 'reimbursable',
BILLABLE: 'billable',
POLICY_ID: 'policyID',
Expand Down Expand Up @@ -6579,6 +6592,9 @@ const CONST = {
PAID: 'paid',
EXPORTED: 'exported',
POSTED: 'posted',
TITLE: 'title',
ASSIGNEE: 'assignee',
CREATED_BY: 'created-by',
REIMBURSABLE: 'reimbursable',
BILLABLE: 'billable',
},
Expand Down
3 changes: 3 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ const ROUTES = {
SEARCH_ADVANCED_FILTERS_PAID: 'search/filters/paid',
SEARCH_ADVANCED_FILTERS_EXPORTED: 'search/filters/exported',
SEARCH_ADVANCED_FILTERS_POSTED: 'search/filters/posted',
SEARCH_ADVANCED_FILTERS_TITLE: 'search/filters/title',
SEARCH_ADVANCED_FILTERS_ASSIGNEE: 'search/filters/assignee',
SEARCH_ADVANCED_FILTERS_CREATED_BY: 'search/filters/createdBy',
SEARCH_ADVANCED_FILTERS_REIMBURSABLE: 'search/filters/reimbursable',
SEARCH_ADVANCED_FILTERS_BILLABLE: 'search/filters/billable',
SEARCH_ADVANCED_FILTERS_WORKSPACE: 'search/filters/workspace',
Expand Down
3 changes: 3 additions & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ const SCREENS = {
ADVANCED_FILTERS_TAG_RHP: 'Search_Advanced_Filters_Tag_RHP',
ADVANCED_FILTERS_FROM_RHP: 'Search_Advanced_Filters_From_RHP',
ADVANCED_FILTERS_TO_RHP: 'Search_Advanced_Filters_To_RHP',
ADVANCED_FILTERS_TITLE_RHP: 'Search_Advanced_Filters_Title_RHP',
ADVANCED_FILTERS_ASSIGNEE_RHP: 'Search_Advanced_Filters_Assignee_RHP',
ADVANCED_FILTERS_CREATED_BY_RHP: 'Search_Advanced_Filters_Created_By_RHP',
ADVANCED_FILTERS_REIMBURSABLE_RHP: 'Search_Advanced_Filters_Reimbursable_RHP',
ADVANCED_FILTERS_BILLABLE_RHP: 'Search_Advanced_Filters_Billable_RHP',
ADVANCED_FILTERS_WORKSPACE_RHP: 'Search_Advanced_Filters_Workspace_RHP',
Expand Down
27 changes: 13 additions & 14 deletions src/components/Search/SearchAutocompleteList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,13 @@ function SearchAutocompleteList(

const typeAutocompleteList = Object.values(CONST.SEARCH.DATA_TYPES);
const groupByAutocompleteList = Object.values(CONST.SEARCH.GROUP_BY);
const statusAutocompleteList = Object.values({...CONST.SEARCH.STATUS.EXPENSE, ...CONST.SEARCH.STATUS.INVOICE, ...CONST.SEARCH.STATUS.CHAT, ...CONST.SEARCH.STATUS.TRIP});
const statusAutocompleteList = Object.values({
...CONST.SEARCH.STATUS.EXPENSE,
...CONST.SEARCH.STATUS.INVOICE,
...CONST.SEARCH.STATUS.CHAT,
...CONST.SEARCH.STATUS.TRIP,
...CONST.SEARCH.STATUS.TASK,
});
const expenseTypes = Object.values(CONST.SEARCH.TRANSACTION_TYPE);
const booleanTypes = Object.values(CONST.SEARCH.BOOLEAN);

Expand Down Expand Up @@ -308,28 +314,21 @@ function SearchAutocompleteList(
mapKey: CONST.SEARCH.SYNTAX_FILTER_KEYS.TAX_RATE,
}));
}
case CONST.SEARCH.SYNTAX_FILTER_KEYS.CREATED_BY:
case CONST.SEARCH.SYNTAX_FILTER_KEYS.ASSIGNEE:
case CONST.SEARCH.SYNTAX_FILTER_KEYS.TO:
case CONST.SEARCH.SYNTAX_FILTER_KEYS.FROM: {
const filteredParticipants = getParticipantsAutocompleteList()
.filter((participant) => participant.name.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(participant.name.toLowerCase()))
.slice(0, 10);
const filterKey = autocompleteKey === CONST.SEARCH.SYNTAX_FILTER_KEYS.CREATED_BY ? CONST.SEARCH.SEARCH_USER_FRIENDLY_KEYS.CREATED_BY : autocompleteKey;

return filteredParticipants.map((participant) => ({
filterKey: CONST.SEARCH.SEARCH_USER_FRIENDLY_KEYS.FROM,
text: participant.name,
autocompleteID: participant.accountID,
mapKey: CONST.SEARCH.SYNTAX_FILTER_KEYS.FROM,
}));
}
case CONST.SEARCH.SYNTAX_FILTER_KEYS.TO: {
const filteredParticipants = getParticipantsAutocompleteList()
.filter((participant) => participant.name.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(participant.name.toLowerCase()))
.slice(0, 10);

return filteredParticipants.map((participant) => ({
filterKey: CONST.SEARCH.SEARCH_USER_FRIENDLY_KEYS.TO,
filterKey,
text: participant.name,
autocompleteID: participant.accountID,
mapKey: CONST.SEARCH.SYNTAX_FILTER_KEYS.TO,
mapKey: autocompleteKey,
}));
}
case CONST.SEARCH.SYNTAX_FILTER_KEYS.IN: {
Expand Down
30 changes: 18 additions & 12 deletions src/components/Search/SearchContext.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {useCallback, useContext, useMemo, useState} from 'react';
import type {ReportActionListItemType, ReportListItemType, TransactionListItemType} from '@components/SelectionList/types';
import type {ReportActionListItemType, ReportListItemType, TaskListItemType, TransactionListItemType} from '@components/SelectionList/types';
import {isMoneyRequestReport} from '@libs/ReportUtils';
import {isReportListItemType, isTransactionListItemType} from '@libs/SearchUIUtils';
import CONST from '@src/CONST';
Expand Down Expand Up @@ -27,7 +27,10 @@ const defaultSearchContext: SearchContext = {

const Context = React.createContext<SearchContext>(defaultSearchContext);

function getReportsFromSelectedTransactions(data: TransactionListItemType[] | ReportListItemType[] | ReportActionListItemType[], selectedTransactions: SelectedTransactions) {
function getReportsFromSelectedTransactions(
data: TransactionListItemType[] | ReportListItemType[] | ReportActionListItemType[] | TaskListItemType[],
selectedTransactions: SelectedTransactions,
) {
if (data.length === 0) {
return [];
}
Expand Down Expand Up @@ -81,17 +84,20 @@ function SearchContextProvider({children}: ChildrenProps) {
}));
}, []);

const setSelectedTransactions = useCallback((selectedTransactions: SelectedTransactions, data: TransactionListItemType[] | ReportListItemType[] | ReportActionListItemType[]) => {
// When selecting transactions, we also need to manage the reports to which these transactions belong. This is done to ensure proper exporting to CSV.
const selectedReports = getReportsFromSelectedTransactions(data, selectedTransactions);
const setSelectedTransactions = useCallback(
(selectedTransactions: SelectedTransactions, data: TransactionListItemType[] | ReportListItemType[] | ReportActionListItemType[] | TaskListItemType[]) => {
// When selecting transactions, we also need to manage the reports to which these transactions belong. This is done to ensure proper exporting to CSV.
const selectedReports = getReportsFromSelectedTransactions(data, selectedTransactions);

setSearchContextData((prevState) => ({
...prevState,
selectedTransactions,
shouldTurnOffSelectionMode: false,
selectedReports,
}));
}, []);
setSearchContextData((prevState) => ({
...prevState,
selectedTransactions,
shouldTurnOffSelectionMode: false,
selectedReports,
}));
},
[],
);

const clearSelectedTransactions = useCallback(
(searchHash?: number, shouldTurnOffSelectionMode = false) => {
Expand Down
35 changes: 22 additions & 13 deletions src/components/Search/SearchList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ import Modal from '@components/Modal';
import {PressableWithFeedback} from '@components/Pressable';
import type ChatListItem from '@components/SelectionList/ChatListItem';
import type ReportListItem from '@components/SelectionList/Search/ReportListItem';
import type TaskListItem from '@components/SelectionList/Search/TaskListItem';
import type TransactionListItem from '@components/SelectionList/Search/TransactionListItem';
import type {ExtendedTargetedEvent, ReportActionListItemType, ReportListItemType, TransactionListItemType} from '@components/SelectionList/types';
import type {ExtendedTargetedEvent, ReportListItemType, SearchListItem} from '@components/SelectionList/types';
import Text from '@components/Text';
import useArrowKeyFocusManager from '@hooks/useArrowKeyFocusManager';
import useKeyboardShortcut from '@hooks/useKeyboardShortcut';
Expand All @@ -31,8 +32,7 @@ import variables from '@styles/variables';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';

type SearchListItem = TransactionListItemType | ReportListItemType | ReportActionListItemType;
type SearchListItemComponentType = typeof TransactionListItem | typeof ChatListItem | typeof ReportListItem;
type SearchListItemComponentType = typeof TransactionListItem | typeof ChatListItem | typeof ReportListItem | typeof TaskListItem;

type SearchListHandle = {
scrollAndHighlightItem?: (items: string[]) => void;
Expand Down Expand Up @@ -336,19 +336,27 @@ function SearchList(
],
);

const tableHeaderVisible = canSelectMultiple || !!SearchTableHeader;
const selectAllButtonVisible = canSelectMultiple && !SearchTableHeader;

return (
<View style={[styles.flex1, !isKeyboardShown && safeAreaPaddingBottomStyle, containerStyle]}>
{canSelectMultiple && (
{tableHeaderVisible && (
<View style={[styles.searchListHeaderContainerStyle, styles.listTableHeader]}>
<Checkbox
accessibilityLabel={translate('workspace.people.selectAll')}
isChecked={selectedItemsLength === flattenedTransactions.length}
isIndeterminate={selectedItemsLength > 0 && selectedItemsLength !== flattenedTransactions.length}
onPress={() => {
onAllCheckboxPress();
}}
/>
{SearchTableHeader ?? (
{canSelectMultiple && (
<Checkbox
accessibilityLabel={translate('workspace.people.selectAll')}
isChecked={selectedItemsLength === flattenedTransactions.length}
isIndeterminate={selectedItemsLength > 0 && selectedItemsLength !== flattenedTransactions.length}
onPress={() => {
onAllCheckboxPress();
}}
/>
)}

{SearchTableHeader}

{selectAllButtonVisible && (
<PressableWithFeedback
style={[styles.userSelectNone, styles.alignItemsCenter]}
onPress={onAllCheckboxPress}
Expand All @@ -362,6 +370,7 @@ function SearchList(
)}
</View>
)}

<Animated.FlatList
data={data}
renderItem={renderItem}
Expand Down
25 changes: 24 additions & 1 deletion src/components/Search/SearchPageHeader/SearchStatusBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {DropdownOption} from '@components/ButtonWithDropdownMenu/types';
import * as Expensicons from '@components/Icon/Expensicons';
import ScrollView from '@components/ScrollView';
import {useSearchContext} from '@components/Search/SearchContext';
import type {ChatSearchStatus, ExpenseSearchStatus, InvoiceSearchStatus, SearchGroupBy, SearchQueryJSON, TripSearchStatus} from '@components/Search/types';
import type {ChatSearchStatus, ExpenseSearchStatus, InvoiceSearchStatus, SearchGroupBy, SearchQueryJSON, TaskSearchStatus, TripSearchStatus} from '@components/Search/types';
import SearchStatusSkeleton from '@components/Skeletons/SearchStatusSkeleton';
import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
Expand Down Expand Up @@ -198,6 +198,27 @@ const chatOptions: Array<{type: SearchDataTypes; status: ChatSearchStatus; icon:
},
];

const taskOptions: Array<{type: SearchDataTypes; status: TaskSearchStatus; icon: IconAsset; text: TranslationPaths}> = [
{
type: CONST.SEARCH.DATA_TYPES.TASK,
status: CONST.SEARCH.STATUS.TASK.ALL,
icon: Expensicons.All,
text: 'common.all',
},
{
type: CONST.SEARCH.DATA_TYPES.TASK,
status: CONST.SEARCH.STATUS.TASK.OUTSTANDING,
icon: Expensicons.Hourglass,
text: 'common.outstanding',
},
{
type: CONST.SEARCH.DATA_TYPES.TASK,
status: CONST.SEARCH.STATUS.TASK.COMPLETED,
icon: Expensicons.Checkbox,
text: 'search.filters.completed',
},
];

function getOptions(type: SearchDataTypes, groupBy: SearchGroupBy | undefined) {
switch (type) {
case CONST.SEARCH.DATA_TYPES.INVOICE:
Expand All @@ -206,6 +227,8 @@ function getOptions(type: SearchDataTypes, groupBy: SearchGroupBy | undefined) {
return tripOptions;
case CONST.SEARCH.DATA_TYPES.CHAT:
return chatOptions;
case CONST.SEARCH.DATA_TYPES.TASK:
return taskOptions;
case CONST.SEARCH.DATA_TYPES.EXPENSE:
default:
return groupBy === CONST.SEARCH.GROUP_BY.REPORTS ? expenseReportOptions : expenseOptions;
Expand Down
35 changes: 23 additions & 12 deletions src/components/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {useOnyx} from 'react-native-onyx';
import FullPageErrorView from '@components/BlockingViews/FullPageErrorView';
import FullPageOfflineBlockingView from '@components/BlockingViews/FullPageOfflineBlockingView';
import SearchTableHeader from '@components/SelectionList/SearchTableHeader';
import type {ReportActionListItemType, ReportListItemType, TransactionListItemType} from '@components/SelectionList/types';
import type {ReportActionListItemType, ReportListItemType, SearchListItem, TransactionListItemType} from '@components/SelectionList/types';
import SearchRowSkeleton from '@components/Skeletons/SearchRowSkeleton';
import useLocalize from '@hooks/useLocalize';
import useMobileSelectionMode from '@hooks/useMobileSelectionMode';
Expand All @@ -32,6 +32,7 @@ import {
isReportListItemType,
isSearchDataLoaded,
isSearchResultsEmpty as isSearchResultsEmptyUtil,
isTaskListItemType,
isTransactionListItemType,
shouldShowEmptyState,
shouldShowYear as shouldShowYearUtil,
Expand Down Expand Up @@ -78,12 +79,14 @@ function mapToTransactionItemWithSelectionInfo(item: TransactionListItemType, se
return {...item, shouldAnimateInHighlight, isSelected: selectedTransactions[item.keyForList]?.isSelected && canSelectMultiple};
}

function mapToItemWithSelectionInfo(
item: TransactionListItemType | ReportListItemType | ReportActionListItemType,
selectedTransactions: SelectedTransactions,
canSelectMultiple: boolean,
shouldAnimateInHighlight: boolean,
) {
function mapToItemWithSelectionInfo(item: SearchListItem, selectedTransactions: SelectedTransactions, canSelectMultiple: boolean, shouldAnimateInHighlight: boolean) {
if (isTaskListItemType(item)) {
return {
...item,
shouldAnimateInHighlight,
};
}

if (isReportActionListItemType(item)) {
return {
...item,
Expand Down Expand Up @@ -158,7 +161,6 @@ function Search({queryJSON, currentSearchResults, lastNonEmptySearchResults, onS
const shouldGroupByReports = groupBy === CONST.SEARCH.GROUP_BY.REPORTS;

const {canUseTableReportView} = usePermissions();
const canSelectMultiple = isSmallScreenWidth ? !!selectionMode?.isEnabled : true;

useEffect(() => {
clearSelectedTransactions(hash);
Expand Down Expand Up @@ -327,7 +329,7 @@ function Search({queryJSON, currentSearchResults, lastNonEmptySearchResults, onS
}, [isFocused, data, searchResults?.search?.hasMoreResults, selectedTransactions, setExportMode, setShouldShowExportModeOption, shouldGroupByReports]);

const openReport = useCallback(
(item: TransactionListItemType | ReportListItemType | ReportActionListItemType, isOpenedAsReport?: boolean) => {
(item: SearchListItem, isOpenedAsReport?: boolean) => {
const isFromSelfDM = item.reportID === CONST.REPORT.UNREPORTED_REPORTID;
const isTransactionItem = isTransactionListItemType(item);

Expand Down Expand Up @@ -407,7 +409,11 @@ function Search({queryJSON, currentSearchResults, lastNonEmptySearchResults, onS

const ListItem = getListItem(type, status, shouldGroupByReports);
const sortedData = getSortedSections(type, status, data, sortBy, sortOrder, shouldGroupByReports);

const isChat = type === CONST.SEARCH.DATA_TYPES.CHAT;
const isTask = type === CONST.SEARCH.DATA_TYPES.TASK;
const canSelectMultiple = !isChat && !isTask && isLargeScreenWidth;

const sortedSelectedData = sortedData.map((item) => {
const baseKey = isChat
? `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${(item as ReportActionListItemType).reportActionID}`
Expand Down Expand Up @@ -453,10 +459,13 @@ function Search({queryJSON, currentSearchResults, lastNonEmptySearchResults, onS
);
}

const toggleTransaction = (item: TransactionListItemType | ReportListItemType | ReportActionListItemType) => {
const toggleTransaction = (item: SearchListItem) => {
if (isReportActionListItemType(item)) {
return;
}
if (isTaskListItemType(item)) {
return;
}
if (isTransactionListItemType(item)) {
if (!item.keyForList) {
return;
Expand Down Expand Up @@ -518,6 +527,7 @@ function Search({queryJSON, currentSearchResults, lastNonEmptySearchResults, onS

const shouldShowYear = shouldShowYearUtil(searchResults?.data);
const shouldShowSorting = !Array.isArray(status) && !shouldGroupByReports;
const shouldShowTableHeader = isLargeScreenWidth && !isChat;

return (
<SearchScopeProvider isOnSearch>
Expand All @@ -528,11 +538,12 @@ function Search({queryJSON, currentSearchResults, lastNonEmptySearchResults, onS
onSelectRow={openReport}
onCheckboxPress={toggleTransaction}
onAllCheckboxPress={toggleAllTransactions}
canSelectMultiple={type !== CONST.SEARCH.DATA_TYPES.CHAT && canSelectMultiple}
canSelectMultiple={canSelectMultiple}
shouldPreventLongPressRow={isChat}
SearchTableHeader={
!isLargeScreenWidth ? undefined : (
!shouldShowTableHeader ? undefined : (
<SearchTableHeader
canSelectMultiple={canSelectMultiple}
data={searchResults?.data}
metadata={searchResults?.search}
onSortPress={onSortPress}
Expand Down
Loading
Loading