Skip to content

Commit

Permalink
Merge pull request #46220 from Expensify/rodrigo-followup-45511
Browse files Browse the repository at this point in the history
Removes SearchActionOptionsUtils file
  • Loading branch information
carlosmiceli authored Jul 25, 2024
2 parents 6cf5472 + 1710fc3 commit b479341
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 31 deletions.
16 changes: 0 additions & 16 deletions src/components/Search/SearchActionOptionsUtils.tsx

This file was deleted.

30 changes: 15 additions & 15 deletions src/components/Search/SearchPageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import ROUTES from '@src/ROUTES';
import type {SearchReport} from '@src/types/onyx/SearchResults';
import type DeepValueOf from '@src/types/utils/DeepValueOf';
import type IconAsset from '@src/types/utils/IconAsset';
import getDownloadOption from './SearchActionOptionsUtils';
import {useSearchContext} from './SearchContext';
import type {SearchStatus, SelectedTransactions} from './types';

Expand Down Expand Up @@ -74,22 +73,23 @@ function SearchPageHeader({

const options: Array<DropdownOption<SearchHeaderOptionValue>> = [];

// Because of some problems with the lib we use for download on native we are only enabling download for web, we should remove the SearchActionOptionsUtils files when https://github.com/Expensify/App/issues/45511 is done
const downloadOption = getDownloadOption(translate('common.download'), () => {
if (isOffline) {
setOfflineModalOpen?.();
return;
}

SearchActions.exportSearchItemsToCSV(status, selectedReports, selectedTransactionsKeys, [activeWorkspaceID ?? ''], () => {
setDownloadErrorModalOpen?.();
});
options.push({
icon: Expensicons.Download,
text: translate('common.download'),
value: CONST.SEARCH.BULK_ACTION_TYPES.EXPORT,
shouldCloseModalOnSelect: true,
onSelected: () => {
if (isOffline) {
setOfflineModalOpen?.();
return;
}

SearchActions.exportSearchItemsToCSV(status, selectedReports, selectedTransactionsKeys, [activeWorkspaceID ?? ''], () => {
setDownloadErrorModalOpen?.();
});
},
});

if (downloadOption) {
options.push(downloadOption);
}

const shouldShowHoldOption = !isOffline && selectedTransactionsKeys.every((id) => selectedTransactions[id].canHold);

if (shouldShowHoldOption) {
Expand Down

0 comments on commit b479341

Please sign in to comment.