From b2c1ec5869f53286c3ceb87645f2f1f6631940f1 Mon Sep 17 00:00:00 2001 From: Adam Grzybowski Date: Mon, 18 Nov 2024 17:56:52 +0100 Subject: [PATCH] adjust linking from search page --- src/components/Search/index.tsx | 7 +++++-- .../Navigation/linkTo/helpers/shouldConvertReportPath.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/Search/index.tsx b/src/components/Search/index.tsx index f3bfa508963f..5cacde7e4f77 100644 --- a/src/components/Search/index.tsx +++ b/src/components/Search/index.tsx @@ -368,11 +368,14 @@ function Search({queryJSON, onSearchListScroll, isSearchScreenFocused, contentCo if (SearchUIUtils.isReportActionListItemType(item)) { const reportActionID = item.reportActionID; - Navigation.navigate(ROUTES.SEARCH_REPORT.getRoute({reportID, reportActionID, backTo})); + + // We always want to open it in RHP + Navigation.navigate(ROUTES.SEARCH_REPORT.getRoute({reportID, reportActionID, backTo}), {reportPathConversionEnabled: false}); return; } - Navigation.navigate(ROUTES.SEARCH_REPORT.getRoute({reportID, backTo})); + // We always want to open it in RHP + Navigation.navigate(ROUTES.SEARCH_REPORT.getRoute({reportID, backTo}), {reportPathConversionEnabled: false}); }; const fetchMoreResults = () => { diff --git a/src/libs/Navigation/linkTo/helpers/shouldConvertReportPath.ts b/src/libs/Navigation/linkTo/helpers/shouldConvertReportPath.ts index 9d4cfcabd18c..a19d3b6cb91c 100644 --- a/src/libs/Navigation/linkTo/helpers/shouldConvertReportPath.ts +++ b/src/libs/Navigation/linkTo/helpers/shouldConvertReportPath.ts @@ -5,7 +5,7 @@ import SCREENS from '@src/SCREENS'; // It's necessary to stay in RHP if we are in RHP report or in fullscreen if we are in fullscreen report. function shouldConvertReportPath(currentFocusedRoute: NavigationPartialRoute, focusedRouteFromPath: NavigationPartialRoute) { // @TODO: Navigating from search central pane could be handled with explicit convert: false option. We would need to add it as option to linkTo. - if (focusedRouteFromPath.name === SCREENS.REPORT && (currentFocusedRoute.name === SCREENS.SEARCH.REPORT_RHP || currentFocusedRoute.name === SCREENS.SEARCH.CENTRAL_PANE)) { + if (focusedRouteFromPath.name === SCREENS.REPORT && currentFocusedRoute.name === SCREENS.SEARCH.REPORT_RHP) { return true; }