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:
Ted Johansson
2025-02-05 15:02:46 +08:00
committed by GitHub
parent 5eb7d6d9c0
commit bb12f8275d
3 changed files with 15 additions and 3 deletions

View File

@ -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