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" 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; 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} +
+
+ ${cta} -> +
+
+ + + +
+
+ `).appendTo(this.sidebar); + } catch (error) { + console.error(error); + } + } };