mirror of
https://github.com/discourse/discourse.git
synced 2025-02-05 19:11:13 +00:00
FIX: Admin sidebar disappeared on some routes for header dropdown (#27216)
When navigation_menu is set to header dropdown, we are still forcing admin sidebar by checking if the user is an admin route (c.f. 9bcbfbba43b876ae92cb90d6d619be7b1154c119). However in the initial commit the route check had the false premise that all admin routes started with `admin.`; there are others that don't. We need to force admin sidebar on all routes starting with `admin` (no `.`). c.f. https://meta.discourse.org/t/feedback-on-admin-sidebar-when-header-dropdown-navigation-selected/309490/3?u=martin
This commit is contained in:
parent
998b50fdf4
commit
73c6bb2593
@ -99,7 +99,7 @@ export default Controller.extend({
|
|||||||
|
|
||||||
// Always show sidebar for admin if user can see the admin sidbar
|
// Always show sidebar for admin if user can see the admin sidbar
|
||||||
if (
|
if (
|
||||||
this.router.currentRouteName.startsWith("admin.") &&
|
this.router.currentRouteName.startsWith("admin") &&
|
||||||
this.currentUser?.use_admin_sidebar
|
this.currentUser?.use_admin_sidebar
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -50,6 +50,15 @@ describe "Navigation menu states", type: :system, js: true do
|
|||||||
expect(header_dropdown).to have_no_dropdown_visible
|
expect(header_dropdown).to have_no_dropdown_visible
|
||||||
end
|
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
|
context "when the user is not in admin_sidebar_enabled_groups" do
|
||||||
before { SiteSetting.admin_sidebar_enabled_groups = "" }
|
before { SiteSetting.admin_sidebar_enabled_groups = "" }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user