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

Format message for olddot action #45683

Merged
merged 7 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 0 additions & 2 deletions src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -737,8 +737,6 @@ function getLastMessageTextForReport(report: OnyxEntry<Report>, lastActorDetails
lastMessageTextFromReport = ReportUtils.getIOUApprovedMessage(reportID);
} else if (ReportActionUtils.isActionableAddPaymentCard(lastReportAction)) {
lastMessageTextFromReport = ReportActionUtils.getReportActionMessageText(lastReportAction);
} else if (lastReportAction?.actionName === 'EXPORTINTEGRATION') {
lastMessageTextFromReport = ReportActionUtils.getExportIntegrationLastMessageText(lastReportAction);
} else if (lastReportAction?.actionName && ReportActionUtils.isOldDotReportAction(lastReportAction)) {
lastMessageTextFromReport = ReportActionUtils.getMessageOfOldDotReportAction(lastReportAction);
}
Expand Down
3 changes: 3 additions & 0 deletions src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1201,6 +1201,7 @@ function isOldDotReportAction(action: ReportAction | OldDotReportAction) {
CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_QUICK_BOOKS,
CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_REQUESTED,
CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_SETUP,
CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION,
].some((oldDotActionName) => oldDotActionName === action.actionName);
}

Expand Down Expand Up @@ -1274,6 +1275,8 @@ function getMessageOfOldDotReportAction(oldDotAction: PartialReportAction | OldD
return Localize.translateLocal('report.actions.type.unshare', {to: originalMessage.to});
case CONST.REPORT.ACTIONS.TYPE.TAKE_CONTROL:
return Localize.translateLocal('report.actions.type.takeControl');
case CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION:
return getExportIntegrationLastMessageText(oldDotAction as ReportAction);
default:
return '';
}
Expand Down
4 changes: 4 additions & 0 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3378,6 +3378,10 @@ function getReportName(report: OnyxEntry<Report>, policy?: OnyxEntry<Policy>, pa
return formatReportLastMessageText(formattedName);
}

if (!isEmptyObject(parentReportAction) && ReportActionsUtils.isOldDotReportAction(parentReportAction)) {
return ReportActionsUtils.getMessageOfOldDotReportAction(parentReportAction);
}

if (ReportActionsUtils.getReportActionMessage(parentReportAction)?.isDeletedParentAction) {
return Localize.translateLocal('parentReportAction.deletedMessage');
}
Expand Down
Loading