Skip to content

A platform for community discussion. Free, open, simple.

FIX: Admin sidebar disappeared on some routes for header dropdown (#27216)

Martin Brennan73c6bb25937a
diff --git a/app/assets/javascripts/discourse/app/controllers/application.js b/app/assets/javascripts/discourse/app/controllers/application.js
index 40202a78a97..c0d990ecc57 100644
--- a/app/assets/javascripts/discourse/app/controllers/application.js
+++ b/app/assets/javascripts/discourse/app/controllers/application.js
@@ -99,7 +99,7 @@ export default Controller.extend({
// Always show sidebar for admin if user can see the admin sidbar
if (
- this.router.currentRouteName.startsWith("admin.") &&
+ this.router.currentRouteName.startsWith("admin") &&
this.currentUser?.use_admin_sidebar
) {
return true;
diff --git a/spec/system/navigation_menu_state_integration_spec.rb b/spec/system/navigation_menu_state_integration_spec.rb
index 0a879bc83e6..fcbf346d41c 100644
--- a/spec/system/navigation_menu_state_integration_spec.rb
+++ b/spec/system/navigation_menu_state_integration_spec.rb
@@ -50,6 +50,15 @@ describe "Navigation menu states", type: :system, js: true do
expect(header_dropdown).to have_no_dropdown_visible
end
+ it "shows the sidebar on other admin pages" do
+ visit "/admin"
+ expect(sidebar_navigation).to be_visible
+ visit "/admin/site_settings/category/all_results"
+ expect(sidebar_navigation).to be_visible
+ visit "/admin/reports"
+ expect(sidebar_navigation).to be_visible
+ end
+
context "when the user is not in admin_sidebar_enabled_groups" do
before { SiteSetting.admin_sidebar_enabled_groups = "" }