mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
DEV: Only include custom admin UIs in the plugins index tabs (#31192)
In the current admin index page, all plugins show up as tabs. This includes plugins with auto-generated config routes. This changes the tabs to include only plugins with custom UIs.
This commit is contained in:
@ -115,6 +115,7 @@ class Plugin::Instance
|
||||
label: label,
|
||||
location: location,
|
||||
use_new_show_route: opts.fetch(:use_new_show_route, false),
|
||||
auto_generated: false,
|
||||
}
|
||||
end
|
||||
|
||||
@ -128,7 +129,7 @@ class Plugin::Instance
|
||||
end
|
||||
|
||||
route
|
||||
.slice(:location, :label, :use_new_show_route)
|
||||
.slice(:location, :label, :use_new_show_route, :auto_generated)
|
||||
.tap do |admin_route|
|
||||
path = admin_route[:use_new_show_route] ? "show" : admin_route[:location]
|
||||
admin_route[:full_location] = "adminPlugins.#{path}"
|
||||
@ -1495,6 +1496,11 @@ class Plugin::Instance
|
||||
end
|
||||
|
||||
def default_admin_route
|
||||
{ label: "#{name.underscore}.title", location: name, use_new_show_route: true }
|
||||
{
|
||||
label: "#{name.underscore}.title",
|
||||
location: name,
|
||||
use_new_show_route: true,
|
||||
auto_generated: true,
|
||||
}
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user