mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Always preload admin plugin list for admin in sidebar (#25606)
When we show the links to installed plugins in the admin sidebar (for plugins that have custom admin routes) we were previously only doing this if you opened /admin, not if you navigated there from the main forum. We should just always preload this data if the user is admin. This commit also changes `admin_sidebar_enabled_groups` to not be sent to the client as part of ongoing efforts to not check groups on the client, since not all a user's groups may be serialized.
This commit is contained in:
@@ -1308,6 +1308,7 @@ RSpec.describe ApplicationController do
|
||||
"topicTrackingStates",
|
||||
"topicTrackingStateMeta",
|
||||
"fontMap",
|
||||
"enabledPluginAdminRoutes",
|
||||
],
|
||||
)
|
||||
end
|
||||
@@ -1320,6 +1321,11 @@ RSpec.describe ApplicationController do
|
||||
DiscourseFonts.fonts.filter { |f| f[:variants].present? }.map { |f| f[:key] },
|
||||
)
|
||||
end
|
||||
|
||||
it "has correctly loaded enabledPluginAdminRoutes" do
|
||||
get "/latest"
|
||||
expect(JSON.parse(preloaded_json["enabledPluginAdminRoutes"])).to eq([])
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user