Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function BaseReportActionContextMenu({
'Trashcan',
]);
const StyleUtils = useStyleUtils();
const {translate, getLocalDateFromDatetime} = useLocalize();
const {translate, getLocalDateFromDatetime, formatPhoneNumber} = useLocalize();
// eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
const {shouldUseNarrowLayout, isSmallScreenWidth} = useResponsiveLayout();
const [shouldKeepOpen, setShouldKeepOpen] = useState(false);
Expand Down Expand Up @@ -430,6 +430,7 @@ function BaseReportActionContextMenu({
policy,
policyTags,
translate,
formatPhoneNumber,
harvestReport,
harvestReportOriginalID,
introSelected,
Expand Down
7 changes: 3 additions & 4 deletions src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import EmailUtils from '@libs/EmailUtils';
import {getEnvironmentURL} from '@libs/Environment/Environment';
import fileDownload from '@libs/fileDownload';
import getAttachmentDetails from '@libs/fileDownload/getAttachmentDetails';
import {formatPhoneNumber as formatPhoneNumberPhoneUtils} from '@libs/LocalePhoneNumber';
import {getForReportAction} from '@libs/ModifiedExpenseMessage';
import createDynamicRoute from '@libs/Navigation/helpers/dynamicRoutesUtils/createDynamicRoute';
import Navigation from '@libs/Navigation/Navigation';
Expand Down Expand Up @@ -337,6 +336,7 @@ type ContextMenuActionPayload = {
getLocalDateFromDatetime: LocaleContextProps['getLocalDateFromDatetime'];
policyTags: OnyxEntry<PolicyTagLists>;
translate: LocalizedTranslate;
formatPhoneNumber: LocaleContextProps['formatPhoneNumber'];
harvestReport?: OnyxEntry<ReportType>;
harvestReportOriginalID?: string;
introSelected: OnyxEntry<IntroSelected>;
Expand Down Expand Up @@ -932,6 +932,7 @@ const ContextMenuActions: ContextMenuAction[] = [
getLocalDateFromDatetime,
policyTags,
translate,
formatPhoneNumber,
harvestReport,
harvestReportOriginalID,
currentUserPersonalDetails,
Expand Down Expand Up @@ -1129,9 +1130,7 @@ const ContextMenuActions: ContextMenuAction[] = [
),
);
} else if (isReimbursementQueuedAction(reportAction)) {
Clipboard.setString(
getReimbursementQueuedActionMessage({reportAction, translate, formatPhoneNumber: formatPhoneNumberPhoneUtils, report, shouldUseShortDisplayName: false}),
);
Clipboard.setString(getReimbursementQueuedActionMessage({reportAction, translate, formatPhoneNumber, report, shouldUseShortDisplayName: false}));
} else if (isActionableMentionWhisper(reportAction)) {
const targetAccountIDs = getOriginalMessage(reportAction)?.inviteeAccountIDs;
const mentionWhisperMessage = getActionableMentionWhisperMessage(translate, reportAction, getPersonalDetailsListByIDs(targetAccountIDs, personalDetails));
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/ContextMenuActionsCopyMessageTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import getClipboardText from '@libs/Clipboard/getClipboardText';

import CONST from '@src/CONST';

import {formatPhoneNumber} from '../utils/TestHelper';

jest.mock(
'expo-web-browser',
() => ({
Expand Down Expand Up @@ -55,6 +57,7 @@ const createPayload = (selection: string): Record<string, unknown> => ({
getLocalDateFromDatetime: jest.fn(),
policyTags: {},
translate: (translateKey: string) => translateKey,
formatPhoneNumber,
currentUserPersonalDetails: {
accountID: 1,
login: 'user@expensify.com',
Expand Down
Loading