refactor: clean up unused variables and streamline tab management in Deal, Lead, and MobileLead components
This commit is contained in:
parent
7e42599b49
commit
ba99d14f68
@ -584,6 +584,7 @@ const tabs = computed(() => {
|
|||||||
]
|
]
|
||||||
return tabOptions.filter((tab) => (tab.condition ? tab.condition() : true))
|
return tabOptions.filter((tab) => (tab.condition ? tab.condition() : true))
|
||||||
})
|
})
|
||||||
|
|
||||||
const { tabIndex } = useActiveTabManager(tabs, 'lastDealTab')
|
const { tabIndex } = useActiveTabManager(tabs, 'lastDealTab')
|
||||||
|
|
||||||
const sections = createResource({
|
const sections = createResource({
|
||||||
|
|||||||
@ -314,10 +314,13 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const reload = ref(false)
|
||||||
|
const activities = ref(null)
|
||||||
const errorTitle = ref('')
|
const errorTitle = ref('')
|
||||||
const errorMessage = ref('')
|
const errorMessage = ref('')
|
||||||
const showDeleteLinkedDocModal = ref(false)
|
const showDeleteLinkedDocModal = ref(false)
|
||||||
const showConvertToDealModal = ref(false)
|
const showConvertToDealModal = ref(false)
|
||||||
|
const showFilesUploader = ref(false)
|
||||||
|
|
||||||
const { triggerOnChange, assignees, document, scripts, error } = useDocument(
|
const { triggerOnChange, assignees, document, scripts, error } = useDocument(
|
||||||
'CRM Lead',
|
'CRM Lead',
|
||||||
@ -362,9 +365,6 @@ watch(
|
|||||||
{ once: true },
|
{ once: true },
|
||||||
)
|
)
|
||||||
|
|
||||||
const reload = ref(false)
|
|
||||||
const showFilesUploader = ref(false)
|
|
||||||
|
|
||||||
const breadcrumbs = computed(() => {
|
const breadcrumbs = computed(() => {
|
||||||
let items = [{ label: __('Leads'), route: { name: 'Leads' } }]
|
let items = [{ label: __('Leads'), route: { name: 'Leads' } }]
|
||||||
|
|
||||||
@ -396,10 +396,7 @@ const title = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
usePageMeta(() => {
|
usePageMeta(() => {
|
||||||
return {
|
return { title: title.value, icon: brand.favicon }
|
||||||
title: title.value,
|
|
||||||
icon: brand.favicon,
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const tabs = computed(() => {
|
const tabs = computed(() => {
|
||||||
@ -456,17 +453,6 @@ const tabs = computed(() => {
|
|||||||
|
|
||||||
const { tabIndex, changeTabTo } = useActiveTabManager(tabs, 'lastLeadTab')
|
const { tabIndex, changeTabTo } = useActiveTabManager(tabs, 'lastLeadTab')
|
||||||
|
|
||||||
watch(tabs, (value) => {
|
|
||||||
if (value && route.params.tabName) {
|
|
||||||
let index = value.findIndex(
|
|
||||||
(tab) => tab.name.toLowerCase() === route.params.tabName.toLowerCase(),
|
|
||||||
)
|
|
||||||
if (index !== -1) {
|
|
||||||
tabIndex.value = index
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const sections = createResource({
|
const sections = createResource({
|
||||||
url: 'crm.fcrm.doctype.crm_fields_layout.crm_fields_layout.get_sidepanel_sections',
|
url: 'crm.fcrm.doctype.crm_fields_layout.crm_fields_layout.get_sidepanel_sections',
|
||||||
cache: ['sidePanelSections', 'CRM Lead'],
|
cache: ['sidePanelSections', 'CRM Lead'],
|
||||||
@ -506,8 +492,6 @@ function deleteLead() {
|
|||||||
showDeleteLinkedDocModal.value = true
|
showDeleteLinkedDocModal.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const activities = ref(null)
|
|
||||||
|
|
||||||
function openEmailBox() {
|
function openEmailBox() {
|
||||||
let currentTab = tabs.value[tabIndex.value]
|
let currentTab = tabs.value[tabIndex.value]
|
||||||
if (!['Emails', 'Comments', 'Activities'].includes(currentTab.name)) {
|
if (!['Emails', 'Comments', 'Activities'].includes(currentTab.name)) {
|
||||||
|
|||||||
@ -384,18 +384,8 @@ const tabs = computed(() => {
|
|||||||
]
|
]
|
||||||
return tabOptions.filter((tab) => (tab.condition ? tab.condition() : true))
|
return tabOptions.filter((tab) => (tab.condition ? tab.condition() : true))
|
||||||
})
|
})
|
||||||
const { tabIndex } = useActiveTabManager(tabs, 'lastLeadTab')
|
|
||||||
|
|
||||||
watch(tabs, (value) => {
|
const { tabIndex } = useActiveTabManager(tabs, 'lastLeadTab')
|
||||||
if (value && route.params.tabName) {
|
|
||||||
let index = value.findIndex(
|
|
||||||
(tab) => tab.name.toLowerCase() === route.params.tabName.toLowerCase(),
|
|
||||||
)
|
|
||||||
if (index !== -1) {
|
|
||||||
tabIndex.value = index
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const sections = createResource({
|
const sections = createResource({
|
||||||
url: 'crm.fcrm.doctype.crm_fields_layout.crm_fields_layout.get_sidepanel_sections',
|
url: 'crm.fcrm.doctype.crm_fields_layout.crm_fields_layout.get_sidepanel_sections',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user