Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions frontend/src/components/Activities/EmailArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@
class="text-ink-gray-7"
@click="reply(activity.data, true)"
/>
<Button
:tooltip="__('Forward')"
variant="ghost"
:icon="ForwardIcon"
class="text-ink-gray-7"
@click="forward(activity.data)"
/>
</div>
</div>
</div>
Expand Down Expand Up @@ -79,6 +86,7 @@
<script setup>
import ReplyIcon from '@/components/Icons/ReplyIcon.vue'
import ReplyAllIcon from '@/components/Icons/ReplyAllIcon.vue'
import ForwardIcon from '@/components/Icons/ForwardIcon.vue'
import AttachmentItem from '@/components/AttachmentItem.vue'
import EmailContent from '@/components/Activities/EmailContent.vue'
import { Badge, Tooltip } from 'frappe-ui'
Expand Down Expand Up @@ -138,6 +146,34 @@ function reply(email, reply_all = false) {
.run()
}

function forward(email) {
props.emailBox.show = true
let editor = props.emailBox.editor

editor.toEmails = []
editor.ccEmails = []
editor.bccEmails = []
editor.cc = editor.bcc = false

if (email.attachments?.length) {
props.emailBox.attachments = [...email.attachments]
} else {
props.emailBox.attachments = []
}

editor.subject = email.subject.startsWith('Fw:')
? email.subject
: `Fw: ${email.subject}`

editor.editor
.chain()
.clearContent()
.insertContent(`<blockquote>${email.content}</blockquote>`)
.insertContentAt(0, { type: 'paragraph' })
.focus('start')
.run()
}

const status = computed(() => {
let _status = props.activity?.data?.delivery_status
let indicator_color = 'red'
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/CommunicationArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,6 @@ defineExpose({
show: showEmailBox,
showComment: showCommentBox,
editor: newEmailEditor,
attachments: attachments,
})
</script>
16 changes: 16 additions & 0 deletions frontend/src/components/Icons/ForwardIcon.vue
Original file line number Diff line number Diff line change
@@ -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="M10.3536 3.14645C10.1583 2.95118 9.84171 2.95118 9.64645 3.14645C9.45118 3.34171 9.45118 3.65829 9.64645 3.85355L12.7929 7H6C3.51472 7 1.5 9.01472 1.5 11.5V12C1.5 12.2761 1.72386 12.5 2 12.5C2.27614 12.5 2.5 12.2761 2.5 12V11.5C2.5 9.567 4.067 8 6 8H12.7929L9.64645 11.1464C9.45118 11.3417 9.45118 11.6583 9.64645 11.8536C9.84171 12.0488 10.1583 12.0488 10.3536 11.8536L14.3536 7.85355C14.5488 7.65829 14.5488 7.34171 14.3536 7.14645L10.3536 3.14645Z"
fill="currentColor"
/>
</svg>
</template>