diff --git a/app/javascript/dashboard/components-next/message/Message.vue b/app/javascript/dashboard/components-next/message/Message.vue index cf6cc0881..98323f79a 100644 --- a/app/javascript/dashboard/components-next/message/Message.vue +++ b/app/javascript/dashboard/components-next/message/Message.vue @@ -315,11 +315,7 @@ const componentToRender = computed(() => { }); const shouldShowContextMenu = computed(() => { - return !( - props.status === MESSAGE_STATUS.FAILED || - props.status === MESSAGE_STATUS.PROGRESS || - props.contentAttributes?.isUnsupported - ); + return !props.contentAttributes?.isUnsupported; }); const isBubble = computed(() => { @@ -344,12 +340,23 @@ const contextMenuEnabledOptions = computed(() => { const hasAttachments = !!(props.attachments && props.attachments.length > 0); const isOutgoing = props.messageType === MESSAGE_TYPES.OUTGOING; + const isFailedOrProcessing = + props.status === MESSAGE_STATUS.FAILED || + props.status === MESSAGE_STATUS.PROGRESS; return { copy: hasText, - delete: hasText || hasAttachments, - cannedResponse: isOutgoing && hasText, - replyTo: !props.private && props.inboxSupportsReplyTo.outgoing, + delete: + (hasText || hasAttachments) && + !isFailedOrProcessing && + !isMessageDeleted.value, + cannedResponse: isOutgoing && hasText && !isMessageDeleted.value, + copyLink: !isFailedOrProcessing, + translate: !isFailedOrProcessing && !isMessageDeleted.value && hasText, + replyTo: + !props.private && + props.inboxSupportsReplyTo.outgoing && + !isFailedOrProcessing, }; }); @@ -499,8 +506,8 @@ provideMessageContext({
conversationDynamicScroller.value?.$el -); -const conversationListScrollLock = useScrollLock( - conversationListScrollableElement -); + +provide('contextMenuElementTarget', conversationDynamicScroller); const activeAssigneeTab = ref(wootConstants.ASSIGNEE_TYPE.ME); const activeStatus = ref(wootConstants.STATUS_TYPE.OPEN); @@ -746,7 +741,6 @@ function allSelectedConversationsStatus(status) { function onContextMenuToggle(state) { isContextMenuOpen.value = state; - conversationListScrollLock.value = state; } function toggleSelectAll(check) { @@ -770,10 +764,6 @@ onMounted(() => { } }); -onUnmounted(() => { - conversationListScrollLock.value = false; -}); - provide('selectConversation', selectConversation); provide('deSelectConversation', deSelectConversation); provide('assignAgent', onAssignAgent); diff --git a/app/javascript/dashboard/components/ui/ContextMenu.vue b/app/javascript/dashboard/components/ui/ContextMenu.vue index e75e9bae7..0773e4fd2 100644 --- a/app/javascript/dashboard/components/ui/ContextMenu.vue +++ b/app/javascript/dashboard/components/ui/ContextMenu.vue @@ -1,6 +1,13 @@