Fix errors found by Codacy
This commit is contained in:
parent
b95da2a670
commit
fe36f44b9f
4 changed files with 13 additions and 12 deletions
|
|
@ -147,7 +147,7 @@ frappe.ui.form.on("Communication", {
|
|||
d.show();
|
||||
},
|
||||
|
||||
show_move_dialog: function(frm){
|
||||
show_move_dialog: function(frm) {
|
||||
var lib = "frappe.email";
|
||||
var d = new frappe.ui.Dialog ({
|
||||
title: __("Move"),
|
||||
|
|
@ -161,12 +161,13 @@ frappe.ui.form.on("Communication", {
|
|||
return {
|
||||
"filters": {
|
||||
"name": ["!=", frm.doc.email_account],
|
||||
"enable_incoming": ["=", 1]
|
||||
}
|
||||
}
|
||||
}
|
||||
}],
|
||||
primary_action_label: __("Move"),
|
||||
primary_action(values) {
|
||||
primary_action_label: __("Move"),
|
||||
primary_action(values) {
|
||||
d.hide();
|
||||
frappe.call({
|
||||
method: "frappe.email.inbox.move_email",
|
||||
|
|
@ -179,7 +180,7 @@ frappe.ui.form.on("Communication", {
|
|||
window.history.back();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
d.show();
|
||||
},
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ def create_email_flag_queue(names, action):
|
|||
|
||||
@frappe.whitelist()
|
||||
def mark_as_closed_open(communication, action):
|
||||
"""set status to open or close"""
|
||||
"""Set status to open or close"""
|
||||
if action == "Close":
|
||||
frappe.db.set_value("Communication", communication, "status", "Closed")
|
||||
else:
|
||||
|
|
@ -106,17 +106,17 @@ def mark_as_closed_open(communication, action):
|
|||
|
||||
@frappe.whitelist()
|
||||
def move_email(communication, email_account):
|
||||
"""move email to another email_account"""
|
||||
"""Move email to another email_account"""
|
||||
frappe.db.set_value("Communication", communication, "email_account", email_account)
|
||||
|
||||
@frappe.whitelist()
|
||||
def mark_as_trash(communication):
|
||||
"""set email status to trash"""
|
||||
"""Set email status to trash"""
|
||||
frappe.db.set_value("Communication", communication, "email_status", "Trash")
|
||||
|
||||
@frappe.whitelist()
|
||||
def mark_as_spam(communication, sender):
|
||||
""" set email status to spam """
|
||||
"""Set email status to spam"""
|
||||
email_rule = frappe.db.get_value("Email Rule", { "email_id": sender })
|
||||
if not email_rule:
|
||||
frappe.get_doc({
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ frappe.views.ListSidebar = class ListSidebar {
|
|||
accounts.forEach((account) => {
|
||||
let email_account = (account.email_id == "All Accounts") ? "All Accounts" : account.email_account;
|
||||
let route = ["List", "Communication", "Inbox", email_account].join('/');
|
||||
let display_name = (account.email_id == "All Accounts" || account.email_id == "Sent Mail" || account.email_id == "Spam" || account.email_id == "Trash") ? __(account.email_id) : account.email_id
|
||||
let display_name = (account.email_id == "All Accounts" || account.email_id == "Sent Mail" || account.email_id == "Spam" || account.email_id == "Trash") ? __(account.email_id) : account.email_id;
|
||||
|
||||
if (!divider) {
|
||||
this.get_divider().appendTo($dropdown);
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ frappe.views.InboxView = class InboxView extends frappe.views.ListView {
|
|||
}
|
||||
|
||||
render_header() {
|
||||
this.$result.find('.list-row-head').remove()
|
||||
this.$result.find('.list-row-head').remove();
|
||||
this.$result.prepend(this.get_header_html());
|
||||
}
|
||||
|
||||
|
|
@ -102,8 +102,8 @@ frappe.views.InboxView = class InboxView extends frappe.views.ListView {
|
|||
|
||||
const communication_date = comment_when(email.communication_date, true);
|
||||
const status = email.status == "Closed" ? `<span class="fa fa-check fa-large" title="${__(email.status)}"></span>`
|
||||
: email.status == "Replied" ? `<span class="fa fa-mail-reply fa-large" title="${__(email.status)}"></span>`
|
||||
: "";
|
||||
: email.status == "Replied" ? `<span class="fa fa-mail-reply fa-large" title="${__(email.status)}"></span>`
|
||||
: "";
|
||||
|
||||
return `
|
||||
<div class="level-item hidden-xs list-row-activity">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue