A platform for community discussion. Free, open, simple.
UX: Redirect to homepage after completing the wizard (#36002)
Penar Musaraj3184ac4700f1
diff --git a/frontend/discourse/app/templates/wizard/step.gjs b/frontend/discourse/app/templates/wizard/step.gjsindex f21af952e07..1b7ed55ef34 100644--- a/frontend/discourse/app/templates/wizard/step.gjs+++ b/frontend/discourse/app/templates/wizard/step.gjs@@ -2,14 +2,12 @@ import Component from "@glimmer/component";import { action } from "@ember/object";import { service } from "@ember/service";import getUrl from "discourse/lib/get-url";-import DiscourseURL from "discourse/lib/url";import { defaultHomepage } from "discourse/lib/utilities";import WizardCanvas from "discourse/static/wizard/components/wizard-canvas";import WizardStep from "discourse/static/wizard/components/wizard-step";export default class extends Component {@service router;- @service siteSettings;<template>{{#if this.showCanvas}}@@ -33,14 +31,8 @@ export default class extends Component {return this.step.id === "ready";}- #goHomeOrQuickStart() {- if (this.siteSettings.bootstrap_mode_enabled) {- DiscourseURL.routeTo(- `/t/${this.siteSettings.admin_quick_start_topic_id}`- );- } else {- this.router.transitionTo(`discovery.${defaultHomepage()}`);- }+ #redirectToHome() {+ this.router.transitionTo(`discovery.${defaultHomepage()}`);}@action@@ -52,7 +44,7 @@ export default class extends Component {} else if (response?.success && next) {this.router.transitionTo("wizard.step", next);} else if (response?.success) {- this.#goHomeOrQuickStart();+ this.#redirectToHome();}}@@ -63,6 +55,6 @@ export default class extends Component {@actiongoHome() {- this.#goHomeOrQuickStart();+ this.#redirectToHome();}}diff --git a/spec/system/wizard_spec.rb b/spec/system/wizard_spec.rbindex d68e1a9ce58..4638577ee50 100644--- a/spec/system/wizard_spec.rb+++ b/spec/system/wizard_spec.rb@@ -58,15 +58,15 @@ describe "Wizard", type: :system doexpect(page).to have_current_path("/latest")end- it "redirects to admin guide when bootstrap mode is enabled" do+ it "redirects to homepage even when bootstrap mode is enabled" dotopic = Fabricate(:topic_with_op, title: "Admin Getting Started Guide")SiteSetting.bootstrap_mode_enabled = trueSiteSetting.admin_quick_start_topic_id = topic.idwizard_page.go_to_step("ready")- wizard_page.click_jump_in- expect(page).to have_current_path(topic.url)+ wizard_page.click_jump_in+ expect(page).to have_current_path("/latest")endendend