From 4598b26c73814ec7170d533f637ce60f84ee091d Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Sat, 31 Jul 2021 13:24:18 +0530 Subject: [PATCH 01/13] fix: multiple issues with Email Inbox --- frappe/public/js/frappe/ui/toolbar/awesome_bar.js | 7 ++++++- frappe/public/js/frappe/views/inbox/inbox_view.js | 11 ++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/frappe/public/js/frappe/ui/toolbar/awesome_bar.js b/frappe/public/js/frappe/ui/toolbar/awesome_bar.js index b85de18be2..952fd62aa1 100644 --- a/frappe/public/js/frappe/ui/toolbar/awesome_bar.js +++ b/frappe/public/js/frappe/ui/toolbar/awesome_bar.js @@ -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) { diff --git a/frappe/public/js/frappe/views/inbox/inbox_view.js b/frappe/public/js/frappe/views/inbox/inbox_view.js index 8b53bd49a9..6c5b330a9f 100644 --- a/frappe/public/js/frappe/views/inbox/inbox_view.js +++ b/frappe/public/js/frappe/views/inbox/inbox_view.js @@ -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 ? `` : ''; - const form_link = frappe.utils.get_form_link(email.reference_doctype, email.reference_name); - const link = email.reference_doctype && email.reference_doctype !== this.doctype ? - ` - ` : ''; + `; + } const communication_date = comment_when(email.communication_date, true); const status = From 68263b8663ba2e79622441209757db844c876be4 Mon Sep 17 00:00:00 2001 From: shariquerik Date: Thu, 19 Aug 2021 12:27:44 +0530 Subject: [PATCH 02/13] fix: App without home page gives error when navigate to home --- frappe/public/js/frappe/router.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/public/js/frappe/router.js b/frappe/public/js/frappe/router.js index 4360f3e887..c27e443c06 100644 --- a/frappe/public/js/frappe/router.js +++ b/frappe/public/js/frappe/router.js @@ -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) { From b96b4c90f76b5500ec6899265e2ea216e1c8f0eb Mon Sep 17 00:00:00 2001 From: shariquerik Date: Thu, 19 Aug 2021 12:30:59 +0530 Subject: [PATCH 03/13] fix: Can't navigate to webpage with name same as private workspace --- frappe/public/js/frappe/router.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/router.js b/frappe/public/js/frappe/router.js index c27e443c06..484f1ac911 100644 --- a/frappe/public/js/frappe/router.js +++ b/frappe/public/js/frappe/router.js @@ -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]]) { From 461dfd6c6e14a08fdd5f5e0e7bb06a1e8769192b Mon Sep 17 00:00:00 2001 From: shariquerik Date: Thu, 19 Aug 2021 12:42:43 +0530 Subject: [PATCH 04/13] fix: Make Content hidden and added validation --- frappe/desk/doctype/workspace/workspace.json | 15 ++++++++------- frappe/desk/doctype/workspace/workspace.py | 3 +++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/frappe/desk/doctype/workspace/workspace.json b/frappe/desk/doctype/workspace/workspace.json index e2ae38faf1..e991ee3f8f 100644 --- a/frappe/desk/doctype/workspace/workspace.json +++ b/frappe/desk/doctype/workspace/workspace.json @@ -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": [ @@ -239,14 +239,10 @@ "fieldtype": "Data", "label": "Parent Page" }, - { - "fieldname": "content_section", - "fieldtype": "Section Break", - "label": "Content" - }, { "fieldname": "content", "fieldtype": "Long Text", + "hidden": 1, "label": "Content" }, { @@ -259,10 +255,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:36:29.825169", "modified_by": "Administrator", "module": "Desk", "name": "Workspace", diff --git a/frappe/desk/doctype/workspace/workspace.py b/frappe/desk/doctype/workspace/workspace.py index 0821ae03c4..693c34bcd1 100644 --- a/frappe/desk/doctype/workspace/workspace.py +++ b/frappe/desk/doctype/workspace/workspace.py @@ -17,6 +17,9 @@ class Workspace(Document): frappe.throw(_("You need to be in developer mode to edit this document")) validate_route_conflict(self.doctype, self.name) + if isinstance(self.content, list): + frappe.throw(_("Content data shoud be a list")) + duplicate_exists = frappe.db.exists("Workspace", { "name": ["!=", self.name], 'is_default': 1, 'extends': self.extends }) From 1032d3a7d1101b9e7d68032e7c9d7c244ca21cc3 Mon Sep 17 00:00:00 2001 From: shariquerik Date: Thu, 19 Aug 2021 12:49:45 +0530 Subject: [PATCH 05/13] fix: Removed default collapsing sidebar section --- frappe/public/js/frappe/views/workspace/workspace.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/frappe/public/js/frappe/views/workspace/workspace.js b/frappe/public/js/frappe/views/workspace/workspace.js index b46c220d9d..8f11e711ca 100644 --- a/frappe/public/js/frappe/views/workspace/workspace.js +++ b/frappe/public/js/frappe/views/workspace/workspace.js @@ -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'); } From bb55ca4c29c584275ed6a14660552250da4744b9 Mon Sep 17 00:00:00 2001 From: shariquerik Date: Thu, 19 Aug 2021 12:51:40 +0530 Subject: [PATCH 06/13] fix: Make title and label field mandatory --- frappe/desk/doctype/workspace/workspace.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frappe/desk/doctype/workspace/workspace.json b/frappe/desk/doctype/workspace/workspace.json index e991ee3f8f..020f3153df 100644 --- a/frappe/desk/doctype/workspace/workspace.json +++ b/frappe/desk/doctype/workspace/workspace.json @@ -46,6 +46,7 @@ "fieldname": "label", "fieldtype": "Data", "label": "Name", + "reqd": 1, "unique": 1 }, { @@ -232,7 +233,8 @@ { "fieldname": "title", "fieldtype": "Data", - "label": "Title" + "label": "Title", + "reqd": 1 }, { "fieldname": "parent_page", @@ -263,7 +265,7 @@ } ], "links": [], - "modified": "2021-08-19 12:36:29.825169", + "modified": "2021-08-19 12:51:00.233017", "modified_by": "Administrator", "module": "Desk", "name": "Workspace", From 6a599f77ebf29a6e466ad44c75c915586ff8971a Mon Sep 17 00:00:00 2001 From: shariquerik Date: Thu, 19 Aug 2021 14:07:52 +0530 Subject: [PATCH 07/13] fix: Content validation --- frappe/desk/doctype/workspace/workspace.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frappe/desk/doctype/workspace/workspace.py b/frappe/desk/doctype/workspace/workspace.py index 693c34bcd1..31ae5754c1 100644 --- a/frappe/desk/doctype/workspace/workspace.py +++ b/frappe/desk/doctype/workspace/workspace.py @@ -17,7 +17,10 @@ class Workspace(Document): frappe.throw(_("You need to be in developer mode to edit this document")) validate_route_conflict(self.doctype, self.name) - if isinstance(self.content, list): + try: + if not isinstance(loads(self.content), list): + raise + except: frappe.throw(_("Content data shoud be a list")) duplicate_exists = frappe.db.exists("Workspace", { From ca4d220f145d0678f2621e3631a8993c2c3d02b3 Mon Sep 17 00:00:00 2001 From: shariquerik Date: Thu, 19 Aug 2021 14:20:18 +0530 Subject: [PATCH 08/13] fix: sider fix --- frappe/desk/doctype/workspace/workspace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/desk/doctype/workspace/workspace.py b/frappe/desk/doctype/workspace/workspace.py index 31ae5754c1..7795d02616 100644 --- a/frappe/desk/doctype/workspace/workspace.py +++ b/frappe/desk/doctype/workspace/workspace.py @@ -20,7 +20,7 @@ class Workspace(Document): try: if not isinstance(loads(self.content), list): raise - except: + except Exception: frappe.throw(_("Content data shoud be a list")) duplicate_exists = frappe.db.exists("Workspace", { From 7c178ae18c41d21ac53d8b77aae0b179adeb8349 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 23 Aug 2021 11:28:33 +0530 Subject: [PATCH 09/13] fix(ux): better message for removal of assignment (#14008) (cherry picked from commit 40352d9df6418e0c435e0ae9f9dd8f96095c70db) Co-authored-by: Ankush Menat --- frappe/desk/doctype/todo/todo.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frappe/desk/doctype/todo/todo.py b/frappe/desk/doctype/todo/todo.py index 09297b4e5e..754b94cdcb 100644 --- a/frappe/desk/doctype/todo/todo.py +++ b/frappe/desk/doctype/todo/todo.py @@ -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" } From 30f9572122a4ef8c357799e50f763e49c21cac4c Mon Sep 17 00:00:00 2001 From: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> Date: Mon, 23 Aug 2021 12:32:14 +0530 Subject: [PATCH 10/13] chore: Let maintainer raise a PR on stable branch --- .mergify.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.mergify.yml b/.mergify.yml index 1a81a28594..8c7a7dc95d 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -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: From 7e9b78bf7deb5dd03c01653e81ef810e7f2dd7bc Mon Sep 17 00:00:00 2001 From: shariquerik Date: Mon, 23 Aug 2021 13:45:14 +0530 Subject: [PATCH 11/13] test: Type on focused block fix --- cypress/integration/workspace.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/integration/workspace.js b/cypress/integration/workspace.js index 9701e54c5e..28930b5734 100644 --- a/cypress/integration/workspace.js +++ b/cypress/integration/workspace.js @@ -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'); }); From 70899a7a959be3d7ba26bd6aa6783a7123434c24 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 23 Aug 2021 21:43:29 +0530 Subject: [PATCH 12/13] feat(minor): Added app_name and app_logo in Website Settings --- .../website_settings/website_settings.json | 23 +++++++++++++++---- frappe/www/login.py | 8 ++++--- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/frappe/website/doctype/website_settings/website_settings.json b/frappe/website/doctype/website_settings/website_settings.json index f4eee7231e..e7ae2a01e1 100644 --- a/frappe/website/doctype/website_settings/website_settings.json +++ b/frappe/website/doctype/website_settings/website_settings.json @@ -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 -} +} \ No newline at end of file diff --git a/frappe/www/login.py b/frappe/www/login.py index 6542b29d42..f816b2f91e 100644 --- a/frappe/www/login.py +++ b/frappe/www/login.py @@ -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"]) From 7caae74004b30cfcd6718c1a3b3f1d151efe9e1b Mon Sep 17 00:00:00 2001 From: Shariq Ansari <30859809+shariquerik@users.noreply.github.com> Date: Tue, 24 Aug 2021 10:15:37 +0530 Subject: [PATCH 13/13] build: Update datatable to 1.15.4 (#14016) Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 1ddbec178e..2283a44533 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/yarn.lock b/yarn.lock index e8f527b7f1..ee530d747b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"