FIX: Sidebar is always disabled on wizard route (#17682)

This commit is contained in:
Alan Guo Xiang Tan 2022-07-27 15:17:20 +08:00 committed by GitHub
parent 8b08b9a763
commit 3682513475
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 2 deletions

View File

@ -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;
},

View File

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