From 844baf2ed4e08411f3582ef58fea76a33443e1ef Mon Sep 17 00:00:00 2001 From: Andrew Rosiclair Date: Fri, 5 Jul 2024 15:21:04 -0400 Subject: [PATCH 01/23] remove EXPORTINTEGRATION from OldDot actions list --- src/libs/ReportActionsUtils.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 65aaf4c9de0a..2fdfdfad2af0 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -1188,7 +1188,6 @@ function isOldDotReportAction(action: ReportAction | OldDotReportAction) { CONST.REPORT.ACTIONS.TYPE.CHANGE_TYPE, CONST.REPORT.ACTIONS.TYPE.DELEGATE_SUBMIT, CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_CSV, - CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION, CONST.REPORT.ACTIONS.TYPE.FORWARDED, CONST.REPORT.ACTIONS.TYPE.INTEGRATIONS_MESSAGE, CONST.REPORT.ACTIONS.TYPE.MANAGER_ATTACH_RECEIPT, From 06f584c8da52b2b6fd473b9642333bed2ddb94d0 Mon Sep 17 00:00:00 2001 From: Andrew Rosiclair Date: Fri, 5 Jul 2024 15:25:24 -0400 Subject: [PATCH 02/23] add originalMessage for EXPORTINTEGRATION --- src/types/onyx/OriginalMessage.ts | 38 ++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index c7d9397f3202..f3b07add172a 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -402,6 +402,41 @@ type OriginalMessageApproved = { expenseReportID: string; }; +/** + * + */ +type OriginalMessageExportIntegration = { + /** + * Whether the export was done via an automation + */ + automaticAction: false; + + /** + * The integration that was exported to (display text) + */ + label: string; + + /** + * + */ + lastModified: string; + + /** + * Whether the report was manually marked as exported + */ + markedManually: boolean; + + /** + * An list of URLs to the report in the integration for company card expenses + */ + nonReimbursableUrls: string[]; + + /** + * An list of URLs to the report in the integration for out of pocket expenses + */ + reimbursableUrls: string[]; +}; + /** The map type of original message */ type OriginalMessageMap = { /** */ @@ -435,7 +470,7 @@ type OriginalMessageMap = { /** */ [CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_CSV]: never; /** */ - [CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION]: never; + [CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION]: OriginalMessageExportIntegration; /** */ [CONST.REPORT.ACTIONS.TYPE.FORWARDED]: never; /** */ @@ -543,4 +578,5 @@ export type { OriginalMessageChangeLog, JoinWorkspaceResolution, OriginalMessageModifiedExpense, + OriginalMessageExportIntegration, }; From 624f5501231204d60cd15b6817c286f6c6c35851 Mon Sep 17 00:00:00 2001 From: Andrew Rosiclair Date: Fri, 5 Jul 2024 15:28:27 -0400 Subject: [PATCH 03/23] add copy --- src/languages/en.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 153d2e40fc25..495e7838bf59 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3294,7 +3294,12 @@ export default { changeType: ({oldType, newType}: ChangeTypeParams) => `changed type from ${oldType} to ${newType}`, delegateSubmit: ({delegateUser, originalManager}: DelegateSubmitParams) => `sent this report to ${delegateUser} since ${originalManager} is on vacation`, exportedToCSV: `exported this report to CSV`, - exportedToIntegration: ({label}: ExportedToIntegrationParams) => `exported this report to ${label}`, + exportedToIntegration: { + automatic: ({label}: ExportedToIntegrationParams) => `exported this report to ${label}. `, + manual: ({label}: ExportedToIntegrationParams) => `marked this report as manually exported to ${label}. `, + reimburseableLink: 'View out of pocket expenses. ', + nonReimbursableLink: 'View company card expenses. ', + }, forwarded: ({amount, currency}: ForwardedParams) => `approved ${currency}${amount}`, integrationsMessage: (errorMessage: string, label: string) => `failed to export this report to ${label} ("${errorMessage}").`, managerAttachReceipt: `added a receipt`, From 3d9aa0f57b48760edcf17fb8617313310f795aaf Mon Sep 17 00:00:00 2001 From: Andrew Rosiclair Date: Fri, 5 Jul 2024 15:28:43 -0400 Subject: [PATCH 04/23] add ExportIntegration action --- .../ReportActionItem/ExportIntegration.tsx | 43 +++++++++++++++++++ src/pages/home/report/ReportActionItem.tsx | 3 ++ 2 files changed, 46 insertions(+) create mode 100644 src/components/ReportActionItem/ExportIntegration.tsx diff --git a/src/components/ReportActionItem/ExportIntegration.tsx b/src/components/ReportActionItem/ExportIntegration.tsx new file mode 100644 index 000000000000..6054d1b56309 --- /dev/null +++ b/src/components/ReportActionItem/ExportIntegration.tsx @@ -0,0 +1,43 @@ +import React from 'react'; +import {View} from 'react-native'; +import type {OnyxEntry} from 'react-native-onyx'; +import Text from '@components/Text'; +import TextLink from '@components/TextLink'; +import useLocalize from '@hooks/useLocalize'; +import useThemeStyles from '@hooks/useThemeStyles'; +import * as ReportActionUtils from '@libs/ReportActionsUtils'; +import type {ReportAction} from '@src/types/onyx'; +import type {OriginalMessageExportIntegration} from '@src/types/onyx/OriginalMessage'; + +type ExportIntegrationProps = { + action: OnyxEntry; +}; + +function ExportIntegration({action}: ExportIntegrationProps) { + const styles = useThemeStyles(); + const {translate} = useLocalize(); + const {label, markedManually, reimbursableUrls, nonReimbursableUrls} = (ReportActionUtils.getOriginalMessage(action) ?? {}) as OriginalMessageExportIntegration; + + const exportText = markedManually ? translate('report.actions.type.exportedToIntegration.manual', {label}) : translate('report.actions.type.exportedToIntegration.automatic', {label}); + + let linkText = ''; + let linkURL = ''; + if (reimbursableUrls.length === 1) { + linkText = translate('report.actions.type.exportedToIntegration.reimburseableLink'); + linkURL = reimbursableUrls[0]; + } else if (nonReimbursableUrls.length >= 1) { + linkText = translate('report.actions.type.exportedToIntegration.nonReimbursableLink'); + linkURL = nonReimbursableUrls[0]; + } + + return ( + + {exportText} + {linkText && {linkText}} + + ); +} + +ExportIntegration.displayName = 'ExportIntegration'; + +export default ExportIntegration; diff --git a/src/pages/home/report/ReportActionItem.tsx b/src/pages/home/report/ReportActionItem.tsx index f0b36667e1dd..02d3d19f4bae 100644 --- a/src/pages/home/report/ReportActionItem.tsx +++ b/src/pages/home/report/ReportActionItem.tsx @@ -21,6 +21,7 @@ import RenderHTML from '@components/RenderHTML'; import type {ActionableItem} from '@components/ReportActionItem/ActionableItemButtons'; import ActionableItemButtons from '@components/ReportActionItem/ActionableItemButtons'; import ChronosOOOListActions from '@components/ReportActionItem/ChronosOOOListActions'; +import ExportIntegration from '@components/ReportActionItem/ExportIntegration'; import MoneyRequestAction from '@components/ReportActionItem/MoneyRequestAction'; import RenameAction from '@components/ReportActionItem/RenameAction'; import ReportPreview from '@components/ReportActionItem/ReportPreview'; @@ -633,6 +634,8 @@ function ReportActionItem({ children = ; } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.ADD_TAG) { children = ; + } else if (ReportActionsUtils.isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION)) { + children = ; } else { const hasBeenFlagged = ![CONST.MODERATION.MODERATOR_DECISION_APPROVED, CONST.MODERATION.MODERATOR_DECISION_PENDING].some((item) => item === moderationDecision) && From 99731b3e2f92934ffecd541b9fa5eceb78e75308 Mon Sep 17 00:00:00 2001 From: Andrew Rosiclair Date: Fri, 5 Jul 2024 17:05:39 -0400 Subject: [PATCH 05/23] add more integration labels --- src/CONST.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/CONST.ts b/src/CONST.ts index d308267ffd9d..5f5d0128d3bb 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1965,8 +1965,12 @@ const CONST = { NAME_USER_FRIENDLY: { netsuite: 'NetSuite', quickbooksOnline: 'Quickbooks Online', + quickbooksDesktop: 'Quickbooks Desktop', xero: 'Xero', intacct: 'Sage Intacct', + financialForce: 'FinancialForce', + billCom: 'Bill.com', + zenefits: 'Zenefits', }, SYNC_STAGE_NAME: { STARTING_IMPORT_QBO: 'startingImportQBO', From 9235c987b0acb6145193e3d1520b0a84d2ab74f6 Mon Sep 17 00:00:00 2001 From: Andrew Rosiclair Date: Fri, 5 Jul 2024 17:06:04 -0400 Subject: [PATCH 06/23] handle multiple non-reimbursable urls --- .../ReportActionItem/ExportIntegration.tsx | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/components/ReportActionItem/ExportIntegration.tsx b/src/components/ReportActionItem/ExportIntegration.tsx index 6054d1b56309..d671d1e548ef 100644 --- a/src/components/ReportActionItem/ExportIntegration.tsx +++ b/src/components/ReportActionItem/ExportIntegration.tsx @@ -6,6 +6,7 @@ import TextLink from '@components/TextLink'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import * as ReportActionUtils from '@libs/ReportActionsUtils'; +import CONST from '@src/CONST'; import type {ReportAction} from '@src/types/onyx'; import type {OriginalMessageExportIntegration} from '@src/types/onyx/OriginalMessage'; @@ -17,6 +18,9 @@ function ExportIntegration({action}: ExportIntegrationProps) { const styles = useThemeStyles(); const {translate} = useLocalize(); const {label, markedManually, reimbursableUrls, nonReimbursableUrls} = (ReportActionUtils.getOriginalMessage(action) ?? {}) as OriginalMessageExportIntegration; + const wasExportedAfterBase62 = (action?.created ?? '') > '2022-11-14'; + const reportID = action?.reportID ?? ''; + const base62ReportID = 'BASE62REPORTID'; const exportText = markedManually ? translate('report.actions.type.exportedToIntegration.manual', {label}) : translate('report.actions.type.exportedToIntegration.automatic', {label}); @@ -25,9 +29,27 @@ function ExportIntegration({action}: ExportIntegrationProps) { if (reimbursableUrls.length === 1) { linkText = translate('report.actions.type.exportedToIntegration.reimburseableLink'); linkURL = reimbursableUrls[0]; - } else if (nonReimbursableUrls.length >= 1) { + } else if (nonReimbursableUrls.length) { linkText = translate('report.actions.type.exportedToIntegration.nonReimbursableLink'); - linkURL = nonReimbursableUrls[0]; + + if (nonReimbursableUrls.length === 1) { + linkURL = nonReimbursableUrls[0]; + } else { + switch (label) { + case CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY.xero: + linkURL = 'https://go.xero.com/Bank/BankAccounts.aspx'; + break; + case CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY.netsuite: + linkURL = 'https://system.netsuite.com/app/common/search/ubersearchresults.nl?quicksearch=T&searchtype=Uber&frame=be&Uber_NAMEtype=KEYWORDSTARTSWITH&Uber_NAME='; + linkURL += wasExportedAfterBase62 ? base62ReportID : reportID; + break; + case CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY.financialForce: + linkURL = ''; + break; + default: + linkURL = 'https://qbo.intuit.com/app/expenses'; + } + } } return ( From fdfb58bc9c76e27243aa405f9f0cb97162fc4c52 Mon Sep 17 00:00:00 2001 From: Andrew Rosiclair Date: Fri, 5 Jul 2024 17:17:19 -0400 Subject: [PATCH 07/23] calculate base62 reportID --- .../ReportActionItem/ExportIntegration.tsx | 3 ++- src/libs/ReportUtils.ts | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/components/ReportActionItem/ExportIntegration.tsx b/src/components/ReportActionItem/ExportIntegration.tsx index d671d1e548ef..9dcf98ee26ac 100644 --- a/src/components/ReportActionItem/ExportIntegration.tsx +++ b/src/components/ReportActionItem/ExportIntegration.tsx @@ -6,6 +6,7 @@ import TextLink from '@components/TextLink'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import * as ReportActionUtils from '@libs/ReportActionsUtils'; +import * as ReportUtils from '@libs/ReportUtils'; import CONST from '@src/CONST'; import type {ReportAction} from '@src/types/onyx'; import type {OriginalMessageExportIntegration} from '@src/types/onyx/OriginalMessage'; @@ -20,7 +21,7 @@ function ExportIntegration({action}: ExportIntegrationProps) { const {label, markedManually, reimbursableUrls, nonReimbursableUrls} = (ReportActionUtils.getOriginalMessage(action) ?? {}) as OriginalMessageExportIntegration; const wasExportedAfterBase62 = (action?.created ?? '') > '2022-11-14'; const reportID = action?.reportID ?? ''; - const base62ReportID = 'BASE62REPORTID'; + const base62ReportID = ReportUtils.getBase62ReportID(Number(reportID)); const exportText = markedManually ? translate('report.actions.type.exportedToIntegration.manual', {label}) : translate('report.actions.type.exportedToIntegration.automatic', {label}); diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 019c9c96a0b4..cf6a7f52da66 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -7059,6 +7059,24 @@ function findPolicyExpenseChatByPolicyID(policyID: string): OnyxEntry { return Object.values(allReports ?? {}).find((report) => isPolicyExpenseChat(report) && report?.policyID === policyID); } +/** + * Take an integer reportID and convert it to a string representing a Base-62 report ID. + * + * @return string The reportID in base 62-format, always 12 characters beginning with `R`. + */ +function getBase62ReportID(reportID: number): string { + const alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; + let result = ''; + let remainder = reportID; + while (remainder > 0) { + const currentVal = remainder % 62; + result = alphabet[currentVal] + result; + remainder = Math.floor(remainder / 62); + } + + return `R${result.padStart(11, '0')}`; +} + export { addDomainToShortMention, areAllRequestsBeingSmartScanned, @@ -7338,6 +7356,7 @@ export { findPolicyExpenseChatByPolicyID, isIndividualInvoiceRoom, hasOnlyNonReimbursableTransactions, + getBase62ReportID, }; export type { From 22ab047b4307e4ce197cf0df906a49420ca92fa3 Mon Sep 17 00:00:00 2001 From: Andrew Rosiclair Date: Mon, 8 Jul 2024 11:07:18 -0400 Subject: [PATCH 08/23] allow multiple links --- .../ReportActionItem/ExportIntegration.tsx | 35 ++++++++++++------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/src/components/ReportActionItem/ExportIntegration.tsx b/src/components/ReportActionItem/ExportIntegration.tsx index 9dcf98ee26ac..e6a559dd4a42 100644 --- a/src/components/ReportActionItem/ExportIntegration.tsx +++ b/src/components/ReportActionItem/ExportIntegration.tsx @@ -25,38 +25,47 @@ function ExportIntegration({action}: ExportIntegrationProps) { const exportText = markedManually ? translate('report.actions.type.exportedToIntegration.manual', {label}) : translate('report.actions.type.exportedToIntegration.automatic', {label}); - let linkText = ''; - let linkURL = ''; + const links: Array<{text: string; url: string}> = []; + if (reimbursableUrls.length === 1) { - linkText = translate('report.actions.type.exportedToIntegration.reimburseableLink'); - linkURL = reimbursableUrls[0]; - } else if (nonReimbursableUrls.length) { - linkText = translate('report.actions.type.exportedToIntegration.nonReimbursableLink'); + links.push({ + text: translate('report.actions.type.exportedToIntegration.reimburseableLink'), + url: reimbursableUrls[0], + }); + } + + if (nonReimbursableUrls.length) { + const text = translate('report.actions.type.exportedToIntegration.nonReimbursableLink'); + let url = ''; if (nonReimbursableUrls.length === 1) { - linkURL = nonReimbursableUrls[0]; + url = nonReimbursableUrls[0]; } else { switch (label) { case CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY.xero: - linkURL = 'https://go.xero.com/Bank/BankAccounts.aspx'; + url = 'https://go.xero.com/Bank/BankAccounts.aspx'; break; case CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY.netsuite: - linkURL = 'https://system.netsuite.com/app/common/search/ubersearchresults.nl?quicksearch=T&searchtype=Uber&frame=be&Uber_NAMEtype=KEYWORDSTARTSWITH&Uber_NAME='; - linkURL += wasExportedAfterBase62 ? base62ReportID : reportID; + url = 'https://system.netsuite.com/app/common/search/ubersearchresults.nl?quicksearch=T&searchtype=Uber&frame=be&Uber_NAMEtype=KEYWORDSTARTSWITH&Uber_NAME='; + url += wasExportedAfterBase62 ? base62ReportID : reportID; break; case CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY.financialForce: - linkURL = ''; + url = ''; break; default: - linkURL = 'https://qbo.intuit.com/app/expenses'; + url = 'https://qbo.intuit.com/app/expenses'; } } + + links.push({text, url}); } return ( {exportText} - {linkText && {linkText}} + {links.map((link) => ( + {link.text} + ))} ); } From 854f5a7213d8ec2b6d513774d59aff3b561ab75a Mon Sep 17 00:00:00 2001 From: Andrew Rosiclair Date: Mon, 8 Jul 2024 11:09:55 -0400 Subject: [PATCH 09/23] remove trailing spaces from translations --- src/components/ReportActionItem/ExportIntegration.tsx | 4 ++-- src/languages/en.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/ReportActionItem/ExportIntegration.tsx b/src/components/ReportActionItem/ExportIntegration.tsx index e6a559dd4a42..ab5a0ebc5f89 100644 --- a/src/components/ReportActionItem/ExportIntegration.tsx +++ b/src/components/ReportActionItem/ExportIntegration.tsx @@ -62,9 +62,9 @@ function ExportIntegration({action}: ExportIntegrationProps) { return ( - {exportText} + {exportText} {links.map((link) => ( - {link.text} + {link.text} ))} ); diff --git a/src/languages/en.ts b/src/languages/en.ts index 495e7838bf59..d1eb905bfcfd 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3295,10 +3295,10 @@ export default { delegateSubmit: ({delegateUser, originalManager}: DelegateSubmitParams) => `sent this report to ${delegateUser} since ${originalManager} is on vacation`, exportedToCSV: `exported this report to CSV`, exportedToIntegration: { - automatic: ({label}: ExportedToIntegrationParams) => `exported this report to ${label}. `, - manual: ({label}: ExportedToIntegrationParams) => `marked this report as manually exported to ${label}. `, - reimburseableLink: 'View out of pocket expenses. ', - nonReimbursableLink: 'View company card expenses. ', + automatic: ({label}: ExportedToIntegrationParams) => `exported this report to ${label}.`, + manual: ({label}: ExportedToIntegrationParams) => `marked this report as manually exported to ${label}.`, + reimburseableLink: 'View out of pocket expenses.', + nonReimbursableLink: 'View company card expenses.', }, forwarded: ({amount, currency}: ForwardedParams) => `approved ${currency}${amount}`, integrationsMessage: (errorMessage: string, label: string) => `failed to export this report to ${label} ("${errorMessage}").`, From bb30de14c81df3a1a408ab6d5f223572d3c56b96 Mon Sep 17 00:00:00 2001 From: Andrew Rosiclair Date: Mon, 8 Jul 2024 11:24:47 -0400 Subject: [PATCH 10/23] fix wrapping --- src/components/ReportActionItem/ExportIntegration.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ReportActionItem/ExportIntegration.tsx b/src/components/ReportActionItem/ExportIntegration.tsx index ab5a0ebc5f89..3846ce660aa3 100644 --- a/src/components/ReportActionItem/ExportIntegration.tsx +++ b/src/components/ReportActionItem/ExportIntegration.tsx @@ -61,7 +61,7 @@ function ExportIntegration({action}: ExportIntegrationProps) { } return ( - + {exportText} {links.map((link) => ( {link.text} From 8ed0db38409e80d9fe256137ca4c2f5b691ff873 Mon Sep 17 00:00:00 2001 From: Andrew Rosiclair Date: Mon, 8 Jul 2024 12:19:00 -0400 Subject: [PATCH 11/23] remove from OldDot actions --- src/libs/ReportActionsUtils.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 6a8b2dccf199..0084cbffe0b5 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -1189,8 +1189,6 @@ function getMessageOfOldDotReportAction(oldDotAction: PartialReportAction | OldD } case CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_CSV: return Localize.translateLocal('report.actions.type.exportedToCSV'); - case CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION: - return Localize.translateLocal('report.actions.type.exportedToIntegration', {label: originalMessage.label}); case CONST.REPORT.ACTIONS.TYPE.INTEGRATIONS_MESSAGE: { const {result, label} = originalMessage; const errorMessage = result?.messages?.join(', ') ?? ''; From 71ceaaffe59ed8ce77a03e09b958feb96de900c3 Mon Sep 17 00:00:00 2001 From: Andrew Rosiclair Date: Mon, 8 Jul 2024 12:45:12 -0400 Subject: [PATCH 12/23] support pending action --- src/components/ReportActionItem/ExportIntegration.tsx | 10 +++++++++- src/languages/en.ts | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/ReportActionItem/ExportIntegration.tsx b/src/components/ReportActionItem/ExportIntegration.tsx index 3846ce660aa3..ff97467cade7 100644 --- a/src/components/ReportActionItem/ExportIntegration.tsx +++ b/src/components/ReportActionItem/ExportIntegration.tsx @@ -22,8 +22,16 @@ function ExportIntegration({action}: ExportIntegrationProps) { const wasExportedAfterBase62 = (action?.created ?? '') > '2022-11-14'; const reportID = action?.reportID ?? ''; const base62ReportID = ReportUtils.getBase62ReportID(Number(reportID)); + const isPending = action?.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD; - const exportText = markedManually ? translate('report.actions.type.exportedToIntegration.manual', {label}) : translate('report.actions.type.exportedToIntegration.automatic', {label}); + let exportText = ''; + if (isPending) { + exportText = translate('report.actions.type.exportedToIntegration.pending', {label}); + } else if (markedManually) { + exportText = translate('report.actions.type.exportedToIntegration.manual', {label}); + } else { + exportText = translate('report.actions.type.exportedToIntegration.automatic', {label}); + } const links: Array<{text: string; url: string}> = []; diff --git a/src/languages/en.ts b/src/languages/en.ts index 0e83d2887619..cc305d61dd80 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3379,6 +3379,7 @@ export default { manual: ({label}: ExportedToIntegrationParams) => `marked this report as manually exported to ${label}.`, reimburseableLink: 'View out of pocket expenses.', nonReimbursableLink: 'View company card expenses.', + pending: ({label}: ExportedToIntegrationParams) => `started exporting this report to ${label}...`, }, forwarded: ({amount, currency}: ForwardedParams) => `approved ${currency}${amount}`, integrationsMessage: (errorMessage: string, label: string) => `failed to export this report to ${label} ("${errorMessage}").`, From b0c573cdb09fb0deb5e82f064d1eda9827b58a85 Mon Sep 17 00:00:00 2001 From: Andrew Rosiclair Date: Mon, 8 Jul 2024 12:54:59 -0400 Subject: [PATCH 13/23] add key --- src/components/ReportActionItem/ExportIntegration.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/ReportActionItem/ExportIntegration.tsx b/src/components/ReportActionItem/ExportIntegration.tsx index ff97467cade7..aaa9be28f8f7 100644 --- a/src/components/ReportActionItem/ExportIntegration.tsx +++ b/src/components/ReportActionItem/ExportIntegration.tsx @@ -72,7 +72,12 @@ function ExportIntegration({action}: ExportIntegrationProps) { {exportText} {links.map((link) => ( - {link.text} + + {link.text}{' '} + ))} ); From ceb811c8f7575c626cc7c48f47dba352a8ebb36a Mon Sep 17 00:00:00 2001 From: Andrew Rosiclair Date: Thu, 11 Jul 2024 18:31:44 -0400 Subject: [PATCH 14/23] move to separate module to fix dependency cycle --- src/libs/ReportUtils.ts | 19 ------------------- src/libs/getBase62ReportID.ts | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 src/libs/getBase62ReportID.ts diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 9aae25945c67..9fe81b7de5b1 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -7119,24 +7119,6 @@ function findPolicyExpenseChatByPolicyID(policyID: string): OnyxEntry { return Object.values(ReportConnection.getAllReports() ?? {}).find((report) => isPolicyExpenseChat(report) && report?.policyID === policyID); } -/** - * Take an integer reportID and convert it to a string representing a Base-62 report ID. - * - * @return string The reportID in base 62-format, always 12 characters beginning with `R`. - */ -function getBase62ReportID(reportID: number): string { - const alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; - let result = ''; - let remainder = reportID; - while (remainder > 0) { - const currentVal = remainder % 62; - result = alphabet[currentVal] + result; - remainder = Math.floor(remainder / 62); - } - - return `R${result.padStart(11, '0')}`; -} - export { addDomainToShortMention, areAllRequestsBeingSmartScanned, @@ -7417,7 +7399,6 @@ export { getChatUsedForOnboarding, findPolicyExpenseChatByPolicyID, hasOnlyNonReimbursableTransactions, - getBase62ReportID, getMostRecentlyVisitedReport, getReport, }; diff --git a/src/libs/getBase62ReportID.ts b/src/libs/getBase62ReportID.ts new file mode 100644 index 000000000000..5a457e0aef2a --- /dev/null +++ b/src/libs/getBase62ReportID.ts @@ -0,0 +1,19 @@ +/** + * Take an integer reportID and convert it to a string representing a Base-62 report ID. + * + * This is in it's own module to prevent a dependency cycle between libs/ReportUtils.ts and libs/ReportActionUtils.ts + * + * @return string The reportID in base 62-format, always 12 characters beginning with `R`. + */ +export default function getBase62ReportID(reportID: number): string { + const alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; + let result = ''; + let remainder = reportID; + while (remainder > 0) { + const currentVal = remainder % 62; + result = alphabet[currentVal] + result; + remainder = Math.floor(remainder / 62); + } + + return `R${result.padStart(11, '0')}`; +} From 34fd9559905ee42564e6c52e51951bbef99e3bea Mon Sep 17 00:00:00 2001 From: Andrew Rosiclair Date: Thu, 11 Jul 2024 18:32:26 -0400 Subject: [PATCH 15/23] move message building to ReportActionUtils --- .../ReportActionItem/ExportIntegration.tsx | 86 +++++-------------- src/libs/ReportActionsUtils.ts | 76 +++++++++++++++- 2 files changed, 98 insertions(+), 64 deletions(-) diff --git a/src/components/ReportActionItem/ExportIntegration.tsx b/src/components/ReportActionItem/ExportIntegration.tsx index aaa9be28f8f7..78e6170d3dd7 100644 --- a/src/components/ReportActionItem/ExportIntegration.tsx +++ b/src/components/ReportActionItem/ExportIntegration.tsx @@ -1,15 +1,12 @@ +/* eslint-disable react/no-array-index-key */ import React from 'react'; import {View} from 'react-native'; import type {OnyxEntry} from 'react-native-onyx'; import Text from '@components/Text'; import TextLink from '@components/TextLink'; -import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import * as ReportActionUtils from '@libs/ReportActionsUtils'; -import * as ReportUtils from '@libs/ReportUtils'; -import CONST from '@src/CONST'; import type {ReportAction} from '@src/types/onyx'; -import type {OriginalMessageExportIntegration} from '@src/types/onyx/OriginalMessage'; type ExportIntegrationProps = { action: OnyxEntry; @@ -17,68 +14,31 @@ type ExportIntegrationProps = { function ExportIntegration({action}: ExportIntegrationProps) { const styles = useThemeStyles(); - const {translate} = useLocalize(); - const {label, markedManually, reimbursableUrls, nonReimbursableUrls} = (ReportActionUtils.getOriginalMessage(action) ?? {}) as OriginalMessageExportIntegration; - const wasExportedAfterBase62 = (action?.created ?? '') > '2022-11-14'; - const reportID = action?.reportID ?? ''; - const base62ReportID = ReportUtils.getBase62ReportID(Number(reportID)); - const isPending = action?.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD; - - let exportText = ''; - if (isPending) { - exportText = translate('report.actions.type.exportedToIntegration.pending', {label}); - } else if (markedManually) { - exportText = translate('report.actions.type.exportedToIntegration.manual', {label}); - } else { - exportText = translate('report.actions.type.exportedToIntegration.automatic', {label}); - } - - const links: Array<{text: string; url: string}> = []; - - if (reimbursableUrls.length === 1) { - links.push({ - text: translate('report.actions.type.exportedToIntegration.reimburseableLink'), - url: reimbursableUrls[0], - }); - } - - if (nonReimbursableUrls.length) { - const text = translate('report.actions.type.exportedToIntegration.nonReimbursableLink'); - let url = ''; - - if (nonReimbursableUrls.length === 1) { - url = nonReimbursableUrls[0]; - } else { - switch (label) { - case CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY.xero: - url = 'https://go.xero.com/Bank/BankAccounts.aspx'; - break; - case CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY.netsuite: - url = 'https://system.netsuite.com/app/common/search/ubersearchresults.nl?quicksearch=T&searchtype=Uber&frame=be&Uber_NAMEtype=KEYWORDSTARTSWITH&Uber_NAME='; - url += wasExportedAfterBase62 ? base62ReportID : reportID; - break; - case CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY.financialForce: - url = ''; - break; - default: - url = 'https://qbo.intuit.com/app/expenses'; - } - } - - links.push({text, url}); - } + const fragments = ReportActionUtils.getExportIntegrationActionFragments(action); return ( - {exportText} - {links.map((link) => ( - - {link.text}{' '} - - ))} + {fragments.map((fragment, index) => { + if (!fragment.url) { + return ( + + {fragment.text}{' '} + + ); + } + + return ( + + {fragment.text}{' '} + + ); + })} ); } diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index b3040916dd26..9eff0f666aed 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -8,7 +8,7 @@ import CONST from '@src/CONST'; import type {TranslationPaths} from '@src/languages/types'; import ONYXKEYS from '@src/ONYXKEYS'; import type {OnyxInputOrEntry} from '@src/types/onyx'; -import type {JoinWorkspaceResolution} from '@src/types/onyx/OriginalMessage'; +import type {JoinWorkspaceResolution, OriginalMessageExportIntegration} from '@src/types/onyx/OriginalMessage'; import type Report from '@src/types/onyx/Report'; import type {Message, OldDotReportAction, OriginalMessage, ReportActions} from '@src/types/onyx/ReportAction'; import type ReportAction from '@src/types/onyx/ReportAction'; @@ -16,6 +16,7 @@ import type ReportActionName from '@src/types/onyx/ReportActionName'; import {isEmptyObject} from '@src/types/utils/EmptyObject'; import DateUtils from './DateUtils'; import * as Environment from './Environment/Environment'; +import getBase62ReportID from './getBase62ReportID'; import isReportMessageAttachment from './isReportMessageAttachment'; import * as Localize from './Localize'; import Log from './Log'; @@ -1413,6 +1414,77 @@ function isActionableAddPaymentCard(reportAction: OnyxEntry): repo return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ACTIONABLE_ADD_PAYMENT_CARD; } +function getExportIntegrationLastMessageText(reportAction: OnyxEntry): string { + const fragments = getExportIntegrationActionFragments(reportAction); + return fragments.reduce((acc, fragment) => `${acc} ${fragment.text}`, ''); +} + +function getExportIntegrationActionFragments(reportAction: OnyxEntry): Array<{text: string; url: string}> { + if (reportAction?.actionName !== 'EXPORTINTEGRATION') { + throw Error(`received wrong action type. actionName: ${reportAction?.actionName}`); + } + + const isPending = reportAction?.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD; + const {label, markedManually, reimbursableUrls, nonReimbursableUrls} = (getOriginalMessage(reportAction) ?? {}) as OriginalMessageExportIntegration; + const reportID = reportAction?.reportID ?? ''; + const wasExportedAfterBase62 = (reportAction?.created ?? '') > '2022-11-14'; + const base62ReportID = getBase62ReportID(Number(reportID)); + + const result: Array<{text: string; url: string}> = []; + + if (isPending) { + result.push({ + text: Localize.translateLocal('report.actions.type.exportedToIntegration.pending', {label}), + url: '', + }); + } else if (markedManually) { + result.push({ + text: Localize.translateLocal('report.actions.type.exportedToIntegration.manual', {label}), + url: '', + }); + } else { + result.push({ + text: Localize.translateLocal('report.actions.type.exportedToIntegration.automatic', {label}), + url: '', + }); + } + + if (reimbursableUrls.length === 1) { + result.push({ + text: Localize.translateLocal('report.actions.type.exportedToIntegration.reimburseableLink'), + url: reimbursableUrls[0], + }); + } + + if (nonReimbursableUrls.length) { + const text = Localize.translateLocal('report.actions.type.exportedToIntegration.nonReimbursableLink'); + let url = ''; + + if (nonReimbursableUrls.length === 1) { + url = nonReimbursableUrls[0]; + } else { + switch (label) { + case CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY.xero: + url = 'https://go.xero.com/Bank/BankAccounts.aspx'; + break; + case CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY.netsuite: + url = 'https://system.netsuite.com/app/common/search/ubersearchresults.nl?quicksearch=T&searchtype=Uber&frame=be&Uber_NAMEtype=KEYWORDSTARTSWITH&Uber_NAME='; + url += wasExportedAfterBase62 ? base62ReportID : reportID; + break; + case CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY.financialForce: + url = ''; + break; + default: + url = 'https://qbo.intuit.com/app/expenses'; + } + } + + result.push({text, url}); + } + + return result; +} + export { extractLinksFromMessageHtml, getDismissedViolationMessageText, @@ -1500,6 +1572,8 @@ export { getIOUActionForReportID, getFilteredForOneTransactionView, isActionableAddPaymentCard, + getExportIntegrationActionFragments, + getExportIntegrationLastMessageText, }; export type {LastVisibleMessage}; From 48ca92b79973764f70ff8042f91dc13fb835c9d1 Mon Sep 17 00:00:00 2001 From: Andrew Rosiclair Date: Thu, 11 Jul 2024 18:32:51 -0400 Subject: [PATCH 16/23] use message util for LHN last message text --- src/libs/OptionsListUtils.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libs/OptionsListUtils.ts b/src/libs/OptionsListUtils.ts index 97c9a0965f1d..e2c5f917af00 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -727,6 +727,8 @@ function getLastMessageTextForReport(report: OnyxEntry, lastActorDetails lastMessageTextFromReport = ReportUtils.getIOUApprovedMessage(reportID); } else if (ReportActionUtils.isActionableAddPaymentCard(lastReportAction)) { lastMessageTextFromReport = ReportActionUtils.getReportActionMessageText(lastReportAction); + } else if (lastReportAction?.actionName === 'EXPORTINTEGRATION') { + lastMessageTextFromReport = ReportActionUtils.getExportIntegrationLastMessageText(lastReportAction); } return lastMessageTextFromReport || (report?.lastMessageText ?? ''); From fbd6b626a276867afa8e97b40cf921283ee1d05d Mon Sep 17 00:00:00 2001 From: Andrew Rosiclair Date: Fri, 12 Jul 2024 14:28:05 -0400 Subject: [PATCH 17/23] add spanish translations --- src/languages/es.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/languages/es.ts b/src/languages/es.ts index 889c2a88ec12..b4d8666e3ec2 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -3634,7 +3634,13 @@ export default { changeType: ({oldType, newType}: ChangeTypeParams) => `cambió type de ${oldType} a ${newType}`, delegateSubmit: ({delegateUser, originalManager}: DelegateSubmitParams) => `envié este informe a ${delegateUser} ya que ${originalManager} está de vacaciones`, exportedToCSV: `exportó este informe a CSV`, - exportedToIntegration: ({label}: ExportedToIntegrationParams) => `exportó este informe a ${label}`, + exportedToIntegration: { + automatic: ({label}: ExportedToIntegrationParams) => `exportó este informe a ${label}.`, + manual: ({label}: ExportedToIntegrationParams) => `marcó este informe como exportado manualmente a ${label}.`, + reimburseableLink: 'Ver los gastos por cuenta propia.', + nonReimbursableLink: 'Ver los gastos de la tarjeta de empresa.', + pending: ({label}: ExportedToIntegrationParams) => `comenzó a exportar este informe a ${label}...`, + }, forwarded: ({amount, currency}: ForwardedParams) => `aprobado ${currency}${amount}`, integrationsMessage: (errorMessage: string, label: string) => `no se pudo exportar este informe a ${label} ("${errorMessage}").`, managerAttachReceipt: `agregó un recibo`, From bb4bc42597cc929ed0b861f175c647096b31e755 Mon Sep 17 00:00:00 2001 From: Andrew Rosiclair Date: Mon, 15 Jul 2024 16:11:14 -0400 Subject: [PATCH 18/23] use consts --- src/libs/ReportActionsUtils.ts | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 9eff0f666aed..b1e32ec92b05 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -83,6 +83,27 @@ Onyx.connect({ let environmentURL: string; Environment.getEnvironmentURL().then((url: string) => (environmentURL = url)); +/* + * Url to the Xero non reimbursable expenses list + */ +const XERO_NON_REIMBURSABLE_EXPENSES_URL = 'https://go.xero.com/Bank/BankAccounts.aspx'; + +/* + * Url to the NetSuite global search, which should be suffixed with the reportID. + */ +const NETSUITE_NON_REIMBURSABLE_EXPENSES_URL_PREFIX = + 'https://system.netsuite.com/app/common/search/ubersearchresults.nl?quicksearch=T&searchtype=Uber&frame=be&Uber_NAMEtype=KEYWORDSTARTSWITH&Uber_NAME='; + +/* + * Url prefix to any Salesforce transaction or transaction list. + */ +const SALESFORCE_EXPENSES_URL_PREFIX = 'https://login.salesforce.com/'; + +/* + * Url to the QBO expenses list + */ +const QBO_EXPENSES_URL = 'https://qbo.intuit.com/app/expenses'; + function isCreatedAction(reportAction: OnyxInputOrEntry): boolean { return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.CREATED; } @@ -1465,17 +1486,17 @@ function getExportIntegrationActionFragments(reportAction: OnyxEntry Date: Mon, 15 Jul 2024 16:13:09 -0400 Subject: [PATCH 19/23] handle salesforce URLs --- src/libs/ReportActionsUtils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index b1e32ec92b05..8c0ac0a335e9 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -1493,7 +1493,8 @@ function getExportIntegrationActionFragments(reportAction: OnyxEntry Date: Mon, 15 Jul 2024 16:54:14 -0400 Subject: [PATCH 20/23] handle empty URLs --- src/libs/ReportActionsUtils.ts | 6 ++++-- src/types/onyx/OriginalMessage.ts | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 8c0ac0a335e9..afea133a2d4b 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -1446,13 +1446,15 @@ function getExportIntegrationActionFragments(reportAction: OnyxEntry '2022-11-14'; const base62ReportID = getBase62ReportID(Number(reportID)); const result: Array<{text: string; url: string}> = []; - if (isPending) { result.push({ text: Localize.translateLocal('report.actions.type.exportedToIntegration.pending', {label}), diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index 8f1936574832..2841b0a7d45c 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -429,12 +429,12 @@ type OriginalMessageExportIntegration = { /** * An list of URLs to the report in the integration for company card expenses */ - nonReimbursableUrls: string[]; + nonReimbursableUrls?: string[]; /** * An list of URLs to the report in the integration for out of pocket expenses */ - reimbursableUrls: string[]; + reimbursableUrls?: string[]; }; /** Model of `unapproved` report action */ From 0c49035313b4118489debebecca5a79e70e082be Mon Sep 17 00:00:00 2001 From: Andrew Rosiclair Date: Mon, 15 Jul 2024 17:13:05 -0400 Subject: [PATCH 21/23] copy formatted message text to clipboard --- src/pages/home/report/ContextMenu/ContextMenuActions.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx index 0ff3a50bc0dd..d49518bcaf59 100644 --- a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx +++ b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx @@ -417,6 +417,8 @@ const ContextMenuActions: ContextMenuAction[] = [ const reason = originalMessage?.reason; const violationName = originalMessage?.violationName; Clipboard.setString(Localize.translateLocal(`violationDismissal.${violationName}.${reason}` as TranslationPaths)); + } else if (reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION) { + setClipboardMessage(ReportActionsUtils.getExportIntegrationLastMessageText(reportAction)); } else if (content) { setClipboardMessage( content.replace(/()(.*?)(<\/mention-user>)/gi, (match, openTag: string, innerContent: string, closeTag: string): string => { From f409e36f37965f81016e5de022c7b6b646a3f4ba Mon Sep 17 00:00:00 2001 From: Andrew Rosiclair Date: Mon, 15 Jul 2024 17:32:14 -0400 Subject: [PATCH 22/23] copy formatted html to preserve links --- src/libs/ReportActionsUtils.ts | 7 +++++++ src/pages/home/report/ContextMenu/ContextMenuActions.tsx | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index afea133a2d4b..998ce9fe3d51 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -1440,6 +1440,12 @@ function getExportIntegrationLastMessageText(reportAction: OnyxEntry `${acc} ${fragment.text}`, ''); } +function getExportIntegrationMessageHTML(reportAction: OnyxEntry): string { + const fragments = getExportIntegrationActionFragments(reportAction); + const htmlFragments = fragments.map((fragment) => (fragment.url ? `${fragment.text}` : fragment.text)); + return htmlFragments.join(' '); +} + function getExportIntegrationActionFragments(reportAction: OnyxEntry): Array<{text: string; url: string}> { if (reportAction?.actionName !== 'EXPORTINTEGRATION') { throw Error(`received wrong action type. actionName: ${reportAction?.actionName}`); @@ -1598,6 +1604,7 @@ export { isActionableAddPaymentCard, getExportIntegrationActionFragments, getExportIntegrationLastMessageText, + getExportIntegrationMessageHTML, }; export type {LastVisibleMessage}; diff --git a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx index d49518bcaf59..27859cec4193 100644 --- a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx +++ b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx @@ -418,7 +418,7 @@ const ContextMenuActions: ContextMenuAction[] = [ const violationName = originalMessage?.violationName; Clipboard.setString(Localize.translateLocal(`violationDismissal.${violationName}.${reason}` as TranslationPaths)); } else if (reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION) { - setClipboardMessage(ReportActionsUtils.getExportIntegrationLastMessageText(reportAction)); + setClipboardMessage(ReportActionsUtils.getExportIntegrationMessageHTML(reportAction)); } else if (content) { setClipboardMessage( content.replace(/()(.*?)(<\/mention-user>)/gi, (match, openTag: string, innerContent: string, closeTag: string): string => { From 730a7150da8d90b5e2019e02125879a93cd6451a Mon Sep 17 00:00:00 2001 From: Andrew Rosiclair Date: Tue, 16 Jul 2024 14:52:29 -0400 Subject: [PATCH 23/23] use string type --- src/languages/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/languages/types.ts b/src/languages/types.ts index 9b9e7120e8f4..24117f257d8f 100644 --- a/src/languages/types.ts +++ b/src/languages/types.ts @@ -1,5 +1,5 @@ import type {OnyxInputOrEntry, ReportAction} from '@src/types/onyx'; -import type {ConnectionName, Unit} from '@src/types/onyx/Policy'; +import type {Unit} from '@src/types/onyx/Policy'; import type {ViolationDataType} from '@src/types/onyx/TransactionViolation'; import type en from './en'; @@ -311,7 +311,7 @@ type ChangeTypeParams = {oldType: string; newType: string}; type DelegateSubmitParams = {delegateUser: string; originalManager: string}; -type ExportedToIntegrationParams = {label: ConnectionName}; +type ExportedToIntegrationParams = {label: string}; type ForwardedParams = {amount: string; currency: string};