From 70c98abc8455bc8bf891736f3945f49f5596e931 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 23 Sep 2024 16:53:31 +0530 Subject: [PATCH] fix(minor): only select public workspaces by default --- .../server_script/server_script_list.js | 38 - frappe/desk/form/meta.py | 8 +- frappe/public/icons/lucide.svg | 3060 ++++++++--------- frappe/public/icons/timeless/icons.svg | 4 + frappe/public/js/frappe/list/list_view.js | 9 +- .../frappe/views/dashboard/dashboard_view.js | 6 +- .../js/frappe/views/reports/query_report.js | 12 +- .../js/frappe/web_form/web_form_list.js | 9 +- frappe/public/scss/common/icons.scss | 4 +- frappe/templates/includes/list/list.html | 4 +- 10 files changed, 1562 insertions(+), 1592 deletions(-) delete mode 100644 frappe/core/doctype/server_script/server_script_list.js diff --git a/frappe/core/doctype/server_script/server_script_list.js b/frappe/core/doctype/server_script/server_script_list.js deleted file mode 100644 index 1d4cdfdfe6..0000000000 --- a/frappe/core/doctype/server_script/server_script_list.js +++ /dev/null @@ -1,38 +0,0 @@ -frappe.listview_settings["Server Script"] = { - onload: function (listview) { - add_github_star_cta(listview); - }, -}; - -function add_github_star_cta(listview) { - try { - const key = "show_github_star_banner"; - if (localStorage.getItem(key) == "false") { - return; - } - - if (listview.github_star_banner) { - listview.github_star_banner.remove(); - } - - const message = __("Loving Frappe Framework?"); - const link = "https://github.com/frappe/frappe"; - const cta = __("Star us on GitHub"); - - listview.github_star_banner = $(` -
-
- ${message}
${cta} → -
-
- - - -
-
- `).appendTo(listview.page.sidebar); - } catch (error) { - console.error(error); - } -} diff --git a/frappe/desk/form/meta.py b/frappe/desk/form/meta.py index aaf1461113..1efa747b92 100644 --- a/frappe/desk/form/meta.py +++ b/frappe/desk/form/meta.py @@ -260,13 +260,16 @@ class FormMeta(Meta): self.set("__dashboard", self.get_dashboard_data()) def load_workspaces(self): - # find workspaces from shortcut Shortcut = frappe.qb.DocType("Workspace Shortcut") + Workspace = frappe.qb.DocType("Workspace") shortcut = ( frappe.qb.from_(Shortcut) .select(Shortcut.parent) + .inner_join(Workspace) + .on(Workspace.name == Shortcut.parent) .where(Shortcut.link_to == self.name) .where(Shortcut.type == "DocType") + .where(Workspace.public == 1) .run() ) if shortcut: @@ -276,8 +279,11 @@ class FormMeta(Meta): link = ( frappe.qb.from_(Link) .select(Link.parent) + .inner_join(Workspace) + .on(Workspace.name == Link.parent) .where(Link.link_type == "DocType") .where(Link.link_to == self.name) + .where(Workspace.public == 1) .run() ) diff --git a/frappe/public/icons/lucide.svg b/frappe/public/icons/lucide.svg index b68d084662..b9bbb03158 100644 --- a/frappe/public/icons/lucide.svg +++ b/frappe/public/icons/lucide.svg @@ -2,4591 +2,4591 @@

`; - const empty_state_image = "/assets/frappe/images/ui-states/list-empty-state.svg"; - const empty_state_html = `
- Generic Empty State + + +
${no_result_message_html} ${customize_button} diff --git a/frappe/public/js/frappe/views/reports/query_report.js b/frappe/public/js/frappe/views/reports/query_report.js index 12637479af..658ce4a7b3 100644 --- a/frappe/public/js/frappe/views/reports/query_report.js +++ b/frappe/public/js/frappe/views/reports/query_report.js @@ -103,9 +103,9 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList { get_no_result_message() { return `
-
- Generic Empty State -
+ + +

${__("Nothing to show")}

`; } @@ -1015,9 +1015,9 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList { show_loading_screen() { const loading_state = `
-
- Generic Empty State -
+ + +

${__("Loading")}...

`; diff --git a/frappe/public/js/frappe/web_form/web_form_list.js b/frappe/public/js/frappe/web_form/web_form_list.js index e0745f243a..c2be360079 100644 --- a/frappe/public/js/frappe/web_form/web_form_list.js +++ b/frappe/public/js/frappe/web_form/web_form_list.js @@ -233,12 +233,9 @@ export default class WebFormList { let empty_state = $(`
-
- Generic Empty State -
+ + +

${__("No {0} found", [__(this.doctype)])}

${new_button}
diff --git a/frappe/public/scss/common/icons.scss b/frappe/public/scss/common/icons.scss index 0c4183466a..bef46bd625 100644 --- a/frappe/public/scss/common/icons.scss +++ b/frappe/public/scss/common/icons.scss @@ -72,8 +72,8 @@ use.like-icon { } .icon-xl { - width: 75px; - height: 75px; + width: 40px; + height: 40px; } .no-stroke { diff --git a/frappe/templates/includes/list/list.html b/frappe/templates/includes/list/list.html index ae3725d601..f3149023b4 100644 --- a/frappe/templates/includes/list/list.html +++ b/frappe/templates/includes/list/list.html @@ -3,7 +3,9 @@ {% endif %} {% if not result -%}
- + + +
{{ no_result_message or _("Nothing to show") }}
{% else %}