diff --git a/src/CONST/index.ts b/src/CONST/index.ts
index 9c99f51274ec..0f0cdd95c031 100755
--- a/src/CONST/index.ts
+++ b/src/CONST/index.ts
@@ -1072,7 +1072,6 @@ const CONST = {
MAX_COUNT_BEFORE_FOCUS_UPDATE: 30,
MIN_INITIAL_REPORT_ACTION_COUNT: 15,
UNREPORTED_REPORT_ID: '0',
- DEFAULT_REPORT_ID: '1',
SPLIT_REPORT_ID: '-2',
SECONDARY_ACTIONS: {
SUBMIT: 'submit',
diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts
index 57bf7fb6f023..3637ad7772e5 100755
--- a/src/ONYXKEYS.ts
+++ b/src/ONYXKEYS.ts
@@ -561,8 +561,6 @@ const ONYXKEYS = {
/** List of transaction thread IDs used when navigating to prev/next transaction when viewing it in RHP */
TRANSACTION_THREAD_NAVIGATION_REPORT_IDS: 'transactionThreadNavigationReportIDs',
- REPORT_NAVIGATION_LAST_SEARCH_QUERY: 'ReportNavigationLastSearchQuery',
-
/** Timestamp of the last login on iOS */
NVP_LAST_ECASH_IOS_LOGIN: 'nvp_lastECashIOSLogin',
NVP_LAST_IPHONE_LOGIN: 'nvp_lastiPhoneLogin',
@@ -1232,7 +1230,6 @@ type OnyxValuesMapping = {
[ONYXKEYS.NVP_LAST_IPHONE_LOGIN]: string;
[ONYXKEYS.NVP_LAST_ANDROID_LOGIN]: string;
[ONYXKEYS.TRANSACTION_THREAD_NAVIGATION_REPORT_IDS]: string[];
- [ONYXKEYS.REPORT_NAVIGATION_LAST_SEARCH_QUERY]: OnyxTypes.LastSearchParams;
[ONYXKEYS.NVP_INTEGRATION_SERVER_EXPORT_TEMPLATES]: OnyxTypes.ExportTemplate[];
[ONYXKEYS.ONBOARDING_USER_REPORTED_INTEGRATION]: OnboardingAccounting;
[ONYXKEYS.HYBRID_APP]: OnyxTypes.HybridApp;
diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx
index 976d1c632b71..8d4445a6b1e0 100644
--- a/src/components/MoneyReportHeader.tsx
+++ b/src/components/MoneyReportHeader.tsx
@@ -113,7 +113,6 @@ import MoneyReportHeaderStatusBar from './MoneyReportHeaderStatusBar';
import MoneyReportHeaderStatusBarSkeleton from './MoneyReportHeaderStatusBarSkeleton';
import type {MoneyRequestHeaderStatusBarProps} from './MoneyRequestHeaderStatusBar';
import MoneyRequestHeaderStatusBar from './MoneyRequestHeaderStatusBar';
-import MoneyRequestReportNavigation from './MoneyRequestReportView/MoneyRequestReportNavigation';
import type {PopoverMenuItem} from './PopoverMenu';
import type {ActionHandledType} from './ProcessMoneyReportHoldMenu';
import ProcessMoneyReportHoldMenu from './ProcessMoneyReportHoldMenu';
@@ -372,7 +371,6 @@ function MoneyReportHeader({
const isReportInRHP = route.name === SCREENS.SEARCH.REPORT_RHP;
const shouldDisplaySearchRouter = !isReportInRHP || isSmallScreenWidth;
- const isReportInSearch = route.name === SCREENS.SEARCH.MONEY_REQUEST_REPORT;
const confirmPayment = useCallback(
(type?: PaymentMethodType | undefined, payAsBusiness?: boolean, methodID?: number, paymentMethod?: PaymentMethod) => {
@@ -1130,13 +1128,40 @@ function MoneyReportHeader({
);
- const headerNavigation = isReportInSearch ? (
-
- ) : undefined;
+ const moreContentUnfiltered = [
+ shouldShowSelectedTransactionsButton && shouldDisplayNarrowVersion && (
+
+ null}
+ options={selectedTransactionsOptions}
+ customText={translate('workspace.common.selected', {count: selectedTransactionIDs.length})}
+ isSplitButton={false}
+ shouldAlwaysShowDropdownMenu
+ wrapperStyle={styles.w100}
+ />
+
+ ),
+ shouldShowNextStep && !!optimisticNextStep?.message?.length && (
+
+ ),
+ shouldShowNextStep && !optimisticNextStep && !!isLoadingInitialReportActions && !isOffline && ,
+ !!statusBarProps && (
+
+ ),
+ ];
+ const moreContent = moreContentUnfiltered.filter(Boolean);
+ const isMoreContentShown = moreContent.length > 0;
+ const shouldAddGapToContents = moreContent.length > 1;
return (
@@ -1168,39 +1193,14 @@ function MoneyReportHeader({
)}
-
- {shouldDisplayNarrowVersion &&
- (shouldShowSelectedTransactionsButton ? (
-
- null}
- options={selectedTransactionsOptions}
- customText={translate('workspace.common.selected', {count: selectedTransactionIDs.length})}
- isSplitButton={false}
- shouldAlwaysShowDropdownMenu
- wrapperStyle={styles.w100}
- />
-
- ) : (
-
- {!!primaryAction && {primaryActionsImplementation[primaryAction]}}
- {!!applicableSecondaryActions.length && KYCMoreDropdown}
-
- ))}
-
-
-
- {shouldShowNextStep && !!optimisticNextStep?.message?.length && }
- {shouldShowNextStep && !optimisticNextStep && !!isLoadingInitialReportActions && !isOffline && }
- {!!statusBarProps && (
-
- )}
+ {shouldDisplayNarrowVersion && !shouldShowSelectedTransactionsButton && (
+
+ {!!primaryAction && {primaryActionsImplementation[primaryAction]}}
+ {!!applicableSecondaryActions.length && KYCMoreDropdown}
- {headerNavigation}
-
+ )}
+
+ {isMoreContentShown && {moreContent}}
{isHoldMenuVisible && requestType !== undefined && (
diff --git a/src/components/MoneyRequestReportView/MoneyRequestReportNavigation.tsx b/src/components/MoneyRequestReportView/MoneyRequestReportNavigation.tsx
deleted file mode 100644
index 4dc2e2878550..000000000000
--- a/src/components/MoneyRequestReportView/MoneyRequestReportNavigation.tsx
+++ /dev/null
@@ -1,145 +0,0 @@
-import React, {useEffect} from 'react';
-import {View} from 'react-native';
-import PrevNextButtons from '@components/PrevNextButtons';
-import Text from '@components/Text';
-import useLocalize from '@hooks/useLocalize';
-import useOnyx from '@hooks/useOnyx';
-import useThemeStyles from '@hooks/useThemeStyles';
-import {selectArchivedReportsIdSet, selectFilteredReportActions} from '@libs/ReportUtils';
-import {getSections, getSortedSections} from '@libs/SearchUIUtils';
-import Navigation from '@navigation/Navigation';
-import saveLastSearchParams from '@userActions/ReportNavigation';
-import {search} from '@userActions/Search';
-import CONST from '@src/CONST';
-import ONYXKEYS from '@src/ONYXKEYS';
-
-type MoneyRequestReportNavigationProps = {
- reportID?: string;
- shouldDisplayNarrowVersion: boolean;
- backTo?: string;
-};
-
-function MoneyRequestReportNavigation({reportID, shouldDisplayNarrowVersion, backTo}: MoneyRequestReportNavigationProps) {
- const [lastSearchQuery] = useOnyx(ONYXKEYS.REPORT_NAVIGATION_LAST_SEARCH_QUERY, {canBeMissing: true});
- const [currentSearchResults] = useOnyx(`${ONYXKEYS.COLLECTION.SNAPSHOT}${lastSearchQuery?.queryJSON?.hash}`, {canBeMissing: true});
- const [accountID] = useOnyx(ONYXKEYS.SESSION, {canBeMissing: false, selector: (s) => s?.accountID});
-
- const {localeCompare, formatPhoneNumber} = useLocalize();
-
- const [exportReportActions] = useOnyx(ONYXKEYS.COLLECTION.REPORT_ACTIONS, {
- canEvict: false,
- canBeMissing: true,
- selector: selectFilteredReportActions,
- });
-
- const [archivedReportsIdSet = new Set()] = useOnyx(ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS, {
- canBeMissing: true,
- selector: selectArchivedReportsIdSet,
- });
-
- const {type, status, sortBy, sortOrder, groupBy} = lastSearchQuery?.queryJSON ?? {};
- let results: Array = [];
- if (!!type && !!groupBy && !!currentSearchResults?.data && !!currentSearchResults?.search) {
- const temp = getSections(
- type,
- currentSearchResults.data,
- currentSearchResults.search,
- accountID,
- formatPhoneNumber,
- groupBy,
- exportReportActions,
- lastSearchQuery?.searchKey,
- archivedReportsIdSet,
- );
- results = getSortedSections(type, status ?? '', temp, localeCompare, sortBy, sortOrder, groupBy).map((value) => value.reportID);
- }
- const allReports = results;
-
- const currentIndex = allReports.indexOf(reportID ?? CONST.REPORT.DEFAULT_REPORT_ID);
- const allReportsCount = lastSearchQuery?.previousLengthOfResults ?? 0;
-
- const hideNextButton = !lastSearchQuery?.hasMoreResults && currentIndex === allReports.length - 1;
- const hidePrevButton = currentIndex === 0;
- const styles = useThemeStyles();
- const shouldDisplayNavigationArrows = allReports && allReports.length > 1;
-
- useEffect(() => {
- if (!lastSearchQuery?.queryJSON) {
- return;
- }
-
- if (lastSearchQuery.allowPostSearchRecount) {
- saveLastSearchParams({
- ...lastSearchQuery,
- allowPostSearchRecount: false,
- previousLengthOfResults: allReports.length,
- });
- return;
- }
-
- if (currentIndex < allReportsCount - 1) {
- return;
- }
-
- saveLastSearchParams({
- ...lastSearchQuery,
- previousLengthOfResults: allReports.length,
- });
- }, [currentIndex, allReportsCount, allReports.length, lastSearchQuery?.queryJSON, lastSearchQuery]);
-
- const goToReportId = (reportId?: string) => {
- if (!reportId) {
- return;
- }
- Navigation.setParams({
- reportID: reportId,
- backTo: backTo ?? '',
- });
- };
-
- const goToNextReport = () => {
- if (currentIndex === -1 || allReports.length === 0) {
- return '';
- }
- if (currentIndex > allReports.length * 0.75 && lastSearchQuery?.hasMoreResults) {
- const newOffset = (lastSearchQuery.offset ?? 0) + CONST.SEARCH.RESULTS_PAGE_SIZE;
- search({
- queryJSON: lastSearchQuery.queryJSON,
- offset: newOffset,
- prevReports: allReports,
- shouldCalculateTotals: false,
- searchKey: lastSearchQuery.searchKey,
- });
- }
-
- const nextIndex = (currentIndex + 1) % allReports.length;
- goToReportId(allReports.at(nextIndex));
- };
-
- const goToPrevReport = () => {
- if (currentIndex === -1 || allReports.length === 0) {
- return '';
- }
-
- const prevIndex = (currentIndex - 1) % allReports.length;
- goToReportId(allReports.at(prevIndex));
- };
-
- return (
- shouldDisplayNavigationArrows && (
-
- {!shouldDisplayNarrowVersion && {`${currentIndex + 1} of ${allReportsCount}`}}
-
-
- )
- );
-}
-
-MoneyRequestReportNavigation.displayName = 'MoneyRequestReportNavigation';
-
-export default MoneyRequestReportNavigation;
diff --git a/src/components/PrevNextButtons.tsx b/src/components/PrevNextButtons.tsx
index 401a4d39fdb2..23f950d30f52 100644
--- a/src/components/PrevNextButtons.tsx
+++ b/src/components/PrevNextButtons.tsx
@@ -16,10 +16,10 @@ type PrevNextButtonsProps = {
isNextButtonDisabled?: boolean;
/** Moves a user to the next item */
- onNext?: (event?: GestureResponderEvent | KeyboardEvent) => void;
+ onNext: (event?: GestureResponderEvent | KeyboardEvent) => void;
/** Moves a user to the previous item */
- onPrevious?: (event?: GestureResponderEvent | KeyboardEvent) => void;
+ onPrevious: (event?: GestureResponderEvent | KeyboardEvent) => void;
};
function PrevNextButtons({isPrevButtonDisabled, isNextButtonDisabled, onNext, onPrevious}: PrevNextButtonsProps) {
@@ -33,7 +33,7 @@ function PrevNextButtons({isPrevButtonDisabled, isNextButtonDisabled, onNext, on
accessibilityRole={CONST.ROLE.BUTTON}
accessibilityLabel={CONST.ROLE.BUTTON}
disabled={isPrevButtonDisabled}
- style={[styles.h7, styles.mr1, styles.alignItemsCenter, styles.justifyContentCenter]}
+ style={[styles.h10, styles.mr1, styles.alignItemsCenter, styles.justifyContentCenter]}
onPress={onPrevious}
>
@@ -50,7 +50,7 @@ function PrevNextButtons({isPrevButtonDisabled, isNextButtonDisabled, onNext, on
accessibilityRole={CONST.ROLE.BUTTON}
accessibilityLabel={CONST.ROLE.BUTTON}
disabled={isNextButtonDisabled}
- style={[styles.h7, styles.alignItemsCenter, styles.justifyContentCenter]}
+ style={[styles.h10, styles.alignItemsCenter, styles.justifyContentCenter]}
onPress={onNext}
>
diff --git a/src/components/Search/index.tsx b/src/components/Search/index.tsx
index 3822732e88d2..02d2dbd054df 100644
--- a/src/components/Search/index.tsx
+++ b/src/components/Search/index.tsx
@@ -24,8 +24,8 @@ import Log from '@libs/Log';
import isSearchTopmostFullScreenRoute from '@libs/Navigation/helpers/isSearchTopmostFullScreenRoute';
import type {PlatformStackNavigationProp} from '@libs/Navigation/PlatformStackNavigation/types';
import Performance from '@libs/Performance';
-import {getIOUActionForTransactionID} from '@libs/ReportActionsUtils';
-import {canEditFieldOfMoneyRequest, generateReportID, selectArchivedReportsIdSet, selectFilteredReportActions} from '@libs/ReportUtils';
+import {getIOUActionForTransactionID, isExportIntegrationAction, isIntegrationMessageAction} from '@libs/ReportActionsUtils';
+import {canEditFieldOfMoneyRequest, generateReportID, isArchivedReport} from '@libs/ReportUtils';
import {buildCannedSearchQuery, buildSearchQueryString} from '@libs/SearchQueryUtils';
import {
getListItem,
@@ -45,7 +45,7 @@ import {
shouldShowEmptyState,
shouldShowYear as shouldShowYearUtil,
} from '@libs/SearchUIUtils';
-import type {SearchKey} from '@libs/SearchUIUtils';
+import type {ArchivedReportsIDSet, SearchKey} from '@libs/SearchUIUtils';
import {isOnHold, isTransactionPendingDelete} from '@libs/TransactionUtils';
import Navigation, {navigationRef} from '@navigation/Navigation';
import type {SearchFullscreenNavigatorParamList} from '@navigation/types';
@@ -198,14 +198,35 @@ function Search({queryJSON, searchResults, onSearchListScroll, contentContainerS
const [archivedReportsIdSet = new Set()] = useOnyx(ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS, {
canBeMissing: true,
- selector: selectArchivedReportsIdSet,
+ selector: (all): ArchivedReportsIDSet => {
+ const ids = new Set();
+ if (!all) {
+ return ids;
+ }
+
+ const prefixLength = ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS.length;
+ for (const [key, value] of Object.entries(all)) {
+ if (isArchivedReport(value)) {
+ const reportID = key.slice(prefixLength);
+ ids.add(reportID);
+ }
+ }
+ return ids;
+ },
});
// Create a selector for only the reportActions needed to determine if a report has been exported or not, grouped by report
const [exportReportActions] = useOnyx(ONYXKEYS.COLLECTION.REPORT_ACTIONS, {
canEvict: false,
canBeMissing: true,
- selector: selectFilteredReportActions,
+ selector: (allReportActions) => {
+ return Object.fromEntries(
+ Object.entries(allReportActions ?? {}).map(([reportID, reportActionsGroup]) => {
+ const filteredReportActions = Object.values(reportActionsGroup ?? {}).filter((action) => isExportIntegrationAction(action) || isIntegrationMessageAction(action));
+ return [reportID, filteredReportActions];
+ }),
+ );
+ },
});
const {defaultCardFeed} = useCardFeedsForDisplay();
const [accountID] = useOnyx(ONYXKEYS.SESSION, {canBeMissing: false, selector: (s) => s?.accountID});
@@ -295,10 +316,7 @@ function Search({queryJSON, searchResults, onSearchListScroll, contentContainerS
return;
}
- const results = searchResults
- ? getSections(type, searchResults.data, searchResults.search, accountID, formatPhoneNumber, groupBy).map((element) => element?.reportID ?? CONST.REPORT.DEFAULT_REPORT_ID)
- : [];
- handleSearch({queryJSON, searchKey, offset, shouldCalculateTotals, prevReports: results});
+ handleSearch({queryJSON, searchKey, offset, shouldCalculateTotals});
// We don't need to run the effect on change of isFocused.
// eslint-disable-next-line react-compiler/react-compiler
// eslint-disable-next-line react-hooks/exhaustive-deps
@@ -340,8 +358,7 @@ function Search({queryJSON, searchResults, onSearchListScroll, contentContainerS
return [];
}
- const results = getSections(type, searchResults.data, searchResults.search, accountID, formatPhoneNumber, groupBy, exportReportActions, searchKey, archivedReportsIdSet);
- return results;
+ return getSections(type, searchResults.data, searchResults.search, accountID, formatPhoneNumber, groupBy, exportReportActions, searchKey, archivedReportsIdSet);
}, [searchKey, exportReportActions, groupBy, isDataLoaded, searchResults, type, archivedReportsIdSet, formatPhoneNumber, accountID]);
useEffect(() => {
diff --git a/src/components/Search/types.ts b/src/components/Search/types.ts
index 273a62d4dd90..370897cc9bc4 100644
--- a/src/components/Search/types.ts
+++ b/src/components/Search/types.ts
@@ -179,7 +179,6 @@ type SearchParams = {
queryJSON: SearchQueryJSON;
searchKey: SearchKey | undefined;
offset: number;
- prevReports?: string[];
shouldCalculateTotals: boolean;
};
diff --git a/src/libs/API/types.ts b/src/libs/API/types.ts
index 3e7631872854..7bcb1333af84 100644
--- a/src/libs/API/types.ts
+++ b/src/libs/API/types.ts
@@ -1190,7 +1190,6 @@ const SIDE_EFFECT_REQUEST_COMMANDS = {
COMPLETE_HYBRID_APP_ONBOARDING: 'CompleteHybridAppOnboarding',
CONNECT_POLICY_TO_QUICKBOOKS_DESKTOP: 'ConnectPolicyToQuickbooksDesktop',
MERGE_INTO_ACCOUNT_AND_LOGIN: 'MergeIntoAccountAndLogIn',
- SEARCH: 'Search',
// PayMoneyRequestOnSearch only works online (pattern C) and we need to play the success sound only when the request is successful
PAY_MONEY_REQUEST_ON_SEARCH: 'PayMoneyRequestOnSearch',
diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts
index b690c9d1e674..f75198c90f8f 100644
--- a/src/libs/ReportUtils.ts
+++ b/src/libs/ReportUtils.ts
@@ -220,7 +220,6 @@ import {
wasActionTakenByCurrentUser,
} from './ReportActionsUtils';
import type {LastVisibleMessage} from './ReportActionsUtils';
-import type {ArchivedReportsIDSet} from './SearchUIUtils';
import {shouldRestrictUserBillableActions} from './SubscriptionUtils';
import {
getAttendees,
@@ -11425,39 +11424,6 @@ function getMoneyReportPreviewName(action: ReportAction, iouReport: OnyxEntry> | null | undefined): ArchivedReportsIDSet {
- const archivedIDs = new Set();
- if (!all) {
- return archivedIDs;
- }
-
- const prefixLen = ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS.length;
-
- for (const [key, value] of Object.entries(all)) {
- if (isArchivedReport(value)) {
- archivedIDs.add(key.slice(prefixLen));
- }
- }
-
- return archivedIDs;
-}
-
-function selectFilteredReportActions(
- reportActions: Record> | undefined> | null | undefined,
-): Record | undefined {
- if (!reportActions) {
- return {};
- }
-
- return Object.fromEntries(
- Object.entries(reportActions).map(([reportId, actionsGroup]) => {
- const actions = Object.values(actionsGroup ?? {});
- const filteredActions = actions.filter((action): action is ReportAction => isExportIntegrationAction(action) || isIntegrationMessageAction(action));
- return [reportId, filteredActions];
- }),
- );
-}
-
/**
* Returns the translated, human-readable status of the report based on its state and status values.
* The status is determined by the stateNum and statusNum of the report.
@@ -11473,6 +11439,7 @@ function selectFilteredReportActions(
* 6 | 4 | Paid |
* ========================================
*/
+
function getReportStatusTranslation(stateNum?: number, statusNum?: number): string {
if (stateNum === undefined || statusNum === undefined) {
return '';
@@ -11782,8 +11749,6 @@ export {
parseReportRouteParams,
parseReportActionHtmlToText,
requiresAttentionFromCurrentUser,
- selectArchivedReportsIdSet,
- selectFilteredReportActions,
shouldAutoFocusOnKeyPress,
shouldCreateNewMoneyRequestReport,
shouldDisableDetailPage,
diff --git a/src/libs/actions/ReportNavigation.ts b/src/libs/actions/ReportNavigation.ts
deleted file mode 100644
index b95ef1906455..000000000000
--- a/src/libs/actions/ReportNavigation.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import Onyx from 'react-native-onyx';
-import ONYXKEYS from '@src/ONYXKEYS';
-import type LastSearchParams from '@src/types/onyx/ReportNavigation';
-
-function saveLastSearchParams(value: LastSearchParams) {
- Onyx.set(ONYXKEYS.REPORT_NAVIGATION_LAST_SEARCH_QUERY, value);
-}
-
-export default saveLastSearchParams;
diff --git a/src/libs/actions/Search.ts b/src/libs/actions/Search.ts
index e17e00eff0ef..1ec0e841674e 100644
--- a/src/libs/actions/Search.ts
+++ b/src/libs/actions/Search.ts
@@ -28,15 +28,6 @@ import type {PaymentInformation} from '@src/types/onyx/LastPaymentMethod';
import type {ConnectionName} from '@src/types/onyx/Policy';
import type {SearchPolicy, SearchReport, SearchTransaction} from '@src/types/onyx/SearchResults';
import type Nullable from '@src/types/utils/Nullable';
-import saveLastSearchParams from './ReportNavigation';
-
-type OnyxSearchResponse = {
- data: [];
- search: {
- offset: number;
- hasMoreResults: boolean;
- };
-};
function handleActionButtonPress(
hash: number,
@@ -316,13 +307,11 @@ function search({
searchKey,
offset,
shouldCalculateTotals = false,
- prevReports,
}: {
queryJSON: SearchQueryJSON;
searchKey: SearchKey | undefined;
offset?: number;
shouldCalculateTotals?: boolean;
- prevReports?: Array;
}) {
const {optimisticData, finallyData, failureData} = getOnyxLoadingData(queryJSON.hash, queryJSON);
const {flatFilters, ...queryJSONWithoutFlatFilters} = queryJSON;
@@ -330,46 +319,11 @@ function search({
...queryJSONWithoutFlatFilters,
searchKey,
offset,
- filters: queryJSONWithoutFlatFilters.filters ?? null,
shouldCalculateTotals,
};
const jsonQuery = JSON.stringify(query);
- saveLastSearchParams({
- queryJSON,
- offset,
- allowPostSearchRecount: false,
- });
-
- // eslint-disable-next-line rulesdir/no-api-side-effects-method
- API.makeRequestWithSideEffects(READ_COMMANDS.SEARCH, {hash: queryJSON.hash, jsonQuery}, {optimisticData, finallyData, failureData}).then((result) => {
- const response = result?.onyxData?.[0]?.value as OnyxSearchResponse;
- const reports = Object.keys(response?.data ?? {})
- .filter((key) => key.startsWith(ONYXKEYS.COLLECTION.REPORT))
- .map((key) => key.replace(ONYXKEYS.COLLECTION.REPORT, ''));
- if (response?.search?.offset) {
- // Indicates that search results are extended from the Report view (with navigation between reports),
- // using previous results to enable correct counter behavior.
- if (prevReports) {
- saveLastSearchParams({
- queryJSON,
- offset,
- hasMoreResults: !!response?.search?.hasMoreResults,
- previousLengthOfResults: prevReports.length,
- allowPostSearchRecount: false,
- });
- }
- } else {
- // Applies to all searches from the Search View
- saveLastSearchParams({
- queryJSON,
- offset,
- hasMoreResults: !!response?.search?.hasMoreResults,
- previousLengthOfResults: reports.length,
- allowPostSearchRecount: true,
- });
- }
- });
+ API.read(READ_COMMANDS.SEARCH, {hash: queryJSON.hash, jsonQuery}, {optimisticData, finallyData, failureData});
}
/**
diff --git a/src/styles/utils/flex.ts b/src/styles/utils/flex.ts
index 82e41e7d37e1..aafda26f3acd 100644
--- a/src/styles/utils/flex.ts
+++ b/src/styles/utils/flex.ts
@@ -113,10 +113,6 @@ export default {
flexWrap: 'wrap',
},
- flexNoWrap: {
- flexWrap: 'nowrap',
- },
-
flexGrow0: {
flexGrow: 0,
},
diff --git a/src/styles/utils/sizing.ts b/src/styles/utils/sizing.ts
index d9aa4df8ec5e..dab8e474abb6 100644
--- a/src/styles/utils/sizing.ts
+++ b/src/styles/utils/sizing.ts
@@ -13,10 +13,6 @@ export default {
height: '100%',
},
- h7: {
- height: 28,
- },
-
h10: {
height: 40,
},
diff --git a/src/types/onyx/ReportNavigation.ts b/src/types/onyx/ReportNavigation.ts
deleted file mode 100644
index 07c6ef04a7eb..000000000000
--- a/src/types/onyx/ReportNavigation.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-import type {SearchQueryJSON} from '@components/Search/types';
-import type {SearchKey} from '@libs/SearchUIUtils';
-
-/**
- * Represents the parameters from the previous search invocation.
- * This is used to persist search arguments between navigations within reports,
- * and allows loading more search results as the user continues navigating.
- */
-type LastSearchParams = {
- /**
- * The number of results returned in the previous search.
- */
- previousLengthOfResults?: number;
- /**
- * Enables post-search recount based on extra criteria unknown during the initial search.
- */
- allowPostSearchRecount?: boolean;
- /**
- * Indicates whether there are more results available beyond the last search.
- */
- hasMoreResults?: boolean;
-
- /**
- * The full query JSON object that was used in the last search.
- */
- queryJSON: SearchQueryJSON;
- /**
- * The current offset used in pagination for fetching the previous set of results.
- */
- offset?: number;
-
- /**
- *Optional witch field contain search key for last search performed
- */
- searchKey?: SearchKey;
-};
-
-export default LastSearchParams;
diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts
index 9d13fb18e1f9..4aa8b7f0951d 100644
--- a/src/types/onyx/index.ts
+++ b/src/types/onyx/index.ts
@@ -88,7 +88,6 @@ import type ReportActionsDraft from './ReportActionsDraft';
import type ReportActionsDrafts from './ReportActionsDrafts';
import type ReportMetadata from './ReportMetadata';
import type ReportNameValuePairs from './ReportNameValuePairs';
-import type LastSearchParams from './ReportNavigation';
import type ReportNextStep from './ReportNextStep';
import type ReportUserIsTyping from './ReportUserIsTyping';
import type {ReportFieldsViolations, ReportViolationName} from './ReportViolation';
@@ -266,7 +265,6 @@ export type {
TravelProvisioning,
SidePanel,
LastPaymentMethodType,
- LastSearchParams,
ReportAttributesDerivedValue,
ReportTransactionsAndViolationsDerivedValue,
OutstandingReportsByPolicyIDDerivedValue,