From b4d9461c6566be32324c330e875c3975adfd9f71 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Sun, 4 Feb 2024 16:55:17 +0530 Subject: [PATCH 1/4] fix: allow dynamic link in filters --- crm/api/doc.py | 1 + frontend/src/components/Filter.vue | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/crm/api/doc.py b/crm/api/doc.py index bbafda0f7..e3c8acc42 100644 --- a/crm/api/doc.py +++ b/crm/api/doc.py @@ -41,6 +41,7 @@ def get_filterable_fields(doctype: str): "Float", "Int", "Currency", + "Dynamic Link", "Link", "Long Text", "Select", diff --git a/frontend/src/components/Filter.vue b/frontend/src/components/Filter.vue index f643d8885..d9a6ea38e 100644 --- a/frontend/src/components/Filter.vue +++ b/frontend/src/components/Filter.vue @@ -103,7 +103,7 @@ import { FormControl, Autocomplete, createResource } from 'frappe-ui' import { h, defineModel, computed } from 'vue' const typeCheck = ['Check'] -const typeLink = ['Link'] +const typeLink = ['Link', 'Dynamic Link'] const typeNumber = ['Float', 'Int', 'Currency', 'Percent'] const typeSelect = ['Select'] const typeString = ['Data', 'Long Text', 'Small Text', 'Text Editor', 'Text'] @@ -324,6 +324,9 @@ function getValSelect(f) { })), }) } else if (typeLink.includes(fieldtype)) { + if (field.fieldtype === 'Dynamic Link') { + return h(FormControl, { type: 'text' }) + } return h(Link, { class: 'form-control', doctype: options }) } else if (typeNumber.includes(fieldtype)) { return h(FormControl, { type: 'number' }) From e06d110cbcc971b79e1edc1a504210350ec3ab0e Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Sun, 4 Feb 2024 16:56:10 +0530 Subject: [PATCH 2/4] fix: added tasks in sidebar & router.js --- frontend/src/components/Layouts/AppSidebar.vue | 6 ++++++ frontend/src/router.js | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/frontend/src/components/Layouts/AppSidebar.vue b/frontend/src/components/Layouts/AppSidebar.vue index aff93339a..615823ac8 100644 --- a/frontend/src/components/Layouts/AppSidebar.vue +++ b/frontend/src/components/Layouts/AppSidebar.vue @@ -105,6 +105,7 @@ import DealsIcon from '@/components/Icons/DealsIcon.vue' import ContactsIcon from '@/components/Icons/ContactsIcon.vue' import OrganizationsIcon from '@/components/Icons/OrganizationsIcon.vue' import NoteIcon from '@/components/Icons/NoteIcon.vue' +import TaskIcon from '@/components/Icons/TaskIcon.vue' import PhoneIcon from '@/components/Icons/PhoneIcon.vue' import CollapseSidebar from '@/components/Icons/CollapseSidebar.vue' import NotificationsIcon from '@/components/Icons/NotificationsIcon.vue' @@ -146,6 +147,11 @@ const links = [ icon: NoteIcon, to: 'Notes', }, + { + label: 'Tasks', + icon: TaskIcon, + to: 'Tasks', + }, { label: 'Call Logs', icon: PhoneIcon, diff --git a/frontend/src/router.js b/frontend/src/router.js index adc3f17f3..06129b76f 100644 --- a/frontend/src/router.js +++ b/frontend/src/router.js @@ -37,6 +37,11 @@ const routes = [ name: 'Notes', component: () => import('@/pages/Notes.vue'), }, + { + path: '/tasks', + name: 'Tasks', + component: () => import('@/pages/Tasks.vue'), + }, { path: '/contacts', name: 'Contacts', From 531e5710b8f5e34776fe21c680a7b741e3ad03e4 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Sun, 4 Feb 2024 16:56:52 +0530 Subject: [PATCH 3/4] fix: added task listview and dialog --- crm/fcrm/doctype/crm_task/crm_task.py | 53 +++++- .../components/ListViews/TasksListView.vue | 164 ++++++++++++++++++ frontend/src/pages/Tasks.vue | 106 +++++++++++ 3 files changed, 322 insertions(+), 1 deletion(-) create mode 100644 frontend/src/components/ListViews/TasksListView.vue create mode 100644 frontend/src/pages/Tasks.vue diff --git a/crm/fcrm/doctype/crm_task/crm_task.py b/crm/fcrm/doctype/crm_task/crm_task.py index 325843cc0..c244ba73a 100644 --- a/crm/fcrm/doctype/crm_task/crm_task.py +++ b/crm/fcrm/doctype/crm_task/crm_task.py @@ -6,4 +6,55 @@ class CRMTask(Document): - pass + @staticmethod + def default_list_data(): + columns = [ + { + 'label': 'Title', + 'type': 'Data', + 'key': 'title', + 'width': '12rem', + }, + { + 'label': 'Status', + 'type': 'Select', + 'key': 'status', + 'width': '8rem', + }, + { + 'label': 'Priority', + 'type': 'Select', + 'key': 'priority', + 'width': '8rem', + }, + { + 'label': 'Due Date', + 'type': 'Date', + 'key': 'due_date', + 'width': '8rem', + }, + { + 'label': 'Assigned To', + 'type': 'Link', + 'key': 'assigned_to', + 'width': '10rem', + }, + { + 'label': 'Last Modified', + 'type': 'Datetime', + 'key': 'modified', + 'width': '8rem', + }, + ] + + rows = [ + "name", + "title", + "description", + "assigned_to", + "due_date", + "status", + "priority", + "modified", + ] + return {'columns': columns, 'rows': rows} diff --git a/frontend/src/components/ListViews/TasksListView.vue b/frontend/src/components/ListViews/TasksListView.vue new file mode 100644 index 000000000..b6e9f1ced --- /dev/null +++ b/frontend/src/components/ListViews/TasksListView.vue @@ -0,0 +1,164 @@ + + diff --git a/frontend/src/pages/Tasks.vue b/frontend/src/pages/Tasks.vue new file mode 100644 index 000000000..2a5c11ebe --- /dev/null +++ b/frontend/src/pages/Tasks.vue @@ -0,0 +1,106 @@ + + + From 6c41e855189d7ae4bdf9e23040a093b6401d17d4 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Sun, 4 Feb 2024 17:32:12 +0530 Subject: [PATCH 4/4] fix: show linked lead & deal button --- crm/fcrm/doctype/crm_task/crm_task.py | 4 ++- frontend/src/components/Modals/TaskModal.vue | 33 ++++++++++++++++++++ frontend/src/pages/Tasks.vue | 6 +++- 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/crm/fcrm/doctype/crm_task/crm_task.py b/crm/fcrm/doctype/crm_task/crm_task.py index c244ba73a..1559ff3e0 100644 --- a/crm/fcrm/doctype/crm_task/crm_task.py +++ b/crm/fcrm/doctype/crm_task/crm_task.py @@ -13,7 +13,7 @@ def default_list_data(): 'label': 'Title', 'type': 'Data', 'key': 'title', - 'width': '12rem', + 'width': '16rem', }, { 'label': 'Status', @@ -55,6 +55,8 @@ def default_list_data(): "due_date", "status", "priority", + "reference_doctype", + "reference_docname", "modified", ] return {'columns': columns, 'rows': rows} diff --git a/frontend/src/components/Modals/TaskModal.vue b/frontend/src/components/Modals/TaskModal.vue index e5439860a..ee6326814 100644 --- a/frontend/src/components/Modals/TaskModal.vue +++ b/frontend/src/components/Modals/TaskModal.vue @@ -13,6 +13,24 @@ ], }" > +