chore: MInor fix

This commit is contained in:
iamsivin
2025-05-23 12:51:40 +05:30
parent e973309610
commit d3e3809118
5 changed files with 36 additions and 7 deletions
@@ -355,7 +355,12 @@ const contextMenuEnabledOptions = computed(() => {
forwardEmail:
props.isEmailInbox &&
!props.private &&
props.status !== MESSAGE_STATUS.PROGRESS,
props.status !== MESSAGE_STATUS.PROGRESS &&
![
CONTENT_TYPES.FORM,
CONTENT_TYPES.INPUT_CSAT,
CONTENT_TYPES.CARDS,
].includes(props.contentType),
};
});
@@ -1,5 +1,12 @@
<script setup>
import { computed, useTemplateRef, ref, onMounted, reactive } from 'vue';
import {
computed,
useTemplateRef,
ref,
onMounted,
reactive,
inject,
} from 'vue';
import { Letter } from 'vue-letter';
import { allowedCssProperties } from 'lettersanitizer';
import { useToggle } from '@vueuse/core';
@@ -33,7 +40,7 @@ const contentContainer = useTemplateRef('contentContainer');
// Forward form - managed locally but can be triggered by parent
const [showForwardMessageModal, toggleForwardModal] = useToggle();
const forwardFormPosition = reactive({ top: 0, right: 0 });
const conversationPanelElement = document.querySelector('.conversation-panel');
const conversationPanelRef = inject('conversationPanelRef', null);
onMounted(() => {
isExpandable.value = contentContainer.value?.scrollHeight > 400;
@@ -229,7 +236,7 @@ defineExpose({
v-if="showForwardMessageModal"
:x="forwardFormPosition.x"
:y="forwardFormPosition.y"
:scroll-lock-element="conversationPanelElement"
:scroll-lock-element="conversationPanelRef?.$el"
@close="closeForwardModal"
>
<ForwardMessageForm
@@ -188,6 +188,15 @@ export default {
delete: this.hasText || this.hasAttachments,
cannedResponse: this.isOutgoing && this.hasText,
replyTo: !this.data.private && this.inboxSupportsReplyTo.outgoing,
forwardEmail:
this.isAnEmailInbox &&
!this.data.private &&
this.status !== MESSAGE_STATUS.PROGRESS &&
![
CONTENT_TYPES.FORM,
CONTENT_TYPES.INPUT_CSAT,
CONTENT_TYPES.CARDS,
].includes(this.contentType),
};
},
contentAttributes() {
@@ -1,5 +1,5 @@
<script>
import { ref } from 'vue';
import { ref, provide } from 'vue';
// composable
import { useConfig } from 'dashboard/composables/useConfig';
import { useKeyboardEvents } from 'dashboard/composables/useKeyboardEvents';
@@ -65,6 +65,7 @@ export default {
emits: ['contactPanelToggle'],
setup() {
const isPopOutReplyBox = ref(false);
const conversationPanelRef = ref(null);
const { isEnterprise } = useConfig();
const closePopOutReplyBox = () => {
@@ -100,6 +101,8 @@ export default {
FEATURE_FLAGS.CHATWOOT_V4
);
provide('conversationPanelRef', conversationPanelRef);
return {
isEnterprise,
isPopOutReplyBox,
@@ -110,6 +113,7 @@ export default {
fetchIntegrationsIfRequired,
fetchLabelSuggestions,
showNextBubbles,
conversationPanelRef,
};
},
data() {
@@ -543,6 +547,7 @@ export default {
</div>
<NextMessageList
v-if="showNextBubbles"
ref="conversationPanelRef"
class="conversation-panel"
:current-user-id="currentUserId"
:first-unread-id="unReadMessages[0]?.id"
@@ -584,7 +589,7 @@ export default {
/>
</template>
</NextMessageList>
<ul v-else class="conversation-panel">
<ul v-else ref="conversationPanelRef" class="conversation-panel">
<transition name="slide-up">
<!-- eslint-disable-next-line vue/require-toggle-inside-transition -->
<li class="min-h-[4rem]">
@@ -1,5 +1,6 @@
<script>
import { useAlert } from 'dashboard/composables';
import { inject } from 'vue';
import { mapGetters } from 'vuex';
import { useMessageFormatter } from 'shared/composables/useMessageFormatter';
import ContextMenu from 'dashboard/components/ui/ContextMenu.vue';
@@ -47,8 +48,10 @@ export default {
emits: ['open', 'close', 'replyTo', 'forwardEmail'],
setup() {
const { getPlainText } = useMessageFormatter();
const conversationPanelRef = inject('conversationPanelRef', null);
return {
getPlainText,
conversationPanelRef,
};
},
data() {
@@ -63,7 +66,7 @@ export default {
currentAccountId: 'getCurrentAccountId',
}),
conversationPanelElement() {
return document.querySelector('.conversation-panel');
return this.conversationPanelRef?.$el;
},
plainTextContent() {
return this.getPlainText(this.messageContent);