From bbd80769c68a971c8e37169d24af881046d05fc1 Mon Sep 17 00:00:00 2001 From: Francois Laithier Date: Tue, 24 Feb 2026 17:47:47 -0800 Subject: [PATCH 01/14] Make auto-submit DEW error messages appear from concierge, edit error message --- src/languages/en.ts | 1 + src/languages/es.ts | 1 + src/libs/ReportActionsUtils.ts | 1 + src/pages/inbox/report/PureReportActionItem.tsx | 13 +++++++++++-- src/types/onyx/OriginalMessage.ts | 3 +++ 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index fe10986c45d5..3e6a7a39adfe 100644 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1280,6 +1280,7 @@ const translations = { submitted: (memo?: string) => `submitted${memo ? `, saying ${memo}` : ''}`, automaticallySubmitted: `submitted via delay submissions`, queuedToSubmitViaDEW: 'queued to submit via custom approval workflow', + failedToAutoSubmitViaDEW: (reason: string) => `failed to submit the report via delay submissions because ${reason}`, queuedToApproveViaDEW: 'queued to approve via custom approval workflow', trackedAmount: (formattedAmount: string, comment?: string) => `tracking ${formattedAmount}${comment ? ` for ${comment}` : ''}`, splitAmount: (amount: string) => `split ${amount}`, diff --git a/src/languages/es.ts b/src/languages/es.ts index 308af6fe1d71..abb7a9550f99 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1111,6 +1111,7 @@ const translations: TranslationDeepObject = { submitted: (memo) => `enviado${memo ? `, dijo ${memo}` : ''}`, automaticallySubmitted: `envió mediante retrasar envíos`, queuedToSubmitViaDEW: 'en cola para enviar a través del flujo de aprobación personalizado', + failedToAutoSubmitViaDEW: (reason: string) => `failed to submit the report via delay submissions because ${reason}`, queuedToApproveViaDEW: 'en cola para aprobar a través del flujo de aprobación personalizado', trackedAmount: (formattedAmount, comment) => `realizó un seguimiento de ${formattedAmount}${comment ? ` para ${comment}` : ''}`, splitAmount: (amount) => `dividir ${amount}`, diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 2f9ba2aaf85d..e14b3160c2f1 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -874,6 +874,7 @@ function getReportActionActorAccountID( return reportAction?.actorAccountID; } + case CONST.REPORT.ACTIONS.TYPE.DEW_SUBMIT_FAILED: case CONST.REPORT.ACTIONS.TYPE.SUBMITTED: case CONST.REPORT.ACTIONS.TYPE.SUBMITTED_AND_CLOSED: case CONST.REPORT.ACTIONS.TYPE.APPROVED: diff --git a/src/pages/inbox/report/PureReportActionItem.tsx b/src/pages/inbox/report/PureReportActionItem.tsx index ab2ac5a5e132..26348a4567af 100644 --- a/src/pages/inbox/report/PureReportActionItem.tsx +++ b/src/pages/inbox/report/PureReportActionItem.tsx @@ -261,6 +261,7 @@ import ReportActionItemMessageWithExplain from './ReportActionItemMessageWithExp import ReportActionItemSingle from './ReportActionItemSingle'; import ReportActionItemThread from './ReportActionItemThread'; import TripSummary from './TripSummary'; +import Parser from '@libs/Parser'; type PureReportActionItemProps = { /** All the data of the policy collection */ @@ -1361,8 +1362,16 @@ function PureReportActionItem({ children = ; } } else if (isDynamicExternalWorkflowSubmitFailedAction(action)) { - const errorMessage = getOriginalMessage(action)?.message ?? translate('iou.error.genericCreateFailureMessage'); - children = ; + const wasSubmittedViaHarvesting = getOriginalMessage(action)?.harvesting ?? false; + + let errorMessage = getOriginalMessage(action)?.message ?? translate('iou.error.genericCreateFailureMessage'); + if (wasSubmittedViaHarvesting) { + errorMessage = translate('iou.failedToAutoSubmitViaDEW', errorMessage); + } + + children = ( + ${errorMessage}`} /> + ); } else if (isDynamicExternalWorkflowApproveFailedAction(action)) { const errorMessage = getOriginalMessage(action)?.message ?? translate('iou.error.genericCreateFailureMessage'); children = ; diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index 9636fdeea3da..d9588a9f9e05 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -1200,6 +1200,9 @@ type OriginalMessageDEWFailed = { /** Whether the action was automatic */ automaticAction?: boolean; + + /** Was the report submitted via harvesting (delayed submit) */ + harvesting?: boolean; }; /** From d9cd6f60a5b5897b8fefbcfd6e46f12efd3750ca Mon Sep 17 00:00:00 2001 From: Francois Laithier Date: Wed, 25 Feb 2026 17:33:47 -0800 Subject: [PATCH 02/14] Use prefix string whether error was with harvesting or not --- src/languages/en.ts | 1 + src/languages/es.ts | 3 ++- src/pages/inbox/report/PureReportActionItem.tsx | 15 ++++++++++----- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 3e6a7a39adfe..0bad06621440 100644 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1281,6 +1281,7 @@ const translations = { automaticallySubmitted: `submitted via delay submissions`, queuedToSubmitViaDEW: 'queued to submit via custom approval workflow', failedToAutoSubmitViaDEW: (reason: string) => `failed to submit the report via delay submissions because ${reason}`, + failedToSubmitViaDEW: (reason: string) => `failed to submit the report because ${reason}`, queuedToApproveViaDEW: 'queued to approve via custom approval workflow', trackedAmount: (formattedAmount: string, comment?: string) => `tracking ${formattedAmount}${comment ? ` for ${comment}` : ''}`, splitAmount: (amount: string) => `split ${amount}`, diff --git a/src/languages/es.ts b/src/languages/es.ts index abb7a9550f99..d6f0c27de93d 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1111,7 +1111,8 @@ const translations: TranslationDeepObject = { submitted: (memo) => `enviado${memo ? `, dijo ${memo}` : ''}`, automaticallySubmitted: `envió mediante retrasar envíos`, queuedToSubmitViaDEW: 'en cola para enviar a través del flujo de aprobación personalizado', - failedToAutoSubmitViaDEW: (reason: string) => `failed to submit the report via delay submissions because ${reason}`, + failedToAutoSubmitViaDEW: (reason: string) => `No se ha podido enviar este informe mediante retrasar envíos porque ${reason}`, + failedToSubmitViaDEW: (reason: string) => `No se ha podido enviar este informe porque ${reason}`, queuedToApproveViaDEW: 'en cola para aprobar a través del flujo de aprobación personalizado', trackedAmount: (formattedAmount, comment) => `realizó un seguimiento de ${formattedAmount}${comment ? ` para ${comment}` : ''}`, splitAmount: (amount) => `dividir ${amount}`, diff --git a/src/pages/inbox/report/PureReportActionItem.tsx b/src/pages/inbox/report/PureReportActionItem.tsx index 26348a4567af..e6e212414ffe 100644 --- a/src/pages/inbox/report/PureReportActionItem.tsx +++ b/src/pages/inbox/report/PureReportActionItem.tsx @@ -261,7 +261,6 @@ import ReportActionItemMessageWithExplain from './ReportActionItemMessageWithExp import ReportActionItemSingle from './ReportActionItemSingle'; import ReportActionItemThread from './ReportActionItemThread'; import TripSummary from './TripSummary'; -import Parser from '@libs/Parser'; type PureReportActionItemProps = { /** All the data of the policy collection */ @@ -1364,13 +1363,19 @@ function PureReportActionItem({ } else if (isDynamicExternalWorkflowSubmitFailedAction(action)) { const wasSubmittedViaHarvesting = getOriginalMessage(action)?.harvesting ?? false; - let errorMessage = getOriginalMessage(action)?.message ?? translate('iou.error.genericCreateFailureMessage'); - if (wasSubmittedViaHarvesting) { - errorMessage = translate('iou.failedToAutoSubmitViaDEW', errorMessage); + let failedSubmitReason = getOriginalMessage(action)?.message ?? translate('iou.error.genericCreateFailureMessage'); + + // Uncapitalize the first letter of the failure reason since it will be concatenated to the end of another one + if (failedSubmitReason.length) { + failedSubmitReason = failedSubmitReason[0].toLowerCase() + failedSubmitReason.slice(1); } + const reason = wasSubmittedViaHarvesting + ? translate('iou.failedToAutoSubmitViaDEW', failedSubmitReason) + : translate('iou.failedToSubmitViaDEW', failedSubmitReason); + children = ( - ${errorMessage}`} /> + ${reason}`} /> ); } else if (isDynamicExternalWorkflowApproveFailedAction(action)) { const errorMessage = getOriginalMessage(action)?.message ?? translate('iou.error.genericCreateFailureMessage'); From 8af6dc297053b708c3656005af438a95b83aabd1 Mon Sep 17 00:00:00 2001 From: Francois Laithier Date: Wed, 25 Feb 2026 18:00:54 -0800 Subject: [PATCH 03/14] Use same pattern for approve errors --- src/languages/en.ts | 2 ++ src/pages/inbox/report/PureReportActionItem.tsx | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 0bad06621440..796b99d7409a 100644 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1282,6 +1282,8 @@ const translations = { queuedToSubmitViaDEW: 'queued to submit via custom approval workflow', failedToAutoSubmitViaDEW: (reason: string) => `failed to submit the report via delay submissions because ${reason}`, failedToSubmitViaDEW: (reason: string) => `failed to submit the report because ${reason}`, + failedToAutoApproveViaDEW: (reason: string) => `failed to approve via workspace rules because ${reason}`, + failedToApproveViaDEW: (reason: string) => `failed to approve because ${reason}`, queuedToApproveViaDEW: 'queued to approve via custom approval workflow', trackedAmount: (formattedAmount: string, comment?: string) => `tracking ${formattedAmount}${comment ? ` for ${comment}` : ''}`, splitAmount: (amount: string) => `split ${amount}`, diff --git a/src/pages/inbox/report/PureReportActionItem.tsx b/src/pages/inbox/report/PureReportActionItem.tsx index e6e212414ffe..334e9bb48c3d 100644 --- a/src/pages/inbox/report/PureReportActionItem.tsx +++ b/src/pages/inbox/report/PureReportActionItem.tsx @@ -1378,8 +1378,21 @@ function PureReportActionItem({ ${reason}`} /> ); } else if (isDynamicExternalWorkflowApproveFailedAction(action)) { - const errorMessage = getOriginalMessage(action)?.message ?? translate('iou.error.genericCreateFailureMessage'); - children = ; + const wasAutoApproveAction = getOriginalMessage(action)?.automaticAction ?? false; + + let failedApproveReason = getOriginalMessage(action)?.message ?? translate('iou.error.genericCreateFailureMessage'); + // Uncapitalize the first letter of the failure reason since it will be concatenated to the end of another one + if (failedApproveReason.length) { + failedApproveReason = failedApproveReason[0].toLowerCase() + failedApproveReason.slice(1); + } + + const reason = wasAutoApproveAction + ? translate('iou.failedToAutoApproveViaDEW', failedApproveReason) + : translate('iou.failedToApproveViaDEW', failedApproveReason); + + children = ( + ${reason}`} /> + ); } else if (isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.IOU) && getOriginalMessage(action)?.type === CONST.IOU.REPORT_ACTION_TYPE.PAY) { const wasAutoPaid = getOriginalMessage(action)?.automaticAction ?? false; const paymentType = getOriginalMessage(action)?.paymentType; From d14f1e37d8f1c4abb8ece6af9aee20dfd47610b7 Mon Sep 17 00:00:00 2001 From: Francois Laithier Date: Wed, 25 Feb 2026 18:29:35 -0800 Subject: [PATCH 04/14] Make auto-approve error actions show from Concierge, update how message is shown --- src/languages/en.ts | 8 ++++---- src/libs/ReportActionsUtils.ts | 1 + .../inbox/report/PureReportActionItem.tsx | 19 ++++--------------- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 796b99d7409a..d668c30bbe9e 100644 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1280,10 +1280,10 @@ const translations = { submitted: (memo?: string) => `submitted${memo ? `, saying ${memo}` : ''}`, automaticallySubmitted: `submitted via delay submissions`, queuedToSubmitViaDEW: 'queued to submit via custom approval workflow', - failedToAutoSubmitViaDEW: (reason: string) => `failed to submit the report via delay submissions because ${reason}`, - failedToSubmitViaDEW: (reason: string) => `failed to submit the report because ${reason}`, - failedToAutoApproveViaDEW: (reason: string) => `failed to approve via workspace rules because ${reason}`, - failedToApproveViaDEW: (reason: string) => `failed to approve because ${reason}`, + failedToAutoSubmitViaDEW: (reason: string) => `failed to submit the report via delay submissions. ${reason}`, + failedToSubmitViaDEW: (reason: string) => `failed to submit the report. ${reason}`, + failedToAutoApproveViaDEW: (reason: string) => `failed to approve via workspace rules. ${reason}`, + failedToApproveViaDEW: (reason: string) => `failed to approve. ${reason}`, queuedToApproveViaDEW: 'queued to approve via custom approval workflow', trackedAmount: (formattedAmount: string, comment?: string) => `tracking ${formattedAmount}${comment ? ` for ${comment}` : ''}`, splitAmount: (amount: string) => `split ${amount}`, diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index e14b3160c2f1..60148868612b 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -875,6 +875,7 @@ function getReportActionActorAccountID( } case CONST.REPORT.ACTIONS.TYPE.DEW_SUBMIT_FAILED: + case CONST.REPORT.ACTIONS.TYPE.DEW_APPROVE_FAILED: case CONST.REPORT.ACTIONS.TYPE.SUBMITTED: case CONST.REPORT.ACTIONS.TYPE.SUBMITTED_AND_CLOSED: case CONST.REPORT.ACTIONS.TYPE.APPROVED: diff --git a/src/pages/inbox/report/PureReportActionItem.tsx b/src/pages/inbox/report/PureReportActionItem.tsx index 334e9bb48c3d..e606657ccbac 100644 --- a/src/pages/inbox/report/PureReportActionItem.tsx +++ b/src/pages/inbox/report/PureReportActionItem.tsx @@ -1364,34 +1364,23 @@ function PureReportActionItem({ const wasSubmittedViaHarvesting = getOriginalMessage(action)?.harvesting ?? false; let failedSubmitReason = getOriginalMessage(action)?.message ?? translate('iou.error.genericCreateFailureMessage'); - - // Uncapitalize the first letter of the failure reason since it will be concatenated to the end of another one - if (failedSubmitReason.length) { - failedSubmitReason = failedSubmitReason[0].toLowerCase() + failedSubmitReason.slice(1); - } - - const reason = wasSubmittedViaHarvesting + failedSubmitReason = wasSubmittedViaHarvesting ? translate('iou.failedToAutoSubmitViaDEW', failedSubmitReason) : translate('iou.failedToSubmitViaDEW', failedSubmitReason); children = ( - ${reason}`} /> + ${failedSubmitReason}`} /> ); } else if (isDynamicExternalWorkflowApproveFailedAction(action)) { const wasAutoApproveAction = getOriginalMessage(action)?.automaticAction ?? false; let failedApproveReason = getOriginalMessage(action)?.message ?? translate('iou.error.genericCreateFailureMessage'); - // Uncapitalize the first letter of the failure reason since it will be concatenated to the end of another one - if (failedApproveReason.length) { - failedApproveReason = failedApproveReason[0].toLowerCase() + failedApproveReason.slice(1); - } - - const reason = wasAutoApproveAction + failedApproveReason = wasAutoApproveAction ? translate('iou.failedToAutoApproveViaDEW', failedApproveReason) : translate('iou.failedToApproveViaDEW', failedApproveReason); children = ( - ${reason}`} /> + ${failedApproveReason}`} /> ); } else if (isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.IOU) && getOriginalMessage(action)?.type === CONST.IOU.REPORT_ACTION_TYPE.PAY) { const wasAutoPaid = getOriginalMessage(action)?.automaticAction ?? false; From dedb6e2bce4e1c89f067b1ea3172b8f3dba13e3c Mon Sep 17 00:00:00 2001 From: Francois Laithier Date: Wed, 25 Feb 2026 18:50:28 -0800 Subject: [PATCH 05/14] Add missing es translation --- src/languages/es.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/languages/es.ts b/src/languages/es.ts index d6f0c27de93d..aa28cbb2ff15 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1111,8 +1111,10 @@ const translations: TranslationDeepObject = { submitted: (memo) => `enviado${memo ? `, dijo ${memo}` : ''}`, automaticallySubmitted: `envió mediante retrasar envíos`, queuedToSubmitViaDEW: 'en cola para enviar a través del flujo de aprobación personalizado', - failedToAutoSubmitViaDEW: (reason: string) => `No se ha podido enviar este informe mediante retrasar envíos porque ${reason}`, - failedToSubmitViaDEW: (reason: string) => `No se ha podido enviar este informe porque ${reason}`, + failedToAutoSubmitViaDEW: (reason: string) => `no ha podido enviar este informe mediante retrasar envíos. ${reason}`, + failedToSubmitViaDEW: (reason: string) => `no ha podido enviar este informe. ${reason}`, + failedToAutoApproveViaDEW: (reason: string) => `no ha podido aprobar mediante workspace rules. ${reason}`, + failedToApproveViaDEW: (reason: string) => `no ha podido aprobar. ${reason}`, queuedToApproveViaDEW: 'en cola para aprobar a través del flujo de aprobación personalizado', trackedAmount: (formattedAmount, comment) => `realizó un seguimiento de ${formattedAmount}${comment ? ` para ${comment}` : ''}`, splitAmount: (amount) => `dividir ${amount}`, From eeb117e2943dd415b2a19135aa7322d7e6026250 Mon Sep 17 00:00:00 2001 From: Francois Laithier Date: Wed, 25 Feb 2026 18:54:26 -0800 Subject: [PATCH 06/14] Fix style --- .../inbox/report/PureReportActionItem.tsx | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/pages/inbox/report/PureReportActionItem.tsx b/src/pages/inbox/report/PureReportActionItem.tsx index e606657ccbac..2219c96f171c 100644 --- a/src/pages/inbox/report/PureReportActionItem.tsx +++ b/src/pages/inbox/report/PureReportActionItem.tsx @@ -1364,24 +1364,24 @@ function PureReportActionItem({ const wasSubmittedViaHarvesting = getOriginalMessage(action)?.harvesting ?? false; let failedSubmitReason = getOriginalMessage(action)?.message ?? translate('iou.error.genericCreateFailureMessage'); - failedSubmitReason = wasSubmittedViaHarvesting - ? translate('iou.failedToAutoSubmitViaDEW', failedSubmitReason) - : translate('iou.failedToSubmitViaDEW', failedSubmitReason); + failedSubmitReason = wasSubmittedViaHarvesting ? translate('iou.failedToAutoSubmitViaDEW', failedSubmitReason) : translate('iou.failedToSubmitViaDEW', failedSubmitReason); - children = ( - ${failedSubmitReason}`} /> - ); + children = ( + + ${failedSubmitReason}`} /> + + ); } else if (isDynamicExternalWorkflowApproveFailedAction(action)) { const wasAutoApproveAction = getOriginalMessage(action)?.automaticAction ?? false; let failedApproveReason = getOriginalMessage(action)?.message ?? translate('iou.error.genericCreateFailureMessage'); - failedApproveReason = wasAutoApproveAction - ? translate('iou.failedToAutoApproveViaDEW', failedApproveReason) - : translate('iou.failedToApproveViaDEW', failedApproveReason); + failedApproveReason = wasAutoApproveAction ? translate('iou.failedToAutoApproveViaDEW', failedApproveReason) : translate('iou.failedToApproveViaDEW', failedApproveReason); - children = ( - ${failedApproveReason}`} /> - ); + children = ( + + ${failedApproveReason}`} /> + + ); } else if (isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.IOU) && getOriginalMessage(action)?.type === CONST.IOU.REPORT_ACTION_TYPE.PAY) { const wasAutoPaid = getOriginalMessage(action)?.automaticAction ?? false; const paymentType = getOriginalMessage(action)?.paymentType; From fb912b95253331c7b4f6dcd3d896af6756ccc36c Mon Sep 17 00:00:00 2001 From: Francois Laithier Date: Wed, 25 Feb 2026 18:57:51 -0800 Subject: [PATCH 07/14] Add missing translations Coming from `npx ts-node ./scripts/generateTranslations.ts --compare-ref=main` since GH action wasn't working --- src/languages/de.ts | 4 ++++ src/languages/fr.ts | 5 +++++ src/languages/it.ts | 5 +++++ src/languages/ja.ts | 4 ++++ src/languages/nl.ts | 4 ++++ src/languages/pl.ts | 5 +++++ src/languages/pt-BR.ts | 4 ++++ src/languages/zh-hans.ts | 4 ++++ 8 files changed, 35 insertions(+) diff --git a/src/languages/de.ts b/src/languages/de.ts index cdc2e5526b00..2472796adb20 100644 --- a/src/languages/de.ts +++ b/src/languages/de.ts @@ -1517,6 +1517,10 @@ const translations: TranslationDeepObject = { }, duplicateNonDefaultWorkspacePerDiemError: 'Sie können Per-Diem-Ausgaben nicht über mehrere Workspaces hinweg duplizieren, da sich die Sätze zwischen den Workspaces unterscheiden können.', + failedToAutoSubmitViaDEW: (reason: string) => `Senden des Berichts über Übermittlungen verzögern fehlgeschlagen. ${reason}`, + failedToSubmitViaDEW: (reason: string) => `Der Bericht konnte nicht übermittelt werden. ${reason}`, + failedToAutoApproveViaDEW: (reason: string) => `Genehmigung über Workspace-Regeln fehlgeschlagen. ${reason}`, + failedToApproveViaDEW: (reason: string) => `Genehmigung fehlgeschlagen. ${reason}`, }, transactionMerge: { listPage: { diff --git a/src/languages/fr.ts b/src/languages/fr.ts index e2f830bb90bd..160b40656f6e 100644 --- a/src/languages/fr.ts +++ b/src/languages/fr.ts @@ -1522,6 +1522,11 @@ const translations: TranslationDeepObject = { }, duplicateNonDefaultWorkspacePerDiemError: 'Vous ne pouvez pas dupliquer les indemnités journalières entre plusieurs espaces de travail, car les taux peuvent différer d’un espace de travail à l’autre.', + failedToAutoSubmitViaDEW: (reason: string) => `échec de la soumission de la note de frais via soumissions différées. ${reason}`, + failedToSubmitViaDEW: (reason: string) => `échec de la soumission de la note de frais. ${reason}`, + failedToAutoApproveViaDEW: (reason: string) => + `impossible d’approuver via les règles de l’espace de travail. ${reason}`, + failedToApproveViaDEW: (reason: string) => `échec de l’approbation. ${reason}`, }, transactionMerge: { listPage: { diff --git a/src/languages/it.ts b/src/languages/it.ts index 71a693672a3a..100809b7d255 100644 --- a/src/languages/it.ts +++ b/src/languages/it.ts @@ -1513,6 +1513,11 @@ const translations: TranslationDeepObject = { format: (fragments: string, route: string) => `${fragments} tramite le regole dello spazio di lavoro`, }, duplicateNonDefaultWorkspacePerDiemError: 'Non puoi duplicare le spese di diaria tra diversi spazi di lavoro perché le tariffe potrebbero essere diverse tra gli spazi di lavoro.', + failedToAutoSubmitViaDEW: (reason: string) => `invio del resoconto non riuscito tramite rimanda invii. ${reason}`, + failedToSubmitViaDEW: (reason: string) => `invio del rapporto non riuscito. ${reason}`, + failedToAutoApproveViaDEW: (reason: string) => + `approvazione non riuscita tramite le regole dello spazio di lavoro. ${reason}`, + failedToApproveViaDEW: (reason: string) => `approvazione non riuscita. ${reason}`, }, transactionMerge: { listPage: { diff --git a/src/languages/ja.ts b/src/languages/ja.ts index 78da63366d2c..7b79ae4d805c 100644 --- a/src/languages/ja.ts +++ b/src/languages/ja.ts @@ -1503,6 +1503,10 @@ const translations: TranslationDeepObject = { format: (fragments: string, route: string) => `${fragments}(ワークスペースルール経由)`, }, duplicateNonDefaultWorkspacePerDiemError: 'ワークスペースごとに日当レートが異なる場合があるため、日当経費をワークスペース間で複製することはできません。', + failedToAutoSubmitViaDEW: (reason: string) => `提出を遅らせるを使ったレポートの送信に失敗しました。${reason}`, + failedToSubmitViaDEW: (reason: string) => `レポートの送信に失敗しました。${reason}`, + failedToAutoApproveViaDEW: (reason: string) => `ワークスペースルールで承認に失敗しました。${reason}`, + failedToApproveViaDEW: (reason: string) => `承認に失敗しました。${reason}`, }, transactionMerge: { listPage: { diff --git a/src/languages/nl.ts b/src/languages/nl.ts index fb7319713ee0..b0a85d6c6ddc 100644 --- a/src/languages/nl.ts +++ b/src/languages/nl.ts @@ -1511,6 +1511,10 @@ const translations: TranslationDeepObject = { format: (fragments: string, route: string) => `${fragments} via werkruimte­regels`, }, duplicateNonDefaultWorkspacePerDiemError: 'Je kunt dagvergoedingen niet dupliceren tussen werkruimtes, omdat de tarieven per werkruimte kunnen verschillen.', + failedToAutoSubmitViaDEW: (reason: string) => `rapport indienen via indiening uitstellen is mislukt. ${reason}`, + failedToSubmitViaDEW: (reason: string) => `het is niet gelukt om het rapport in te dienen. ${reason}`, + failedToAutoApproveViaDEW: (reason: string) => `goedkeuren via werkruimte­regels is mislukt. ${reason}`, + failedToApproveViaDEW: (reason: string) => `goedkeuren mislukt. ${reason}`, }, transactionMerge: { listPage: { diff --git a/src/languages/pl.ts b/src/languages/pl.ts index 78200c1d5e0b..b64859cf34f3 100644 --- a/src/languages/pl.ts +++ b/src/languages/pl.ts @@ -1511,6 +1511,11 @@ const translations: TranslationDeepObject = { }, duplicateNonDefaultWorkspacePerDiemError: 'Nie możesz duplikować wydatków z tytułu diet między przestrzeniami roboczymi, ponieważ stawki mogą się różnić między poszczególnymi przestrzeniami.', + failedToAutoSubmitViaDEW: (reason: string) => `nie udało się przesłać raportu przez opóźnianie wysyłki. ${reason}`, + failedToSubmitViaDEW: (reason: string) => `nie udało się wysłać raportu. ${reason}`, + failedToAutoApproveViaDEW: (reason: string) => + `nie udało się zatwierdzić przez zasady w przestrzeni roboczej. ${reason}`, + failedToApproveViaDEW: (reason: string) => `nie udało się zaakceptować. ${reason}`, }, transactionMerge: { listPage: { diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts index caba5c45cf8a..61d299275910 100644 --- a/src/languages/pt-BR.ts +++ b/src/languages/pt-BR.ts @@ -1508,6 +1508,10 @@ const translations: TranslationDeepObject = { format: (fragments: string, route: string) => `${fragments} via regras do espaço de trabalho`, }, duplicateNonDefaultWorkspacePerDiemError: 'Você não pode duplicar despesas de diárias entre espaços de trabalho porque as tarifas podem variar entre eles.', + failedToAutoSubmitViaDEW: (reason: string) => `falha ao enviar o relatório via adiar envios. ${reason}`, + failedToSubmitViaDEW: (reason: string) => `falha ao enviar o relatório. ${reason}`, + failedToAutoApproveViaDEW: (reason: string) => `falha ao aprovar pelas regras do workspace. ${reason}`, + failedToApproveViaDEW: (reason: string) => `falha ao aprovar. ${reason}`, }, transactionMerge: { listPage: { diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts index ebb52f8a4baf..25c8ab5427b1 100644 --- a/src/languages/zh-hans.ts +++ b/src/languages/zh-hans.ts @@ -1482,6 +1482,10 @@ const translations: TranslationDeepObject = { format: (fragments: string, route: string) => `${fragments} 通过 工作区规则`, }, duplicateNonDefaultWorkspacePerDiemError: '您无法在不同工作区之间复制每日津贴报销,因为各工作区的补贴标准可能不同。', + failedToAutoSubmitViaDEW: (reason: string) => `通过延迟提交提交报表失败。${reason}`, + failedToSubmitViaDEW: (reason: string) => `报表提交失败。${reason}`, + failedToAutoApproveViaDEW: (reason: string) => `未能通过工作区规则批准。${reason}`, + failedToApproveViaDEW: (reason: string) => `批准失败。${reason}`, }, transactionMerge: { listPage: { From 369a8e5e59f4b1979d3a48d2424d6a3b60466975 Mon Sep 17 00:00:00 2001 From: Francois Laithier Date: Thu, 26 Feb 2026 10:30:38 -0800 Subject: [PATCH 08/14] Use const vars instead of `let` --- src/pages/inbox/report/PureReportActionItem.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/inbox/report/PureReportActionItem.tsx b/src/pages/inbox/report/PureReportActionItem.tsx index 2219c96f171c..015f8c361000 100644 --- a/src/pages/inbox/report/PureReportActionItem.tsx +++ b/src/pages/inbox/report/PureReportActionItem.tsx @@ -1363,8 +1363,8 @@ function PureReportActionItem({ } else if (isDynamicExternalWorkflowSubmitFailedAction(action)) { const wasSubmittedViaHarvesting = getOriginalMessage(action)?.harvesting ?? false; - let failedSubmitReason = getOriginalMessage(action)?.message ?? translate('iou.error.genericCreateFailureMessage'); - failedSubmitReason = wasSubmittedViaHarvesting ? translate('iou.failedToAutoSubmitViaDEW', failedSubmitReason) : translate('iou.failedToSubmitViaDEW', failedSubmitReason); + const message = getOriginalMessage(action)?.message ?? translate('iou.error.genericCreateFailureMessage'); + const failedSubmitReason = wasSubmittedViaHarvesting ? translate('iou.failedToAutoSubmitViaDEW', message) : translate('iou.failedToSubmitViaDEW', message); children = ( @@ -1374,8 +1374,8 @@ function PureReportActionItem({ } else if (isDynamicExternalWorkflowApproveFailedAction(action)) { const wasAutoApproveAction = getOriginalMessage(action)?.automaticAction ?? false; - let failedApproveReason = getOriginalMessage(action)?.message ?? translate('iou.error.genericCreateFailureMessage'); - failedApproveReason = wasAutoApproveAction ? translate('iou.failedToAutoApproveViaDEW', failedApproveReason) : translate('iou.failedToApproveViaDEW', failedApproveReason); + const message = getOriginalMessage(action)?.message ?? translate('iou.error.genericCreateFailureMessage'); + const failedApproveReason = wasAutoApproveAction ? translate('iou.failedToAutoApproveViaDEW', message) : translate('iou.failedToApproveViaDEW', message); children = ( From 21493fd3e2f0806486e91786adf15aafc6347441 Mon Sep 17 00:00:00 2001 From: Francois Laithier Date: Thu, 26 Feb 2026 10:39:19 -0800 Subject: [PATCH 09/14] Move DEW action logic to `ReportActionsUtils.getReportActionMessageFragments()` --- src/libs/ReportActionsUtils.ts | 16 +++++++++++++ .../inbox/report/PureReportActionItem.tsx | 24 ------------------- 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 60148868612b..38232966fc13 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -2182,6 +2182,22 @@ function getReportActionMessageFragments(translate: LocalizedTranslate, action: return [{text: message, html: `${message}`, type: 'COMMENT'}]; } + if (isDynamicExternalWorkflowSubmitFailedAction(action)) { + const originalMessage = getOriginalMessage(action); + const wasSubmittedViaHarvesting = originalMessage?.harvesting ?? false; + const message = originalMessage?.message ?? translate('iou.error.genericCreateFailureMessage'); + const failedSubmitReason = wasSubmittedViaHarvesting ? translate('iou.failedToAutoSubmitViaDEW', message) : translate('iou.failedToSubmitViaDEW', message); + return [{text: message, html: `${failedSubmitReason}`, type: 'COMMENT'}]; + } + + if (isDynamicExternalWorkflowApproveFailedAction(action)) { + const originalMessage = getOriginalMessage(action); + const wasAutoApproveAction = originalMessage?.automaticAction ?? false; + const message = originalMessage?.message ?? translate('iou.error.genericCreateFailureMessage'); + const failedApproveReason = wasAutoApproveAction ? translate('iou.failedToAutoApproveViaDEW', message) : translate('iou.failedToApproveViaDEW', message); + return [{text: message, html: `${failedApproveReason}`, type: 'COMMENT'}]; + } + const actionMessage = action.previousMessage ?? action.message; if (Array.isArray(actionMessage)) { return actionMessage.filter((item): item is Message => !!item); diff --git a/src/pages/inbox/report/PureReportActionItem.tsx b/src/pages/inbox/report/PureReportActionItem.tsx index 015f8c361000..eadceb3eb7c9 100644 --- a/src/pages/inbox/report/PureReportActionItem.tsx +++ b/src/pages/inbox/report/PureReportActionItem.tsx @@ -178,8 +178,6 @@ import { isCreatedTaskReportAction, isDeletedAction, isDeletedParentAction as isDeletedParentActionUtils, - isDynamicExternalWorkflowApproveFailedAction, - isDynamicExternalWorkflowSubmitFailedAction, isIOURequestReportAction, isMarkAsClosedAction, isMessageDeleted, @@ -1360,28 +1358,6 @@ function PureReportActionItem({ } else { children = ; } - } else if (isDynamicExternalWorkflowSubmitFailedAction(action)) { - const wasSubmittedViaHarvesting = getOriginalMessage(action)?.harvesting ?? false; - - const message = getOriginalMessage(action)?.message ?? translate('iou.error.genericCreateFailureMessage'); - const failedSubmitReason = wasSubmittedViaHarvesting ? translate('iou.failedToAutoSubmitViaDEW', message) : translate('iou.failedToSubmitViaDEW', message); - - children = ( - - ${failedSubmitReason}`} /> - - ); - } else if (isDynamicExternalWorkflowApproveFailedAction(action)) { - const wasAutoApproveAction = getOriginalMessage(action)?.automaticAction ?? false; - - const message = getOriginalMessage(action)?.message ?? translate('iou.error.genericCreateFailureMessage'); - const failedApproveReason = wasAutoApproveAction ? translate('iou.failedToAutoApproveViaDEW', message) : translate('iou.failedToApproveViaDEW', message); - - children = ( - - ${failedApproveReason}`} /> - - ); } else if (isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.IOU) && getOriginalMessage(action)?.type === CONST.IOU.REPORT_ACTION_TYPE.PAY) { const wasAutoPaid = getOriginalMessage(action)?.automaticAction ?? false; const paymentType = getOriginalMessage(action)?.paymentType; From c23a10d803a55f4639aa03aba4de655a90467ff5 Mon Sep 17 00:00:00 2001 From: Francois Laithier Date: Thu, 26 Feb 2026 10:56:43 -0800 Subject: [PATCH 10/14] Add tests --- tests/unit/ReportActionsUtilsTest.ts | 71 ++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/tests/unit/ReportActionsUtilsTest.ts b/tests/unit/ReportActionsUtilsTest.ts index f1727bb15593..24c0f75dcdf3 100644 --- a/tests/unit/ReportActionsUtilsTest.ts +++ b/tests/unit/ReportActionsUtilsTest.ts @@ -1162,6 +1162,77 @@ describe('ReportActionsUtils', () => { // Then it should return the correct message fragments expect(expectedFragments).toEqual([{text: expectedMessage, html: `${expectedMessage}`, type: 'COMMENT'}]); }); + + it('should return the correct fragment for DEW_SUBMIT_FAILED with harvesting', () => { + const errorMessage = 'All expenses must be categorized before submitting'; + const action: ReportAction = { + actionName: CONST.REPORT.ACTIONS.TYPE.DEW_SUBMIT_FAILED, + reportActionID: '1', + created: '1', + message: [], + originalMessage: { + message: errorMessage, + harvesting: true, + }, + }; + + const fragments = ReportActionsUtils.getReportActionMessageFragments(translateLocal, action); + const expectedHtml = `${translateLocal('iou.failedToAutoSubmitViaDEW', errorMessage)}`; + expect(fragments).toEqual([{text: errorMessage, html: expectedHtml, type: 'COMMENT'}]); + }); + + it('should return the correct fragment for DEW_SUBMIT_FAILED without harvesting', () => { + const errorMessage = 'All expenses must be categorized before submitting'; + const action: ReportAction = { + actionName: CONST.REPORT.ACTIONS.TYPE.DEW_SUBMIT_FAILED, + reportActionID: '1', + created: '1', + message: [], + originalMessage: { + message: errorMessage, + }, + }; + + const fragments = ReportActionsUtils.getReportActionMessageFragments(translateLocal, action); + const expectedHtml = `${translateLocal('iou.failedToSubmitViaDEW', errorMessage)}`; + expect(fragments).toEqual([{text: errorMessage, html: expectedHtml, type: 'COMMENT'}]); + }); + + it('should return the correct fragment for DEW_APPROVE_FAILED with automaticAction', () => { + const errorMessage = 'This report cannot be approved'; + const action: ReportAction = { + actionName: CONST.REPORT.ACTIONS.TYPE.DEW_APPROVE_FAILED, + reportActionID: '1', + created: '1', + message: [], + originalMessage: { + message: errorMessage, + automaticAction: true, + }, + }; + + const fragments = ReportActionsUtils.getReportActionMessageFragments(translateLocal, action); + const expectedHtml = `${translateLocal('iou.failedToAutoApproveViaDEW', errorMessage)}`; + expect(fragments).toEqual([{text: errorMessage, html: expectedHtml, type: 'COMMENT'}]); + }); + + it('should return the correct fragment for DEW_APPROVE_FAILED without automaticAction', () => { + const errorMessage = 'This report cannot be approved'; + const action: ReportAction = { + actionName: CONST.REPORT.ACTIONS.TYPE.DEW_APPROVE_FAILED, + reportActionID: '1', + created: '1', + message: [], + originalMessage: { + message: errorMessage, + automaticAction: false, + }, + }; + + const fragments = ReportActionsUtils.getReportActionMessageFragments(translateLocal, action); + const expectedHtml = `${translateLocal('iou.failedToApproveViaDEW', errorMessage)}`; + expect(fragments).toEqual([{text: errorMessage, html: expectedHtml, type: 'COMMENT'}]); + }); }); describe('getSendMoneyFlowAction', () => { From c689c7f53ea8e0e2a2fdf89fff3dacce533c9cee Mon Sep 17 00:00:00 2001 From: Francois Laithier Date: Thu, 26 Feb 2026 11:05:22 -0800 Subject: [PATCH 11/14] Fix prettier --- tests/unit/libs/getClipboardTextTest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/libs/getClipboardTextTest.ts b/tests/unit/libs/getClipboardTextTest.ts index 042120d6357b..15c2480f9aed 100644 --- a/tests/unit/libs/getClipboardTextTest.ts +++ b/tests/unit/libs/getClipboardTextTest.ts @@ -1,5 +1,5 @@ -import Parser from '@libs/Parser'; import getClipboardText from '@libs/Clipboard/getClipboardText'; +import Parser from '@libs/Parser'; jest.mock('@libs/Parser', () => ({ // eslint-disable-next-line @typescript-eslint/naming-convention From 0a936049c6616e76a5b9cf07506706381bf32784 Mon Sep 17 00:00:00 2001 From: Francois Laithier Date: Thu, 26 Feb 2026 21:31:01 -0800 Subject: [PATCH 12/14] Use correct variables in `getReportActionMessageFragments` --- src/libs/ReportActionsUtils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 4cf08b97ebd1..9b599fb02b6a 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -2308,7 +2308,7 @@ function getReportActionMessageFragments(translate: LocalizedTranslate, action: const wasSubmittedViaHarvesting = originalMessage?.harvesting ?? false; const message = originalMessage?.message ?? translate('iou.error.genericCreateFailureMessage'); const failedSubmitReason = wasSubmittedViaHarvesting ? translate('iou.failedToAutoSubmitViaDEW', message) : translate('iou.failedToSubmitViaDEW', message); - return [{text: message, html: `${failedSubmitReason}`, type: 'COMMENT'}]; + return [{text: failedSubmitReason, html: `${failedSubmitReason}`, type: 'COMMENT'}]; } if (isDynamicExternalWorkflowApproveFailedAction(action)) { @@ -2316,7 +2316,7 @@ function getReportActionMessageFragments(translate: LocalizedTranslate, action: const wasAutoApproveAction = originalMessage?.automaticAction ?? false; const message = originalMessage?.message ?? translate('iou.error.genericCreateFailureMessage'); const failedApproveReason = wasAutoApproveAction ? translate('iou.failedToAutoApproveViaDEW', message) : translate('iou.failedToApproveViaDEW', message); - return [{text: message, html: `${failedApproveReason}`, type: 'COMMENT'}]; + return [{text: failedApproveReason, html: `${failedApproveReason}`, type: 'COMMENT'}]; } const actionMessage = action.previousMessage ?? action.message; From 49268b532675a45d53356883095dc86877397dc9 Mon Sep 17 00:00:00 2001 From: Francois Laithier Date: Thu, 26 Feb 2026 21:37:06 -0800 Subject: [PATCH 13/14] Update tests --- tests/unit/ReportActionsUtilsTest.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/unit/ReportActionsUtilsTest.ts b/tests/unit/ReportActionsUtilsTest.ts index d7e667789891..5011493567be 100644 --- a/tests/unit/ReportActionsUtilsTest.ts +++ b/tests/unit/ReportActionsUtilsTest.ts @@ -1200,8 +1200,9 @@ describe('ReportActionsUtils', () => { }; const fragments = ReportActionsUtils.getReportActionMessageFragments(translateLocal, action); - const expectedHtml = `${translateLocal('iou.failedToAutoSubmitViaDEW', errorMessage)}`; - expect(fragments).toEqual([{text: errorMessage, html: expectedHtml, type: 'COMMENT'}]); + const expectedText = translateLocal('iou.failedToAutoSubmitViaDEW', errorMessage); + const expectedHtml = `${expectedText}`; + expect(fragments).toEqual([{text: expectedText, html: expectedHtml, type: 'COMMENT'}]); }); it('should return the correct fragment for DEW_SUBMIT_FAILED without harvesting', () => { @@ -1217,8 +1218,9 @@ describe('ReportActionsUtils', () => { }; const fragments = ReportActionsUtils.getReportActionMessageFragments(translateLocal, action); - const expectedHtml = `${translateLocal('iou.failedToSubmitViaDEW', errorMessage)}`; - expect(fragments).toEqual([{text: errorMessage, html: expectedHtml, type: 'COMMENT'}]); + const expectedText = translateLocal('iou.failedToSubmitViaDEW', errorMessage); + const expectedHtml = `${expectedText}`; + expect(fragments).toEqual([{text: expectedText, html: expectedHtml, type: 'COMMENT'}]); }); it('should return the correct fragment for DEW_APPROVE_FAILED with automaticAction', () => { @@ -1235,8 +1237,9 @@ describe('ReportActionsUtils', () => { }; const fragments = ReportActionsUtils.getReportActionMessageFragments(translateLocal, action); - const expectedHtml = `${translateLocal('iou.failedToAutoApproveViaDEW', errorMessage)}`; - expect(fragments).toEqual([{text: errorMessage, html: expectedHtml, type: 'COMMENT'}]); + const expectedText = translateLocal('iou.failedToAutoApproveViaDEW', errorMessage); + const expectedHtml = `${expectedText}`; + expect(fragments).toEqual([{text: expectedText, html: expectedHtml, type: 'COMMENT'}]); }); it('should return the correct fragment for DEW_APPROVE_FAILED without automaticAction', () => { @@ -1253,8 +1256,9 @@ describe('ReportActionsUtils', () => { }; const fragments = ReportActionsUtils.getReportActionMessageFragments(translateLocal, action); - const expectedHtml = `${translateLocal('iou.failedToApproveViaDEW', errorMessage)}`; - expect(fragments).toEqual([{text: errorMessage, html: expectedHtml, type: 'COMMENT'}]); + const expectedText = translateLocal('iou.failedToApproveViaDEW', errorMessage); + const expectedHtml = `${expectedText}`; + expect(fragments).toEqual([{text: expectedText, html: expectedHtml, type: 'COMMENT'}]); }); }); From 1562f06080c07547bf8097b9a6438922b9058cd5 Mon Sep 17 00:00:00 2001 From: Francois Laithier Date: Fri, 27 Feb 2026 00:18:03 -0800 Subject: [PATCH 14/14] Fix incorrect Spanish translation --- src/languages/es.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/languages/es.ts b/src/languages/es.ts index 561b1cae52b5..3210946c3737 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1147,7 +1147,8 @@ const translations: TranslationDeepObject = { queuedToSubmitViaDEW: 'en cola para enviar a través del flujo de aprobación personalizado', failedToAutoSubmitViaDEW: (reason: string) => `no ha podido enviar este informe mediante retrasar envíos. ${reason}`, failedToSubmitViaDEW: (reason: string) => `no ha podido enviar este informe. ${reason}`, - failedToAutoApproveViaDEW: (reason: string) => `no ha podido aprobar mediante workspace rules. ${reason}`, + failedToAutoApproveViaDEW: (reason: string) => + `no ha podido aprobar mediante reglas del espacio de trabajo. ${reason}`, failedToApproveViaDEW: (reason: string) => `no ha podido aprobar. ${reason}`, queuedToApproveViaDEW: 'en cola para aprobar a través del flujo de aprobación personalizado', trackedAmount: (formattedAmount, comment) => `realizó un seguimiento de ${formattedAmount}${comment ? ` para ${comment}` : ''}`,