Revert "FEATURE: revert redirect from wizard to guide (#26873)" (#26916)

This reverts commit 74f1a79d36.
This commit is contained in:
Krzysztof Kotlarek 2024-05-08 08:46:30 +10:00 committed by GitHub
parent fe16633a0c
commit b3f321e333
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 23 additions and 2 deletions

View File

@ -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();
}
}
);

View File

@ -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