From 12ff53165bcb902290ef95666a6befc7a4e20e30 Mon Sep 17 00:00:00 2001 From: Yuwen Memon Date: Wed, 1 May 2024 21:06:54 -0700 Subject: [PATCH 1/5] Add support for MERGED_WITH_CASH_TRANSACTION system message --- src/CONST.ts | 1 + src/languages/en.ts | 3 +++ src/languages/es.ts | 3 +++ src/pages/home/report/ReportActionItem.tsx | 4 +++- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/CONST.ts b/src/CONST.ts index afe9bdd1114e..9404026ddc1b 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -666,6 +666,7 @@ const CONST = { MANAGER_DETACH_RECEIPT: 'MANAGERDETACHRECEIPT', // OldDot Action MARKED_REIMBURSED: 'MARKEDREIMBURSED', // OldDot Action MARK_REIMBURSED_FROM_INTEGRATION: 'MARKREIMBURSEDFROMINTEGRATION', // OldDot Action + MERGED_WITH_CASH_TRANSACTION: 'MERGEDWITHCASHTRANSACTION', MODIFIED_EXPENSE: 'MODIFIEDEXPENSE', MOVED: 'MOVED', OUTDATED_BANK_ACCOUNT: 'OUTDATEDBANKACCOUNT', // OldDot Action diff --git a/src/languages/en.ts b/src/languages/en.ts index 48df154a3a5c..2103cb7fa5fd 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -2953,4 +2953,7 @@ export default { offline: "You appear to be offline. Unfortunately, Expensify Classic doesn't work offline, but New Expensify does. If you prefer to use Expensify Classic, try again when you have an internet connection.", }, + systemMessage: { + mergedWithCashTransaction: 'matched a receipt to this transaction.', + }, } satisfies TranslationBase; diff --git a/src/languages/es.ts b/src/languages/es.ts index 544a1d562ced..29388b2bb8ca 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -3454,4 +3454,7 @@ export default { offline: 'Parece que estás desconectado. Desafortunadamente, Expensify Classic no funciona sin conexión, pero New Expensify sí. Si prefieres utilizar Expensify Classic, inténtalo de nuevo cuando tengas conexión a internet.', }, + systemMessage: { + mergedWithCashTransaction: 'encontró un recibo para esta transacción', + }, } satisfies EnglishTranslation; diff --git a/src/pages/home/report/ReportActionItem.tsx b/src/pages/home/report/ReportActionItem.tsx index 64cc31fca993..333143ca7fb4 100644 --- a/src/pages/home/report/ReportActionItem.tsx +++ b/src/pages/home/report/ReportActionItem.tsx @@ -611,7 +611,9 @@ function ReportActionItem({ } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.HOLD_COMMENT) { children = ; } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.UNHOLD) { - children = ; + children = ; + } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.MERGED_WITH_CASH_TRANSACTION) { + children = ; } else { const hasBeenFlagged = ![CONST.MODERATION.MODERATOR_DECISION_APPROVED, CONST.MODERATION.MODERATOR_DECISION_PENDING].some((item) => item === moderationDecision) && From 944e35d40cc48efdfce869c5116293eda0e5e283 Mon Sep 17 00:00:00 2001 From: Yuwen Memon Date: Wed, 1 May 2024 21:33:56 -0700 Subject: [PATCH 2/5] lint n' types --- src/pages/home/report/ReportActionItem.tsx | 2 +- src/types/onyx/OriginalMessage.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/pages/home/report/ReportActionItem.tsx b/src/pages/home/report/ReportActionItem.tsx index 333143ca7fb4..69198e7c8e2d 100644 --- a/src/pages/home/report/ReportActionItem.tsx +++ b/src/pages/home/report/ReportActionItem.tsx @@ -611,7 +611,7 @@ function ReportActionItem({ } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.HOLD_COMMENT) { children = ; } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.UNHOLD) { - children = ; + children = ; } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.MERGED_WITH_CASH_TRANSACTION) { children = ; } else { diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index 853ca8485c4a..a9559d49c965 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -311,6 +311,11 @@ type OriginalMessageMoved = { }; }; +type OriginalMessageMergedWithCashTranasction = { + actionName: typeof CONST.REPORT.ACTIONS.TYPE.MERGED_WITH_CASH_TRANSACTION; + originalMessage: Record; +}; + type OriginalMessage = | OriginalMessageApproved | OriginalMessageIOU @@ -334,7 +339,8 @@ type OriginalMessage = | OriginalMessageReimbursementDequeued | OriginalMessageMoved | OriginalMessageMarkedReimbursed - | OriginalMessageActionableTrackedExpenseWhisper; + | OriginalMessageActionableTrackedExpenseWhisper + | OriginalMessageMergedWithCashTranasction; export default OriginalMessage; export type { From 8faa75046df1691a638e268f2ee751e4a4017a41 Mon Sep 17 00:00:00 2001 From: Yuwen Memon Date: Thu, 2 May 2024 11:17:44 -0700 Subject: [PATCH 3/5] Prettier --- src/types/onyx/OriginalMessage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index 69b1b9727149..ceb0cdbea152 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -314,7 +314,7 @@ type OriginalMessageMoved = { type OriginalMessageMergedWithCashTranasction = { actionName: typeof CONST.REPORT.ACTIONS.TYPE.MERGED_WITH_CASH_TRANSACTION; originalMessage: Record; // No data is sent with this action -} +}; type OriginalMessageDismissedViolation = { actionName: typeof CONST.REPORT.ACTIONS.TYPE.DISMISSED_VIOLATION; From 9d3390ba8c8c09b5c197e5c3450339d6015e25ab Mon Sep 17 00:00:00 2001 From: Yuwen Memon Date: Fri, 3 May 2024 11:46:31 -0700 Subject: [PATCH 4/5] Update src/languages/es.ts Co-authored-by: Francois Laithier --- src/languages/es.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/es.ts b/src/languages/es.ts index 3057b1b78920..a4409c3b2e30 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -3462,6 +3462,6 @@ export default { 'Parece que estás desconectado. Desafortunadamente, Expensify Classic no funciona sin conexión, pero New Expensify sí. Si prefieres utilizar Expensify Classic, inténtalo de nuevo cuando tengas conexión a internet.', }, systemMessage: { - mergedWithCashTransaction: 'encontró un recibo para esta transacción', + mergedWithCashTransaction: 'encontró un recibo para esta transacción.', }, } satisfies EnglishTranslation; From a5cb2982c9eda612b9cf7cb2ef25e2732b8e227d Mon Sep 17 00:00:00 2001 From: Yuwen Memon Date: Fri, 3 May 2024 14:25:12 -0700 Subject: [PATCH 5/5] Fix typo in variable name --- src/types/onyx/OriginalMessage.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index ceb0cdbea152..da2be3675860 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -311,7 +311,7 @@ type OriginalMessageMoved = { }; }; -type OriginalMessageMergedWithCashTranasction = { +type OriginalMessageMergedWithCashTransaction = { actionName: typeof CONST.REPORT.ACTIONS.TYPE.MERGED_WITH_CASH_TRANSACTION; originalMessage: Record; // No data is sent with this action }; @@ -348,7 +348,7 @@ type OriginalMessage = | OriginalMessageMoved | OriginalMessageMarkedReimbursed | OriginalMessageActionableTrackedExpenseWhisper - | OriginalMessageMergedWithCashTranasction + | OriginalMessageMergedWithCashTransaction | OriginalMessageDismissedViolation; export default OriginalMessage;