diff --git a/src/CONST.ts b/src/CONST.ts index 88a35f1c3e8a..b7c330439475 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -709,6 +709,7 @@ const CONST = { FORWARDED: 'FORWARDED', // OldDot Action HOLD: 'HOLD', HOLD_COMMENT: 'HOLDCOMMENT', + INTEGRATION_SYNC_FAILED: 'INTEGRATIONSYNCFAILED', IOU: 'IOU', INTEGRATIONS_MESSAGE: 'INTEGRATIONSMESSAGE', // OldDot Action MANAGER_ATTACH_RECEIPT: 'MANAGERATTACHRECEIPT', // OldDot Action diff --git a/src/languages/en.ts b/src/languages/en.ts index a378df670367..1ad463cb576d 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3857,6 +3857,7 @@ export default { stripePaid: ({amount, currency}: StripePaidParams) => `paid ${currency}${amount}`, takeControl: `took control`, unapproved: ({amount, currency}: UnapprovedParams) => `unapproved ${currency}${amount}`, + integrationSyncFailed: (label: string, errorMessage: string) => `failed to sync with ${label} ("${errorMessage}")`, addEmployee: (email: string, role: string) => `added ${email} as ${role === 'user' ? 'member' : 'admin'}`, updateRole: (email: string, currentRole: string, newRole: string) => `updated the role of ${email} from ${currentRole} to ${newRole}`, removeMember: (email: string, role: string) => `removed ${role} ${email}`, diff --git a/src/languages/es.ts b/src/languages/es.ts index a106666bf2ca..76c2585d7f04 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -3909,6 +3909,7 @@ export default { stripePaid: ({amount, currency}: StripePaidParams) => `pagado ${currency}${amount}`, takeControl: `tomó el control`, unapproved: ({amount, currency}: UnapprovedParams) => `no aprobado ${currency}${amount}`, + integrationSyncFailed: (label: string, errorMessage: string) => `no se pudo sincronizar con ${label} ("${errorMessage}")`, addEmployee: (email: string, role: string) => `agregó a ${email} como ${role === 'user' ? 'miembro' : 'administrador'}`, updateRole: (email: string, currentRole: string, newRole: string) => `actualicé el rol ${email} de ${currentRole === 'user' ? 'miembro' : 'administrador'} a ${newRole === 'user' ? 'miembro' : 'administrador'}`, diff --git a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx index a3b5a98c8d2f..175d1b2d56ac 100644 --- a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx +++ b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx @@ -470,6 +470,9 @@ const ContextMenuActions: ContextMenuAction[] = [ setClipboardMessage(ReportActionsUtils.getPolicyChangeLogChangeRoleMessage(reportAction)); } else if (reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.DELETE_EMPLOYEE) { setClipboardMessage(ReportActionsUtils.getPolicyChangeLogDeleteMemberMessage(reportAction)); + } else if (ReportActionsUtils.isActionOfType(reportAction, CONST.REPORT.ACTIONS.TYPE.INTEGRATION_SYNC_FAILED)) { + const {label, errorMessage} = ReportActionsUtils.getOriginalMessage(reportAction) ?? {label: '', errorMessage: ''}; + setClipboardMessage(Localize.translateLocal('report.actions.type.integrationSyncFailed', label, errorMessage)); } else if (content) { setClipboardMessage( content.replace(/()(.*?)(<\/mention-user>)/gi, (match, openTag: string, innerContent: string, closeTag: string): string => { diff --git a/src/pages/home/report/ReportActionItem.tsx b/src/pages/home/report/ReportActionItem.tsx index c30d71038096..e4dab8518eb2 100644 --- a/src/pages/home/report/ReportActionItem.tsx +++ b/src/pages/home/report/ReportActionItem.tsx @@ -673,6 +673,9 @@ function ReportActionItem({ } else if (ReportActionsUtils.isRenamedAction(action)) { const message = ReportActionsUtils.getRenamedAction(action); children = ; + } else if (ReportActionsUtils.isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.INTEGRATION_SYNC_FAILED)) { + const {label, errorMessage} = ReportActionsUtils.getOriginalMessage(action) ?? {label: '', errorMessage: ''}; + children = ; } else { const hasBeenFlagged = ![CONST.MODERATION.MODERATOR_DECISION_APPROVED, CONST.MODERATION.MODERATOR_DECISION_PENDING].some((item) => item === moderationDecision) && diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index 8bcd5932bfc6..c18992923c21 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -496,6 +496,20 @@ type OriginalMessageUnapproved = { */ type OriginalMessageAddPaymentCard = Record; +/** + * Original message for INTEGRATIONSYNCFAILED actions + */ +type OriginalMessageIntegrationSyncFailed = { + /** The user friendly connection name */ + label: string; + + /** The source of the connection sync */ + source: string; + + /** The error message from Integration Server */ + errorMessage: string; +}; + /** The map type of original message */ type OriginalMessageMap = { /** */ @@ -624,6 +638,8 @@ type OriginalMessageMap = { [CONST.REPORT.ACTIONS.TYPE.CARD_MISSING_ADDRESS]: never; /** */ [CONST.REPORT.ACTIONS.TYPE.CARD_ISSUED_VIRTUAL]: never; + /** */ + [CONST.REPORT.ACTIONS.TYPE.INTEGRATION_SYNC_FAILED]: OriginalMessageIntegrationSyncFailed; } & OldDotOriginalMessageMap & { [T in ValueOf]: OriginalMessageChangeLog; } & {