Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
dc6c72c
feat: report core dynamic routes
mananjadhav May 9, 2026
1e8d0e2
fix: backwarc compatibility for share url
mananjadhav May 9, 2026
02ea918
fix: lint errors
mananjadhav May 9, 2026
90019ab
fix: update hard coded urls
mananjadhav May 9, 2026
c2383af
refactor: update the path
mananjadhav May 9, 2026
7380ae7
fix: share path duplicate url
mananjadhav May 11, 2026
837926b
fix: update stored path logic
mananjadhav May 11, 2026
61cdc54
fix: remove unused report
mananjadhav May 11, 2026
be8d6d5
fix: lint error
mananjadhav May 11, 2026
d814ea2
revert: Remove the route in state changes
mananjadhav May 11, 2026
7c14379
feat: migrate referral code
mananjadhav May 11, 2026
6db2a1a
fix: route entry screen
mananjadhav May 11, 2026
da55877
fix: old route mapping
mananjadhav May 11, 2026
d3f86a9
Merge branch 'main' of github.com:mananjadhav/App into mj-83365-dr-re…
mananjadhav May 13, 2026
f267295
fix: remove unwanted test stub
mananjadhav May 13, 2026
95f6eef
fix: remove the base path
mananjadhav May 13, 2026
2ce5a7a
fix: lint error
mananjadhav May 13, 2026
91a0d2d
fix: rollback report_id
mananjadhav May 13, 2026
dd3d442
fix: remove incorrect test
mananjadhav May 13, 2026
cf4aa48
Merge branch 'main' of github.com:mananjadhav/App into mj-83365-dr-re…
mananjadhav May 14, 2026
bc4a42b
Merge branch 'main' of github.com:mananjadhav/App into mj-83365-dr-re…
mananjadhav May 18, 2026
58718a1
fix: update the details path
mananjadhav May 18, 2026
56783e1
fix: anonymous route handling
mananjadhav May 18, 2026
d25eac6
fix: lint errors
mananjadhav May 18, 2026
8ee1cb9
fix: add mock
mananjadhav May 18, 2026
38d6b2f
Merge branch 'main' of github.com:mananjadhav/App into mj-83365-dr-re…
mananjadhav May 18, 2026
134c8b4
fix: merge conflict bug
mananjadhav May 18, 2026
1cc5404
Merge branch 'main' of github.com:mananjadhav/App into mj-83365-dr-re…
mananjadhav May 19, 2026
4c77dd1
fix: remove report_with_id
mananjadhav May 19, 2026
16e427b
fix: share code redirection
mananjadhav May 19, 2026
82127e8
fix: remove unused var
mananjadhav May 19, 2026
257ba84
fix: remove report_with_id
mananjadhav May 19, 2026
42499bb
fix: remove active route
mananjadhav May 19, 2026
e31744b
fix: type error
mananjadhav May 19, 2026
c36e5ea
Merge branch 'main' of github.com:mananjadhav/App into mj-83365-dr-re…
mananjadhav May 20, 2026
63000f5
Merge branch 'main' of github.com:mananjadhav/App into mj-83365-dr-re…
mananjadhav May 22, 2026
6b987a4
fix: route mapping
mananjadhav May 22, 2026
9d0f4d7
fix: rename files
mananjadhav May 22, 2026
955b7eb
fix: added fallback for backTo and dynamic route
mananjadhav May 22, 2026
012ba9c
fix: rollback unwanted prop
mananjadhav May 22, 2026
35472d2
fix: add type error
mananjadhav May 22, 2026
d2bf9c1
Merge branch 'main' of github.com:mananjadhav/App into mj-83365-dr-re…
mananjadhav May 26, 2026
115a4d7
fix: remove runAfterInteractions
mananjadhav May 26, 2026
8b998a4
fix: prettier
mananjadhav May 26, 2026
245192e
fix: revert to runAfterInteractions
mananjadhav May 26, 2026
8503677
Merge branch 'mj-83365-dr-report-core-1' of github.com:mananjadhav/Ap…
mananjadhav May 26, 2026
3c4ce8a
Merge branch 'main' of github.com:mananjadhav/App into mj-83365-dr-re…
mananjadhav May 26, 2026
13c8d47
fix: route fixes
mananjadhav May 26, 2026
4098a3c
fix: prettier fix
mananjadhav May 26, 2026
cd9ed94
fix: rollback
mananjadhav May 26, 2026
a398095
fix: back route
mananjadhav May 26, 2026
1453ecd
fix: lint errors
mananjadhav May 26, 2026
cc44d68
fix: added eslint ignore
mananjadhav May 26, 2026
bd7afc9
Merge branch 'main' of github.com:mananjadhav/App into mj-83365-dr-re…
mananjadhav May 26, 2026
5021355
Merge branch 'main' of github.com:mananjadhav/App into mj-83365-dr-re…
mananjadhav May 27, 2026
9c3c6a3
fix: update import path
mananjadhav May 27, 2026
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
4 changes: 2 additions & 2 deletions config/eslint/eslint.seatbelt.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,8 @@
"../../src/pages/Debug/Transaction/DebugTransactionViolations.tsx" "no-restricted-syntax" 1
"../../src/pages/Debug/TransactionViolation/DebugTransactionViolationPage.tsx" "@typescript-eslint/no-deprecated/InteractionManager.runAfterInteractions" 1
"../../src/pages/DynamicReportChangeApproverPage.tsx" "react-hooks/set-state-in-effect" 1
"../../src/pages/DynamicReportDetailsPage.tsx" "@typescript-eslint/no-deprecated/InteractionManager.runAfterInteractions" 1
"../../src/pages/DynamicReportDetailsPage.tsx" "react-hooks/preserve-manual-memoization" 4
"../../src/pages/EnablePayments/AddBankAccount/AddBankAccount.tsx" "@typescript-eslint/no-deprecated/useSubStep" 1
"../../src/pages/EnablePayments/FeesAndTerms/FeesAndTerms.tsx" "@typescript-eslint/no-deprecated/useSubStep" 1
"../../src/pages/EnablePayments/FeesAndTerms/FeesAndTerms.tsx" "no-restricted-syntax" 2
Expand All @@ -463,8 +465,6 @@
"../../src/pages/ReimbursementAccount/USD/CompleteVerification/CompleteVerification.tsx" "@typescript-eslint/no-deprecated/useSubStep" 1
"../../src/pages/ReimbursementAccount/USD/Requestor/PersonalInfo/PersonalInfo.tsx" "@typescript-eslint/no-deprecated/useSubStep" 1
"../../src/pages/ReportDescriptionPage.tsx" "no-restricted-syntax" 1
"../../src/pages/ReportDetailsPage.tsx" "@typescript-eslint/no-deprecated/InteractionManager.runAfterInteractions" 1
"../../src/pages/ReportDetailsPage.tsx" "react-hooks/preserve-manual-memoization" 4
"../../src/pages/ReportParticipantDetailsPage.tsx" "@typescript-eslint/no-deprecated/ConfirmModal" 1
"../../src/pages/RoomMemberDetailsPage.tsx" "@typescript-eslint/no-deprecated/ConfirmModal" 1
"../../src/pages/RoomMembersPage.tsx" "react-hooks/preserve-manual-memoization" 1
Expand Down
94 changes: 61 additions & 33 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const DYNAMIC_ROUTES = {
},
REPORT_SETTINGS_NAME: {
path: 'settings/name',
entryScreens: [SCREENS.REPORT_DETAILS.ROOT],
entryScreens: [SCREENS.REPORT_DETAILS.DYNAMIC_ROOT],
},
REPORT_SETTINGS_WRITE_CAPABILITY: {
path: 'who-can-post',
Expand All @@ -152,13 +152,19 @@ const DYNAMIC_ROUTES = {
SCREENS.RIGHT_MODAL.SEARCH_REPORT,
SCREENS.RIGHT_MODAL.EXPENSE_REPORT,
SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT,
SCREENS.REPORT_DETAILS.ROOT,
SCREENS.REPORT_CHANGE_WORKSPACE.ROOT,
SCREENS.REPORT_DETAILS.DYNAMIC_ROOT,
SCREENS.REPORT_CHANGE_WORKSPACE.DYNAMIC_ROOT,
],
},
EDIT_REPORT_FIELD: {
path: 'edit/policyField/:policyID/:fieldID',
entryScreens: [SCREENS.REPORT, SCREENS.RIGHT_MODAL.SEARCH_REPORT, SCREENS.RIGHT_MODAL.EXPENSE_REPORT, SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT, SCREENS.REPORT_DETAILS.ROOT],
entryScreens: [
SCREENS.REPORT,
SCREENS.RIGHT_MODAL.SEARCH_REPORT,
SCREENS.RIGHT_MODAL.EXPENSE_REPORT,
SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT,
SCREENS.REPORT_DETAILS.DYNAMIC_ROOT,
],
getRoute: (policyID: string, fieldID: string) => `edit/policyField/${policyID}/${encodeURIComponent(fieldID)}` as const,
},
PROFILE: {
Expand Down Expand Up @@ -637,6 +643,35 @@ const DYNAMIC_ROUTES = {
path: 'exit-survey/confirm',
entryScreens: ['*'],
},
REPORT_DETAILS: {
path: 'details',
entryScreens: [SCREENS.RIGHT_MODAL.SEARCH_REPORT, SCREENS.RIGHT_MODAL.EXPENSE_REPORT, SCREENS.REPORT, SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT, SCREENS.SEARCH.ROOT],
},
REPORT_DETAILS_SHARE_CODE: {
path: 'share-code',
entryScreens: [
SCREENS.RIGHT_MODAL.SEARCH_REPORT,
SCREENS.RIGHT_MODAL.EXPENSE_REPORT,
SCREENS.REPORT,
SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT,
SCREENS.SEARCH.ROOT,
SCREENS.REPORT_DETAILS.DYNAMIC_ROOT,
],
},
REFERRAL_DETAILS: {
path: 'referral/:contentType',
entryScreens: ['*'],
getRoute: (contentType: string) => `referral/${contentType}` as const,
},
REPORT_DETAILS_EXPORT: {
path: 'details/export/:connectionName',
entryScreens: [SCREENS.RIGHT_MODAL.SEARCH_REPORT, SCREENS.RIGHT_MODAL.EXPENSE_REPORT, SCREENS.REPORT, SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT, SCREENS.SEARCH.ROOT],
getRoute: (connectionName: ConnectionName) => `details/export/${connectionName as string}` as const,
},
REPORT_CHANGE_WORKSPACE: {
path: 'change-workspace',
entryScreens: [SCREENS.RIGHT_MODAL.SEARCH_REPORT, SCREENS.RIGHT_MODAL.EXPENSE_REPORT, SCREENS.REPORT, SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT, SCREENS.SEARCH.ROOT],
},
TRAVEL_PUBLIC_DOMAIN_ERROR: {
path: 'public-domain-error',
entryScreens: [SCREENS.TRAVEL.MY_TRIPS, SCREENS.WORKSPACE.TRAVEL, SCREENS.SEARCH.ROOT],
Expand Down Expand Up @@ -679,7 +714,13 @@ const DYNAMIC_ROUTES = {
},
REPORT_DESCRIPTION: {
path: 'description',
entryScreens: [SCREENS.REPORT, SCREENS.RIGHT_MODAL.SEARCH_REPORT, SCREENS.RIGHT_MODAL.EXPENSE_REPORT, SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT, SCREENS.REPORT_DETAILS.ROOT],
entryScreens: [
SCREENS.REPORT,
SCREENS.RIGHT_MODAL.SEARCH_REPORT,
SCREENS.RIGHT_MODAL.EXPENSE_REPORT,
SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT,
SCREENS.REPORT_DETAILS.DYNAMIC_ROOT,
],
},
TASK_ASSIGNEE: {
path: 'assignee',
Expand All @@ -692,7 +733,7 @@ const DYNAMIC_ROUTES = {
SCREENS.RIGHT_MODAL.SEARCH_REPORT,
SCREENS.RIGHT_MODAL.EXPENSE_REPORT,
SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT,
SCREENS.REPORT_DETAILS.ROOT,
SCREENS.REPORT_DETAILS.DYNAMIC_ROOT,
SCREENS.DYNAMIC_PROFILE,
],
getRoute: (reportID?: string) => getUrlWithParams('notes', reportID ? {reportID} : {}),
Expand All @@ -705,7 +746,7 @@ const DYNAMIC_ROUTES = {
SCREENS.RIGHT_MODAL.SEARCH_REPORT,
SCREENS.RIGHT_MODAL.EXPENSE_REPORT,
SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT,
SCREENS.REPORT_DETAILS.ROOT,
SCREENS.REPORT_DETAILS.DYNAMIC_ROOT,
SCREENS.DYNAMIC_PROFILE,
SCREENS.DYNAMIC_PRIVATE_NOTES_LIST,
],
Expand Down Expand Up @@ -1329,6 +1370,19 @@ const ROUTES = {
route: 'r/:threadReportID/edit/currency',
getRoute: (threadReportID: string, currency: string, backTo: string) => `r/${threadReportID}/edit/currency?currency=${currency}&backTo=${backTo}` as const,
},
EDIT_REPORT_FIELD_REQUEST: {
route: 'r/:reportID/edit/policyField/:policyID/:fieldID',
getRoute: (reportID: string | undefined, policyID: string | undefined, fieldID: string, backTo?: string) => {
if (!policyID || !reportID) {
Log.warn('Invalid policyID or reportID is used to build the EDIT_REPORT_FIELD_REQUEST route', {
policyID,
reportID,
});
}

return getUrlWithBackToParam(`r/${reportID}/edit/policyField/${policyID}/${encodeURIComponent(fieldID)}` as const, backTo);
},
},
REPORT_WITH_ID_DETAILS_SHARE_CODE: {
route: 'r/:reportID/details/shareCode',
getRoute: (reportID: string | undefined, backTo?: string) => {
Expand Down Expand Up @@ -1367,26 +1421,6 @@ const ROUTES = {

getRoute: (reportID: string, accountID: number, backTo?: string) => getUrlWithBackToParam(`r/${reportID}/participants/${accountID}/role` as const, backTo),
},
REPORT_WITH_ID_DETAILS: {
route: 'r/:reportID/details',
getRoute: (reportID: string | number | undefined, backTo?: string) => {
if (!reportID) {
Log.warn('Invalid reportID is used to build the REPORT_WITH_ID_DETAILS route');
}

return getUrlWithBackToParam(`r/${reportID}/details`, backTo);
},
},
REPORT_WITH_ID_DETAILS_EXPORT: {
route: 'r/:reportID/details/export/:connectionName',

getRoute: (reportID: string, connectionName: ConnectionName, backTo?: string) => getUrlWithBackToParam(`r/${reportID}/details/export/${connectionName as string}` as const, backTo),
},
REPORT_WITH_ID_CHANGE_WORKSPACE: {
route: 'r/:reportID/change-workspace',

getRoute: (reportID: string, backTo?: string) => getUrlWithBackToParam(`r/${reportID}/change-workspace` as const, backTo),
},
REPORT_SETTINGS: {
route: 'r/:reportID/settings',

Expand Down Expand Up @@ -3151,12 +3185,6 @@ const ROUTES = {
route: 'workspaces/:policyID/rules/merchant-rules/:ruleID/preview-matches',
getRoute: (policyID: string, ruleID?: string) => `workspaces/${policyID}/rules/merchant-rules/${ruleID ?? 'new'}/preview-matches` as const,
},
// Referral program promotion
REFERRAL_DETAILS_MODAL: {
route: 'referral/:contentType',

getRoute: (contentType: string, backTo?: string) => getUrlWithBackToParam(`referral/${contentType}`, backTo),
},
SHARE_ROOT: 'share/root',
SHARE_ROOT_SHARE: 'share/root/share',
SHARE_ROOT_SUBMIT: 'share/root/submit',
Expand Down
10 changes: 5 additions & 5 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,13 +526,13 @@ const SCREENS = {
},

REPORT_DETAILS: {
ROOT: 'Report_Details_Root',
SHARE_CODE: 'Report_Details_Share_Code',
EXPORT: 'Report_Details_Export',
DYNAMIC_ROOT: 'Dynamic_Report_Details_Root',
DYNAMIC_SHARE_CODE: 'Dynamic_Report_Details_Share_Code',
DYNAMIC_EXPORT: 'Dynamic_Report_Details_Export',
},

REPORT_CHANGE_WORKSPACE: {
ROOT: 'ReportChangeWorkspace_Root',
DYNAMIC_ROOT: 'Dynamic_Report_Change_Workspace_Root',
},

WORKSPACE_CONFIRMATION: {ROOT: 'Workspace_Confirmation_Root', OWNER_SELECTOR: 'Workspace_Confirmation_Owner_Selector', SUCCESS: 'Workspace_Confirmation_Success'},
Expand Down Expand Up @@ -1003,7 +1003,7 @@ const SCREENS = {
REIMBURSEMENT_ACCOUNT: 'ReimbursementAccount',
REIMBURSEMENT_ACCOUNT_NON_USD: 'Reimbursement_Account_Non_USD',
REIMBURSEMENT_ACCOUNT_ENTER_SIGNER_INFO: 'Reimbursement_Account_Signer_Info',
REFERRAL_DETAILS: 'Referral_Details',
DYNAMIC_REFERRAL_DETAILS: 'Dynamic_Referral_Details',
REPORT_VERIFY_ACCOUNT: 'Report_Verify_Account',
EXPENSE_REPORT_VERIFY_ACCOUNT: 'Expense_Report_Verify_Account',
SHARE: {
Expand Down
4 changes: 2 additions & 2 deletions src/components/AvatarWithDisplayName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ function AvatarWithDisplayName({
}, [parentReportActionActorAccountID, report?.parentReportActionID]);

const goToDetailsPage = () => {
navigateToDetailsPage(report, Navigation.getActiveRoute());
navigateToDetailsPage(report);
};

const navigateToEditReportTitle = (event?: GestureResponderEvent | KeyboardEvent) => {
Expand Down Expand Up @@ -267,7 +267,7 @@ function AvatarWithDisplayName({

if (report?.reportID) {
// Report detail route is added as fallback but based on the current implementation this route won't be executed
Navigation.navigate(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report.reportID));
Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.REPORT_DETAILS.path));
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import {search} from '@libs/actions/Search';
import getNonEmptyStringOnyxID from '@libs/getNonEmptyStringOnyxID';
import getPlatform from '@libs/getPlatform';
import {getTotalAmountForIOUReportPreviewButton} from '@libs/MoneyRequestReportUtils';
import Navigation from '@libs/Navigation/Navigation';
import type {KYCFlowEvent, TriggerKYCFlow, WorkspacePolicyPaymentOption} from '@libs/PaymentUtils';
import {selectPaymentType} from '@libs/PaymentUtils';
import {sortPoliciesByName} from '@libs/PolicyUtils';
Expand Down Expand Up @@ -345,7 +344,7 @@ function MoneyReportHeaderSecondaryActionsInner({reportID, primaryAction, isRepo
icon: expensifyIcons.Info,
sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.VIEW_DETAILS,
onSelected: () => {
navigateToDetailsPage(moneyRequestReport, Navigation.getReportRHPActiveRoute());
navigateToDetailsPage(moneyRequestReport);
},
},
...exportActionEntries,
Expand Down
2 changes: 1 addition & 1 deletion src/components/MoneyRequestHeaderSecondaryActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ function MoneyRequestHeaderSecondaryActions({reportID, onBackButtonPress}: Money
text: translate('iou.viewDetails'),
icon: expensifyIcons.Info,
onSelected: () => {
navigateToDetailsPage(report, Navigation.getActiveRoute());
navigateToDetailsPage(report);
},
},
[CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.DELETE]: {
Expand Down
9 changes: 5 additions & 4 deletions src/components/PromotedActionsBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset';
import useLocalize from '@hooks/useLocalize';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import createDynamicRoute from '@libs/Navigation/helpers/dynamicRoutesUtils/createDynamicRoute';
import Navigation from '@libs/Navigation/Navigation';
import type {IntroSelected} from '@userActions/Report';
import {joinRoom, navigateToAndOpenReport, navigateToAndOpenReportWithAccountIDs, togglePinnedState} from '@userActions/Report';
import {callFunctionIfActionIsAllowed} from '@userActions/Session';
import CONST from '@src/CONST';
import ROUTES from '@src/ROUTES';
import ROUTES, {DYNAMIC_ROUTES} from '@src/ROUTES';
import type {PersonalDetailsList} from '@src/types/onyx';
import type Beta from '@src/types/onyx/Beta';
import type OnyxReport from '@src/types/onyx/Report';
Expand All @@ -25,7 +26,7 @@ type PromotedAction = {
type BasePromotedActions = typeof CONST.PROMOTED_ACTIONS.PIN;

type PromotedActionsType = Record<BasePromotedActions, (report: OnyxReport) => PromotedAction> & {
[CONST.PROMOTED_ACTIONS.SHARE]: (report: OnyxReport, backTo?: string) => PromotedAction;
[CONST.PROMOTED_ACTIONS.SHARE]: (report: OnyxReport) => PromotedAction;
} & {
[CONST.PROMOTED_ACTIONS.MESSAGE]: (params: {
reportID?: string;
Expand Down Expand Up @@ -56,11 +57,11 @@ const PromotedActions = {
translationKey: report.isPinned ? 'common.unPin' : 'common.pin',
onSelected: callFunctionIfActionIsAllowed(() => togglePinnedState(report.reportID, !!report.isPinned)),
}),
share: (report, backTo) => ({
share: () => ({
key: CONST.PROMOTED_ACTIONS.SHARE,
icon: 'QrCode',
translationKey: 'common.share',
onSelected: () => Navigation.navigate(ROUTES.REPORT_WITH_ID_DETAILS_SHARE_CODE.getRoute(report.reportID, backTo)),
onSelected: () => Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.REPORT_DETAILS_SHARE_CODE.path)),
}),
join: (report, currentUserAccountID) => ({
key: CONST.PROMOTED_ACTIONS.JOIN,
Expand Down
5 changes: 3 additions & 2 deletions src/components/ReferralProgramCTA.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import variables from '@styles/variables';
import CONST from '@src/CONST';
import createDynamicRoute from '@src/libs/Navigation/helpers/dynamicRoutesUtils/createDynamicRoute';
import Navigation from '@src/libs/Navigation/Navigation';
import ROUTES from '@src/ROUTES';
import {DYNAMIC_ROUTES} from '@src/ROUTES';
import Icon from './Icon';
import {PressableWithoutFeedback} from './Pressable';
import RenderHTML from './RenderHTML';
Expand Down Expand Up @@ -55,7 +56,7 @@ function ReferralProgramCTA({referralContentType, style, onDismiss}: ReferralPro
<PressableWithoutFeedback
sentryLabel={CONST.SENTRY_LABEL.REFERRAL_PROGRAM.CTA}
onPress={() => {
Navigation.navigate(ROUTES.REFERRAL_DETAILS_MODAL.getRoute(referralContentType, Navigation.getActiveRouteWithoutParams()));
Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.REFERRAL_DETAILS.getRoute(referralContentType), Navigation.getActiveRouteWithoutParams()));
Comment thread
mananjadhav marked this conversation as resolved.
}}
style={[styles.pAbsolute, styles.t0, styles.b0, styles.l0, {right: CLOSE_BUTTON_OFFSET}]}
accessibilityLabel={translate(`referralProgram.${referralContentType}.header`)}
Expand Down
7 changes: 5 additions & 2 deletions src/components/ReportWelcomeText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import usePreferredPolicy from '@hooks/usePreferredPolicy';
import useReportAttributes from '@hooks/useReportAttributes';
import useReportIsArchived from '@hooks/useReportIsArchived';
import useThemeStyles from '@hooks/useThemeStyles';
import createDynamicRoute from '@libs/Navigation/helpers/dynamicRoutesUtils/createDynamicRoute';
import Navigation from '@libs/Navigation/Navigation';
import {getPersonalDetailsForAccountIDs} from '@libs/OptionsListUtils';
import {getReportName} from '@libs/ReportNameUtils';
Expand All @@ -26,7 +27,7 @@ import SidebarUtils from '@libs/SidebarUtils';
import CONST from '@src/CONST';
import type {IOUType} from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import {DYNAMIC_ROUTES} from '@src/ROUTES';
import type {Policy, Report} from '@src/types/onyx';
import RenderHTML from './RenderHTML';
import Text from './Text';
Expand Down Expand Up @@ -87,7 +88,9 @@ function ReportWelcomeText({report, policy}: ReportWelcomeTextProps) {
moneyRequestOptions.includes(CONST.IOU.TYPE.TRACK) ||
moneyRequestOptions.includes(CONST.IOU.TYPE.SPLIT);

const reportDetailsLink = report?.reportID ? `${environmentURL}/${ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report.reportID, Navigation.getReportRHPActiveRoute())}` : '';
const reportRHPActiveRoute = Navigation.getReportRHPActiveRoute();
const reportDetailsPath = reportRHPActiveRoute ? createDynamicRoute(DYNAMIC_ROUTES.REPORT_DETAILS.path, reportRHPActiveRoute) : createDynamicRoute(DYNAMIC_ROUTES.REPORT_DETAILS.path);
const reportDetailsLink = report?.reportID ? `${environmentURL}/${reportDetailsPath}` : '';

let welcomeHeroText = translate('reportActionsView.sayHello');
if (isConciergeChat) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const normalizeReportID = (reportID: ProtectedCurrentRouteReportID) => {
};

type SearchRoute = Omit<Route<string>, 'key'> | undefined;
type RouteWithReportIDInParams<T> = T & {params: ReportDetailsNavigatorParamList[typeof SCREENS.REPORT_DETAILS.ROOT]};
type RouteWithReportIDInParams<T> = T & {params: ReportDetailsNavigatorParamList[typeof SCREENS.REPORT_DETAILS.DYNAMIC_ROOT]};

const getCurrentRouteReportID: (url: string) => string | ProtectedCurrentRouteReportID = (url): string | typeof NO_REPORT_ID_IN_PARAMS | typeof NO_REPORT_ID => {
const route = Navigation.getActiveRouteWithoutParams() as ActiveRoute;
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useExpenseActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ function useExpenseActions({reportID, isReportInSearch = false, backTo, onDuplic
if (!moneyRequestReport) {
return;
}
Navigation.navigate(ROUTES.REPORT_WITH_ID_CHANGE_WORKSPACE.getRoute(moneyRequestReport.reportID, Navigation.getActiveRoute()));
Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.REPORT_CHANGE_WORKSPACE.path));
},
},
[CONST.REPORT.SECONDARY_ACTIONS.MOVE_EXPENSE]: {
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useExportAgainModal.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {ModalActions} from '@components/Modal/Global/ModalContext';
import {exportToIntegration, markAsManuallyExported} from '@libs/actions/Report';
import {getConnectedIntegration, getValidConnectedIntegration} from '@libs/PolicyUtils';
import type {ExportType} from '@pages/inbox/report/ReportDetailsExportPage';
import type {ExportType} from '@pages/inbox/report/DynamicReportDetailsExportPage';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import useConfirmModal from './useConfirmModal';
Expand Down
Loading
Loading