Merge branch 'develop' into fix-update-docfield-property-function

This commit is contained in:
Ahmed Hasanin 2023-03-28 14:05:06 +02:00 committed by GitHub
commit 9fbed88d40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 3 deletions

View file

@ -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"

View file

@ -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;

View file

@ -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 = $(`
<div style="position: relative;">
<div class="">
${message}
</div>
<div class="mt-2">
<a href="${link}" target="_blank" style="color: var(--primary-color)">${cta} -> </a>
</div>
<div style="position: absolute; top: 0px; right: 0px; cursor: pointer;" title="Dismiss"
onclick="localStorage.setItem('show_insights_banner', 'false') || this.parentElement.remove()">
<svg class="icon icon-sm" style="">
<use class="" href="#icon-close"></use>
</svg>
</div>
</div>
`).appendTo(this.sidebar);
} catch (error) {
console.error(error);
}
}
};