Merge pull request #21072 from ankush/onboarding_

fix(ux): auto jump to next step in onboarding
This commit is contained in:
Ankush Menat 2023-05-22 21:45:28 +05:30 committed by GitHub
commit fe67fcdb11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -438,6 +438,7 @@ export default class OnboardingWidget extends Widget {
};
this.update_step_status(step, "is_complete", 1, callback);
this.activate_next_step(step);
}
skip_step(step) {
@ -451,6 +452,16 @@ export default class OnboardingWidget extends Widget {
};
this.update_step_status(step, "is_skipped", 1, callback);
this.activate_next_step(step);
}
activate_next_step(step) {
let current_step_index = this.steps.findIndex((s) => s == step);
let next_step = this.steps[current_step_index + 1];
if (!next_step) return;
this.show_step(next_step);
}
update_step_status(step, status, value, callback) {
@ -552,6 +563,7 @@ export default class OnboardingWidget extends Widget {
localStorage.setItem("dismissed-onboarding", JSON.stringify(dismissed));
this.delete(true, true);
this.widget.closest(".ce-block").hide();
frappe.telemetry.capture("dismissed_" + frappe.scrub(this.title), "frappe_onboarding");
});
dismiss.appendTo(this.action_area);
}