diff --git a/frontend/src/components/ListView.vue b/frontend/src/components/ListView.vue
index b0925af9..87ed48b1 100644
--- a/frontend/src/components/ListView.vue
+++ b/frontend/src/components/ListView.vue
@@ -68,18 +68,19 @@
>
@@ -167,9 +168,10 @@ const viewsDropdownOptions = [
]
function getValue(value) {
- if (typeof value === 'object') {
+ if (value && typeof value === 'object') {
value.label = value.full_name || value.label
- value.image = value.user_image || value.logo
+ value.image = value.image || value.user_image || value.logo
+ value.image_label = value.image_label || value.label
return value
}
return {
diff --git a/frontend/src/pages/Contacts.vue b/frontend/src/pages/Contacts.vue
index eb62c091..a650756d 100644
--- a/frontend/src/pages/Contacts.vue
+++ b/frontend/src/pages/Contacts.vue
@@ -12,7 +12,7 @@ const title = 'Contacts'
const contacts = createListResource({
type: 'list',
doctype: 'Contact',
- fields: ['name', 'full_name', 'email_id', 'phone'],
+ fields: ['name', 'full_name', 'image', 'email_id', 'phone'],
orderBy: 'full_name asc',
cache: 'Contacts',
pageLength: 999,
@@ -44,7 +44,11 @@ const columns = [
const rows = computed(() => {
return contacts.data?.map((contact) => {
return {
- full_name: contact.full_name,
+ full_name: {
+ label: contact.full_name,
+ image_label: contact.full_name,
+ image: contact.image,
+ },
email: contact.email_id,
phone: contact.phone,
}
diff --git a/frontend/src/pages/Leads.vue b/frontend/src/pages/Leads.vue
index 25195d8e..6a9a1174 100644
--- a/frontend/src/pages/Leads.vue
+++ b/frontend/src/pages/Leads.vue
@@ -17,7 +17,8 @@ const leads = createListResource({
fields: [
'name',
'first_name',
- 'last_name',
+ 'lead_name',
+ 'image',
'organization_name',
'organization_logo',
'status',
@@ -26,7 +27,7 @@ const leads = createListResource({
'lead_owner',
'modified',
],
- orderBy: 'modified asc',
+ orderBy: 'modified desc',
cache: 'Leads',
pageLength: 999,
auto: true,
@@ -36,7 +37,8 @@ leads.fetch()
const columns = [
{
label: 'Name',
- key: 'full_name',
+ key: 'lead_name',
+ type: 'user',
size: 'w-44',
},
{
@@ -74,7 +76,11 @@ const columns = [
const rows = computed(() => {
return leads.data?.map((lead) => {
return {
- full_name: lead.first_name + ' ' + lead.last_name,
+ lead_name: {
+ label: lead.lead_name,
+ image: lead.image,
+ image_label: lead.first_name,
+ },
organization_name: {
label: lead.organization_name,
logo: lead.organization_logo,
@@ -85,7 +91,7 @@ const rows = computed(() => {
},
email: lead.email,
mobile_no: lead.mobile_no,
- lead_owner: getUser(lead.lead_owner),
+ lead_owner: lead.lead_owner && getUser(lead.lead_owner),
}
})
})