1
0
forked from test/crm

feat: added replyAll feat

This commit is contained in:
Shariq Ansari 2023-12-26 20:14:35 +05:30
parent 81fd7875d6
commit db6f50ff7d
2 changed files with 44 additions and 4 deletions

View File

@ -370,10 +370,17 @@
<Button
variant="ghost"
class="text-gray-700"
@click="reply(activity.data.content)"
@click="reply(activity.data)"
>
<ReplyIcon class="h-4 w-4" />
</Button>
<Button
variant="ghost"
class="text-gray-700"
@click="reply(activity.data, true)"
>
<ReplyAllIcon class="h-4 w-4" />
</Button>
</div>
</div>
<div class="mb-3 text-sm text-gray-600 leading-5">
@ -689,6 +696,7 @@ import EmailAtIcon from '@/components/Icons/EmailAtIcon.vue'
import InboundCallIcon from '@/components/Icons/InboundCallIcon.vue'
import OutboundCallIcon from '@/components/Icons/OutboundCallIcon.vue'
import ReplyIcon from '@/components/Icons/ReplyIcon.vue'
import ReplyAllIcon from '@/components/Icons/ReplyAllIcon.vue'
import AttachmentItem from '@/components/AttachmentItem.vue'
import CommunicationArea from '@/components/CommunicationArea.vue'
import NoteModal from '@/components/Modals/NoteModal.vue'
@ -1007,10 +1015,26 @@ function updateTaskStatus(status, task) {
}
// Email
function reply(message) {
function reply(email, reply_all = false) {
emailBox.value.show = true
let editor = emailBox.value.editor.editor
editor
let editor = emailBox.value.editor
let message = email.content
let recipients = email.recipients.split(',').map((r) => r.trim())
editor.toEmails = recipients
editor.cc = editor.bcc = false
if (reply_all) {
let cc = email.cc?.split(',').map((r) => r.trim())
let bcc = email.bcc?.split(',').map((r) => r.trim())
editor.cc = cc ? true : false
editor.bcc = bcc ? true : false
editor.ccEmails = cc
editor.bccEmails = bcc
}
editor.editor
.chain()
.clearContent()
.insertContent(message)

View File

@ -0,0 +1,16 @@
<template>
<svg
width="16"
height="16"
viewBox="0 0 16 16"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M5.85355 3.14645C5.65829 2.95118 5.34171 2.95118 5.14645 3.14645L1.14645 7.14645C0.951184 7.34171 0.951184 7.65829 1.14645 7.85355L5.14645 11.8536C5.34171 12.0488 5.65829 12.0488 5.85355 11.8536C6.04882 11.6583 6.04882 11.3417 5.85355 11.1464L2.20711 7.5L5.85355 3.85355C6.04882 3.65829 6.04882 3.34171 5.85355 3.14645ZM10 8C11.933 8 13.5 9.567 13.5 11.5V12C13.5 12.2761 13.7239 12.5 14 12.5C14.2761 12.5 14.5 12.2761 14.5 12V11.5C14.5 9.01472 12.4853 7 10 7H6.6728L9.81924 3.85355C10.0145 3.65829 10.0145 3.34171 9.81924 3.14645C9.62398 2.95118 9.3074 2.95118 9.11214 3.14645L5.11214 7.14645C4.91688 7.34171 4.91688 7.65829 5.11214 7.85355L9.11214 11.8536C9.3074 12.0488 9.62398 12.0488 9.81924 11.8536C10.0145 11.6583 10.0145 11.3417 9.81924 11.1464L6.6728 8H10Z"
fill="currentColor"
/>
</svg>
</template>