Merge branch 'staging-fixes' into staging

This commit is contained in:
Frappe Bot 2018-11-09 10:13:51 +00:00
commit cc9874e025
13 changed files with 639 additions and 569 deletions

View file

@ -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()

View file

@ -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: {} });
}
};

View file

@ -61,8 +61,6 @@ def search_widget(doctype, txt, query=None, searchfield=None, start=0,
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

View file

@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@ -16,6 +17,7 @@
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -42,10 +44,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -72,16 +76,18 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "show_as_cc",
"fieldtype": "Data",
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@ -102,10 +108,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -131,10 +139,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -162,10 +172,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -191,10 +203,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -221,10 +235,12 @@
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -251,10 +267,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -280,10 +298,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -311,10 +331,12 @@
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -341,10 +363,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -372,10 +396,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -403,10 +429,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -433,10 +461,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -463,10 +493,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -493,10 +525,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -523,6 +557,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}
],
@ -537,7 +572,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-09-25 15:39:21.781324",
"modified": "2018-11-09 15:34:07.229657",
"modified_by": "Administrator",
"module": "Email",
"name": "Email Queue",
@ -545,7 +580,6 @@
"permissions": [
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 1,
@ -570,5 +604,6 @@
"show_name_in_global_search": 0,
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0
"track_seen": 0,
"track_views": 0
}

View 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()
]);
});

View file

@ -11,8 +11,8 @@ app_color = "orange"
source_link = "https://github.com/frappe/frappe"
app_license = "MIT"
develop_version = '11.x.x-develop'
staging_version = '11.0.3-beta.22'
develop_version = '12.x.x-develop'
staging_version = '11.0.3-beta.23'
app_email = "info@frappe.io"

View file

@ -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');

View file

@ -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;

View file

@ -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();

View file

@ -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>

View file

@ -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) {
@ -657,7 +655,7 @@ frappe.views.CommunicationComposer = Class.extend({
var communication_date = last_email.communication_date || last_email.creation;
content = '<div><br></div>'
+ reply
+ "<br><!-- original-reply --><br>"
+ "<div data-comment='original-reply'></div>"
+ '<blockquote>' +
'<p>' + __("On {0}, {1} wrote:",
[frappe.datetime.global_date_format(communication_date) , last_email.sender]) + '</p>' +

View file

@ -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 = [

View file

@ -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 = []