Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
0bb3799
Use locale phone formatter in report previews
marufsharifi Sep 24, 2026
1326068
Pass formatPhoneNumber to report preview helpers
marufsharifi Sep 24, 2026
de15c0c
Pass formatPhoneNumber through options list utilities and update rela…
marufsharifi Sep 24, 2026
9399ad5
refactor: use phone utils in report preview
marufsharifi Sep 24, 2026
1ebf37e
Pass formatPhoneNumber through search and participant option builders
marufsharifi Sep 26, 2026
a28c562
fix: pass phone formatter to money request participant options
marufsharifi Sep 26, 2026
5d56c6e
Fixed Lint Failures
marufsharifi Sep 26, 2026
2e6cc12
refactor: group OptionsListUtils formatter callbacks
marufsharifi Sep 26, 2026
2c64556
test: include phone formatter in participant options expectation
marufsharifi Sep 26, 2026
c8f0a37
test: mock phone formatter in participant policy hook
marufsharifi Sep 26, 2026
c1a1f3d
Merge branch 'main' into fix/66327-passes-phone-formatter-in-report-p…
marufsharifi Sep 30, 2026
10f2a41
Pass phone formatter to search options
marufsharifi Sep 30, 2026
ad6892c
fix: group OptionsListUtils localization params
marufsharifi Sep 30, 2026
998f20d
Merge branch 'main' into fix/66327-passes-phone-formatter-in-report-p…
marufsharifi Oct 13, 2026
a6de563
refactor: align phone number formatter arguments in search options an…
marufsharifi Oct 13, 2026
e4f15a6
Fix phone number formatting in search report options
marufsharifi Oct 13, 2026
f3e4466
fix: pass phone formatter to search options
marufsharifi Oct 13, 2026
12bf03f
Merge branch 'main' into fix/66327-passes-phone-formatter-in-report-p…
marufsharifi Oct 15, 2026
b0ba782
test: pass phone formatter to office location preview
marufsharifi Oct 15, 2026
1f0eb08
Merge branch 'main' into fix/66327-passes-phone-formatter-in-report-p…
marufsharifi Oct 16, 2026
6cb3d6a
Merge branch 'main' into fix/66327-passes-phone-formatter-in-report-p…
marufsharifi Oct 17, 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
6 changes: 5 additions & 1 deletion src/components/Search/FilterComponents/InSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function getSelectedOptionData(option: Option & Pick<OptionData, 'reportID'>): O
}

function InSelector({value = [], selectionListTextInputStyle, selectionListStyle, autoFocus, ready = true, footer, onChange}: InSelectorProps) {
const {translate, dateFnsLocale} = useLocalize();
const {translate, dateFnsLocale, formatPhoneNumber} = useLocalize();
const shouldFooterBeInsideList = useShouldFooterBeInsideList();
const {convertToDisplayString, convertToDisplayStringWithoutCurrency} = useCurrencyListActions();
const personalDetails = usePersonalDetails();
Expand Down Expand Up @@ -119,6 +119,7 @@ function InSelector({value = [], selectionListTextInputStyle, selectionListStyle
reportAttributesDerived,
isTrackIntentUser,
pendingDeleteMemberAccountIDs: pendingDeleteMemberAccountIDsByReportID?.[id],
formatPhoneNumber,
}),
),
isSelected,
Expand All @@ -143,6 +144,7 @@ function InSelector({value = [], selectionListTextInputStyle, selectionListStyle
translate,
currentUserAccountID,
rules,
formatPhoneNumber,
},
);
return {...report, alternateText};
Expand Down Expand Up @@ -180,6 +182,7 @@ function InSelector({value = [], selectionListTextInputStyle, selectionListStyle
translate,
getReportByID,
rules,
formatPhoneNumber,
}).options;

