diff --git a/app/assets/javascripts/discourse/app/templates/wizard/step.gjs b/app/assets/javascripts/discourse/app/templates/wizard/step.gjs index f2e0f6f5e20..acdfd268f59 100644 --- a/app/assets/javascripts/discourse/app/templates/wizard/step.gjs +++ b/app/assets/javascripts/discourse/app/templates/wizard/step.gjs @@ -2,6 +2,7 @@ import Component from "@glimmer/component"; import { action } from "@ember/object"; import { service } from "@ember/service"; import RouteTemplate from "ember-route-template"; +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"; @@ -34,6 +35,16 @@ export default RouteTemplate( 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()}`); + } + } + @action goNext(response) { const next = this.step.next; @@ -43,7 +54,7 @@ export default RouteTemplate( } else if (response?.success && next) { this.router.transitionTo("wizard.step", next); } else if (response?.success) { - this.router.transitionTo(`discovery.${defaultHomepage()}`); + this.#goHomeOrQuickStart(); } } @@ -54,7 +65,7 @@ export default RouteTemplate( @action goHome() { - this.router.transitionTo(`discovery.${defaultHomepage()}`); + this.#goHomeOrQuickStart(); } } ); diff --git a/spec/system/wizard_spec.rb b/spec/system/wizard_spec.rb index 9e0bfe54f16..1d1fae26938 100644 --- a/spec/system/wizard_spec.rb +++ b/spec/system/wizard_spec.rb @@ -15,4 +15,14 @@ describe "Wizard", type: :system do expect(page).to have_current_path("/latest") end + + it "redirects to admin guide when wizard is completed and bootstrap mode is enabled" do + SiteSetting.bootstrap_mode_enabled = true + SiteSetting.admin_quick_start_topic_id = topic.id + + visit("/wizard/steps/ready") + wizard_page.click_jump_in + + expect(page).to have_current_path("/t/admin-guide-with-15-chars/#{topic.id}") + end end