Merge branch 'staging' into develop
This commit is contained in:
commit
478e60fdb1
13 changed files with 656 additions and 567 deletions
|
|
@ -17,7 +17,7 @@ from faker import Faker
|
|||
from .exceptions import *
|
||||
from .utils.jinja import (get_jenv, get_template, render_template, get_email_from_template, get_jloader)
|
||||
|
||||
__version__ = '10.1.59'
|
||||
__version__ = '10.1.60'
|
||||
__title__ = "Frappe Framework"
|
||||
|
||||
local = Local()
|
||||
|
|
|
|||
|
|
@ -19,16 +19,7 @@ frappe.listview_settings['Communication'] = {
|
|||
});
|
||||
},
|
||||
|
||||
set_primary_action: function(list_view) {
|
||||
var me = this;
|
||||
if (list_view.new_doctype) {
|
||||
list_view.page.set_primary_action(
|
||||
__("New"),
|
||||
function() { new frappe.views.CommunicationComposer({ doc: {} }) },
|
||||
"octicon octicon-plus"
|
||||
);
|
||||
} else {
|
||||
list_view.page.clear_primary_action();
|
||||
}
|
||||
primary_action: function() {
|
||||
new frappe.views.CommunicationComposer({ doc: {} });
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -60,9 +60,7 @@ def search_widget(doctype, txt, query=None, searchfield=None, start=0,
|
|||
page_length=10, filters=None, filter_fields=None, as_dict=False, ignore_user_permissions=False):
|
||||
if isinstance(filters, string_types):
|
||||
filters = json.loads(filters)
|
||||
|
||||
meta = frappe.get_meta(doctype)
|
||||
|
||||
|
||||
if searchfield:
|
||||
sanitize_searchfield(searchfield)
|
||||
|
||||
|
|
@ -80,6 +78,8 @@ def search_widget(doctype, txt, query=None, searchfield=None, start=0,
|
|||
search_widget(doctype, txt, standard_queries[doctype][0],
|
||||
searchfield, start, page_length, filters)
|
||||
else:
|
||||
meta = frappe.get_meta(doctype)
|
||||
|
||||
if query:
|
||||
frappe.throw(_("This query style is discontinued"))
|
||||
# custom query
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
23
frappe/email/doctype/email_queue/test_email_queue.js
Normal file
23
frappe/email/doctype/email_queue/test_email_queue.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/* eslint-disable */
|
||||
// rename this file from _test_[name] to test_[name] to activate
|
||||
// and remove above this line
|
||||
|
||||
QUnit.test("test: Email Queue", function (assert) {
|
||||
let done = assert.async();
|
||||
|
||||
// number of asserts
|
||||
assert.expect(1);
|
||||
|
||||
frappe.run_serially([
|
||||
// insert a new Email Queue
|
||||
() => frappe.tests.make('Email Queue', [
|
||||
// values to be set
|
||||
{key: 'value'}
|
||||
]),
|
||||
() => {
|
||||
assert.equal(cur_frm.doc.key, 'value');
|
||||
},
|
||||
() => done()
|
||||
]);
|
||||
|
||||
});
|
||||
|
|
@ -12,7 +12,7 @@ source_link = "https://github.com/frappe/frappe"
|
|||
app_license = "MIT"
|
||||
|
||||
develop_version = '12.x.x-develop'
|
||||
staging_version = '11.0.3-beta.22'
|
||||
staging_version = '11.0.3-beta.23'
|
||||
|
||||
app_email = "info@frappe.io"
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,24 @@ Table.create = (value) => {
|
|||
}
|
||||
Quill.register(Table, true);
|
||||
|
||||
// hidden blot
|
||||
const Block = Quill.import('blots/block');
|
||||
class HiddenBlock extends Block {
|
||||
static create(value) {
|
||||
const node = super.create(value);
|
||||
node.setAttribute('data-comment', value);
|
||||
node.classList.add('hidden');
|
||||
return node;
|
||||
}
|
||||
|
||||
static formats(node) {
|
||||
return node.getAttribute('data-comment');
|
||||
}
|
||||
}
|
||||
HiddenBlock.blotName = 'hiddenblot';
|
||||
HiddenBlock.tagName = 'DIV';
|
||||
Quill.register(HiddenBlock, true);
|
||||
|
||||
// image uploader
|
||||
const Uploader = Quill.import('modules/uploader');
|
||||
Uploader.DEFAULTS.mimetypes.push('image/gif');
|
||||
|
|
|
|||
|
|
@ -336,7 +336,7 @@ frappe.ui.form.Timeline = class Timeline {
|
|||
});
|
||||
} else {
|
||||
if(c.communication_type=="Communication" && c.communication_medium=="Email") {
|
||||
c.content = c.content.split("<!-- original-reply -->")[0];
|
||||
c.content = c.content.split('<div data-comment="original-reply">')[0];
|
||||
c.content = frappe.utils.strip_original_content(c.content);
|
||||
|
||||
c.original_content = c.content;
|
||||
|
|
|
|||
|
|
@ -168,7 +168,11 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
|
|||
set_primary_action() {
|
||||
if (this.can_create) {
|
||||
this.page.set_primary_action(__('New'), () => {
|
||||
this.make_new_doc();
|
||||
if (this.settings.primary_action) {
|
||||
this.settings.primary_action();
|
||||
} else {
|
||||
this.make_new_doc();
|
||||
}
|
||||
}, 'octicon octicon-plus');
|
||||
} else {
|
||||
this.page.clear_primary_action();
|
||||
|
|
|
|||
|
|
@ -184,11 +184,12 @@ frappe.upload = {
|
|||
});
|
||||
},
|
||||
make_file_row: function(file, { show_private } = {}) {
|
||||
const safe_file_name = frappe.utils.xss_sanitise(file.name);
|
||||
var template = `
|
||||
<div class="list-item-container" data-filename="${file.name}">
|
||||
<div class="list-item-container" data-filename="${safe_file_name}">
|
||||
<div class="list-item">
|
||||
<div class="list-item__content list-item__content--flex-2 ellipsis">
|
||||
<span>${file.name}</span>
|
||||
<span>${safe_file_name}</span>
|
||||
<span style="margin-top: 1px; margin-left: 5px;"
|
||||
class="fa fa-fw text-warning ${file.is_private ? 'fa-lock': 'fa-unlock-alt'}">
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -509,7 +509,12 @@ frappe.views.CommunicationComposer = Class.extend({
|
|||
|
||||
delete_saved_draft() {
|
||||
if (this.dialog) {
|
||||
localStorage.removeItem(this.frm.doctype + this.frm.docname);
|
||||
try {
|
||||
localStorage.removeItem(this.frm.doctype + this.frm.docname);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
console.warn('[Communication] Cannot delete localStorage item'); // eslint-disable-line
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -574,16 +579,6 @@ frappe.views.CommunicationComposer = Class.extend({
|
|||
cur_frm.reload_doc();
|
||||
}
|
||||
|
||||
if (localStorage.getItem(this.frm.doctype + this.frm.docname)) {
|
||||
try {
|
||||
localStorage.removeItem(this.frm.doctype + this.frm.docname);
|
||||
} catch (e) {
|
||||
// silently fail
|
||||
console.log(e);
|
||||
console.warn('[Communication] Failed to delete draft.');
|
||||
}
|
||||
}
|
||||
|
||||
// try the success callback if it exists
|
||||
if (me.success) {
|
||||
try {
|
||||
|
|
@ -635,7 +630,10 @@ frappe.views.CommunicationComposer = Class.extend({
|
|||
this.message = this.txt + (this.message ? ("<br><br>" + this.message) : "");
|
||||
} else {
|
||||
// saved draft in localStorage
|
||||
this.message = localStorage.getItem(this.frm.doctype + this.frm.docname) || '';
|
||||
const { doctype, docname } = this.frm || {};
|
||||
if (doctype && docname) {
|
||||
this.message = localStorage.getItem(doctype + docname) || '';
|
||||
}
|
||||
}
|
||||
|
||||
if(this.real_name) {
|
||||
|
|
@ -649,6 +647,25 @@ frappe.views.CommunicationComposer = Class.extend({
|
|||
// why do we append the last email in the reply?
|
||||
var content = "<div><br></div>" + reply;
|
||||
|
||||
if(last_email) {
|
||||
var last_email_content = last_email.original_comment || last_email.content;
|
||||
|
||||
last_email_content = last_email_content
|
||||
.replace(/<meta[\s\S]*meta>/g, '') // remove <meta> tags
|
||||
.replace(/<style[\s\S]*<\/style>/g, ''); // // remove <style> tags
|
||||
|
||||
var communication_date = last_email.communication_date || last_email.creation;
|
||||
content = '<div><br></div>'
|
||||
+ reply
|
||||
+ "<div data-comment='original-reply'></div>"
|
||||
+ '<blockquote>' +
|
||||
'<p>' + __("On {0}, {1} wrote:",
|
||||
[frappe.datetime.global_date_format(communication_date) , last_email.sender]) + '</p>' +
|
||||
last_email_content +
|
||||
'<blockquote>';
|
||||
} else {
|
||||
content = "<div><br></div>" + reply;
|
||||
}
|
||||
fields.content.set_value(content);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ acceptable_attributes = [
|
|||
'urn', 'valign', 'value', 'variable', 'volume', 'vspace', 'vrml',
|
||||
'width', 'wrap', 'xml:lang', 'data-row', 'data-list', 'data-language',
|
||||
'data-value', 'role', 'frameborder', 'allowfullscreen', 'spellcheck',
|
||||
'data-mode', 'data-gramm', 'data-placeholder'
|
||||
'data-mode', 'data-gramm', 'data-placeholder', 'data-comment'
|
||||
]
|
||||
|
||||
mathml_attributes = [
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ def read_xlsx_file_from_attached_file(file_id=None, fcontent=None, filepath=None
|
|||
return
|
||||
|
||||
rows = []
|
||||
wb1 = load_workbook(filename=filename, read_only=True)
|
||||
wb1 = load_workbook(filename=filename, read_only=True, data_only=True)
|
||||
ws1 = wb1.active
|
||||
for row in ws1.iter_rows():
|
||||
tmp_list = []
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue