mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Show admin plugin route sub-links in sidebar (#24982)
This changes the Plugins link in the admin sidebar to be a section instead, which then shows all enabled plugin admin routes (which are custom routes some plugins e.g. chat define). This is done via adding some special preloaded data for all controllers based on AdminController, and also specifically on Admin::PluginsController, to have the routes loaded without additional requests on page load. We just use a cog for all the route icons for now...we don't have anything better.
This commit is contained in:
@@ -20,11 +20,14 @@ describe "Admin Revamp | Sidebar Navigation", type: :system do
|
||||
expect(sidebar).to have_no_section("admin-nav-section-root")
|
||||
end
|
||||
|
||||
it "does not show the admin sidebar if the setting is disabled" do
|
||||
SiteSetting.enable_admin_sidebar_navigation = false
|
||||
visit("/latest")
|
||||
sidebar.click_link_in_section("community", "admin")
|
||||
expect(page).to have_current_path("/admin")
|
||||
expect(sidebar).to have_no_section("admin-nav-section-root")
|
||||
context "when the setting is disabled" do
|
||||
before { SiteSetting.enable_admin_sidebar_navigation = false }
|
||||
|
||||
it "does not show the admin sidebar" do
|
||||
visit("/latest")
|
||||
sidebar.click_link_in_section("community", "admin")
|
||||
expect(page).to have_current_path("/admin")
|
||||
expect(sidebar).to have_no_section("admin-nav-section-root")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user