A platform for community discussion. Free, open, simple.
FIX: Sidebar is always disabled on wizard route (#17682)
Alan Guo Xiang Tan368251347547
diff --git a/app/assets/javascripts/discourse/app/controllers/application.js b/app/assets/javascripts/discourse/app/controllers/application.jsindex e2fdd32463b..bbe475a63f9 100644--- a/app/assets/javascripts/discourse/app/controllers/application.js+++ b/app/assets/javascripts/discourse/app/controllers/application.js@@ -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;},diff --git a/app/assets/javascripts/discourse/tests/acceptance/sidebar-test.js b/app/assets/javascripts/discourse/tests/acceptance/sidebar-test.jsindex f7ecc13ae6b..c6cd5c39196 100644--- a/app/assets/javascripts/discourse/tests/acceptance/sidebar-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/sidebar-test.js@@ -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("/");