@@ -5346,6 +5346,7 @@ function getTransactionReportName({
53465346 */
53475347function getReportPreviewMessage(
53485348 reportOrID: OnyxInputOrEntry<Report> | string,
5349+ conciergeReportID: string | undefined,
53495350 iouReportAction: OnyxInputOrEntry<ReportAction> = null,
53505351 shouldConsiderScanningReceiptOrPendingRoute = false,
53515352 isPreviewMessageForParentChatReport = false,
@@ -5358,7 +5359,7 @@ function getReportPreviewMessage(
53585359 const reportActionMessage = getReportActionHtml(iouReportAction);
53595360 if (isCopyAction) {
53605361 if (report) {
5361- return computeReportName({report, currentUserLogin: ''}) || (originalReportAction?.childReportName ?? '');
5362+ return computeReportName({report, currentUserLogin: '', conciergeReportID }) || (originalReportAction?.childReportName ?? '');
53625363 }
53635364 return originalReportAction?.childReportName ?? '';
53645365 }
@@ -5880,7 +5881,7 @@ function getReportName(reportNameInformation: GetReportNameParams): string {
58805881 const reportPolicy = policy ?? allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`];
58815882
58825883 // eslint-disable-next-line @typescript-eslint/no-deprecated
5883- const parentReportActionBasedName = computeReportNameBasedOnReportAction(translateLocal, parentReportAction, report, reportPolicy, parentReport);
5884+ const parentReportActionBasedName = computeReportNameBasedOnReportAction(translateLocal, parentReportAction, report, reportPolicy, parentReport, conciergeReportID );
58845885
58855886 if (parentReportActionBasedName) {
58865887 return parentReportActionBasedName;
@@ -7057,15 +7058,20 @@ function getMovedTransactionMessage(translate: LocalizedTranslate, action: Repor
70577058 return translate('iou.movedTransactionFrom', reportUrl, reportName);
70587059}
70597060
7060- function getUnreportedTransactionMessage(translate: LocalizedTranslate, action: ReportAction) {
7061+ function getUnreportedTransactionMessage(
7062+ translate: LocalizedTranslate,
7063+ action: ReportAction,
7064+ // TODO: Make this required when https://github.com/Expensify/App/issues/66411 is done
7065+ conciergeReportID?: string,
7066+ ) {
70617067 const movedTransactionOriginalMessage = getOriginalMessage(action) ?? {};
70627068 const {fromReportID} = movedTransactionOriginalMessage as OriginalMessageMovedTransaction;
70637069
70647070 const fromReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${fromReportID}`];
70657071
70667072 // This will be fixed as follow up https://github.com/Expensify/App/pull/75357
70677073 // eslint-disable-next-line @typescript-eslint/no-deprecated
7068- const reportName = Parser.htmlToText(getReportName({report: fromReport}) ?? fromReport?.reportName ?? '');
7074+ const reportName = Parser.htmlToText(getReportName({report: fromReport, conciergeReportID }) ?? fromReport?.reportName ?? '');
70697075
70707076 let reportUrl = getReportURLForCurrentContext(fromReportID);
70717077
@@ -7643,7 +7649,8 @@ function buildOptimisticReportPreview(
76437649 reportActionID?: string,
76447650): ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW> {
76457651 const hasReceipt = hasReceiptTransactionUtils(transaction);
7646- const message = getReportPreviewMessage(iouReport);
7652+ // TODO: We'll pass the conciergeReportID in the next PR. Ref: https://github.com/Expensify/App/issues/66411
7653+ const message = getReportPreviewMessage(iouReport, undefined);
76477654 const created = DateUtils.getDBTime();
76487655 const reportActorAccountID = (isInvoiceReport(iouReport) || isExpenseReport(iouReport) ? iouReport?.ownerAccountID : iouReport?.managerID) ?? -1;
76497656 const delegateAccountDetails = getPersonalDetailByEmail(delegateEmail);
@@ -7832,7 +7839,8 @@ function updateReportPreview(
78327839 }
78337840 }
78347841
7835- const message = getReportPreviewMessage(iouReport, reportPreviewAction);
7842+ // TODO: We'll pass the conciergeReportID in the next PR. Ref: https://github.com/Expensify/App/issues/66411
7843+ const message = getReportPreviewMessage(iouReport, undefined, reportPreviewAction);
78367844 const originalMessage = getOriginalMessage(reportPreviewAction);
78377845 return {
78387846 ...reportPreviewAction,
0 commit comments