fix: change onboarding_status fieldtype
change onboarding_status to small text and handle null cases.
This commit is contained in:
parent
5290bbb1c6
commit
f612d84247
4 changed files with 12 additions and 5 deletions
|
|
@ -71,7 +71,7 @@ def get_bootinfo():
|
|||
bootinfo.onboarding_tours = (
|
||||
frappe.parse_json(frappe.db.get_single_value("Form Tour Settings", "onboarding_tours") or "[]")
|
||||
if frappe.get_system_settings("enable_onboarding")
|
||||
else "[]"
|
||||
else []
|
||||
)
|
||||
set_time_zone(bootinfo)
|
||||
|
||||
|
|
|
|||
|
|
@ -696,7 +696,7 @@
|
|||
{
|
||||
"default": "{}",
|
||||
"fieldname": "onboarding_status",
|
||||
"fieldtype": "Long Text",
|
||||
"fieldtype": "Small Text",
|
||||
"hidden": 1,
|
||||
"label": "Onboarding Status"
|
||||
}
|
||||
|
|
@ -761,7 +761,7 @@
|
|||
"link_fieldname": "user"
|
||||
}
|
||||
],
|
||||
"modified": "2023-05-24 11:25:27.040415",
|
||||
"modified": "2023-05-24 15:20:06.434506",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Core",
|
||||
"name": "User",
|
||||
|
|
|
|||
|
|
@ -74,7 +74,11 @@ frappe.Application = class Application {
|
|||
|
||||
// page container
|
||||
this.make_page_container();
|
||||
if (!window.Cypress) {
|
||||
if (
|
||||
!window.Cypress &&
|
||||
frappe.boot.onboarding_tours &&
|
||||
frappe.boot.user.onboarding_status != null
|
||||
) {
|
||||
let pending_tours =
|
||||
frappe.boot.onboarding_tours.findIndex((tour) => {
|
||||
frappe.boot.user.onboarding_status[tour[0]]?.is_complete == true;
|
||||
|
|
|
|||
|
|
@ -248,6 +248,9 @@ frappe.ui.OnboardingTour = class OnboardingTour {
|
|||
};
|
||||
|
||||
frappe.ui.init_onboarding_tour = () => {
|
||||
typeof frappe.boot.onboarding_tours == "undefined" && frappe.boot.onboarding_tours == [];
|
||||
typeof frappe.boot.user.onboarding_status == "undefined" &&
|
||||
frappe.boot.user.onboarding_status == {};
|
||||
let route = frappe.router.current_route;
|
||||
if (route[0] === "") return;
|
||||
|
||||
|
|
@ -313,7 +316,7 @@ frappe.ui.init_onboarding_tour = () => {
|
|||
}
|
||||
}
|
||||
if (!tour_name) return;
|
||||
if (frappe.ui.currentTourInstance) {
|
||||
if (frappe.ui.currentTourInstance?.driver) {
|
||||
frappe.ui.currentTourInstance.driver_steps = [];
|
||||
frappe.ui.currentTourInstance.driver.reset(true);
|
||||
frappe.ui.currentTourInstance.update_driver_steps();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue