@@ -329,6 +329,7 @@ import { getView } from '@/utils/view'
import { getSettings } from '@/stores/settings'
import { globalStore } from '@/stores/global'
import { statusesStore } from '@/stores/statuses'
+import { getMeta } from '@/stores/meta'
import { whatsappEnabled, callEnabled } from '@/composables/settings'
import {
createResource,
@@ -347,6 +348,7 @@ import { useActiveTabManager } from '@/composables/useActiveTabManager'
const { brand } = getSettings()
const { $dialog, $socket, makeCall } = globalStore()
const { statusOptions, getDealStatus } = statusesStore()
+const { doctypeMeta } = getMeta('CRM Deal')
const route = useRoute()
const router = useRouter()
@@ -486,15 +488,20 @@ const breadcrumbs = computed(() => {
}
items.push({
- label: organization.data?.name || __('Untitled'),
+ label: title.value,
route: { name: 'Deal', params: { dealId: deal.data.name } },
})
return items
})
+const title = computed(() => {
+ let t = doctypeMeta['CRM Deal']?.title_field || 'name'
+ return deal.data?.[t] || props.dealId
+})
+
usePageMeta(() => {
return {
- title: organization.data?.name || deal.data?.name,
+ title: title.value,
icon: brand.favicon,
}
})
diff --git a/frontend/src/pages/Lead.vue b/frontend/src/pages/Lead.vue
index 1e8d728b..f68e5c53 100644
--- a/frontend/src/pages/Lead.vue
+++ b/frontend/src/pages/Lead.vue
@@ -71,7 +71,7 @@
- {{ lead.data.lead_name || __('Untitled') }}
+ {{ title }}
@@ -343,6 +343,7 @@ import { usersStore } from '@/stores/users'
import { globalStore } from '@/stores/global'
import { contactsStore } from '@/stores/contacts'
import { statusesStore } from '@/stores/statuses'
+import { getMeta } from '@/stores/meta'
import {
whatsappEnabled,
callEnabled,
@@ -370,6 +371,7 @@ const { isManager } = usersStore()
const { $dialog, $socket, makeCall } = globalStore()
const { getContactByName, contacts } = contactsStore()
const { statusOptions, getLeadStatus, getDealStatus } = statusesStore()
+const { doctypeMeta } = getMeta('CRM Lead')
const route = useRoute()
const router = useRouter()
@@ -476,15 +478,20 @@ const breadcrumbs = computed(() => {
}
items.push({
- label: lead.data.lead_name || __('Untitled'),
+ label: title.value,
route: { name: 'Lead', params: { leadId: lead.data.name } },
})
return items
})
+const title = computed(() => {
+ let t = doctypeMeta['CRM Lead']?.title_field || 'name'
+ return lead.data?.[t] || props.leadId
+})
+
usePageMeta(() => {
return {
- title: lead.data?.lead_name || lead.data?.name,
+ title: title.value,
icon: brand.favicon,
}
})
diff --git a/frontend/src/pages/MobileContact.vue b/frontend/src/pages/MobileContact.vue
index a3caf365..728ebc16 100644
--- a/frontend/src/pages/MobileContact.vue
+++ b/frontend/src/pages/MobileContact.vue
@@ -200,6 +200,7 @@ const { $dialog, makeCall } = globalStore()
const { getUser } = usersStore()
const { getOrganization } = organizationsStore()
const { getDealStatus } = statusesStore()
+const { doctypeMeta } = getMeta('Contact')
const props = defineProps({
contactId: {
@@ -250,15 +251,20 @@ const breadcrumbs = computed(() => {
}
items.push({
- label: contact.data?.full_name,
+ label: title.value,
route: { name: 'Contact', params: { contactId: props.contactId } },
})
return items
})
+const title = computed(() => {
+ let t = doctypeMeta['Contact']?.title_field || 'name'
+ return contact.data?.[t] || props.contactId
+})
+
usePageMeta(() => {
return {
- title: contact.data?.full_name || contact.data?.name,
+ title: title.value,
icon: brand.favicon,
}
})
diff --git a/frontend/src/pages/MobileDeal.vue b/frontend/src/pages/MobileDeal.vue
index b4fc37e5..c41ee341 100644
--- a/frontend/src/pages/MobileDeal.vue
+++ b/frontend/src/pages/MobileDeal.vue
@@ -262,6 +262,7 @@ import { getView } from '@/utils/view'
import { getSettings } from '@/stores/settings'
import { globalStore } from '@/stores/global'
import { statusesStore } from '@/stores/statuses'
+import { getMeta } from '@/stores/meta'
import {
whatsappEnabled,
callEnabled,
@@ -285,6 +286,7 @@ import { useRoute, useRouter } from 'vue-router'
const { brand } = getSettings()
const { $dialog, $socket } = globalStore()
const { statusOptions, getDealStatus } = statusesStore()
+const { doctypeMeta } = getMeta('CRM Deal')
const route = useRoute()
const router = useRouter()
@@ -408,15 +410,20 @@ const breadcrumbs = computed(() => {
}
items.push({
- label: organization.data?.name || __('Untitled'),
+ label: title.value,
route: { name: 'Deal', params: { dealId: deal.data.name } },
})
return items
})
+const title = computed(() => {
+ let t = doctypeMeta['CRM Deal']?.title_field || 'name'
+ return deal.data?.[t] || props.dealId
+})
+
usePageMeta(() => {
return {
- title: organization.data?.name || deal.data?.name,
+ title: title.value,
icon: brand.favicon,
}
})
diff --git a/frontend/src/pages/MobileLead.vue b/frontend/src/pages/MobileLead.vue
index df9d0df8..437d65a4 100644
--- a/frontend/src/pages/MobileLead.vue
+++ b/frontend/src/pages/MobileLead.vue
@@ -180,6 +180,7 @@ import { getSettings } from '@/stores/settings'
import { globalStore } from '@/stores/global'
import { contactsStore } from '@/stores/contacts'
import { statusesStore } from '@/stores/statuses'
+import { getMeta } from '@/stores/meta'
import {
whatsappEnabled,
callEnabled,
@@ -204,6 +205,7 @@ const { brand } = getSettings()
const { $dialog, $socket } = globalStore()
const { getContactByName, contacts } = contactsStore()
const { statusOptions, getLeadStatus } = statusesStore()
+const { doctypeMeta } = getMeta('CRM Lead')
const route = useRoute()
const router = useRouter()
@@ -312,15 +314,20 @@ const breadcrumbs = computed(() => {
}
items.push({
- label: lead.data.lead_name || __('Untitled'),
+ label: title.value,
route: { name: 'Lead', params: { leadId: lead.data.name } },
})
return items
})
+const title = computed(() => {
+ let t = doctypeMeta['CRM Lead']?.title_field || 'name'
+ return lead.data?.[t] || props.leadId
+})
+
usePageMeta(() => {
return {
- title: lead.data?.lead_name || lead.data?.name,
+ title: title.value,
icon: brand.favicon,
}
})
diff --git a/frontend/src/pages/MobileOrganization.vue b/frontend/src/pages/MobileOrganization.vue
index 721a952e..ba91553b 100644
--- a/frontend/src/pages/MobileOrganization.vue
+++ b/frontend/src/pages/MobileOrganization.vue
@@ -195,6 +195,7 @@ const { brand } = getSettings()
const { getUser } = usersStore()
const { $dialog } = globalStore()
const { getDealStatus } = statusesStore()
+const { doctypeMeta } = getMeta('CRM Organization')
const route = useRoute()
const router = useRouter()
@@ -241,7 +242,7 @@ const breadcrumbs = computed(() => {
}
items.push({
- label: props.organizationId,
+ label: title.value,
route: {
name: 'Organization',
params: { organizationId: props.organizationId },
@@ -250,9 +251,14 @@ const breadcrumbs = computed(() => {
return items
})
+const title = computed(() => {
+ let t = doctypeMeta['CRM Organization']?.title_field || 'name'
+ return organization.doc?.[t] || props.organizationId
+})
+
usePageMeta(() => {
return {
- title: props.organizationId,
+ title: title.value,
icon: brand.favicon,
}
})
diff --git a/frontend/src/pages/Organization.vue b/frontend/src/pages/Organization.vue
index 74fd9c6f..eeb95afa 100644
--- a/frontend/src/pages/Organization.vue
+++ b/frontend/src/pages/Organization.vue
@@ -215,6 +215,7 @@ const { brand } = getSettings()
const { getUser } = usersStore()
const { $dialog } = globalStore()
const { getDealStatus } = statusesStore()
+const { doctypeMeta } = getMeta('CRM Organization')
const showQuickEntryModal = ref(false)
const route = useRoute()
@@ -262,7 +263,7 @@ const breadcrumbs = computed(() => {
}
items.push({
- label: props.organizationId,
+ label: title.value,
route: {
name: 'Organization',
params: { organizationId: props.organizationId },
@@ -271,9 +272,14 @@ const breadcrumbs = computed(() => {
return items
})
+const title = computed(() => {
+ let t = doctypeMeta['CRM Organization']?.title_field || 'name'
+ return organization.doc?.[t] || props.organizationId
+})
+
usePageMeta(() => {
return {
- title: props.organizationId,
+ title: title.value,
icon: brand.favicon,
}
})