Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update "automatically paid" report action copy #49187

Merged
merged 14 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion help/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
title: New Expensify Help
---

Pages:
* [Expensify Superapp](/superapp.html)

- [Expensify Superapp](/superapp.html)
2 changes: 2 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,8 @@ const translations = {
`${submitterDisplayName} added a bank account. The ${amount} payment has been made.`,
paidElsewhereWithAmount: ({payer, amount}: PaidElsewhereWithAmountParams) => `${payer ? `${payer} ` : ''}paid ${amount} elsewhere`,
paidWithExpensifyWithAmount: ({payer, amount}: PaidWithExpensifyWithAmountParams) => `${payer ? `${payer} ` : ''}paid ${amount} with Expensify`,
automaticallyPaidWithExpensify: ({payer, amount}: PaidWithExpensifyWithAmountParams) =>
`${payer ? `${payer} ` : ''}automatically paid ${amount} with Expensify via <a href="${CONST.CONFIGURE_REIMBURSEMENT_SETTINGS_HELP_URL}">workspace rules</a>`,
noReimbursableExpenses: 'This report has an invalid amount',
pendingConversionMessage: "Total will update when you're back online",
changedTheExpense: 'changed the expense',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,8 @@ const translations = {
`${submitterDisplayName} añadió una cuenta bancaria. El pago de ${amount} se ha realizado.`,
paidElsewhereWithAmount: ({payer, amount}: PaidElsewhereWithAmountParams) => `${payer ? `${payer} ` : ''}pagó ${amount} de otra forma`,
paidWithExpensifyWithAmount: ({payer, amount}: PaidWithExpensifyWithAmountParams) => `${payer ? `${payer} ` : ''}pagó ${amount} con Expensify`,
automaticallyPaidWithExpensify: ({payer, amount}: PaidWithExpensifyWithAmountParams) =>
`${payer ? `${payer} ` : ''}auto-pagó ${amount} con Expensify via <a href="${CONST.CONFIGURE_REIMBURSEMENT_SETTINGS_HELP_URL}">reglas del espacio de trabajo</a>`,
noReimbursableExpenses: 'El importe de este informe no es válido',
pendingConversionMessage: 'El total se actualizará cuando estés online',
changedTheExpense: 'cambió el gasto',
Expand Down
8 changes: 7 additions & 1 deletion src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3438,6 +3438,9 @@ function getReportPreviewMessage(
report.isWaitingOnBankAccount
) {
translatePhraseKey = 'iou.paidWithExpensifyWithAmount';
if (originalMessage?.automaticAction) {
translatePhraseKey = 'iou.automaticallyPaidWithExpensify';
}
}

let actualPayerName = report.managerID === currentUserAccountID ? '' : getDisplayNameForParticipant(report.managerID, true);
Expand Down Expand Up @@ -7126,7 +7129,7 @@ function getIOUReportActionDisplayMessage(reportAction: OnyxEntry<ReportAction>,
return '';
}
const originalMessage = ReportActionsUtils.getOriginalMessage(reportAction);
const {IOUReportID} = originalMessage ?? {};
const {IOUReportID, automaticAction} = originalMessage ?? {};
const iouReport = getReportOrDraftReport(IOUReportID);
let translationKey: TranslationPaths;
if (originalMessage?.type === CONST.IOU.REPORT_ACTION_TYPE.PAY) {
Expand All @@ -7143,6 +7146,9 @@ function getIOUReportActionDisplayMessage(reportAction: OnyxEntry<ReportAction>,
case CONST.IOU.PAYMENT_TYPE.EXPENSIFY:
case CONST.IOU.PAYMENT_TYPE.VBBA:
translationKey = 'iou.paidWithExpensifyWithAmount';
if (automaticAction) {
translationKey = 'iou.automaticallyPaidWithExpensify';
}
break;
default:
translationKey = 'iou.payerPaidAmount';
Expand Down
3 changes: 3 additions & 0 deletions src/types/onyx/OriginalMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ type OriginalMessageIOU = {
/** How much was transactioned */
amount: number;

/** Was the action created automatically, not by a human */
automaticAction?: boolean;

/** Optional comment */
comment?: string;

Expand Down
Loading