Skip to content

Commit

Permalink
Merge pull request #21072 from ankush/onboarding_
Browse files Browse the repository at this point in the history
fix(ux): auto jump to next step in onboarding
  • Loading branch information
ankush committed May 22, 2023
2 parents c643d4a + baa7c9d commit fe67fcd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions frappe/public/js/frappe/widgets/onboarding_widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit fe67fcd

Please sign in to comment.