From c6d50fb3f1c25e4b531a9eaa072efcb346fbecfc Mon Sep 17 00:00:00 2001 From: Maria D'Costa Date: Fri, 7 Mar 2025 18:30:30 +0400 Subject: [PATCH] Merge pull request #58001 from daledah/fix/57977 [CP Staging] fix: refactor logics to show copy URL without reportID (cherry picked from commit 4d6696609e21d21d670a08de3d5e9807a00e4614) (CP triggered by puneetlath) --- .../home/report/ContextMenu/BaseReportActionContextMenu.tsx | 1 - src/pages/home/report/ContextMenu/ContextMenuActions.tsx | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx b/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx index 0aead849c16f..a7f4a0202760 100755 --- a/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx +++ b/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx @@ -205,7 +205,6 @@ function BaseReportActionContextMenu({ let filteredContextMenuActions = ContextMenuActions.filter( (contextAction) => !disabledActions.includes(contextAction) && - reportID && contextAction.shouldShow({ type, reportAction, diff --git a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx index fb45f60fb3c0..5cffa0fdbb1f 100644 --- a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx +++ b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx @@ -150,7 +150,7 @@ type ShouldShow = (args: { betas: OnyxEntry; menuTarget: MutableRefObject | undefined; isChronosReport: boolean; - reportID: string; + reportID?: string; isPinnedChat: boolean; isUnreadChat: boolean; isThreadReportParentAction: boolean; @@ -269,7 +269,7 @@ const ContextMenuActions: ContextMenuAction[] = [ textTranslateKey: 'reportActionContextMenu.replyInThread', icon: Expensicons.ChatBubbleReply, shouldShow: ({type, reportAction, reportID, isThreadReportParentAction}) => { - if (type !== CONST.CONTEXT_MENU_TYPES.REPORT_ACTION) { + if (type !== CONST.CONTEXT_MENU_TYPES.REPORT_ACTION || !reportID) { return false; } return !shouldDisableThread(reportAction, reportID, isThreadReportParentAction); @@ -755,6 +755,7 @@ const ContextMenuActions: ContextMenuAction[] = [ icon: Expensicons.Trashcan, shouldShow: ({type, reportAction, isArchivedRoom, isChronosReport, reportID, moneyRequestAction}) => // Until deleting parent threads is supported in FE, we will prevent the user from deleting a thread parent + !!reportID && type === CONST.CONTEXT_MENU_TYPES.REPORT_ACTION && canDeleteReportAction(moneyRequestAction ?? reportAction, reportID) && !isArchivedRoom &&