fix: added Attachments tab in lead/deal page
This commit is contained in:
parent
ae93b7281a
commit
b40fd4a1af
@ -2,6 +2,7 @@
|
|||||||
<ActivityHeader
|
<ActivityHeader
|
||||||
v-model="tabIndex"
|
v-model="tabIndex"
|
||||||
v-model:showWhatsappTemplates="showWhatsappTemplates"
|
v-model:showWhatsappTemplates="showWhatsappTemplates"
|
||||||
|
v-model:showFilesUploader="showFilesUploader"
|
||||||
:tabs="tabs"
|
:tabs="tabs"
|
||||||
:title="title"
|
:title="title"
|
||||||
:doc="doc"
|
:doc="doc"
|
||||||
@ -362,6 +363,11 @@
|
|||||||
:label="__('Create Task')"
|
:label="__('Create Task')"
|
||||||
@click="modalRef.showTask()"
|
@click="modalRef.showTask()"
|
||||||
/>
|
/>
|
||||||
|
<Button
|
||||||
|
v-else-if="title == 'Attachments'"
|
||||||
|
:label="__('Upload Attachment')"
|
||||||
|
@click="showFilesUploader = true"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</FadedScrollableDiv>
|
</FadedScrollableDiv>
|
||||||
<div>
|
<div>
|
||||||
@ -395,6 +401,12 @@
|
|||||||
:doctype="doctype"
|
:doctype="doctype"
|
||||||
:doc="doc"
|
:doc="doc"
|
||||||
/>
|
/>
|
||||||
|
<FilesUploader
|
||||||
|
v-if="doc.data?.name"
|
||||||
|
v-model="showFilesUploader"
|
||||||
|
:doctype="doctype"
|
||||||
|
:docname="doc.data.name"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import ActivityHeader from '@/components/Activities/ActivityHeader.vue'
|
import ActivityHeader from '@/components/Activities/ActivityHeader.vue'
|
||||||
@ -409,6 +421,7 @@ import Email2Icon from '@/components/Icons/Email2Icon.vue'
|
|||||||
import PhoneIcon from '@/components/Icons/PhoneIcon.vue'
|
import PhoneIcon from '@/components/Icons/PhoneIcon.vue'
|
||||||
import NoteIcon from '@/components/Icons/NoteIcon.vue'
|
import NoteIcon from '@/components/Icons/NoteIcon.vue'
|
||||||
import TaskIcon from '@/components/Icons/TaskIcon.vue'
|
import TaskIcon from '@/components/Icons/TaskIcon.vue'
|
||||||
|
import AttachmentIcon from '@/components/Icons/AttachmentIcon.vue'
|
||||||
import WhatsAppIcon from '@/components/Icons/WhatsAppIcon.vue'
|
import WhatsAppIcon from '@/components/Icons/WhatsAppIcon.vue'
|
||||||
import WhatsAppArea from '@/components/Activities/WhatsAppArea.vue'
|
import WhatsAppArea from '@/components/Activities/WhatsAppArea.vue'
|
||||||
import WhatsAppBox from '@/components/Activities/WhatsAppBox.vue'
|
import WhatsAppBox from '@/components/Activities/WhatsAppBox.vue'
|
||||||
@ -426,6 +439,7 @@ import FadedScrollableDiv from '@/components/FadedScrollableDiv.vue'
|
|||||||
import CommunicationArea from '@/components/CommunicationArea.vue'
|
import CommunicationArea from '@/components/CommunicationArea.vue'
|
||||||
import WhatsappTemplateSelectorModal from '@/components/Modals/WhatsappTemplateSelectorModal.vue'
|
import WhatsappTemplateSelectorModal from '@/components/Modals/WhatsappTemplateSelectorModal.vue'
|
||||||
import AllModals from '@/components/Activities/AllModals.vue'
|
import AllModals from '@/components/Activities/AllModals.vue'
|
||||||
|
import FilesUploader from '@/components/FilesUploader/FilesUploader.vue'
|
||||||
import {
|
import {
|
||||||
timeAgo,
|
timeAgo,
|
||||||
dateFormat,
|
dateFormat,
|
||||||
@ -475,6 +489,7 @@ const tabIndex = defineModel('tabIndex')
|
|||||||
|
|
||||||
const reload_email = ref(false)
|
const reload_email = ref(false)
|
||||||
const modalRef = ref(null)
|
const modalRef = ref(null)
|
||||||
|
const showFilesUploader = ref(false)
|
||||||
|
|
||||||
const title = computed(() => props.tabs?.[tabIndex.value]?.name || 'Activity')
|
const title = computed(() => props.tabs?.[tabIndex.value]?.name || 'Activity')
|
||||||
|
|
||||||
@ -667,6 +682,8 @@ const emptyText = computed(() => {
|
|||||||
text = 'No Notes'
|
text = 'No Notes'
|
||||||
} else if (title.value == 'Tasks') {
|
} else if (title.value == 'Tasks') {
|
||||||
text = 'No Tasks'
|
text = 'No Tasks'
|
||||||
|
} else if (title.value == 'Attachments') {
|
||||||
|
text = 'No Attachments'
|
||||||
} else if (title.value == 'WhatsApp') {
|
} else if (title.value == 'WhatsApp') {
|
||||||
text = 'No WhatsApp Messages'
|
text = 'No WhatsApp Messages'
|
||||||
}
|
}
|
||||||
@ -685,6 +702,8 @@ const emptyTextIcon = computed(() => {
|
|||||||
icon = NoteIcon
|
icon = NoteIcon
|
||||||
} else if (title.value == 'Tasks') {
|
} else if (title.value == 'Tasks') {
|
||||||
icon = TaskIcon
|
icon = TaskIcon
|
||||||
|
} else if (title.value == 'Attachments') {
|
||||||
|
icon = AttachmentIcon
|
||||||
} else if (title.value == 'WhatsApp') {
|
} else if (title.value == 'WhatsApp') {
|
||||||
icon = WhatsAppIcon
|
icon = WhatsAppIcon
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,6 +55,16 @@
|
|||||||
</template>
|
</template>
|
||||||
<span>{{ __('New Task') }}</span>
|
<span>{{ __('New Task') }}</span>
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button
|
||||||
|
v-else-if="title == 'Attachments'"
|
||||||
|
variant="solid"
|
||||||
|
@click="showFilesUploader = true"
|
||||||
|
>
|
||||||
|
<template #prefix>
|
||||||
|
<FeatherIcon name="plus" class="h-4 w-4" />
|
||||||
|
</template>
|
||||||
|
<span>{{ __('Upload Attachment') }}</span>
|
||||||
|
</Button>
|
||||||
<div class="flex gap-2 shrink-0" v-else-if="title == 'WhatsApp'">
|
<div class="flex gap-2 shrink-0" v-else-if="title == 'WhatsApp'">
|
||||||
<Button
|
<Button
|
||||||
:label="__('Send Template')"
|
:label="__('Send Template')"
|
||||||
@ -91,6 +101,7 @@ import CommentIcon from '@/components/Icons/CommentIcon.vue'
|
|||||||
import PhoneIcon from '@/components/Icons/PhoneIcon.vue'
|
import PhoneIcon from '@/components/Icons/PhoneIcon.vue'
|
||||||
import NoteIcon from '@/components/Icons/NoteIcon.vue'
|
import NoteIcon from '@/components/Icons/NoteIcon.vue'
|
||||||
import TaskIcon from '@/components/Icons/TaskIcon.vue'
|
import TaskIcon from '@/components/Icons/TaskIcon.vue'
|
||||||
|
import AttachmentIcon from '@/components/Icons/AttachmentIcon.vue'
|
||||||
import WhatsAppIcon from '@/components/Icons/WhatsAppIcon.vue'
|
import WhatsAppIcon from '@/components/Icons/WhatsAppIcon.vue'
|
||||||
import { globalStore } from '@/stores/global'
|
import { globalStore } from '@/stores/global'
|
||||||
import { whatsappEnabled, callEnabled } from '@/composables/settings'
|
import { whatsappEnabled, callEnabled } from '@/composables/settings'
|
||||||
@ -110,6 +121,7 @@ const { makeCall } = globalStore()
|
|||||||
|
|
||||||
const tabIndex = defineModel()
|
const tabIndex = defineModel()
|
||||||
const showWhatsappTemplates = defineModel('showWhatsappTemplates')
|
const showWhatsappTemplates = defineModel('showWhatsappTemplates')
|
||||||
|
const showFilesUploader = defineModel('showFilesUploader')
|
||||||
|
|
||||||
const defaultActions = computed(() => {
|
const defaultActions = computed(() => {
|
||||||
let actions = [
|
let actions = [
|
||||||
@ -139,6 +151,11 @@ const defaultActions = computed(() => {
|
|||||||
label: __('New Task'),
|
label: __('New Task'),
|
||||||
onClick: () => props.modalRef.showTask(),
|
onClick: () => props.modalRef.showTask(),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
icon: h(AttachmentIcon, { class: 'h-4 w-4' }),
|
||||||
|
label: __('Upload Attachment'),
|
||||||
|
onClick: () => (showFilesUploader.value = true),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
icon: h(WhatsAppIcon, { class: 'h-4 w-4' }),
|
icon: h(WhatsAppIcon, { class: 'h-4 w-4' }),
|
||||||
label: __('New WhatsApp Message'),
|
label: __('New WhatsApp Message'),
|
||||||
|
|||||||
@ -564,6 +564,11 @@ const tabs = computed(() => {
|
|||||||
label: __('Notes'),
|
label: __('Notes'),
|
||||||
icon: NoteIcon,
|
icon: NoteIcon,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'Attachments',
|
||||||
|
label: __('Attachments'),
|
||||||
|
icon: AttachmentIcon,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'WhatsApp',
|
name: 'WhatsApp',
|
||||||
label: __('WhatsApp'),
|
label: __('WhatsApp'),
|
||||||
|
|||||||
@ -510,6 +510,11 @@ const tabs = computed(() => {
|
|||||||
label: __('Notes'),
|
label: __('Notes'),
|
||||||
icon: NoteIcon,
|
icon: NoteIcon,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'Attachments',
|
||||||
|
label: __('Attachments'),
|
||||||
|
icon: AttachmentIcon,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'WhatsApp',
|
name: 'WhatsApp',
|
||||||
label: __('WhatsApp'),
|
label: __('WhatsApp'),
|
||||||
|
|||||||
@ -254,6 +254,7 @@ import CommentIcon from '@/components/Icons/CommentIcon.vue'
|
|||||||
import PhoneIcon from '@/components/Icons/PhoneIcon.vue'
|
import PhoneIcon from '@/components/Icons/PhoneIcon.vue'
|
||||||
import TaskIcon from '@/components/Icons/TaskIcon.vue'
|
import TaskIcon from '@/components/Icons/TaskIcon.vue'
|
||||||
import NoteIcon from '@/components/Icons/NoteIcon.vue'
|
import NoteIcon from '@/components/Icons/NoteIcon.vue'
|
||||||
|
import AttachmentIcon from '@/components/Icons/AttachmentIcon.vue'
|
||||||
import WhatsAppIcon from '@/components/Icons/WhatsAppIcon.vue'
|
import WhatsAppIcon from '@/components/Icons/WhatsAppIcon.vue'
|
||||||
import IndicatorIcon from '@/components/Icons/IndicatorIcon.vue'
|
import IndicatorIcon from '@/components/Icons/IndicatorIcon.vue'
|
||||||
import ArrowUpRightIcon from '@/components/Icons/ArrowUpRightIcon.vue'
|
import ArrowUpRightIcon from '@/components/Icons/ArrowUpRightIcon.vue'
|
||||||
@ -467,6 +468,11 @@ const tabs = computed(() => {
|
|||||||
label: __('Notes'),
|
label: __('Notes'),
|
||||||
icon: NoteIcon,
|
icon: NoteIcon,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'Attachments',
|
||||||
|
label: __('Attachments'),
|
||||||
|
icon: AttachmentIcon,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'WhatsApp',
|
name: 'WhatsApp',
|
||||||
label: __('WhatsApp'),
|
label: __('WhatsApp'),
|
||||||
|
|||||||
@ -179,6 +179,7 @@ import CommentIcon from '@/components/Icons/CommentIcon.vue'
|
|||||||
import PhoneIcon from '@/components/Icons/PhoneIcon.vue'
|
import PhoneIcon from '@/components/Icons/PhoneIcon.vue'
|
||||||
import TaskIcon from '@/components/Icons/TaskIcon.vue'
|
import TaskIcon from '@/components/Icons/TaskIcon.vue'
|
||||||
import NoteIcon from '@/components/Icons/NoteIcon.vue'
|
import NoteIcon from '@/components/Icons/NoteIcon.vue'
|
||||||
|
import AttachmentIcon from '@/components/Icons/AttachmentIcon.vue'
|
||||||
import WhatsAppIcon from '@/components/Icons/WhatsAppIcon.vue'
|
import WhatsAppIcon from '@/components/Icons/WhatsAppIcon.vue'
|
||||||
import IndicatorIcon from '@/components/Icons/IndicatorIcon.vue'
|
import IndicatorIcon from '@/components/Icons/IndicatorIcon.vue'
|
||||||
import OrganizationsIcon from '@/components/Icons/OrganizationsIcon.vue'
|
import OrganizationsIcon from '@/components/Icons/OrganizationsIcon.vue'
|
||||||
@ -377,6 +378,11 @@ const tabs = computed(() => {
|
|||||||
label: __('Notes'),
|
label: __('Notes'),
|
||||||
icon: NoteIcon,
|
icon: NoteIcon,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'Attachments',
|
||||||
|
label: __('Attachments'),
|
||||||
|
icon: AttachmentIcon,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'WhatsApp',
|
name: 'WhatsApp',
|
||||||
label: __('WhatsApp'),
|
label: __('WhatsApp'),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user