Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2b07146
Thread formatPhoneNumber through report preview helpers
marufsharifi Aug 10, 2026
156b485
Merge branch 'main' into fix/66327-report-utils-part-29
marufsharifi Aug 10, 2026
7b8c7be
Thread formatPhoneNumber through report preview builders
marufsharifi Aug 10, 2026
a251319
Propagate phone formatting through report preview actions
marufsharifi Aug 12, 2026
6f77bc7
Merge branch 'main' into fix/66327-report-utils-part-29
marufsharifi Aug 12, 2026
ca6571b
Merge branch 'main' into fix/66327-report-utils-part-29
marufsharifi Aug 12, 2026
18abcd6
Pass formatPhoneNumber through approval and payment flows
marufsharifi Aug 12, 2026
0d72a8d
Pass phone formatter through payment and report flows
marufsharifi Aug 12, 2026
972b9c9
Fix typecheck for search reject and upgrade report helpers
marufsharifi Aug 13, 2026
37c9969
Fix test mocks for formatPhoneNumber support
marufsharifi Aug 13, 2026
fa01873
fixed lint failure
marufsharifi Aug 13, 2026
0dff62f
Fix createNewReport and rejectMoneyRequest type signatures
marufsharifi Aug 13, 2026
bdc0efd
Fix React Compiler deps for phone formatting
marufsharifi Aug 13, 2026
4515c8d
Merge branch 'main' into fix/66327-report-utils-part-29
marufsharifi Aug 17, 2026
9f95689
Fix report creation type errors in search router and IOU tests
marufsharifi Aug 17, 2026
b27c3ab
Merge branch 'main' into fix/66327-report-utils-part-29
marufsharifi Aug 17, 2026
805e31b
resolved the lint errors
marufsharifi Aug 17, 2026
f03337a
Fix useCreateNavigationSuggestions test expectation
marufsharifi Aug 17, 2026
3810672
fix eslint unsafe any in create navigation suggestions test
marufsharifi Aug 18, 2026
895929b
Merge branch 'main' into fix/66327-report-utils-part-29
marufsharifi Aug 18, 2026
75ee9cd
refactor report and search action params
marufsharifi Aug 18, 2026
3a68d85
docs: add field comments for action param types
marufsharifi Aug 18, 2026
6032d72
chore: rename RejectMoneyRequest param type
marufsharifi Aug 18, 2026
14d4858
Merge branch 'main' into fix/66327-report-utils-part-29
marufsharifi Aug 20, 2026
c6335e8
fix: pass formatPhoneNumber to report workflow
marufsharifi Aug 20, 2026
fc1d697
Fix TypeScript errors in report workflow actions
marufsharifi Aug 20, 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
2 changes: 1 addition & 1 deletion src/components/AvatarWithDisplayName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ function AvatarWithDisplayName({
const title = getReportName(report, getReportNameFromNames(derivedReportNames, report?.reportID));
const isParentReportArchived = useReportIsArchived(report?.parentReportID);
const subtitle = getChatRoomSubtitle(report, policy, conciergeReportID, translate, true, isReportArchived);
const parentNavigationSubtitleData = getParentNavigationSubtitle(report, policy, conciergeReportID, translate, derivedParentReportName, isParentReportArchived);
const parentNavigationSubtitleData = getParentNavigationSubtitle(report, policy, conciergeReportID, translate, formatPhoneNumber, derivedParentReportName, isParentReportArchived);
const isMoneyRequestOrReport = isMoneyRequestReport(report) || isMoneyRequest(report) || isTrackExpenseReport(report) || isInvoiceReport(report);
const ownerPersonalDetails = getPersonalDetailsForAccountIDs(report?.ownerAccountID ? [report.ownerAccountID] : [], personalDetails);
const displayNamesWithTooltips = getDisplayNamesWithTooltips(Object.values(ownerPersonalDetails), false, localeCompare, formatPhoneNumber, translate);
Expand Down
4 changes: 3 additions & 1 deletion src/components/KYCWall/BaseKYCWall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function KYCWall({
);
const [doesSubmitterPersonalDetailExist] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: doesSubmitterPersonalDetailExistSelector});

const {translate} = useLocalize();
const {translate, formatPhoneNumber} = useLocalize();
const {getCurrencyDecimals} = useCurrencyListActions();
const currentUserDetails = useCurrentUserPersonalDetails();
const currentUserAccountID = currentUserDetails.accountID;
Expand Down Expand Up @@ -222,6 +222,7 @@ function KYCWall({
reportActionsList: filteredReportActions,
doesEmployeePersonalDetailExist: doesSubmitterPersonalDetailExist ?? false,
getCurrencyDecimals,
formatPhoneNumber,
}) ?? {};
if (policyID && iouReport?.policyID) {
savePreferredPaymentMethod(iouReport.policyID, policyID, CONST.LAST_PAYMENT_METHOD.IOU, lastPaymentMethod?.[iouReport?.policyID]);
Expand Down Expand Up @@ -290,6 +291,7 @@ function KYCWall({
conciergeChat,
localCurrency,
getCurrencyDecimals,
formatPhoneNumber,
],
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function MoneyReportHeaderSecondaryActionsInner({reportID, primaryAction, isRepo
const {isPaidAnimationRunning, isApprovedAnimationRunning, startAnimation, startApprovedAnimation, startSubmittingAnimation} = usePaymentAnimationsContext();
const {openHoldMenu, openPDFDownload, openHoldEducational, openRejectModal} = useMoneyReportHeaderModals();

const {translate, localeCompare} = useLocalize();
const {translate, localeCompare, formatPhoneNumber} = useLocalize();
const isInSidePanel = useIsInSidePanel();
const kycWallRef = useContext(KYCWallContext);

Expand Down Expand Up @@ -219,6 +219,7 @@ function MoneyReportHeaderSecondaryActionsInner({reportID, primaryAction, isRepo
chatReportActions: getChatReportActions(payAsBusiness),
delegateAccountID,
isTrackIntentUser,
formatPhoneNumber,
});
} else {
startAnimation();
Expand Down Expand Up @@ -246,6 +247,7 @@ function MoneyReportHeaderSecondaryActionsInner({reportID, primaryAction, isRepo
delegateAccountID,
isTrackIntentUser,
conciergeChat,
formatPhoneNumber,
});
if (currentSearchQueryJSON && !isOffline) {
search({
Expand Down Expand Up @@ -433,6 +435,7 @@ function MoneyReportHeaderSecondaryActionsInner({reportID, primaryAction, isRepo
const runPaymentSelection = () =>
selectPaymentType({
getCurrencyDecimals,
formatPhoneNumber,
event,
iouPaymentType,
triggerKYCFlow,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type PayPrimaryActionProps = {
function PayPrimaryAction({reportID, chatReportID}: PayPrimaryActionProps) {
const {isPaidAnimationRunning, isApprovedAnimationRunning, stopAnimation, startAnimation, startApprovedAnimation} = usePaymentAnimationsContext();
const {isOffline} = useNetwork();
const {translate} = useLocalize();
const {translate, formatPhoneNumber} = useLocalize();
const {accountID, email, login: currentUserLogin, localCurrencyCode} = useCurrentUserPersonalDetails();
const delegateAccountID = useDelegateAccountID();
const {isDelegateAccessRestricted} = useDelegateNoAccessState();
Expand Down Expand Up @@ -164,6 +164,7 @@ function PayPrimaryAction({reportID, chatReportID}: PayPrimaryActionProps) {
chatReportActions: getChatReportActions(payAsBusiness),
delegateAccountID,
isTrackIntentUser,
formatPhoneNumber,
});
} else {
startAnimation();
Expand All @@ -189,6 +190,7 @@ function PayPrimaryAction({reportID, chatReportID}: PayPrimaryActionProps) {
delegateAccountID,
isTrackIntentUser,
conciergeChat,
formatPhoneNumber,
});
if (currentSearchQueryJSON && !isOffline) {
search({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function SubmitPrimaryAction({reportID}: SubmitPrimaryActionProps) {

function SubmitPrimaryActionContent({reportID}: SubmitPrimaryActionProps) {
const {isSubmittingAnimationRunning, stopAnimation, startSubmittingAnimation} = usePaymentAnimationsContext();
const {translate} = useLocalize();
const {translate, formatPhoneNumber} = useLocalize();
const {getCurrencyDecimals} = useCurrencyListActions();
const {isOffline} = useNetwork();
const {accountID, email} = useCurrentUserPersonalDetails();
Expand Down Expand Up @@ -195,6 +195,7 @@ function SubmitPrimaryActionContent({reportID}: SubmitPrimaryActionProps) {
// Submit via PDF submits the report to the submitter (self); the backend keys off this to generate the PDF.
managerEmail: shouldExportToPDF ? email : undefined,
isTrackIntentUser,
formatPhoneNumber,
});
if (currentSearchQueryJSON && !isOffline) {
search({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {useMoneyReportHeaderModals} from '@components/MoneyReportHeaderModalsCon
import {useCurrencyListActions} from '@hooks/useCurrencyList';
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
import useDelegateAccountID from '@hooks/useDelegateAccountID';
import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import usePermissions from '@hooks/usePermissions';
import useTransactionsAndViolationsForReport from '@hooks/useTransactionsAndViolationsForReport';
Expand All @@ -25,6 +26,7 @@ function useConfirmApproval(reportID: string | undefined, startApprovedAnimation
const {accountID, email} = useCurrentUserPersonalDetails();
const {getCurrencyDecimals} = useCurrencyListActions();
const {isBetaEnabled} = usePermissions();
const {formatPhoneNumber} = useLocalize();
const {isDelegateAccessRestricted} = useDelegateNoAccessState();
const {showDelegateNoAccessModal} = useDelegateNoAccessActions();
const {openHoldMenu} = useMoneyReportHeaderModals();
Expand Down Expand Up @@ -76,6 +78,7 @@ function useConfirmApproval(reportID: string | undefined, startApprovedAnimation
delegateEmail,
delegateAccountID,
isTrackIntentUser,
formatPhoneNumber,
});
}
};
Expand Down
20 changes: 11 additions & 9 deletions src/components/Navigation/QuickCreationActionsBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import {View} from 'react-native';

function QuickCreationActionsBar() {
const styles = useThemeStyles();
const {translate} = useLocalize();
const {translate, formatPhoneNumber} = useLocalize();
const icons = useMemoizedLazyExpensifyIcons(['ReceiptPlus', 'DocumentPlus', 'LocationAdd', 'LuggageWithLinesPlus']);

const [session] = useOnyx(ONYXKEYS.SESSION);
Expand Down Expand Up @@ -99,25 +99,27 @@ function QuickCreationActionsBar() {
return;
}

const {reportID: createdReportID} = createNewReport(
currentUserPersonalDetails,
hasViolations,
const {reportID: createdReportID} = createNewReport({
ownerPersonalDetails: currentUserPersonalDetails,
hasViolationsParam: hasViolations,
isASAPSubmitBetaEnabled,
defaultChatEnabledPolicy,
allBetas,
policy: defaultChatEnabledPolicy,
betas: allBetas,
isTrackIntentUser,
getCurrencyDecimals,
false,
shouldNotifyNewAction: false,
formatPhoneNumber,
shouldDismissEmptyReportsConfirmation,
);
options: {},
});
// Navigate to the Reports page first so getCreateReportRoute() resolves against
// the Search/Reports fullscreen context before opening the created report modal.
Navigation.navigate(getReportsRootRoute());
Navigation.setNavigationActionToMicrotaskQueue(() => {
Navigation.navigate(getCreateReportRoute({reportID: createdReportID}));
});
},
[currentUserPersonalDetails, hasViolations, defaultChatEnabledPolicy, isASAPSubmitBetaEnabled, allBetas, isTrackIntentUser, getCurrencyDecimals],
[currentUserPersonalDetails, hasViolations, defaultChatEnabledPolicy, isASAPSubmitBetaEnabled, allBetas, isTrackIntentUser, getCurrencyDecimals, formatPhoneNumber],
);

const {openCreateReportConfirmation} = useCreateEmptyReportConfirmation({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import useReportPreviewActionButtonData from './useReportPreviewActionButtonData

function PayActionButton() {
const {isOffline} = useNetwork();
const {translate} = useLocalize();
const {translate, formatPhoneNumber} = useLocalize();
const currentUserDetails = useCurrentUserPersonalDetails();
const currentUserAccountID = currentUserDetails.accountID;
const currentUserEmail = currentUserDetails.email ?? '';
Expand Down Expand Up @@ -122,6 +122,7 @@ function PayActionButton() {
chatReportActions: getChatReportActions(payAsBusiness),
delegateAccountID,
isTrackIntentUser,
formatPhoneNumber,
});
} else {
payMoneyRequest({
Expand All @@ -146,6 +147,7 @@ function PayActionButton() {
delegateAccountID,
isTrackIntentUser,
conciergeChat,
formatPhoneNumber,
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function SubmitActionButton() {
}

function SubmitActionButtonContent() {
const {translate} = useLocalize();
const {translate, formatPhoneNumber} = useLocalize();
const {getCurrencyDecimals} = useCurrencyListActions();
const {showConfirmModal} = useConfirmModal();
const currentUserDetails = useCurrentUserPersonalDetails();
Expand Down Expand Up @@ -132,6 +132,7 @@ function SubmitActionButtonContent() {
delegateAccountID,
submitterLogin,
isTrackIntentUser,
formatPhoneNumber,
});
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {useDelegateNoAccessActions, useDelegateNoAccessState} from '@components/

import {useCurrencyListActions} from '@hooks/useCurrencyList';
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import usePermissions from '@hooks/usePermissions';

Expand All @@ -26,6 +27,7 @@ import {useReportPreviewActions, useReportPreviewActionState} from './MoneyReque
function useConfirmApproveReportAction(actionButtonData: ReturnType<typeof useReportPreviewActionButtonData>, transactions: Transaction[], hasViolations: boolean) {
const currentUserDetails = useCurrentUserPersonalDetails();
const {getCurrencyDecimals} = useCurrencyListActions();
const {formatPhoneNumber} = useLocalize();
const {isBetaEnabled} = usePermissions();
const {isDelegateAccessRestricted} = useDelegateNoAccessState();
const {showDelegateNoAccessModal} = useDelegateNoAccessActions();
Expand Down Expand Up @@ -60,6 +62,7 @@ function useConfirmApproveReportAction(actionButtonData: ReturnType<typeof useRe
delegateEmail,
delegateAccountID,
isTrackIntentUser,
formatPhoneNumber,
});
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import SettlementButton from '@components/SettlementButton';
import type {PaymentActionParams} from '@components/SettlementButton/types';

import {useCurrencyListActions} from '@hooks/useCurrencyList';
import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
import useOnyx from '@hooks/useOnyx';
import {getParticipantsInvoiceReport} from '@hooks/useParticipantsInvoiceReport';
Expand Down Expand Up @@ -41,6 +42,7 @@ type PayActionCellProps = {

function PayActionCell({isLoading, policyID, reportID, hash, amount, shouldDisablePointerEvents, chatReport}: PayActionCellProps) {
const styles = useThemeStyles();
const {formatPhoneNumber} = useLocalize();
const {getCurrencyDecimals, convertToDisplayString} = useCurrencyListActions();
const {isOffline} = useNetwork();
const {isDelegateAccessRestricted} = useDelegateNoAccessState();
Expand Down Expand Up @@ -143,6 +145,7 @@ function PayActionCell({isLoading, policyID, reportID, hash, amount, shouldDisab
chatReportActions,
delegateAccountID,
isTrackIntentUser,
formatPhoneNumber,
});
return;
}
Expand Down Expand Up @@ -180,6 +183,7 @@ function PayActionCell({isLoading, policyID, reportID, hash, amount, shouldDisab
delegateAccountID,
isTrackIntentUser,
conciergeChat,
formatPhoneNumber,
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function ExpenseReportListItemInner<TItem extends ListItem>({
* by its own key only while it has none.
*/
const {isSelectAllChecked: isSelected, isIndeterminate} = useGroupCheckboxState({groupKey: item.keyForList, groupTransactions: reportItem.transactions ?? []});
const {translate, dateFnsLocale} = useLocalize();
const {translate, dateFnsLocale, formatPhoneNumber} = useLocalize();
const {getCurrencyDecimals, convertToDisplayString} = useCurrencyListActions();
const {isLargeScreenWidth} = useResponsiveLayout();
const {currentSearchHash, currentSearchKey} = useSearchQueryContext();
Expand Down Expand Up @@ -306,6 +306,7 @@ function ExpenseReportListItemInner<TItem extends ListItem>({
// every row on unrelated violation changes.
allViolations: liveViolationsForSnapshotTransactions,
conciergeChat,
formatPhoneNumber,
});
}, [
currentSearchHash,
Expand Down Expand Up @@ -349,6 +350,7 @@ function ExpenseReportListItemInner<TItem extends ListItem>({
isTrackIntentUser,
liveViolationsForSnapshotTransactions,
conciergeChat,
formatPhoneNumber,
]);

const handleSelectionButtonPress = useCallback(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ function ReportListItemHeaderInner<TItem extends ListItem>({
});
const {isDelegateAccessRestricted} = useDelegateNoAccessState();
const {showDelegateNoAccessModal} = useDelegateNoAccessActions();
const {translate} = useLocalize();
const {translate, formatPhoneNumber} = useLocalize();
const {getCurrencyDecimals} = useCurrencyListActions();
const {showConfirmModal} = useConfirmModal();
const {isSelected} = useRowSelection(reportItem.keyForList);
Expand Down Expand Up @@ -340,6 +340,7 @@ function ReportListItemHeaderInner<TItem extends ListItem>({
isTrackIntentUser,
allViolations,
conciergeChat,
formatPhoneNumber,
});
};
return !isLargeScreenWidth ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function TransactionListItemInner<TItem extends ListItem>({

const {isDelegateAccessRestricted} = useDelegateNoAccessState();
const {showDelegateNoAccessModal} = useDelegateNoAccessActions();
const {translate} = useLocalize();
const {translate, formatPhoneNumber} = useLocalize();
const {getCurrencyDecimals} = useCurrencyListActions();
const {showConfirmModal} = useConfirmModal();
const openReportSubmitToPopover = useOpenReportSubmitToPopover();
Expand Down Expand Up @@ -246,6 +246,7 @@ function TransactionListItemInner<TItem extends ListItem>({
isTrackIntentUser,
allViolations,
conciergeChat,
formatPhoneNumber,
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import {View} from 'react-native';

function SearchActionsBarCreateButton() {
const styles = useThemeStyles();
const {translate} = useLocalize();
const {translate, formatPhoneNumber} = useLocalize();
const expensifyIcons = useMemoizedLazyExpensifyIcons(['Plus', 'Location', 'Document', 'Receipt', 'Coins', 'Cash', 'Transfer', 'MoneyCircle']);

const createButtonRef = useRef<View>(null);
Expand Down Expand Up @@ -82,17 +82,19 @@ function SearchActionsBarCreateButton() {
return;
}

const {reportID: createdReportID} = createNewReport(
currentUserPersonalDetails,
hasViolations,
const {reportID: createdReportID} = createNewReport({
ownerPersonalDetails: currentUserPersonalDetails,
hasViolationsParam: hasViolations,
isASAPSubmitBetaEnabled,
defaultChatEnabledPolicy,
allBetas,
policy: defaultChatEnabledPolicy,
betas: allBetas,
isTrackIntentUser,
getCurrencyDecimals,
false,
shouldNotifyNewAction: false,
formatPhoneNumber,
shouldDismissEmptyReportsConfirmation,
);
options: {},
});
Navigation.setNavigationActionToMicrotaskQueue(() => {
Navigation.navigate(
isSearchTopmostFullScreenRoute()
Expand All @@ -101,7 +103,7 @@ function SearchActionsBarCreateButton() {
);
});
},
[currentUserPersonalDetails, hasViolations, defaultChatEnabledPolicy, isASAPSubmitBetaEnabled, allBetas, isTrackIntentUser, getCurrencyDecimals],
[currentUserPersonalDetails, hasViolations, defaultChatEnabledPolicy, isASAPSubmitBetaEnabled, allBetas, isTrackIntentUser, getCurrencyDecimals, formatPhoneNumber],
);

const {openCreateReportConfirmation} = useCreateEmptyReportConfirmation({
Expand Down
Loading
Loading