mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 17:04:47 +00:00
fix: dont render demo clear button if onboarding tour present
This commit is contained in:
@@ -1,15 +1,25 @@
|
|||||||
$(document).on("toolbar_setup", function () {
|
$(document).on("toolbar_setup", function () {
|
||||||
if (frappe.boot.sysdefaults.demo_company) {
|
if (frappe.boot.sysdefaults.demo_company) {
|
||||||
erpnext.setup_clear_button();
|
render_clear_demo_button();
|
||||||
}
|
}
|
||||||
|
|
||||||
// for first load
|
// for first load after setup.
|
||||||
frappe.realtime.on("demo_data_complete", () => {
|
frappe.realtime.on("demo_data_complete", () => {
|
||||||
erpnext.setup_clear_button();
|
render_clear_demo_button();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
erpnext.setup_clear_button = function () {
|
function render_clear_demo_button() {
|
||||||
|
let wait_for_onboaring_tours = setInterval(() => {
|
||||||
|
if ($("#driver-page-overlay").length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setup_clear_demo_button();
|
||||||
|
clearInterval(wait_for_onboaring_tours);
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
|
||||||
|
function setup_clear_demo_button() {
|
||||||
let message_string = __(
|
let message_string = __(
|
||||||
"Demo data is present on the system, erase data before starting real usage."
|
"Demo data is present on the system, erase data before starting real usage."
|
||||||
);
|
);
|
||||||
@@ -68,4 +78,4 @@ erpnext.setup_clear_button = function () {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user