Merge branch 'develop' into core-test-coverage-1

This commit is contained in:
Suraj Shetty 2021-08-24 10:23:24 +05:30 committed by GitHub
commit 9797c1ad18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 75 additions and 40 deletions

View file

@ -1,9 +1,11 @@
pull_request_rules:
- name: Auto-close PRs on stable branch
conditions:
- or:
- base=version-13
- base=version-12
- and:
- author!=surajshetty3416
- or:
- base=version-13
- base=version-12
actions:
close:
comment:

View file

@ -36,12 +36,12 @@ context('Workspace 2.0', () => {
cy.get('.codex-editor__redactor .ce-block');
cy.get('.custom-actions .inner-group-button[data-label="Add%20Block"]').click();
cy.get('.custom-actions .inner-group-button .dropdown-menu .block-menu-item-label').contains('Heading').click();
cy.get(".ce-block:last").find('h2').click({force: true}).type('Header');
cy.get(":focus").type('Header');
cy.get(".ce-block:last").find('.ce-header').should('exist');
cy.get('.custom-actions .inner-group-button[data-label="Add%20Block"]').click();
cy.get('.custom-actions .inner-group-button .dropdown-menu .block-menu-item-label').contains('Text').click();
cy.get(".ce-block:last").find('.ce-paragraph').click({force: true}).type('Paragraph text');
cy.get(":focus").type('Paragraph text');
cy.get(".ce-block:last").find('.ce-paragraph').should('exist');
});

View file

@ -29,8 +29,15 @@ class ToDo(Document):
else:
# NOTE the previous value is only available in validate method
if self.get_db_value("status") != self.status:
if self.owner == frappe.session.user:
removal_message = frappe._("{0} removed their assignment.").format(
get_fullname(frappe.session.user))
else:
removal_message = frappe._("Assignment of {0} removed by {1}").format(
get_fullname(self.owner), get_fullname(frappe.session.user))
self._assignment = {
"text": frappe._("Assignment closed by {0}").format(get_fullname(frappe.session.user)),
"text": removal_message,
"comment_type": "Assignment Completed"
}

View file

@ -28,7 +28,6 @@
"pin_to_bottom",
"hide_custom",
"public",
"content_section",
"content",
"section_break_2",
"charts_label",
@ -39,6 +38,7 @@
"section_break_18",
"cards_label",
"links",
"roles_section",
"roles"
],
"fields": [
@ -46,6 +46,7 @@
"fieldname": "label",
"fieldtype": "Data",
"label": "Name",
"reqd": 1,
"unique": 1
},
{
@ -232,21 +233,18 @@
{
"fieldname": "title",
"fieldtype": "Data",
"label": "Title"
"label": "Title",
"reqd": 1
},
{
"fieldname": "parent_page",
"fieldtype": "Data",
"label": "Parent Page"
},
{
"fieldname": "content_section",
"fieldtype": "Section Break",
"label": "Content"
},
{
"fieldname": "content",
"fieldtype": "Long Text",
"hidden": 1,
"label": "Content"
},
{
@ -259,10 +257,15 @@
"fieldtype": "Table",
"label": "Roles",
"options": "Has Role"
},
{
"fieldname": "roles_section",
"fieldtype": "Section Break",
"label": "Roles"
}
],
"links": [],
"modified": "2021-08-05 11:49:09.028243",
"modified": "2021-08-19 12:51:00.233017",
"modified_by": "Administrator",
"module": "Desk",
"name": "Workspace",

View file

@ -17,6 +17,12 @@ class Workspace(Document):
frappe.throw(_("You need to be in developer mode to edit this document"))
validate_route_conflict(self.doctype, self.name)
try:
if not isinstance(loads(self.content), list):
raise
except Exception:
frappe.throw(_("Content data shoud be a list"))
duplicate_exists = frappe.db.exists("Workspace", {
"name": ["!=", self.name], 'is_default': 1, 'extends': self.extends
})

View file

