mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-30 18:34:48 +00:00
fix: Changes to fix popup
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
"css/erpnext.css": [
|
"css/erpnext.css": [
|
||||||
"public/less/erpnext.less",
|
"public/less/erpnext.less",
|
||||||
"public/less/hub.less",
|
"public/less/hub.less",
|
||||||
"public/less/call_summary.less"
|
"public/less/call_popup.less"
|
||||||
],
|
],
|
||||||
"css/marketplace.css": [
|
"css/marketplace.css": [
|
||||||
"public/less/hub.less"
|
"public/less/hub.less"
|
||||||
@@ -50,8 +50,7 @@
|
|||||||
"public/js/education/student_button.html",
|
"public/js/education/student_button.html",
|
||||||
"public/js/education/assessment_result_tool.html",
|
"public/js/education/assessment_result_tool.html",
|
||||||
"public/js/hub/hub_factory.js",
|
"public/js/hub/hub_factory.js",
|
||||||
"public/js/call_popup/call_summary_dialog.js",
|
"public/js/call_popup/call_popup.js"
|
||||||
"public/js/call_popup/call_summary.html"
|
|
||||||
],
|
],
|
||||||
"js/item-dashboard.min.js": [
|
"js/item-dashboard.min.js": [
|
||||||
"stock/dashboard/item_dashboard.html",
|
"stock/dashboard/item_dashboard.html",
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
class CallPopup {
|
class CallPopup {
|
||||||
constructor({ contact, call_payload, last_communication }) {
|
constructor({ call_from, call_log }) {
|
||||||
this.number = call_payload.CallFrom;
|
this.number = call_from;
|
||||||
this.contact = contact;
|
this.call_log = call_log;
|
||||||
this.last_communication = last_communication;
|
|
||||||
this.make();
|
this.make();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,7 +33,7 @@ class CallPopup {
|
|||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
this.set_call_status();
|
this.set_call_status(this.call_log.call_status);
|
||||||
this.make_customer_contact();
|
this.make_customer_contact();
|
||||||
this.dialog.show();
|
this.dialog.show();
|
||||||
this.dialog.get_close_btn().show();
|
this.dialog.get_close_btn().show();
|
||||||
@@ -62,48 +61,37 @@ class CallPopup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
make_last_communication_section() {
|
|
||||||
const last_communication_section = this.body.find('.last-communication');
|
|
||||||
const last_communication = frappe.ui.form.make_control({
|
|
||||||
parent: last_communication_section,
|
|
||||||
df: {
|
|
||||||
fieldtype: "Text",
|
|
||||||
label: "Last Communication",
|
|
||||||
fieldname: "last_communication",
|
|
||||||
'default': 'This is not working please helpppp',
|
|
||||||
"placeholder": __("Select or add new customer")
|
|
||||||
},
|
|
||||||
});
|
|
||||||
last_communication.set_value('This is not working please helpppp');
|
|
||||||
}
|
|
||||||
|
|
||||||
make_summary_section() {
|
make_summary_section() {
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
set_call_status(status) {
|
set_call_status() {
|
||||||
let title = '';
|
let title = '';
|
||||||
if (status === 'incoming') {
|
if (this.call_log.call_status === 'Incoming') {
|
||||||
if (this.contact) {
|
if (this.contact) {
|
||||||
title = __('Incoming call from {0}', [this.contact.name]);
|
title = __('Incoming call from {0}', [this.contact.name]);
|
||||||
} else {
|
} else {
|
||||||
title = __('Incoming call from unknown number');
|
title = __('Incoming call from unknown number');
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
title = __('Call Connected');
|
||||||
}
|
}
|
||||||
this.dialog.set_title(title);
|
this.dialog.set_title(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
update(data) {
|
update(data) {
|
||||||
// pass
|
this.call_log = data.call_log;
|
||||||
|
this.set_call_status();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).on('app_ready', function () {
|
$(document).on('app_ready', function () {
|
||||||
frappe.realtime.on('call_update', data => {
|
frappe.realtime.on('show_call_popup', data => {
|
||||||
if (!erpnext.call_popup) {
|
if (!erpnext.call_popup) {
|
||||||
erpnext.call_popup = new CallPopup(data);
|
erpnext.call_popup = new CallPopup(data);
|
||||||
} else {
|
} else {
|
||||||
erpnext.call_popup.update(data);
|
erpnext.call_popup.update(data);
|
||||||
|
erpnext.call_popup.dialog.show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user