const chatOptions = filterAndOrderOptions({
Expand All @@ -198,6 +201,7 @@ function InSelector({value = [], selectionListTextInputStyle, selectionListStyle
currentUserAccountID,
},
translate,
formatPhoneNumber,
rules,
activePolicyID,
});
Expand Down
2 changes: 2 additions & 0 deletions src/components/Search/SearchAutocompleteList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ function SearchAutocompleteList({
translate,
getReportByID,
rules,
formatPhoneNumber,
}).options;
const optionsByReportID = new Map(options.recentReports.map((option) => [option.reportID, option]));
return orderedReportIDs.map((reportID) => optionsByReportID.get(reportID)).filter((option): option is OptionData => !!option && !option.isSelfDM);
Expand All @@ -411,6 +412,7 @@ function SearchAutocompleteList({
translate,
getReportByID,
rules,
formatPhoneNumber,
]);

const [isInitialRender, setIsInitialRender] = useState(true);
Expand Down
2 changes: 2 additions & 0 deletions src/components/Search/SearchRouter/SearchRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ function SearchRouter({onRouterClose, shouldHideInputCaret, isSearchRouterDispla
},
isTrackIntentUser,
pendingDeleteMemberAccountIDs: contextualReportPendingDeleteMemberAccountIDs,
formatPhoneNumber,
});
reportForContextualSearch = option;
}
Expand Down Expand Up @@ -334,6 +335,7 @@ function SearchRouter({onRouterClose, shouldHideInputCaret, isSearchRouterDispla
dateFnsLocale,
currentUserAccountID,
convertToDisplayString,
formatPhoneNumber,
convertToDisplayStringWithoutCurrency,
rules,
contextualReportPendingDeleteMemberAccountIDs,
Expand Down
4 changes: 3 additions & 1 deletion src/hooks/useFilteredOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function useFilteredOptions(config: UseFilteredOptionsConfig): UseFilteredOption
const [isTrackIntentUser] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED, {selector: isTrackIntentUserSelector});

// Option building is locale-dependent, so a consumer that stays mounted through a language switch recomputes.
const {preferredLocale, dateFnsLocale} = useLocalize();
const {preferredLocale, dateFnsLocale, formatPhoneNumber} = useLocalize();
const {convertToDisplayString} = useCurrencyListActions();

// Sorted report actions from the RAM_ONLY_SORTED_REPORT_ACTIONS derived value; a new reference on
Expand Down Expand Up @@ -146,6 +146,7 @@ function useFilteredOptions(config: UseFilteredOptionsConfig): UseFilteredOption
deferContactsUntilSearch,
locale: preferredLocale,
pendingDeleteMemberAccountIDsByReportID,
formatPhoneNumber,
},
rules,
undefined,
Expand Down Expand Up @@ -177,6 +178,7 @@ function useFilteredOptions(config: UseFilteredOptionsConfig): UseFilteredOption
pendingDeleteMemberAccountIDsByReportID,
dateFnsLocale,
convertToDisplayString,
formatPhoneNumber,
],
);

Expand Down
3 changes: 3 additions & 0 deletions src/hooks/useMoneyRequestParticipantsPolicyTags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import type {Locale as DateFnsLocale} from 'date-fns';
import type {OnyxEntry} from 'react-native-onyx';

import {useCurrencyListActions} from './useCurrencyList';
import useLocalize from './useLocalize';
import useOnyx from './useOnyx';
import useParticipantsPolicyTags from './useParticipantsPolicyTags';

Expand Down Expand Up @@ -51,6 +52,7 @@ function useMoneyRequestParticipantsPolicyTags({
dateFnsLocale,
}: UseMoneyRequestParticipantsPolicyTagsParams): UseMoneyRequestParticipantsPolicyTagsResult {
const {convertToDisplayString} = useCurrencyListActions();
const {formatPhoneNumber} = useLocalize();
const [rules] = useOnyx(ONYXKEYS.COLLECTION.RULE);
const participants = getMoneyRequestParticipantOptions({
currentUserAccountID,
Expand All @@ -65,6 +67,7 @@ function useMoneyRequestParticipantsPolicyTags({
translate,
convertToDisplayString,
dateFnsLocale,
formatPhoneNumber,
});
const participantsPolicyTags = useParticipantsPolicyTags(participants);

Expand Down
6 changes: 3 additions & 3 deletions src/hooks/useSearchSelector/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ function useSearchSelectorBase({
getReportByID,
...appliedGetValidOptionsConfig,
},
translate,
{translate, formatPhoneNumber},
rules,
);
case CONST.SEARCH_SELECTOR.SEARCH_CONTEXT_SHARE_DESTINATION:
Expand Down Expand Up @@ -409,7 +409,7 @@ function useSearchSelectorBase({
getReportByID,
...appliedGetValidOptionsConfig,
},
translate,
{translate, formatPhoneNumber},
rules,
);
case CONST.SEARCH_SELECTOR.SEARCH_CONTEXT_ATTENDEES:
Expand Down Expand Up @@ -452,7 +452,7 @@ function useSearchSelectorBase({
getReportByID,
...appliedGetValidOptionsConfig,
},
translate,
{translate, formatPhoneNumber},
rules,
);
default:
Expand Down
2 changes: 2 additions & 0 deletions src/libs/IOUAmountSubmission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ function buildReportParticipants(args: SubmitAmountArgs) {
translate,
dateFnsLocale,
convertToDisplayString,
formatPhoneNumber,
rules,
} = args;
const selectedParticipants = getMoneyRequestParticipantsFromReport(report, currentUserPersonalDetails.accountID);
Expand All @@ -296,6 +297,7 @@ function buildReportParticipants(args: SubmitAmountArgs) {
translate,
dateFnsLocale,
convertToDisplayString,
formatPhoneNumber,
},
rules,
// Passing pendingDeleteMemberAccountIDs as undefined is intentional, getMoneyRequestParticipantsFromReport only report-backs policy expense chats, self DMs and invoice rooms.
Expand Down
Loading
Loading