DEV: Use default admin routes for plugins with settings (#30941)

This change adds a sidebar link for each plugin that fulfils the following criteria:

- Does not have an explicit admin route defined in the plugin.
- Has at least one site setting (not including enabled/disabled.)

That sidebar link leads to the automatically generated plugin show settings page.
This commit is contained in:
Ted Johansson
2025-02-04 14:57:28 +08:00
committed by GitHub
parent 9991eacef4
commit 503f9b6f02
13 changed files with 70 additions and 49 deletions

View File

@ -33,7 +33,7 @@ TEXT
end
it "defaults to using the plugin name with the discourse- prefix removed" do
expect(plugin_instance.humanized_name).to eq("sample-plugin")
expect(plugin_instance.humanized_name).to eq("Sample plugin")
end
it "uses the plugin setting category name if it exists" do
@ -43,7 +43,7 @@ TEXT
it "the plugin name the plugin site settings are still under the generic plugins: category" do
plugin_instance.stubs(:setting_category).returns("plugins")
expect(plugin_instance.humanized_name).to eq("sample-plugin")
expect(plugin_instance.humanized_name).to eq("Sample plugin")
end
it "removes any Discourse prefix from the setting category name" do