From b32720421fcafa61c85a3cf19013ae5a3d15657a Mon Sep 17 00:00:00 2001 From: Chuck Dries Date: Mon, 20 Oct 2025 15:58:30 -0700 Subject: [PATCH 1/3] Fix buildOptimisticIOUReportAction returning an existing reportActionID when it should generate a new one --- src/libs/ReportUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index c6688b847d21..e534c8c7e241 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -6716,7 +6716,7 @@ function buildOptimisticIOUReportAction(params: BuildOptimisticIOUReportActionPa automatic: false, isAttachmentOnly: false, originalMessage, - reportActionID: linkedExpenseReportAction?.reportActionID ?? reportActionID ?? rand64(), + reportActionID: reportActionID ?? rand64(), shouldShow: true, created, pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD, From c7d427a032c8efb5ee5ba568f8de6f47a38c9b96 Mon Sep 17 00:00:00 2001 From: Chuck Dries Date: Tue, 21 Oct 2025 09:54:50 -0700 Subject: [PATCH 2/3] Ignore existing calls to deprecated translateLocal in ReportUtils --- src/libs/ReportUtils.ts | 118 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 113 insertions(+), 5 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index e534c8c7e241..30907e3de388 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -1162,7 +1162,9 @@ Onyx.connect({ if (value ?? true) { return; } + // eslint-disable-next-line @typescript-eslint/no-deprecated hiddenTranslation = translateLocal('common.hidden'); + // eslint-disable-next-line @typescript-eslint/no-deprecated unavailableTranslation = translateLocal('workspace.common.unavailable'); }, }); @@ -3193,6 +3195,7 @@ function getGroupChatName(participants?: SelectedParticipant[], shouldApplyLimit .concat(shouldAddEllipsis ? '...' : ''); } + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('groupChat.defaultReportName', {displayName: getDisplayNameForParticipant({accountID: participantAccountIDs.at(0)})}); } @@ -3563,6 +3566,7 @@ function getDisplayNamesWithTooltips( let pronouns = user?.pronouns ?? undefined; if (pronouns?.startsWith(CONST.PRONOUNS.PREFIX)) { const pronounTranslationKey = pronouns.replace(CONST.PRONOUNS.PREFIX, ''); + // eslint-disable-next-line @typescript-eslint/no-deprecated pronouns = translateLocal(`pronouns.${pronounTranslationKey}` as TranslationPaths); } @@ -3602,10 +3606,10 @@ function getUserDetailTooltipText(accountID: number, fallbackUserDisplayName = ' */ function getDeletedParentActionMessageForChatReport(reportAction: OnyxEntry): string { // By default, let us display [Deleted message] - let deletedMessageText = translateLocal('parentReportAction.deletedMessage'); + let deletedMessageText = translateLocal('parentReportAction.deletedMessage'); // eslint-disable-line @typescript-eslint/no-deprecated if (isCreatedTaskReportAction(reportAction)) { // For canceled task report, let us display [Deleted task] - deletedMessageText = translateLocal('parentReportAction.deletedTask'); + deletedMessageText = translateLocal('parentReportAction.deletedTask'); // eslint-disable-line @typescript-eslint/no-deprecated } return deletedMessageText; } @@ -3636,7 +3640,7 @@ function getReimbursementQueuedActionMessage({ messageKey = 'iou.waitingOnBankAccount'; } - return translateLocal(messageKey, {submitterDisplayName}); + return translateLocal(messageKey, {submitterDisplayName}); // eslint-disable-line @typescript-eslint/no-deprecated } /** @@ -3654,9 +3658,11 @@ function getReimbursementDeQueuedOrCanceledActionMessage( const formattedAmount = convertToDisplayString(amount, currency); if (originalMessage?.cancellationReason === CONST.REPORT.CANCEL_PAYMENT_REASONS.ADMIN || originalMessage?.cancellationReason === CONST.REPORT.CANCEL_PAYMENT_REASONS.USER) { const payerOrApproverName = report?.managerID === currentUserAccountID || !isLHNPreview ? '' : getDisplayNameForParticipant({accountID: report?.managerID, shouldUseShortForm: true}); + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.adminCanceledRequest', {manager: payerOrApproverName, amount: formattedAmount}); } const submitterDisplayName = getDisplayNameForParticipant({accountID: report?.ownerAccountID, shouldUseShortForm: true}) ?? ''; + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.canceledRequest', {submitterDisplayName, amount: formattedAmount}); } @@ -3989,6 +3995,7 @@ function getPolicyExpenseChatName({report, personalDetailsList}: {report: OnyxEn const reportOwnerDisplayName = getDisplayNameForParticipant({accountID: ownerAccountID, shouldRemoveDomain: true}) || login; if (reportOwnerDisplayName) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('workspace.common.policyExpenseChatName', {displayName: reportOwnerDisplayName}); } @@ -4146,12 +4153,14 @@ function getMoneyRequestReportName({ payerOrApproverName = getDisplayNameForParticipant({accountID: report?.managerID}) ?? ''; } + // eslint-disable-next-line @typescript-eslint/no-deprecated const payerPaidAmountMessage = translateLocal('iou.payerPaidAmount', { payer: payerOrApproverName, amount: formattedAmount, }); if (isReportApproved({report})) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.managerApprovedAmount', { manager: payerOrApproverName, amount: formattedAmount, @@ -4159,15 +4168,18 @@ function getMoneyRequestReportName({ } if (report?.isWaitingOnBankAccount) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return `${payerPaidAmountMessage} ${CONST.DOT_SEPARATOR} ${translateLocal('iou.pending')}`; } if (!isSettled(report?.reportID) && hasNonReimbursableTransactions(report?.reportID)) { payerOrApproverName = getDisplayNameForParticipant({accountID: report?.ownerAccountID}) ?? ''; + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.payerSpentAmount', {payer: payerOrApproverName, amount: formattedAmount}); } if (isProcessingReport(report) || isOpenExpenseReport(report) || isOpenInvoiceReport(report) || moneyRequestTotal === 0) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.payerOwesAmount', {payer: payerOrApproverName, amount: formattedAmount}); } @@ -4757,10 +4769,12 @@ function getTransactionReportName({ reports?: SearchReport[]; }): string { if (isReversedTransaction(reportAction)) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('parentReportAction.reversedTransaction'); } if (isDeletedAction(reportAction)) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('parentReportAction.deletedExpense'); } @@ -4768,18 +4782,23 @@ function getTransactionReportName({ if (isEmptyObject(transaction)) { // Transaction data might be empty on app's first load, if so we fallback to Expense/Track Expense + // eslint-disable-next-line @typescript-eslint/no-deprecated return isTrackExpenseAction(reportAction) ? translateLocal('iou.createExpense') : translateLocal('iou.expense'); } if (isScanning(transaction)) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.receiptScanning', {count: 1}); } if (hasMissingSmartscanFieldsTransactionUtils(transaction)) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.receiptMissingDetails'); } + // eslint-disable-next-line @typescript-eslint/no-deprecated if (isFetchingWaypointsFromServer(transaction) && getMerchant(transaction) === translateLocal('iou.fieldPending')) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.fieldPending'); } @@ -4792,6 +4811,7 @@ function getTransactionReportName({ const formattedAmount = convertToDisplayString(amount, getCurrency(transaction)) ?? ''; const comment = getMerchantOrDescription(transaction); + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.threadExpenseReportName', {formattedAmount, comment: Parser.htmlToText(comment)}); } @@ -4836,15 +4856,18 @@ function getReportPreviewMessage( if (!isEmptyObject(linkedTransaction)) { if (isScanning(linkedTransaction)) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.receiptScanning', {count: 1}); } if (hasMissingSmartscanFieldsTransactionUtils(linkedTransaction)) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.receiptMissingDetails'); } const amount = getTransactionAmount(linkedTransaction, !isEmptyObject(report) && isExpenseReport(report), linkedTransaction?.reportID === CONST.REPORT.UNREPORTED_REPORT_ID) ?? 0; const formattedAmount = convertToDisplayString(amount, getCurrency(linkedTransaction)) ?? ''; + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.didSplitAmount', {formattedAmount, comment: getMerchantOrDescription(linkedTransaction)}); } } @@ -4858,15 +4881,18 @@ function getReportPreviewMessage( if (!isEmptyObject(linkedTransaction)) { if (isScanning(linkedTransaction)) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.receiptScanning', {count: 1}); } if (hasMissingSmartscanFieldsTransactionUtils(linkedTransaction)) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.receiptMissingDetails'); } const amount = getTransactionAmount(linkedTransaction, !isEmptyObject(report) && isExpenseReport(report), linkedTransaction?.reportID === CONST.REPORT.UNREPORTED_REPORT_ID) ?? 0; const formattedAmount = convertToDisplayString(amount, getCurrency(linkedTransaction)) ?? ''; + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.trackedAmount', {formattedAmount, comment: getMerchantOrDescription(linkedTransaction)}); } } @@ -4881,6 +4907,7 @@ function getReportPreviewMessage( const formattedAmount = convertToDisplayString(totalAmount, report.currency); if (isReportApproved({report}) && isPaidGroupPolicy(report)) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.managerApprovedAmount', { manager: payerName ?? '', amount: formattedAmount, @@ -4895,10 +4922,12 @@ function getReportPreviewMessage( } if (!isEmptyObject(linkedTransaction) && isScanning(linkedTransaction)) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.receiptScanning', {count: numberOfScanningReceipts}); } if (!isEmptyObject(linkedTransaction) && isFetchingWaypointsFromServer(linkedTransaction) && !getTransactionAmount(linkedTransaction)) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.fieldPending'); } @@ -4930,6 +4959,7 @@ function getReportPreviewMessage( actualPayerName = actualPayerName && isForListPreview && !isPreviewMessageForParentChatReport ? `${actualPayerName}:` : actualPayerName; const payerDisplayName = isPreviewMessageForParentChatReport ? payerName : actualPayerName; + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal(translatePhraseKey, { amount: '', payer: payerDisplayName ?? '', @@ -4939,6 +4969,7 @@ function getReportPreviewMessage( if (report.isWaitingOnBankAccount) { const submitterDisplayName = getDisplayNameForParticipant({accountID: report.ownerAccountID, shouldUseShortForm: true}) ?? ''; + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.waitingOnBankAccount', {submitterDisplayName}); } @@ -4967,13 +4998,16 @@ function getReportPreviewMessage( // We only want to show the actor name in the preview if it's not the current user who took the action const requestorName = lastActorID && lastActorID !== currentUserAccountID ? getDisplayNameForParticipant({accountID: lastActorID, shouldUseShortForm: !isPreviewMessageForParentChatReport}) : ''; + // eslint-disable-next-line @typescript-eslint/no-deprecated return `${requestorName ? `${requestorName}: ` : ''}${translateLocal('iou.expenseAmount', {formattedAmount: amountToDisplay, comment})}`; } if (containsNonReimbursable) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.payerSpentAmount', {payer: getDisplayNameForParticipant({accountID: report.ownerAccountID}) ?? '', amount: formattedAmount}); } + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.payerOwesAmount', {payer: payerName ?? '', amount: formattedAmount, comment}); } @@ -5049,13 +5083,17 @@ function getModifiedExpenseOriginalMessage( if ('reimbursable' in transactionChanges) { const oldReimbursable = getReimbursable(oldTransaction); + // eslint-disable-next-line @typescript-eslint/no-deprecated originalMessage.oldReimbursable = oldReimbursable ? translateLocal('common.reimbursable').toLowerCase() : translateLocal('iou.nonReimbursable').toLowerCase(); + // eslint-disable-next-line @typescript-eslint/no-deprecated originalMessage.reimbursable = transactionChanges?.reimbursable ? translateLocal('common.reimbursable').toLowerCase() : translateLocal('iou.nonReimbursable').toLowerCase(); } if ('billable' in transactionChanges) { const oldBillable = getBillable(oldTransaction); + // eslint-disable-next-line @typescript-eslint/no-deprecated originalMessage.oldBillable = oldBillable ? translateLocal('common.billable').toLowerCase() : translateLocal('common.nonBillable').toLowerCase(); + // eslint-disable-next-line @typescript-eslint/no-deprecated originalMessage.billable = transactionChanges?.billable ? translateLocal('common.billable').toLowerCase() : translateLocal('common.nonBillable').toLowerCase(); } @@ -5095,12 +5133,15 @@ function isChangeLogObject(originalMessage?: OriginalMessageChangeLog): Original */ function getAdminRoomInvitedParticipants(parentReportAction: OnyxEntry, parentReportActionMessage: string) { if (isEmptyObject(parentReportAction)) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return parentReportActionMessage || translateLocal('parentReportAction.deletedMessage'); } if (!getOriginalMessage(parentReportAction)) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return parentReportActionMessage || translateLocal('parentReportAction.deletedMessage'); } if (!isPolicyChangeLogAction(parentReportAction) && !isRoomChangeLogAction(parentReportAction)) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return parentReportActionMessage || translateLocal('parentReportAction.deletedMessage'); } @@ -5112,8 +5153,10 @@ function getAdminRoomInvitedParticipants(parentReportAction: OnyxEntry 0) { return name; } + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('common.hidden'); }); + // eslint-disable-next-line @typescript-eslint/no-deprecated const users = participants.length > 1 ? participants.join(` ${translateLocal('common.and')} `) : participants.at(0); if (!users) { return parentReportActionMessage; @@ -5124,7 +5167,9 @@ function getAdminRoomInvitedParticipants(parentReportAction: OnyxEntry, policy?: OnyxEntry, isPolicyNamePreferred = return ''; } if (isSelfDM(report)) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('reportActionsView.yourSpace'); } if (isInvoiceRoom(report)) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('workspace.common.invoices'); } if (isConciergeChatReport(report)) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('reportActionsView.conciergeSupport'); } if (!isDefaultRoom(report) && !isUserCreatedPolicyRoom(report) && !isPolicyExpenseChat(report)) { @@ -5729,6 +5803,7 @@ function getChatRoomSubtitle(report: OnyxEntry, isPolicyNamePreferred = return getPolicyName({report}); } + // eslint-disable-next-line @typescript-eslint/no-deprecated return `${getReportSubtitlePrefix(report)}${translateLocal('iou.submitsTo', {name: subtitle ?? ''})}`; } @@ -5764,6 +5839,7 @@ function getParentNavigationSubtitle(report: OnyxEntry, isParentReportAr if (isExpenseReport(report)) { return { + // eslint-disable-next-line @typescript-eslint/no-deprecated reportName: translateLocal('workspace.common.policyExpenseChatName', {displayName: reportOwnerDisplayName ?? ''}), workspaceName: getPolicyName({report}), }; @@ -5778,6 +5854,7 @@ function getParentNavigationSubtitle(report: OnyxEntry, isParentReportAr let reportName = `${getPolicyName({report: parentReport})} & ${getInvoicePayerName(parentReport)}`; if (isArchivedNonExpenseReport(parentReport, isParentReportArchived)) { + // eslint-disable-next-line @typescript-eslint/no-deprecated reportName += ` (${translateLocal('common.archived')})`; } @@ -6245,6 +6322,7 @@ function getHumanReadableStatus(statusNum: number): string { function populateOptimisticReportFormula(formula: string, report: OptimisticExpenseReport | OptimisticNewReport, policy: OnyxEntry, isMoneyRequestConfirmation = false): string { // If this is a newly created report and it is from money request confirmation, we should use 'New report' as the report title if (!report.parentReportActionID && isMoneyRequestConfirmation) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.newReport'); } @@ -6457,19 +6535,23 @@ function buildOptimisticEmptyReport(reportID: string, accountID: number, parentR } function getRejectedReportMessage() { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.rejectedThisReport'); } function getUpgradeWorkspaceMessage() { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('workspaceActions.upgradedWorkspace'); } function getDowngradeWorkspaceMessage() { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('workspaceActions.downgradedWorkspace'); } function getWorkspaceNameUpdatedMessage(action: ReportAction) { const {oldName, newName} = getOriginalMessage(action as ReportAction) ?? {}; + // eslint-disable-next-line @typescript-eslint/no-deprecated const message = oldName && newName ? translateLocal('workspaceActions.renamedWorkspaceNameAction', {oldName, newName}) : getReportActionText(action); return Str.htmlEncode(message); } @@ -6479,6 +6561,7 @@ function getDeletedTransactionMessage(action: ReportAction) { const amount = -(deletedTransactionOriginalMessage.amount ?? 0); const currency = deletedTransactionOriginalMessage.currency ?? ''; const formattedAmount = convertToDisplayString(amount, currency) ?? ''; + // eslint-disable-next-line @typescript-eslint/no-deprecated const message = translateLocal('iou.deletedTransaction', { amount: formattedAmount, merchant: deletedTransactionOriginalMessage.merchant ?? '', @@ -6489,12 +6572,14 @@ function getDeletedTransactionMessage(action: ReportAction) { function getMovedTransactionMessage(report: OnyxEntry) { const reportName = getReportName(report) ?? report?.reportName ?? ''; const reportUrl = getReportURLForCurrentContext(report?.reportID); + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.movedTransaction', {reportUrl, reportName}); } function getUnreportedTransactionMessage() { const selfDMReportID = findSelfDMReportID(); const reportUrl = `${environmentURL}/r/${selfDMReportID}`; + // eslint-disable-next-line @typescript-eslint/no-deprecated const message = translateLocal('iou.unreportedTransaction', { reportUrl, }); @@ -6512,6 +6597,7 @@ function getMovedActionMessage(action: ReportAction, report: OnyxEntry) } const {toPolicyID, newParentReportID, movedReportID} = movedActionOriginalMessage; const toPolicyName = getPolicyNameByID(toPolicyID); + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.movedAction', { shouldHideMovedReportUrl: !isDM(report), movedReportUrl: getReportURLForCurrentContext(movedReportID), @@ -6523,6 +6609,7 @@ function getMovedActionMessage(action: ReportAction, report: OnyxEntry) function getPolicyChangeMessage(action: ReportAction) { const PolicyChangeOriginalMessage = getOriginalMessage(action as ReportAction) ?? {}; const {fromPolicy: fromPolicyID, toPolicy: toPolicyID} = PolicyChangeOriginalMessage as OriginalMessageChangePolicy; + // eslint-disable-next-line @typescript-eslint/no-deprecated const message = translateLocal('report.actions.type.changeReportPolicy', { fromPolicyName: fromPolicyID ? getPolicyNameByID(fromPolicyID) : undefined, toPolicyName: getPolicyNameByID(toPolicyID), @@ -6597,13 +6684,16 @@ function getIOUReportActionMessage( if (isInvoice && isSettlingUp) { iouMessage = paymentType === CONST.IOU.PAYMENT_TYPE.ELSEWHERE + // eslint-disable-next-line @typescript-eslint/no-deprecated ? translateLocal('iou.payElsewhere', {formattedAmount: amount}) + // eslint-disable-next-line @typescript-eslint/no-deprecated : translateLocal(payAsBusiness ? 'iou.settleInvoiceBusiness' : 'iou.settleInvoicePersonal', {amount, last4Digits: String(bankAccountID).slice(-4)}); } else { iouMessage = isSettlingUp ? `paid ${amount}${paymentMethodMessage}` : `sent ${amount}${comment && ` for ${comment}`}${paymentMethodMessage}`; } break; case CONST.REPORT.ACTIONS.TYPE.SUBMITTED: + // eslint-disable-next-line @typescript-eslint/no-deprecated iouMessage = translateLocal('iou.expenseAmount', {formattedAmount: amount}); break; default: @@ -7528,6 +7618,7 @@ function buildOptimisticHoldReportAction(created = DateUtils.getDBTime()): Optim { type: CONST.REPORT.MESSAGE.TYPE.TEXT, style: 'normal', + // eslint-disable-next-line @typescript-eslint/no-deprecated text: translateLocal('iou.heldExpense'), }, ], @@ -7590,6 +7681,7 @@ function buildOptimisticUnHoldReportAction(created = DateUtils.getDBTime()): Opt { type: CONST.REPORT.MESSAGE.TYPE.TEXT, style: 'normal', + // eslint-disable-next-line @typescript-eslint/no-deprecated text: translateLocal('iou.unheldExpense'), }, ], @@ -7847,6 +7939,7 @@ function buildOptimisticResolvedDuplicatesReportAction(): OptimisticDismissedVio { type: CONST.REPORT.MESSAGE.TYPE.TEXT, style: 'normal', + // eslint-disable-next-line @typescript-eslint/no-deprecated text: translateLocal('violations.resolvedDuplicates'), }, ], @@ -8622,7 +8715,7 @@ function hasReportErrorsOtherThanFailedReceipt( return ( doesTransactionThreadReportHasViolations || doesReportHaveViolations || - Object.values(allReportErrors).some((error) => error?.[0] !== translateLocal('iou.error.genericSmartscanFailureMessage')) + Object.values(allReportErrors).some((error) => error?.[0] !== translateLocal('iou.error.genericSmartscanFailureMessage')) // eslint-disable-line @typescript-eslint/no-deprecated ); } @@ -9264,6 +9357,7 @@ function getWhisperDisplayNames(participantAccountIDs?: number[]): string | unde // When the current user is the only participant, the display name needs to be "you" because that's the only person reading it if (isWhisperOnlyVisibleToCurrentUser) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('common.youAfterPreposition'); } @@ -9669,6 +9763,7 @@ function getIOUReportActionDisplayMessage(reportAction: OnyxEntry, case CONST.IOU.PAYMENT_TYPE.EXPENSIFY: case CONST.IOU.PAYMENT_TYPE.VBBA: if (isInvoice) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal(payAsBusiness ? 'iou.settleInvoiceBusiness' : 'iou.settleInvoicePersonal', {amount: '', last4Digits}); } translationKey = 'iou.businessBankAccount'; @@ -9686,6 +9781,7 @@ function getIOUReportActionDisplayMessage(reportAction: OnyxEntry, break; } + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal(translationKey, {amount: '', payer: '', last4Digits}); } @@ -9694,11 +9790,13 @@ function getIOUReportActionDisplayMessage(reportAction: OnyxEntry, const isRequestSettled = isSettled(IOUReportID); const isApproved = isReportApproved({report: iouReport}); if (isRequestSettled) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.payerSettled', { amount: formattedAmount, }); } if (isApproved) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.approvedAmount', { amount: formattedAmount, }); @@ -9710,6 +9808,7 @@ function getIOUReportActionDisplayMessage(reportAction: OnyxEntry, } else { translationKey = 'iou.expenseAmount'; } + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal(translationKey, { formattedAmount, comment: getMerchantOrDescription(transaction), @@ -10751,7 +10850,7 @@ function prepareOnboardingOnyxData( // Sign-off welcome message const welcomeSignOffText = - engagementChoice === CONST.ONBOARDING_CHOICES.MANAGE_TEAM ? translateLocal('onboarding.welcomeSignOffTitleManageTeam') : translateLocal('onboarding.welcomeSignOffTitle'); + engagementChoice === CONST.ONBOARDING_CHOICES.MANAGE_TEAM ? translateLocal('onboarding.welcomeSignOffTitleManageTeam') : translateLocal('onboarding.welcomeSignOffTitle'); // eslint-disable-line @typescript-eslint/no-deprecated const welcomeSignOffComment = buildOptimisticAddCommentReportAction(welcomeSignOffText, undefined, actorAccountID, tasksData.length + 3); const welcomeSignOffCommentAction: OptimisticAddCommentReportAction = welcomeSignOffComment.reportAction; const welcomeSignOffMessage = { @@ -11249,6 +11348,7 @@ function getFieldViolationTranslation(reportField: PolicyReportField, violation? switch (violation) { case 'fieldRequired': + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('reportViolations.fieldRequired', {fieldName: reportField.name}); default: return ''; @@ -11737,6 +11837,7 @@ function hasReportBeenRetracted(report: OnyxEntry, reportActions?: OnyxE function getMoneyReportPreviewName(action: ReportAction, iouReport: OnyxEntry, isInvoice?: boolean, reportAttributes?: ReportAttributesDerivedValue['reports']) { if (isInvoice && isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW)) { const originalMessage = getOriginalMessage(action); + // eslint-disable-next-line @typescript-eslint/no-deprecated return originalMessage && translateLocal('iou.invoiceReportName', originalMessage); } return getReportName(iouReport, undefined, undefined, undefined, undefined, reportAttributes) || action.childReportName; @@ -11772,6 +11873,7 @@ function buildOptimisticRejectReportAction(created = DateUtils.getDBTime()): Opt { type: CONST.REPORT.MESSAGE.TYPE.TEXT, style: 'normal', + // eslint-disable-next-line @typescript-eslint/no-deprecated text: translateLocal('iou.reject.reportActions.rejectedExpense'), }, ], @@ -11834,6 +11936,7 @@ function buildOptimisticMarkedAsResolvedReportAction(created = DateUtils.getDBTi { type: CONST.REPORT.MESSAGE.TYPE.TEXT, style: 'normal', + // eslint-disable-next-line @typescript-eslint/no-deprecated text: translateLocal('iou.reject.reportActions.markedAsResolved'), }, ], @@ -11873,15 +11976,19 @@ function getReportStatusTranslation(stateNum?: number, statusNum?: number): stri } if (stateNum === CONST.REPORT.STATE_NUM.OPEN && statusNum === CONST.REPORT.STATUS_NUM.OPEN) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('common.draft'); } if (stateNum === CONST.REPORT.STATE_NUM.SUBMITTED && statusNum === CONST.REPORT.STATUS_NUM.SUBMITTED) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('common.outstanding'); } if (stateNum === CONST.REPORT.STATE_NUM.APPROVED && statusNum === CONST.REPORT.STATUS_NUM.CLOSED) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('common.done'); } if (stateNum === CONST.REPORT.STATE_NUM.APPROVED && statusNum === CONST.REPORT.STATUS_NUM.APPROVED) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.approved'); } if ( @@ -11889,6 +11996,7 @@ function getReportStatusTranslation(stateNum?: number, statusNum?: number): stri (stateNum === CONST.REPORT.STATE_NUM.BILLING && statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED) || (stateNum === CONST.REPORT.STATE_NUM.AUTOREIMBURSED && statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED) ) { + // eslint-disable-next-line @typescript-eslint/no-deprecated return translateLocal('iou.settledExpensify'); } From 44cb52c099871012cafa417f3c2eb5d8c13afe2e Mon Sep 17 00:00:00 2001 From: Chuck Dries Date: Tue, 21 Oct 2025 11:33:24 -0700 Subject: [PATCH 3/3] Run prettier --- src/libs/ReportUtils.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 3b2297733869..a271f93f6211 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -6683,10 +6683,10 @@ function getIOUReportActionMessage( if (isInvoice && isSettlingUp) { iouMessage = paymentType === CONST.IOU.PAYMENT_TYPE.ELSEWHERE - // eslint-disable-next-line @typescript-eslint/no-deprecated - ? translateLocal('iou.payElsewhere', {formattedAmount: amount}) - // eslint-disable-next-line @typescript-eslint/no-deprecated - : translateLocal(payAsBusiness ? 'iou.settleInvoiceBusiness' : 'iou.settleInvoicePersonal', {amount, last4Digits: String(bankAccountID).slice(-4)}); + ? // eslint-disable-next-line @typescript-eslint/no-deprecated + translateLocal('iou.payElsewhere', {formattedAmount: amount}) + : // eslint-disable-next-line @typescript-eslint/no-deprecated + translateLocal(payAsBusiness ? 'iou.settleInvoiceBusiness' : 'iou.settleInvoicePersonal', {amount, last4Digits: String(bankAccountID).slice(-4)}); } else { iouMessage = isSettlingUp ? `paid ${amount}${paymentMethodMessage}` : `sent ${amount}${comment && ` for ${comment}`}${paymentMethodMessage}`; }