@ -129,7 +129,7 @@ frappe.router = {
if (frappe.workspaces[route[0]]) {
// public workspace
route = ['Workspaces', frappe.workspaces[route[0]].title];
} else if (frappe.workspaces[route[1]]) {
} else if (route[0] == 'private' && frappe.workspaces[route[1]]) {
// private workspace
route = ['Workspaces', 'private', frappe.workspaces[route[1]].title];
} else if (this.routes[route[0]]) {
@ -354,8 +354,8 @@ frappe.router = {
return a;
}
}).join('/');
return '/app/' + (path_string || 'home');
let default_page = frappe.workspaces['home'] ? 'home' : Object.keys(frappe.workspaces)[0];
return '/app/' + (path_string || default_page);
},
push_state(url) {

View file

@ -194,9 +194,14 @@ frappe.search.AwesomeBar = class AwesomeBar {
var out = [], routes = [];
options.forEach(function(option) {
if(option.route) {
if(option.route[0] === "List" && option.route[2] !== 'Report') {
if (
option.route[0] === "List" &&
option.route[2] !== 'Report' &&
option.route[2] !== 'Inbox'
) {
option.route.splice(2);
}
var str_route = (typeof option.route==='string') ?
option.route : option.route.join('/');
if(routes.indexOf(str_route)===-1) {

View file

@ -94,19 +94,20 @@ frappe.views.InboxView = class InboxView extends frappe.views.ListView {
this.render_list();
this.on_row_checked();
this.render_count();
this.render_tags();
}
get_meta_html(email) {
const attachment = email.has_attachment ?
`<span class="fa fa-paperclip fa-large" title="${__('Has Attachments')}"></span>` : '';
const form_link = frappe.utils.get_form_link(email.reference_doctype, email.reference_name);
const link = email.reference_doctype && email.reference_doctype !== this.doctype ?
`<a class="text-muted grey" href="${form_link}"
let link = "";
if (email.reference_doctype && email.reference_doctype !== this.doctype) {
link = `<a class="text-muted grey"
href="${frappe.utils.get_form_link(email.reference_doctype, email.reference_name)}"
title="${__('Linked with {0}', [email.reference_doctype])}">
<i class="fa fa-link fa-large"></i>
</a>` : '';
</a>`;
}
const communication_date = comment_when(email.communication_date, true);
const status =

View file

@ -174,10 +174,6 @@ frappe.views.Workspace = class Workspace {
$(e.target).parent().find('.sidebar-item-container').toggleClass('hidden');
});
if (!this.current_page.name) {
$title.trigger("click");
}
if (Object.keys(root_pages).length === 0) {
sidebar_section.addClass('hidden');
}

View file

@ -56,9 +56,11 @@
"google_analytics_id",
"google_analytics_anonymize_ip",
"misc_section",
"subdomain",
"app_name",
"app_logo",
"disable_signup",
"section_break_38",
"subdomain",
"head_html",
"robots_txt",
"route_redirects",
@ -224,7 +226,7 @@
"collapsible": 1,
"fieldname": "misc_section",
"fieldtype": "Section Break",
"label": "Disable Signup"
"label": "Login Page"
},
{
"description": "An icon file with .ico extension. Should be 16 x 16 px. Generated using a favicon generator. [favicon-generator.org]",
@ -235,7 +237,7 @@
{
"description": "Sub-domain provided by erpnext.com",
"fieldname": "subdomain",
"fieldtype": "Text",
"fieldtype": "Small Text",
"label": "Subdomain",
"read_only": 1
},
@ -425,6 +427,17 @@
"fieldname": "navbar_template_section",
"fieldtype": "Section Break",
"label": "Navbar Template"
},
{
"default": "Frappe",
"fieldname": "app_name",
"fieldtype": "Data",
"label": "App Name"
},
{
"fieldname": "app_logo",
"fieldtype": "Attach Image",
"label": "App Logo"
}
],
"icon": "fa fa-cog",
@ -433,7 +446,7 @@
"issingle": 1,
"links": [],
"max_attachments": 10,
"modified": "2021-07-15 17:39:56.609771",
"modified": "2021-08-23 21:39:51.702248",
"modified_by": "Administrator",
"module": "Website",
"name": "Website Settings",
@ -457,4 +470,4 @@
"sort_field": "modified",
"sort_order": "ASC",
"track_changes": 1
}
}

View file

@ -34,9 +34,11 @@ def get_context(context):
context.for_test = 'login.html'
context["title"] = "Login"
context["provider_logins"] = []
context["disable_signup"] = frappe.utils.cint(frappe.db.get_value("Website Settings", "Website Settings", "disable_signup"))
context["logo"] = frappe.get_hooks("app_logo_url")[-1]
context["app_name"] = frappe.get_system_settings("app_name") or _("Frappe")
context["disable_signup"] = frappe.utils.cint(frappe.db.get_single_value("Website Settings", "disable_signup"))
context["logo"] = (frappe.db.get_single_value('Website Settings', 'app_logo') or
frappe.get_hooks("app_logo_url")[-1])
context["app_name"] = (frappe.db.get_single_value('Website Settings', 'app_name') or
frappe.get_system_settings("app_name") or _("Frappe"))
providers = [i.name for i in frappe.get_all("Social Login Key", filters={"enable_social_login":1}, order_by="name")]
for provider in providers:
client_id, base_url = frappe.get_value("Social Login Key", provider, ["client_id", "base_url"])

View file

@ -35,7 +35,7 @@
"express": "^4.17.1",
"fast-deep-equal": "^2.0.1",
"frappe-charts": "^2.0.0-rc13",
"frappe-datatable": "^1.15.3",
"frappe-datatable": "^1.15.4",
"frappe-gantt": "^0.5.0",
"fuse.js": "^3.4.6",
"highlight.js": "^10.4.1",

View file

@ -2721,10 +2721,10 @@ frappe-charts@^2.0.0-rc13:
resolved "https://registry.yarnpkg.com/frappe-charts/-/frappe-charts-2.0.0-rc13.tgz#fdb251d7ae311c41e38f90a3ae108070ec6b9072"
integrity sha512-Bv7IfllIrjRbKWHn5b769dOSenqdBixAr6m5kurf8ZUOJSLOgK4HOXItJ7BA8n9PvviH9/k5DaloisjLM2Bm1w==
frappe-datatable@^1.15.3:
version "1.15.3"
resolved "https://registry.yarnpkg.com/frappe-datatable/-/frappe-datatable-1.15.3.tgz#1737e9aebfd363ffadffced71a3534c40e350223"
integrity sha512-tUE3pNbxCMX0HPKvwurLBPRAOAdS0gNo1+MpoyFSqXI7b7sp6/TCBRht6qu1Luw+VyIzBtXkJdnnqU+Uoy8iow==
frappe-datatable@^1.15.4:
version "1.15.4"
resolved "https://registry.yarnpkg.com/frappe-datatable/-/frappe-datatable-1.15.4.tgz#dc2e5e5d8a0a7cb8ee658f2d39966af1d4405401"
integrity sha512-eW3upPvverm1GNBL4+IcPDvjm5xbJc5ZXW8TYEUZt/QQ2W75K/T6736pSzi9D6mX9sn3BtZ7Ige7MS45SGrgzQ==
dependencies:
hyperlist "^1.0.0-beta"
lodash "^4.17.5"