refactor: clean up unused variables and streamline tab management in Deal, Lead, and MobileLead components
(cherry picked from commit ba99d14f688de7eaa20be142e4b3184645b76305)
This commit is contained in:
parent
12b92b3f21
commit
d94c99b161
@ -587,6 +587,7 @@ const tabs = computed(() => {
|
||||
]
|
||||
return tabOptions.filter((tab) => (tab.condition ? tab.condition() : true))
|
||||
})
|
||||
|
||||
const { tabIndex } = useActiveTabManager(tabs, 'lastDealTab')
|
||||
|
||||
const sections = createResource({
|
||||
|
||||
@ -317,10 +317,13 @@ const props = defineProps({
|
||||
},
|
||||
})
|
||||
|
||||
const reload = ref(false)
|
||||
const activities = ref(null)
|
||||
const errorTitle = ref('')
|
||||
const errorMessage = ref('')
|
||||
const showDeleteLinkedDocModal = ref(false)
|
||||
const showConvertToDealModal = ref(false)
|
||||
const showFilesUploader = ref(false)
|
||||
|
||||
const { triggerOnChange, assignees, document, scripts, error } = useDocument(
|
||||
'CRM Lead',
|
||||
@ -365,9 +368,6 @@ watch(
|
||||
{ once: true },
|
||||
)
|
||||
|
||||
const reload = ref(false)
|
||||
const showFilesUploader = ref(false)
|
||||
|
||||
const breadcrumbs = computed(() => {
|
||||
let items = [{ label: __('Leads'), route: { name: 'Leads' } }]
|
||||
|
||||
@ -399,10 +399,7 @@ const title = computed(() => {
|
||||
})
|
||||
|
||||
usePageMeta(() => {
|
||||
return {
|
||||
title: title.value,
|
||||
icon: brand.favicon,
|
||||
}
|
||||
return { title: title.value, icon: brand.favicon }
|
||||
})
|
||||
|
||||
const tabs = computed(() => {
|
||||
@ -459,17 +456,6 @@ const tabs = computed(() => {
|
||||
|
||||
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({
|
||||
url: 'crm.fcrm.doctype.crm_fields_layout.crm_fields_layout.get_sidepanel_sections',
|
||||
cache: ['sidePanelSections', 'CRM Lead'],
|
||||
@ -509,8 +495,6 @@ function deleteLead() {
|
||||
showDeleteLinkedDocModal.value = true
|
||||
}
|
||||
|
||||
const activities = ref(null)
|
||||
|
||||
function openEmailBox() {
|
||||
let currentTab = tabs.value[tabIndex.value]
|
||||
if (!['Emails', 'Comments', 'Activities'].includes(currentTab.name)) {
|
||||
|
||||
@ -384,18 +384,8 @@ const tabs = computed(() => {
|
||||
]
|
||||
return tabOptions.filter((tab) => (tab.condition ? tab.condition() : true))
|
||||
})
|
||||
const { tabIndex } = 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 { tabIndex } = useActiveTabManager(tabs, 'lastLeadTab')
|
||||
|
||||
const sections = createResource({
|
||||
url: 'crm.fcrm.doctype.crm_fields_layout.crm_fields_layout.get_sidepanel_sections',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user