From be40a3fddc30eca64cf8684948bdb26d2ccf362a Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 13 Dec 2023 11:28:17 +0530 Subject: [PATCH 01/24] fix: show response by in sla status badge if in due state refactored code --- crm/fcrm/doctype/crm_deal/crm_deal.py | 1 + crm/fcrm/doctype/crm_lead/crm_lead.py | 1 + .../components/ListViews/DealsListView.vue | 5 +- .../components/ListViews/LeadsListView.vue | 5 +- frontend/src/components/SectionFields.vue | 6 +- frontend/src/pages/Deal.vue | 9 -- frontend/src/pages/Deals.vue | 42 ++++--- frontend/src/pages/Lead.vue | 112 +++++++----------- frontend/src/pages/Leads.vue | 42 ++++--- 9 files changed, 111 insertions(+), 112 deletions(-) diff --git a/crm/fcrm/doctype/crm_deal/crm_deal.py b/crm/fcrm/doctype/crm_deal/crm_deal.py index ac215ed5..bd775193 100644 --- a/crm/fcrm/doctype/crm_deal/crm_deal.py +++ b/crm/fcrm/doctype/crm_deal/crm_deal.py @@ -139,6 +139,7 @@ class CRMDeal(Document): "mobile_no", "deal_owner", "sla_status", + "response_by", "first_response_time", "first_responded_on", "modified", diff --git a/crm/fcrm/doctype/crm_lead/crm_lead.py b/crm/fcrm/doctype/crm_lead/crm_lead.py index f8a0fb6d..bd26b6a5 100644 --- a/crm/fcrm/doctype/crm_lead/crm_lead.py +++ b/crm/fcrm/doctype/crm_lead/crm_lead.py @@ -219,6 +219,7 @@ class CRMLead(Document): "lead_owner", "first_name", "sla_status", + "response_by", "first_response_time", "first_responded_on", "modified", diff --git a/frontend/src/components/ListViews/DealsListView.vue b/frontend/src/components/ListViews/DealsListView.vue index 72efab98..a02b6996 100644 --- a/frontend/src/components/ListViews/DealsListView.vue +++ b/frontend/src/components/ListViews/DealsListView.vue @@ -51,6 +51,7 @@ 'creation', 'first_response_time', 'first_responded_on', + 'response_by', ].includes(column.key) " class="truncate text-base" @@ -62,11 +63,11 @@ class="truncate text-base" >
diff --git a/frontend/src/components/ListViews/LeadsListView.vue b/frontend/src/components/ListViews/LeadsListView.vue index 01eae1e0..c8d78b8d 100644 --- a/frontend/src/components/ListViews/LeadsListView.vue +++ b/frontend/src/components/ListViews/LeadsListView.vue @@ -60,6 +60,7 @@ 'creation', 'first_response_time', 'first_responded_on', + 'response_by', ].includes(column.key) " class="truncate text-base" @@ -71,11 +72,11 @@ class="truncate text-base" >
diff --git a/frontend/src/components/SectionFields.vue b/frontend/src/components/SectionFields.vue index d6e7ca7a..460f01c8 100644 --- a/frontend/src/components/SectionFields.vue +++ b/frontend/src/components/SectionFields.vue @@ -3,12 +3,12 @@
-
+
{{ field.label }}
-
+
-
Response By
- - {{ timeAgo(lead.data.response_by) }} +
{{ s.label }}
+ +
{{ s.value }}
+
-
-
Fulfilled In
- - {{ formatTime(lead.data.first_response_time) }} - -
-
-
Fulfilled In
- - {{ formatTime(lead.data.first_response_time) }} - -
-
-
Status
-
- -
-
@@ -259,6 +206,7 @@ import { dateFormat, timeAgo, formatTime, + dateTooltipFormat, } from '@/utils' import { usersStore } from '@/stores/users' import { contactsStore } from '@/stores/contacts' @@ -298,15 +246,6 @@ const lead = createResource({ params: { name: props.leadId }, cache: ['lead', props.leadId], auto: true, - onSuccess: (data) => { - if ( - data.response_by && - data.sla_status == 'First Response Due' && - new Date(data.response_by) < new Date() - ) { - updateField('sla_status', 'Failed') - } - }, }) const reload = ref(false) @@ -441,4 +380,41 @@ function updateField(name, value, callback) { callback?.() }) } + +let slaSection = computed(() => { + let sections = [] + if (lead.data.first_response_time) { + sections.push({ + label: 'Fulfilled In', + value: formatTime(lead.data.first_response_time), + tooltipText: dateFormat(lead.data.first_responded_on, dateTooltipFormat), + }) + } + + let status = lead.data.sla_status + let tooltipText = status + let color = + lead.data.sla_status == 'Failed' + ? 'red' + : lead.data.sla_status == 'Fulfilled' + ? 'green' + : 'orange' + + if (status == 'First Response Due') { + status = timeAgo(lead.data.response_by) + tooltipText = dateFormat(lead.data.response_by, dateTooltipFormat) + if (new Date(lead.data.response_by) < new Date()) { + color = 'red' + } + } + + sections.push({ + label: 'Status', + isBadge: true, + value: status, + tooltipText: tooltipText, + color: color, + }) + return sections +}) diff --git a/frontend/src/pages/Leads.vue b/frontend/src/pages/Leads.vue index c52fb9b0..f4b25b30 100644 --- a/frontend/src/pages/Leads.vue +++ b/frontend/src/pages/Leads.vue @@ -155,14 +155,25 @@ const rows = computed(() => { color: getLeadStatus(lead.status)?.iconColorClass, } } else if (row == 'sla_status') { + let value = lead.sla_status + let tooltipText = value + let color = + lead.sla_status == 'Failed' + ? 'red' + : lead.sla_status == 'Fulfilled' + ? 'green' + : 'orange' + if (value == 'First Response Due') { + value = timeAgo(lead.response_by) + tooltipText = dateFormat(lead.response_by, dateTooltipFormat) + if (new Date(lead.response_by) < new Date()) { + color = 'red' + } + } _rows[row] = { - label: lead.sla_status, - color: - lead.sla_status === 'Failed' - ? 'red' - : lead.sla_status === 'Fulfilled' - ? 'green' - : 'gray', + label: tooltipText, + value: value, + color: color, } } else if (row == 'lead_owner') { _rows[row] = { @@ -174,15 +185,18 @@ const rows = computed(() => { label: dateFormat(lead[row], dateTooltipFormat), timeAgo: timeAgo(lead[row]), } - } else if (['first_response_time', 'first_responded_on'].includes(row)) { + } else if ( + ['first_response_time', 'first_responded_on', 'response_by'].includes( + row + ) + ) { + let field = row == 'response_by' ? 'response_by' : 'first_responded_on' _rows[row] = { - label: lead.first_responded_on - ? dateFormat(lead.first_responded_on, dateTooltipFormat) - : '', + label: lead[field] ? dateFormat(lead[field], dateTooltipFormat) : '', timeAgo: lead[row] - ? row == 'first_responded_on' - ? timeAgo(lead[row]) - : formatTime(lead[row]) + ? row == 'first_response_time' + ? formatTime(lead[row]) + : timeAgo(lead[row]) : '', } } From cef998d1ba7ff019ab1cb5839b9e259aa03fcfe6 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 13 Dec 2023 15:25:44 +0530 Subject: [PATCH 02/24] fix: added communication status doctype --- .../crm_communication_status/__init__.py | 0 .../crm_communication_status.js | 8 ++++ .../crm_communication_status.json | 47 +++++++++++++++++++ .../crm_communication_status.py | 9 ++++ .../test_crm_communication_status.py | 9 ++++ 5 files changed, 73 insertions(+) create mode 100644 crm/fcrm/doctype/crm_communication_status/__init__.py create mode 100644 crm/fcrm/doctype/crm_communication_status/crm_communication_status.js create mode 100644 crm/fcrm/doctype/crm_communication_status/crm_communication_status.json create mode 100644 crm/fcrm/doctype/crm_communication_status/crm_communication_status.py create mode 100644 crm/fcrm/doctype/crm_communication_status/test_crm_communication_status.py diff --git a/crm/fcrm/doctype/crm_communication_status/__init__.py b/crm/fcrm/doctype/crm_communication_status/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/crm/fcrm/doctype/crm_communication_status/crm_communication_status.js b/crm/fcrm/doctype/crm_communication_status/crm_communication_status.js new file mode 100644 index 00000000..33e5fd43 --- /dev/null +++ b/crm/fcrm/doctype/crm_communication_status/crm_communication_status.js @@ -0,0 +1,8 @@ +// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt + +// frappe.ui.form.on("CRM Communication Status", { +// refresh(frm) { + +// }, +// }); diff --git a/crm/fcrm/doctype/crm_communication_status/crm_communication_status.json b/crm/fcrm/doctype/crm_communication_status/crm_communication_status.json new file mode 100644 index 00000000..be7aeb93 --- /dev/null +++ b/crm/fcrm/doctype/crm_communication_status/crm_communication_status.json @@ -0,0 +1,47 @@ +{ + "actions": [], + "allow_rename": 1, + "autoname": "field:status", + "creation": "2023-12-13 13:25:07.213100", + "doctype": "DocType", + "engine": "InnoDB", + "field_order": [ + "status" + ], + "fields": [ + { + "fieldname": "status", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Status", + "reqd": 1, + "unique": 1 + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2023-12-13 13:28:38.746199", + "modified_by": "Administrator", + "module": "FCRM", + "name": "CRM Communication Status", + "naming_rule": "By fieldname", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "quick_entry": 1, + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/crm/fcrm/doctype/crm_communication_status/crm_communication_status.py b/crm/fcrm/doctype/crm_communication_status/crm_communication_status.py new file mode 100644 index 00000000..017a6548 --- /dev/null +++ b/crm/fcrm/doctype/crm_communication_status/crm_communication_status.py @@ -0,0 +1,9 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class CRMCommunicationStatus(Document): + pass diff --git a/crm/fcrm/doctype/crm_communication_status/test_crm_communication_status.py b/crm/fcrm/doctype/crm_communication_status/test_crm_communication_status.py new file mode 100644 index 00000000..85f289cc --- /dev/null +++ b/crm/fcrm/doctype/crm_communication_status/test_crm_communication_status.py @@ -0,0 +1,9 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors +# See license.txt + +# import frappe +from frappe.tests.utils import FrappeTestCase + + +class TestCRMCommunicationStatus(FrappeTestCase): + pass From ce98110e36573871b3d4bb4dbfe8f435a1558691 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 13 Dec 2023 15:27:42 +0530 Subject: [PATCH 03/24] fix: replaced lead/deal status with communication status in sla --- crm/fcrm/doctype/crm_deal/crm_deal.json | 10 +++++++++- crm/fcrm/doctype/crm_lead/crm_lead.json | 10 +++++++++- .../crm_service_level_agreement.js | 13 ------------- .../crm_service_level_agreement.py | 12 ++++++------ .../crm_service_level_priority.json | 14 +++----------- 5 files changed, 27 insertions(+), 32 deletions(-) diff --git a/crm/fcrm/doctype/crm_deal/crm_deal.json b/crm/fcrm/doctype/crm_deal/crm_deal.json index 64b8829c..6ebc6ba3 100644 --- a/crm/fcrm/doctype/crm_deal/crm_deal.json +++ b/crm/fcrm/doctype/crm_deal/crm_deal.json @@ -30,6 +30,7 @@ "sla_creation", "column_break_pfvq", "sla_status", + "communication_status", "response_details_section", "response_by", "column_break_hpvj", @@ -195,11 +196,18 @@ "fieldname": "first_responded_on", "fieldtype": "Datetime", "label": "First Responded On" + }, + { + "default": "Open", + "fieldname": "communication_status", + "fieldtype": "Link", + "label": "Communication Status", + "options": "CRM Communication Status" } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2023-12-11 12:37:51.198228", + "modified": "2023-12-13 13:50:55.235109", "modified_by": "Administrator", "module": "FCRM", "name": "CRM Deal", diff --git a/crm/fcrm/doctype/crm_lead/crm_lead.json b/crm/fcrm/doctype/crm_lead/crm_lead.json index c37c8835..4a02bd1f 100644 --- a/crm/fcrm/doctype/crm_lead/crm_lead.json +++ b/crm/fcrm/doctype/crm_lead/crm_lead.json @@ -40,6 +40,7 @@ "sla_creation", "column_break_ffnp", "sla_status", + "communication_status", "response_details_section", "response_by", "column_break_pweh", @@ -257,12 +258,19 @@ "fieldname": "first_responded_on", "fieldtype": "Datetime", "label": "First Responded On" + }, + { + "default": "Open", + "fieldname": "communication_status", + "fieldtype": "Link", + "label": "Communication Status", + "options": "CRM Communication Status" } ], "image_field": "image", "index_web_pages_for_search": 1, "links": [], - "modified": "2023-12-10 13:54:53.630114", + "modified": "2023-12-13 13:50:40.055487", "modified_by": "Administrator", "module": "FCRM", "name": "CRM Lead", diff --git a/crm/fcrm/doctype/crm_service_level_agreement/crm_service_level_agreement.js b/crm/fcrm/doctype/crm_service_level_agreement/crm_service_level_agreement.js index d1c3549c..77448ff4 100644 --- a/crm/fcrm/doctype/crm_service_level_agreement/crm_service_level_agreement.js +++ b/crm/fcrm/doctype/crm_service_level_agreement/crm_service_level_agreement.js @@ -6,16 +6,3 @@ // }, // }); - -frappe.ui.form.on("CRM Service Level Priority", { - priorities_add: function (frm, cdt, cdn) { - if (frm.doc.apply_on == "CRM Deal") { - frappe.model.set_value( - cdt, - cdn, - "reference_doctype", - "CRM Deal Status" - ); - } - }, -}); diff --git a/crm/fcrm/doctype/crm_service_level_agreement/crm_service_level_agreement.py b/crm/fcrm/doctype/crm_service_level_agreement/crm_service_level_agreement.py index 2debf7f1..6a0ea082 100644 --- a/crm/fcrm/doctype/crm_service_level_agreement/crm_service_level_agreement.py +++ b/crm/fcrm/doctype/crm_service_level_agreement/crm_service_level_agreement.py @@ -17,7 +17,7 @@ from frappe.utils import ( class CRMServiceLevelAgreement(Document): def apply(self, doc: Document): self.handle_new(doc) - self.handle_status(doc) + self.handle_communication_status(doc) self.handle_targets(doc) self.handle_sla_status(doc) @@ -27,14 +27,14 @@ class CRMServiceLevelAgreement(Document): creation = doc.sla_creation or now_datetime() doc.sla_creation = creation - def handle_status(self, doc: Document): - if doc.is_new() or not doc.has_value_changed("status"): + def handle_communication_status(self, doc: Document): + if doc.is_new() or not doc.has_value_changed("communication_status"): return self.set_first_responded_on(doc) self.set_first_response_time(doc) def set_first_responded_on(self, doc: Document): - if doc.status != self.get_default_priority(): + if doc.communication_status != self.get_default_priority(): doc.first_responded_on = ( doc.first_responded_on or now_datetime() ) @@ -51,10 +51,10 @@ class CRMServiceLevelAgreement(Document): def set_response_by(self, doc: Document): start_time = doc.sla_creation - status = doc.status + communication_status = doc.communication_status priorities = self.get_priorities() - priority = priorities.get(status) + priority = priorities.get(communication_status) if not priority or doc.response_by: return diff --git a/crm/fcrm/doctype/crm_service_level_priority/crm_service_level_priority.json b/crm/fcrm/doctype/crm_service_level_priority/crm_service_level_priority.json index 294b94a7..658fbaf0 100644 --- a/crm/fcrm/doctype/crm_service_level_priority/crm_service_level_priority.json +++ b/crm/fcrm/doctype/crm_service_level_priority/crm_service_level_priority.json @@ -7,7 +7,6 @@ "engine": "InnoDB", "field_order": [ "default_priority", - "reference_doctype", "priority", "first_response_time" ], @@ -21,10 +20,10 @@ }, { "fieldname": "priority", - "fieldtype": "Dynamic Link", + "fieldtype": "Link", "in_list_view": 1, "label": "Priority", - "options": "reference_doctype", + "options": "CRM Communication Status", "reqd": 1 }, { @@ -33,19 +32,12 @@ "in_list_view": 1, "label": "First Response TIme", "reqd": 1 - }, - { - "default": "CRM Lead Status", - "fieldname": "reference_doctype", - "fieldtype": "Link", - "label": "DocType", - "options": "DocType" } ], "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2023-12-04 14:05:42.838493", + "modified": "2023-12-13 13:26:51.757839", "modified_by": "Administrator", "module": "FCRM", "name": "CRM Service Level Priority", From 70584ac35f8cd41fed7bd7fb8fa27d79b2325d24 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 13 Dec 2023 15:31:31 +0530 Subject: [PATCH 04/24] fix: added default communication statuses on install and changed lead status Open to New --- crm/install.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/crm/install.py b/crm/install.py index 77979f73..51468333 100644 --- a/crm/install.py +++ b/crm/install.py @@ -10,11 +10,12 @@ def before_install(): def after_install(): add_default_lead_statuses() add_default_deal_statuses() + add_default_communication_statuses() frappe.db.commit() def add_default_lead_statuses(): statuses = { - "Open": { + "New": { "color": "gray", "position": 1, }, @@ -90,4 +91,15 @@ def add_default_deal_statuses(): doc.deal_status = status doc.color = statuses[status]["color"] doc.position = statuses[status]["position"] - doc.insert() \ No newline at end of file + doc.insert() + +def add_default_communication_statuses(): + statuses = ["Open", "Replied"] + + for status in statuses: + if frappe.db.exists("CRM Communication Status", status): + continue + + doc = frappe.new_doc("CRM Communication Status") + doc.status = status + doc.insert() From 86984abd2b3ed5d1bcab17dfc3135bd8d2181309 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 13 Dec 2023 15:32:55 +0530 Subject: [PATCH 05/24] fix: added communication status in statuses store --- frontend/src/stores/statuses.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/frontend/src/stores/statuses.js b/frontend/src/stores/statuses.js index e38a8ff1..cc0bf7d3 100644 --- a/frontend/src/stores/statuses.js +++ b/frontend/src/stores/statuses.js @@ -6,6 +6,7 @@ import IndicatorIcon from '@/components/Icons/IndicatorIcon.vue' export const statusesStore = defineStore('crm-statuses', () => { let leadStatusesByName = reactive({}) let dealStatusesByName = reactive({}) + let communicationStatusesByName = reactive({}) const leadStatuses = createListResource({ doctype: 'CRM Lead Status', @@ -41,6 +42,20 @@ export const statusesStore = defineStore('crm-statuses', () => { }, }) + const communicationStatuses = createListResource({ + doctype: 'CRM Communication Status', + fields: ['name'], + cache: 'communication-statuses', + initialData: [], + auto: true, + transform(statuses) { + for (let status of statuses) { + communicationStatusesByName[status.name] = status + } + return statuses + }, + }) + function colorClasses(color, onlyIcon = false) { let textColor = `!text-${color}-600` if (color == 'black') { @@ -62,6 +77,10 @@ export const statusesStore = defineStore('crm-statuses', () => { return dealStatusesByName[name] } + function getCommunicationStatus(name) { + return communicationStatuses[name] + } + function statusOptions(doctype, action) { let statusesByName = doctype == 'deal' ? dealStatusesByName : leadStatusesByName @@ -84,8 +103,10 @@ export const statusesStore = defineStore('crm-statuses', () => { return { leadStatuses, dealStatuses, + communicationStatuses, getLeadStatus, getDealStatus, + getCommunicationStatus, statusOptions, } }) From bf996a3cbd7f1b83cbd0706da7551d6ed95cf903 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 13 Dec 2023 15:54:49 +0530 Subject: [PATCH 06/24] fix: created SLA Section component & added in lead/deal page --- frontend/src/components/SLASection.vue | 114 +++++++++++++++++++++++++ frontend/src/pages/Deal.vue | 80 ++--------------- frontend/src/pages/Lead.vue | 66 ++------------ 3 files changed, 128 insertions(+), 132 deletions(-) create mode 100644 frontend/src/components/SLASection.vue diff --git a/frontend/src/components/SLASection.vue b/frontend/src/components/SLASection.vue new file mode 100644 index 00000000..9dd97133 --- /dev/null +++ b/frontend/src/components/SLASection.vue @@ -0,0 +1,114 @@ + + + + diff --git a/frontend/src/pages/Deal.vue b/frontend/src/pages/Deal.vue index f30ea416..c4ead911 100644 --- a/frontend/src/pages/Deal.vue +++ b/frontend/src/pages/Deal.vue @@ -99,72 +99,11 @@
-
-
-
Response By
- - {{ timeAgo(deal.data.response_by) }} - -
-
-
Fulfilled In
- - {{ formatTime(deal.data.first_response_time) }} - -
-
-
Fulfilled In
- - {{ formatTime(deal.data.first_response_time) }} - -
-
-
Status
-
- -
-
-
+
-
-
-
{{ s.label }}
- -
{{ s.value }}
- -
-
-
+
{ - let sections = [] - if (lead.data.first_response_time) { - sections.push({ - label: 'Fulfilled In', - value: formatTime(lead.data.first_response_time), - tooltipText: dateFormat(lead.data.first_responded_on, dateTooltipFormat), - }) - } - - let status = lead.data.sla_status - let tooltipText = status - let color = - lead.data.sla_status == 'Failed' - ? 'red' - : lead.data.sla_status == 'Fulfilled' - ? 'green' - : 'orange' - - if (status == 'First Response Due') { - status = timeAgo(lead.data.response_by) - tooltipText = dateFormat(lead.data.response_by, dateTooltipFormat) - if (new Date(lead.data.response_by) < new Date()) { - color = 'red' - } - } - - sections.push({ - label: 'Status', - isBadge: true, - value: status, - tooltipText: tooltipText, - color: color, - }) - return sections -}) From 3e30084f6376394cb260dc81ab630c8802e97096 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 13 Dec 2023 16:27:21 +0530 Subject: [PATCH 07/24] fix: removed hardcoded default value --- frontend/src/pages/Deals.vue | 2 +- frontend/src/pages/Leads.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/Deals.vue b/frontend/src/pages/Deals.vue index 4cb7b844..6dcacade 100644 --- a/frontend/src/pages/Deals.vue +++ b/frontend/src/pages/Deals.vue @@ -253,7 +253,7 @@ const showNewDialog = ref(false) let newDeal = reactive({ organization: '', - status: 'Qualification', + status: '', email: '', mobile_no: '', deal_owner: '', diff --git a/frontend/src/pages/Leads.vue b/frontend/src/pages/Leads.vue index f4b25b30..4c9adc10 100644 --- a/frontend/src/pages/Leads.vue +++ b/frontend/src/pages/Leads.vue @@ -256,7 +256,7 @@ let newLead = reactive({ last_name: '', lead_name: '', organization: '', - status: 'Open', + status: '', email: '', mobile_no: '', lead_owner: '', From 37538bd267253e2f1bb2c2559beae50065620479 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 13 Dec 2023 16:28:01 +0530 Subject: [PATCH 08/24] fix: return first status if name is not set --- frontend/src/stores/statuses.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frontend/src/stores/statuses.js b/frontend/src/stores/statuses.js index cc0bf7d3..8b306ec0 100644 --- a/frontend/src/stores/statuses.js +++ b/frontend/src/stores/statuses.js @@ -70,14 +70,23 @@ export const statusesStore = defineStore('crm-statuses', () => { } function getLeadStatus(name) { + if (!name) { + name = leadStatuses.data[0].name + } return leadStatusesByName[name] } function getDealStatus(name) { + if (!name) { + name = dealStatuses.data[0].name + } return dealStatusesByName[name] } function getCommunicationStatus(name) { + if (!name) { + name = communicationStatuses.data[0].name + } return communicationStatuses[name] } From 25300bcf548563dc86ba940018c7faf5d73c59f6 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 13 Dec 2023 16:28:29 +0530 Subject: [PATCH 09/24] fix: newLead/newDeal dialog was not working --- frontend/src/components/NewDeal.vue | 29 +++++++++-------------------- frontend/src/components/NewLead.vue | 29 +++++++++-------------------- 2 files changed, 18 insertions(+), 40 deletions(-) diff --git a/frontend/src/components/NewDeal.vue b/frontend/src/components/NewDeal.vue index 57805ceb..892822ae 100644 --- a/frontend/src/components/NewDeal.vue +++ b/frontend/src/components/NewDeal.vue @@ -8,12 +8,10 @@ v-if="field.type === 'select'" type="select" :options="field.options" - v-model="newDeal[field.name]" + v-model="field.value" > -