shenyu icon indicating copy to clipboard operation
shenyu copied to clipboard

sidebar still shows menu entries of disabled plugins

Open Chrisp12138 opened this issue 3 weeks ago • 1 comments

Current behavior: ResourceServiceImpl#getMenuTree builds the sidebar menu from the resource table only (filtering out super-admin-only perms), without checking the plugin enabled status. Plugin menu resources are auto-created when a plugin is registered (onPluginCreated), and remain visible after the plugin is disabled in the plugin list.

Impact: users click into a disabled plugin's selector/rule page and see an empty or unusable configuration page; the sidebar does not reflect the actual plugin state.

Possible directions (for discussion):

  1. Admin-side: filter plugin menu resources by the plugin enabled status when building the menu tree (or sync a hidden flag on plugin enable/disable events);
  2. Dashboard-side: filter plugin submenus according to the plugin list status;
  3. Alternative: render disabled-plugin menus greyed-out with a "plugin disabled" tooltip, keeping the entry point discoverable.

Asking for the maintainer's preferred direction - happy to implement whichever is chosen.

Chrisp12138 avatar Nov 13 '26 03:11 Chrisp12138

Implemented the fix for #8473. PR:https://github.com/apache/shenyu/pull/8494

The sidebar now hides menu entries belonging to disabled plugins, including their nested child resources.

The implementation:

  • Checks plugin enablement status when building the menu tree.
  • Filters out disabled plugin resources and their descendants.
  • Preserves existing resource records in the database.
  • Automatically restores menu visibility when a plugin is enabled again.

Added unit tests covering disabled plugins, enabled plugins, and menu restoration after re-enablement.

Testing:

  • ResourceServiceTest: 16 tests passed, 0 failures, 0 errors.
  • git diff --check: Passed.

Thank you for reviewing my contribution!

yashdotdev13 avatar Nov 15 '26 05:11 yashdotdev13