From 6bda014406addb89aac3a17c68c997abf01b9db7 Mon Sep 17 00:00:00 2001 From: Devin Slauenwhite Date: Tue, 28 Mar 2023 05:04:45 -0400 Subject: [PATCH 1/3] fix: install cypress plugins in frappe namespace (#20459) --- frappe/commands/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/commands/utils.py b/frappe/commands/utils.py index 01de67eb05..03374986d4 100644 --- a/frappe/commands/utils.py +++ b/frappe/commands/utils.py @@ -912,7 +912,7 @@ def run_ui_tests( os.chdir(app_base_path) - node_bin = subprocess.getoutput("yarn bin") + node_bin = subprocess.getoutput("(cd ../frappe && yarn bin)") cypress_path = f"{node_bin}/cypress" drag_drop_plugin_path = f"{node_bin}/../@4tw/cypress-drag-drop" real_events_plugin_path = f"{node_bin}/../cypress-real-events" @@ -939,7 +939,7 @@ def run_ui_tests( "@cypress/code-coverage@^3", ] ) - frappe.commands.popen(f"yarn add {packages} --no-lockfile") + frappe.commands.popen(f"(cd ../frappe && yarn add {packages} --no-lockfile)") # run for headless mode run_or_open = "run --browser chrome --record" if headless else "open" From e756d417901b755ff2e65de97dddca06d25ee658 Mon Sep 17 00:00:00 2001 From: Saqib Ansari Date: Tue, 28 Mar 2023 17:24:20 +0530 Subject: [PATCH 2/3] chore: add insights banner (#20487) * chore: add insights banner * chore: cleanup message and title [skip ci] --------- Co-authored-by: Ankush Menat --- frappe/public/js/frappe/list/list_sidebar.js | 41 ++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/frappe/public/js/frappe/list/list_sidebar.js b/frappe/public/js/frappe/list/list_sidebar.js index f845f3a375..fe5f0b810f 100644 --- a/frappe/public/js/frappe/list/list_sidebar.js +++ b/frappe/public/js/frappe/list/list_sidebar.js @@ -38,6 +38,8 @@ frappe.views.ListSidebar = class ListSidebar { this.reload_stats(); }); } + + this.add_insights_banner(); } setup_views() { @@ -239,4 +241,43 @@ frappe.views.ListSidebar = class ListSidebar { this.sidebar.find(".stat-no-records").remove(); this.get_stats(); } + + add_insights_banner() { + try { + if (this.list_view.view != "Report") { + return; + } + + if (localStorage.getItem("show_insights_banner") == "false") { + return; + } + + if (this.insights_banner) { + this.insights_banner.remove(); + } + + const message = "Get more insights from your data with Frappe Insights."; + const link = "https://frappe.io/s/insights"; + const cta = "Get Frappe Insights"; + + this.insights_banner = $(` +
+
+ ${message} +
+ +
+ + + +
+
+ `).appendTo(this.sidebar); + } catch (error) { + console.error(error); + } + } }; From 63338a3806281a2933fac7fb158b730c1c64bca9 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Tue, 28 Mar 2023 17:33:05 +0530 Subject: [PATCH 3/3] fix: date field shouldn't be formatted for TZ (#20486) Date fields aren't timezone aware. --- frappe/public/js/frappe/form/formatters.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/form/formatters.js b/frappe/public/js/frappe/form/formatters.js index 1d555c3603..14f01b6607 100644 --- a/frappe/public/js/frappe/form/formatters.js +++ b/frappe/public/js/frappe/form/formatters.js @@ -186,7 +186,7 @@ frappe.form.formatters = { return value; } if (value) { - value = frappe.datetime.str_to_user(value); + value = frappe.datetime.str_to_user(value, false, true); // handle invalid date if (value === "Invalid date") { value = null;