From 253b9bb1f5a8e1fa1e6289dd9d7fa87f6bd90c82 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Mon, 22 May 2023 21:36:59 +0530 Subject: [PATCH] fix(UX): activate next step automatically --- frappe/public/js/frappe/widgets/onboarding_widget.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/frappe/public/js/frappe/widgets/onboarding_widget.js b/frappe/public/js/frappe/widgets/onboarding_widget.js index daacfb79c6..1994bc7e73 100644 --- a/frappe/public/js/frappe/widgets/onboarding_widget.js +++ b/frappe/public/js/frappe/widgets/onboarding_widget.js @@ -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) {