mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: revert redirect from wizard to guide (#26873)
In this PR we started redirecting to the guide page after the wizard - https://github.com/discourse/discourse/pull/26696 The guide will require rebrand and until it is ready, we should redirect to `/latest`
This commit is contained in:
parent
b6f6852bba
commit
74f1a79d36
@ -2,7 +2,6 @@ import Component from "@glimmer/component";
|
|||||||
import { action } from "@ember/object";
|
import { action } from "@ember/object";
|
||||||
import { service } from "@ember/service";
|
import { service } from "@ember/service";
|
||||||
import RouteTemplate from "ember-route-template";
|
import RouteTemplate from "ember-route-template";
|
||||||
import DiscourseURL from "discourse/lib/url";
|
|
||||||
import { defaultHomepage } from "discourse/lib/utilities";
|
import { defaultHomepage } from "discourse/lib/utilities";
|
||||||
import WizardCanvas from "discourse/static/wizard/components/wizard-canvas";
|
import WizardCanvas from "discourse/static/wizard/components/wizard-canvas";
|
||||||
import WizardStep from "discourse/static/wizard/components/wizard-step";
|
import WizardStep from "discourse/static/wizard/components/wizard-step";
|
||||||
@ -35,16 +34,6 @@ export default RouteTemplate(
|
|||||||
return this.step.id === "ready";
|
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
|
@action
|
||||||
goNext(response) {
|
goNext(response) {
|
||||||
const next = this.step.next;
|
const next = this.step.next;
|
||||||
@ -54,7 +43,7 @@ export default RouteTemplate(
|
|||||||
} else if (response?.success && next) {
|
} else if (response?.success && next) {
|
||||||
this.router.transitionTo("wizard.step", next);
|
this.router.transitionTo("wizard.step", next);
|
||||||
} else if (response?.success) {
|
} else if (response?.success) {
|
||||||
this.#goHomeOrQuickStart();
|
this.router.transitionTo(`discovery.${defaultHomepage()}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,7 +54,7 @@ export default RouteTemplate(
|
|||||||
|
|
||||||
@action
|
@action
|
||||||
goHome() {
|
goHome() {
|
||||||
this.#goHomeOrQuickStart();
|
this.router.transitionTo(`discovery.${defaultHomepage()}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -15,14 +15,4 @@ describe "Wizard", type: :system do
|
|||||||
|
|
||||||
expect(page).to have_current_path("/latest")
|
expect(page).to have_current_path("/latest")
|
||||||
end
|
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
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user