diff --git a/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.js b/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.js index b379acf2a530..6cb7ce050e67 100755 --- a/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.js +++ b/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.js @@ -38,7 +38,7 @@ class BaseReportActionContextMenu extends React.Component { } render() { - const shouldShowFilter = contextAction => contextAction.shouldShow(this.props.type, this.props.reportAction, this.props.betas, this.props.anchor); + const shouldShowFilter = contextAction => contextAction.shouldShow(this.props.type, this.props.reportAction, this.props.isArchivedRoom, this.props.betas, this.props.anchor); return this.props.isVisible && ( diff --git a/src/pages/home/report/ContextMenu/ContextMenuActions.js b/src/pages/home/report/ContextMenu/ContextMenuActions.js index e059d055261c..7d84a9b318de 100644 --- a/src/pages/home/report/ContextMenu/ContextMenuActions.js +++ b/src/pages/home/report/ContextMenu/ContextMenuActions.js @@ -127,7 +127,7 @@ export default [ icon: Expensicons.LinkCopy, successIcon: Expensicons.Checkmark, successTextTranslateKey: 'reportActionContextMenu.copied', - shouldShow: (type, reportAction, betas, menuTarget) => { + shouldShow: (type, reportAction, isArchivedRoom, betas, menuTarget) => { const isAttachment = ReportUtils.isReportMessageAttachment(_.last(lodashGet(reportAction, ['message'], [{}]))); // Only hide the copylink menu item when context menu is opened over img element. @@ -162,8 +162,8 @@ export default [ { textTranslateKey: 'reportActionContextMenu.editComment', icon: Expensicons.Pencil, - shouldShow: (type, reportAction) => ( - type === CONTEXT_MENU_TYPES.REPORT_ACTION && ReportUtils.canEditReportAction(reportAction) + shouldShow: (type, reportAction, isArchivedRoom) => ( + type === CONTEXT_MENU_TYPES.REPORT_ACTION && ReportUtils.canEditReportAction(reportAction) && !isArchivedRoom ), onPress: (closePopover, {reportID, reportAction, draftMessage}) => { const editAction = () => Report.saveReportActionDraft( @@ -186,8 +186,8 @@ export default [ { textTranslateKey: 'reportActionContextMenu.deleteComment', icon: Expensicons.Trashcan, - shouldShow: (type, reportAction) => type === CONTEXT_MENU_TYPES.REPORT_ACTION - && ReportUtils.canDeleteReportAction(reportAction), + shouldShow: (type, reportAction, isArchivedRoom) => type === CONTEXT_MENU_TYPES.REPORT_ACTION + && ReportUtils.canDeleteReportAction(reportAction) && !isArchivedRoom, onPress: (closePopover, {reportID, reportAction}) => { if (closePopover) { // Hide popover, then call showDeleteConfirmModal diff --git a/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.js b/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.js index b59ddf87ace6..59b0ba31d021 100644 --- a/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.js +++ b/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.js @@ -223,6 +223,7 @@ class PopoverReportActionContextMenu extends React.Component { selection={this.state.selection} reportID={this.state.reportID} reportAction={this.state.reportAction} + isArchivedRoom={this.props.isArchivedRoom} anchor={this.contextMenuTargetNode} /> ); @@ -295,6 +296,7 @@ class PopoverReportActionContextMenu extends React.Component { reportID={this.state.reportID} reportAction={this.state.reportAction} draftMessage={this.state.reportActionDraftMessage} + isArchivedRoom={this.props.isArchivedRoom} anchor={this.contextMenuTargetNode} /> diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index 5818f07cc6e9..d06622c74684 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -218,6 +218,7 @@ class ReportActionItem extends Component { - + )}