diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 8e9926648c2c..84c68eae93d9 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -1290,6 +1290,15 @@ function getMemberChangeMessageFragment(reportAction: OnyxEntry): }; } +function getUpdateRoomDescriptionFragment(reportAction: ReportAction): Message { + const html = getUpdateRoomDescriptionMessage(reportAction); + return { + html: `${html}`, + text: getReportActionMessage(reportAction) ? getReportActionText(reportAction) : '', + type: CONST.REPORT.MESSAGE.TYPE.COMMENT, + }; +} + function getMemberChangeMessagePlainText(reportAction: OnyxEntry): string { const messageElements = getMemberChangeMessageElements(reportAction); return messageElements.map((element) => element.content).join(''); @@ -1608,6 +1617,7 @@ export { getLatestReportActionFromOnyxData, getLinkedTransactionID, getMemberChangeMessageFragment, + getUpdateRoomDescriptionFragment, getMemberChangeMessagePlainText, getReportActionMessageFragments, getMessageOfOldDotReportAction, diff --git a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx index b0a4d3d59d09..97b7e188222a 100644 --- a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx +++ b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx @@ -420,6 +420,8 @@ const ContextMenuActions: ContextMenuAction[] = [ Clipboard.setString(Localize.translateLocal(`violationDismissal.${violationName}.${reason}` as TranslationPaths)); } else if (reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION) { setClipboardMessage(ReportActionsUtils.getExportIntegrationMessageHTML(reportAction)); + } else if (reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.UPDATE_ROOM_DESCRIPTION) { + setClipboardMessage(ReportActionsUtils.getUpdateRoomDescriptionMessage(reportAction)); } else if (content) { setClipboardMessage( content.replace(/()(.*?)(<\/mention-user>)/gi, (match, openTag: string, innerContent: string, closeTag: string): string => { diff --git a/src/pages/home/report/ReportActionItem.tsx b/src/pages/home/report/ReportActionItem.tsx index 0cb9876b69f8..ff4917d9a74d 100644 --- a/src/pages/home/report/ReportActionItem.tsx +++ b/src/pages/home/report/ReportActionItem.tsx @@ -647,8 +647,13 @@ function ReportActionItem({ } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.MERGED_WITH_CASH_TRANSACTION) { children = ; } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.UPDATE_ROOM_DESCRIPTION) { - const message = ReportActionsUtils.getUpdateRoomDescriptionMessage(action); - children = ; + children = ( + + ); } else if (ReportActionsUtils.isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.DISMISSED_VIOLATION)) { children = ; } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.ADD_TAG) { diff --git a/src/pages/home/report/ReportActionItemMessage.tsx b/src/pages/home/report/ReportActionItemMessage.tsx index 4c9ed8bc78ff..d88a6792f7c9 100644 --- a/src/pages/home/report/ReportActionItemMessage.tsx +++ b/src/pages/home/report/ReportActionItemMessage.tsx @@ -60,6 +60,21 @@ function ReportActionItemMessage({action, transaction, displayAsGroup, reportID, ); } + if (action.actionName === CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.UPDATE_ROOM_DESCRIPTION) { + const fragment = ReportActionsUtils.getUpdateRoomDescriptionFragment(action); + return ( + + + + ); + } + let iouMessage: string | undefined; if (isIOUReport) { const originalMessage = action.actionName === CONST.REPORT.ACTIONS.TYPE.IOU ? ReportActionsUtils.getOriginalMessage(action) : null;