fix: consistency check
This commit is contained in:
parent
25e058833a
commit
0139109de2
@ -1,7 +1,7 @@
|
||||
frappe.ui.form.on("Issue", {
|
||||
onload: function(frm) {
|
||||
frm.email_field = "raised_by";
|
||||
frm.set_query('customer', function () {
|
||||
frm.set_query("customer", function () {
|
||||
return {
|
||||
filters: {
|
||||
"disabled": 0
|
||||
@ -28,14 +28,14 @@ frappe.ui.form.on("Issue", {
|
||||
},
|
||||
callback: function (r) {
|
||||
if (r && r.message) {
|
||||
frm.set_query('priority', function() {
|
||||
frm.set_query("priority", function() {
|
||||
return {
|
||||
filters: {
|
||||
"name": ["in", r.message.priority],
|
||||
}
|
||||
};
|
||||
});
|
||||
frm.set_query('service_level_agreement', function() {
|
||||
frm.set_query("service_level_agreement", function() {
|
||||
return {
|
||||
filters: {
|
||||
"name": ["in", r.message.service_level_agreements],
|
||||
@ -52,9 +52,9 @@ frappe.ui.form.on("Issue", {
|
||||
if (frm.doc.status !== "Closed" && frm.doc.agreement_status === "Ongoing") {
|
||||
if (frm.doc.service_level_agreement) {
|
||||
frappe.call({
|
||||
'method': 'frappe.client.get',
|
||||
"method": "frappe.client.get",
|
||||
args: {
|
||||
doctype: 'Service Level Agreement',
|
||||
doctype: "Service Level Agreement",
|
||||
name: frm.doc.service_level_agreement
|
||||
},
|
||||
callback: function(data) {
|
||||
@ -134,8 +134,8 @@ frappe.ui.form.on("Issue", {
|
||||
reset_sla.clear();
|
||||
|
||||
frappe.show_alert({
|
||||
indicator: 'green',
|
||||
message: __('Resetting Service Level Agreement.')
|
||||
indicator: "green",
|
||||
message: __("Resetting Service Level Agreement.")
|
||||
});
|
||||
|
||||
frm.call("reset_service_level_agreement", {
|
||||
@ -155,33 +155,33 @@ frappe.ui.form.on("Issue", {
|
||||
|
||||
timeline_refresh: function(frm) {
|
||||
// create button for "Help Article"
|
||||
if(frappe.model.can_create('Help Article')) {
|
||||
if(frappe.model.can_create("Help Article")) {
|
||||
// Removing Help Article button if exists to avoid multiple occurance
|
||||
frm.timeline.wrapper.find('.comment-header .asset-details .btn-add-to-kb').remove();
|
||||
$('<button class="btn btn-xs btn-link btn-add-to-kb text-muted hidden-xs pull-right">'+
|
||||
__('Help Article') + '</button>')
|
||||
.appendTo(frm.timeline.wrapper.find('.comment-header .asset-details:not([data-communication-type="Comment"])'))
|
||||
.on('click', function() {
|
||||
var content = $(this).parents('.timeline-item:first').find('.timeline-item-content').html();
|
||||
var doc = frappe.model.get_new_doc('Help Article');
|
||||
.on("click", function() {
|
||||
var content = $(this).parents(".timeline-item:first").find(".timeline-item-content").html();
|
||||
var doc = frappe.model.get_new_doc("Help Article");
|
||||
doc.title = frm.doc.subject;
|
||||
doc.content = content;
|
||||
frappe.set_route('Form', 'Help Article', doc.name);
|
||||
frappe.set_route("Form", "Help Article", doc.name);
|
||||
});
|
||||
}
|
||||
|
||||
if (!frm.timeline.wrapper.find('.btn-split-issue').length) {
|
||||
if (!frm.timeline.wrapper.find(".btn-split-issue").length) {
|
||||
let split_issue = __("Split Issue")
|
||||
$(`<button class="btn btn-xs btn-link btn-add-to-kb text-muted hidden-xs btn-split-issue pull-right" style="display:inline-block; margin-right: 15px">
|
||||
${split_issue}
|
||||
</button>`)
|
||||
.appendTo(frm.timeline.wrapper.find('.comment-header .asset-details:not([data-communication-type="Comment"])'))
|
||||
if (!frm.timeline.wrapper.data("split-issue-event-attached")){
|
||||
frm.timeline.wrapper.on('click', '.btn-split-issue', (e) => {
|
||||
frm.timeline.wrapper.on("click", ".btn-split-issue", (e) => {
|
||||
var dialog = new frappe.ui.Dialog({
|
||||
title: __("Split Issue"),
|
||||
fields: [
|
||||
{fieldname: 'subject', fieldtype: 'Data', reqd:1, label: __('Subject'), description: __('All communications including and above this shall be moved into the new Issue')}
|
||||
{fieldname: "subject", fieldtype: "Data", reqd:1, label: __("Subject"), description: __("All communications including and above this shall be moved into the new Issue")}
|
||||
],
|
||||
primary_action_label: __("Split"),
|
||||
primary_action: function() {
|
||||
@ -234,7 +234,7 @@ function set_time_to_resolve_and_response(frm) {
|
||||
function get_time_left(timestamp, agreement_status) {
|
||||
const diff = moment(timestamp).diff(moment());
|
||||
const diff_display = diff >= 44500 ? moment.duration(diff).humanize() : "Failed";
|
||||
let indicator = (diff_display == 'Failed' && agreement_status != "Fulfilled") ? "red" : "green";
|
||||
let indicator = (diff_display == "Failed" && agreement_status != "Fulfilled") ? "red" : "green";
|
||||
return {"diff_display": diff_display, "indicator": indicator};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user