diff --git a/crm/api/session.py b/crm/api/session.py index c6c5e3dd2..ccaab6668 100644 --- a/crm/api/session.py +++ b/crm/api/session.py @@ -25,7 +25,7 @@ def get_contacts(): contacts = frappe.qb.get_query( "Contact", - fields=['name', 'full_name', 'image', 'email_id', 'mobile_no', 'phone', 'salutation'], + fields=['name', 'first_name', 'last_name', 'full_name', 'image', 'email_id', 'mobile_no', 'phone', 'salutation', 'company_name', 'modified'], order_by="first_name asc", distinct=True, ).run(as_dict=1) diff --git a/frontend/src/components/AppSidebar.vue b/frontend/src/components/AppSidebar.vue index a0217a1e0..f56d4ead5 100644 --- a/frontend/src/components/AppSidebar.vue +++ b/frontend/src/components/AppSidebar.vue @@ -3,16 +3,18 @@ class="flex h-full flex-col justify-between transition-all duration-300 ease-in-out" :class="isSidebarCollapsed ? 'w-12' : 'w-56'" > -
+
- +
+ +
+ + + + + + diff --git a/frontend/src/components/ListViews/ContactsListView.vue b/frontend/src/components/ListViews/ContactsListView.vue index 782fb295e..238fe3858 100644 --- a/frontend/src/components/ListViews/ContactsListView.vue +++ b/frontend/src/components/ListViews/ContactsListView.vue @@ -1,14 +1,65 @@ + + diff --git a/frontend/src/pages/Contacts.vue b/frontend/src/pages/Contacts.vue index 4d4c0481d..5c581f9db 100644 --- a/frontend/src/pages/Contacts.vue +++ b/frontend/src/pages/Contacts.vue @@ -4,7 +4,7 @@ @@ -14,74 +14,69 @@
- - + +
- + + diff --git a/frontend/src/pages/Organization.vue b/frontend/src/pages/Organization.vue index 0ee5b4c65..3270b20e2 100644 --- a/frontend/src/pages/Organization.vue +++ b/frontend/src/pages/Organization.vue @@ -430,7 +430,14 @@ function getContactRowObject(contact) { }, email: contact.email_id, mobile_no: contact.mobile_no, - company_name: contact.company_name, + company_name: { + label: contact.company_name, + logo: props.organization?.organization_logo, + }, + modified: { + label: dateFormat(contact.modified, dateTooltipFormat), + timeAgo: timeAgo(contact.modified), + }, } } @@ -512,9 +519,9 @@ const dealColumns = [ const contactColumns = [ { - label: 'Full name', + label: 'Name', key: 'full_name', - width: '12rem', + width: '17rem', }, { label: 'Email', @@ -531,6 +538,11 @@ const contactColumns = [ key: 'company_name', width: '12rem', }, + { + label: 'Last modified', + key: 'modified', + width: '8rem', + }, ] function reload(val) { diff --git a/frontend/src/router.js b/frontend/src/router.js index c841ccb11..d358c6b25 100644 --- a/frontend/src/router.js +++ b/frontend/src/router.js @@ -39,6 +39,12 @@ const routes = [ name: 'Contacts', component: () => import('@/pages/Contacts.vue'), }, + { + path: '/contacts/:contactId', + name: 'Contact', + component: () => import('@/pages/Contact.vue'), + props: true, + }, { path: '/organizations', name: 'Organizations', diff --git a/frontend/src/stores/contacts.js b/frontend/src/stores/contacts.js index 999ad0e7a..a3d2a9e28 100644 --- a/frontend/src/stores/contacts.js +++ b/frontend/src/stores/contacts.js @@ -4,6 +4,7 @@ import { reactive } from 'vue' export const contactsStore = defineStore('crm-contacts', () => { let contactsByPhone = reactive({}) + let contactsByName = reactive({}) const contacts = createResource({ url: 'crm.api.session.get_contacts', @@ -12,6 +13,7 @@ export const contactsStore = defineStore('crm-contacts', () => { transform(contacts) { for (let contact of contacts) { contactsByPhone[contact.mobile_no] = contact + contactsByName[contact.name] = contact } return contacts }, @@ -26,9 +28,13 @@ export const contactsStore = defineStore('crm-contacts', () => { function getContact(mobile_no) { return contactsByPhone[mobile_no] } + function getContactByName(name) { + return contactsByName[name] + } return { contacts, getContact, + getContactByName, } })