mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 14:42:46 +08:00
FIX: Sidebar is always disabled on wizard route (#17682)
This commit is contained in:
parent
8b08b9a763
commit
3682513475
|
@ -45,8 +45,12 @@ export default Controller.extend({
|
|||
document.querySelector("body").classList.remove("sidebar-animate");
|
||||
},
|
||||
|
||||
@discourseComputed("enable_sidebar", "siteSettings.enable_sidebar")
|
||||
sidebarEnabled(sidebarQueryParamOverride, enableSidebar) {
|
||||
@discourseComputed(
|
||||
"enable_sidebar",
|
||||
"siteSettings.enable_sidebar",
|
||||
"router.currentRouteName"
|
||||
)
|
||||
sidebarEnabled(sidebarQueryParamOverride, enableSidebar, currentRouteName) {
|
||||
if (sidebarQueryParamOverride === "1") {
|
||||
return true;
|
||||
}
|
||||
|
@ -55,6 +59,10 @@ export default Controller.extend({
|
|||
return false;
|
||||
}
|
||||
|
||||
if (currentRouteName.startsWith("wizard")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return enableSidebar;
|
||||
},
|
||||
|
||||
|
|
|
@ -134,6 +134,22 @@ acceptance(
|
|||
assert.notOk(exists(".sidebar-footer-link-admin"));
|
||||
});
|
||||
|
||||
test("sidebar is disabled on wizard route", async function (assert) {
|
||||
await visit("/wizard");
|
||||
|
||||
assert.notOk(
|
||||
exists(".sidebar-container"),
|
||||
"does not display the sidebar on wizard route"
|
||||
);
|
||||
|
||||
await click(".hamburger-dropdown");
|
||||
|
||||
assert.ok(
|
||||
exists(".sidebar-hamburger-dropdown"),
|
||||
"navigation around the site can still be done via the sidebar hamburger"
|
||||
);
|
||||
});
|
||||
|
||||
test("showing and hiding sidebar", async function (assert) {
|
||||
await visit("/");
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user