fix: send email button on empty state email tab

This commit is contained in:
Shariq Ansari 2023-08-30 14:34:50 +05:30
parent 4f23fa62c0
commit f0514f1a21
4 changed files with 14 additions and 4 deletions

View File

@ -244,6 +244,12 @@
label="Create note"
@click="emit('makeNote')"
/>
<Button
v-else-if="title == 'Emails'"
variant="solid"
label="Send email"
@click="emit('setFocusOnEmail')"
/>
</div>
</template>
<script setup>
@ -271,7 +277,7 @@ const props = defineProps({
},
})
const emit = defineEmits(['makeCall', 'makeNote', 'deleteNote'])
const emit = defineEmits(['makeCall', 'makeNote', 'deleteNote', 'setFocusOnEmail'])
const activities = computed(() => {
if (props.title == 'Calls') {

View File

@ -1,6 +1,7 @@
<template>
<div class="max-w-[81.7%] pl-16 p-4 pt-2">
<button
ref="sendEmailRef"
class="flex gap-2 w-full items-center rounded-lg p-2 bg-gray-100 hover:bg-gray-200"
@click="showCommunicationBox = true"
v-show="!showCommunicationBox"
@ -58,6 +59,7 @@ const { getUser } = usersStore()
const showCommunicationBox = ref(false)
const newEmail = ref('')
const newEmailEditor = ref(null)
const sendEmailRef = ref(null)
watch(
() => showCommunicationBox.value,
@ -99,7 +101,5 @@ async function submitComment() {
modelValue.value.reload()
}
function openPhoneCallDialog() {
//
}
defineExpose({ el: sendEmailRef })
</script>

View File

@ -76,10 +76,12 @@
@makeCall="makeCall(deal.data.mobile_no)"
@makeNote="(e) => showNote(e)"
@deleteNote="(e) => deleteNote(e)"
@setFocusOnEmail="() => $refs.sendEmailRef.el.click()"
/>
</TabPanel>
</TabPanels>
<CommunicationArea
ref="sendEmailRef"
v-if="[0, 1].includes(selectedIndex)"
v-model="deal"
/>

View File

@ -79,10 +79,12 @@
@makeCall="makeCall(lead.data.mobile_no)"
@makeNote="(e) => showNote(e)"
@deleteNote="(e) => deleteNote(e)"
@setFocusOnEmail="() => $refs.sendEmailRef.el.click()"
/>
</TabPanel>
</TabPanels>
<CommunicationArea
ref="sendEmailRef"
v-if="[0, 1].includes(selectedIndex)"
v-model="lead"
/>