refactor: clean up unused variables and streamline tab management in Deal, Lead, and MobileLead components

This commit is contained in:
Shariq Ansari 2025-07-30 17:50:16 +05:30
parent 7e42599b49
commit ba99d14f68
3 changed files with 6 additions and 31 deletions

View File

@ -584,6 +584,7 @@ const tabs = computed(() => {
]
return tabOptions.filter((tab) => (tab.condition ? tab.condition() : true))
})
const { tabIndex } = useActiveTabManager(tabs, 'lastDealTab')
const sections = createResource({

View File

@ -314,10 +314,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',
@ -362,9 +365,6 @@ watch(
{ once: true },
)
const reload = ref(false)
const showFilesUploader = ref(false)
const breadcrumbs = computed(() => {
let items = [{ label: __('Leads'), route: { name: 'Leads' } }]
@ -396,10 +396,7 @@ const title = computed(() => {
})
usePageMeta(() => {
return {
title: title.value,
icon: brand.favicon,
}
return { title: title.value, icon: brand.favicon }
})
const tabs = computed(() => {
@ -456,17 +453,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'],
@ -506,8 +492,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)) {

View File

@ -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',