Repository navigation
fix(menu): stop creating the dead Reports menu item and remove existing ones (#2136) - #2137
Merged
Merged
Conversation
…ng ones (#2136) The reports route left the Angular module in 2023, but the plugin kept registering a "Reports" menu entry for /plugins/items-planning-pn/reports. Clicking it matches no route and the frontend's catch-all silently lands on "My eForms". GetNavigationMenu and HeaderMenu no longer offer the entry. Because the host only ever adds plugin menu entries, Configure now removes the dead item and template (with translations, security groups and template permissions) from the host's Angular database on plugin start. Only rows carrying both the dead link and its E2E id are touched; a second start is a no-op, and a failure is logged without stopping the host. Adds Microting.EformAngularFrontendBase 10.0.40, the version the host and the time-planning plugin use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The cleanup is narrowly targeted, failure-tolerant, idempotent, and covered by focused integration tests.
Review effort: Balanced
Findings: None
What changed in this PR
Removes the obsolete Reports navigation entry and cleans up existing database records safely during plugin startup.
Changes:
- Removes Reports from both navigation menu implementations.
- Adds idempotent database cleanup with failure logging.
- Adds integration and menu regression tests.
| File | Description |
|---|---|
ItemsPlanning.Pn.csproj |
Adds the host database dependency. |
DeadReportsMenuCleaner.cs |
Removes dead menu records and dependencies. |
EformItemsPlanningPlugin.cs |
Runs cleanup and stops registering Reports. |
NavigationMenuTests.cs |
Verifies Reports is no longer offered. |
DeadReportsMenuCleanupTests.cs |
Tests cleanup, preservation, and idempotency. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GetNavigationMenuandHeaderMenuno longer offer the "Reports" entry (/plugins/items-planning-pn/reports).Configureremoves existing dead entries from the host's Angular database via the newDeadReportsMenuCleaner. It removes the menu items with their translations and security groups, plus the menu template with its translations and template-permission rows. Only rows carrying both the dead link and theitems-planning-pn-reportsE2E id are touched. Any other item still pointing at the removed template is detached (MenuTemplateId = null), as the host does when it removes a plugin's templates. A second start is a no-op. Removed ids are logged, and a failure is caught and logged without stopping the host.Microting.EformAngularFrontendBase10.0.40, the same version eform-angular-frontend stable and the time-planning plugin use, soBaseDbContexttypes match at runtime.Root cause
The
reportsroute was removed from the Angular module in 2023, but the plugin kept registering the menu entry. Clicking it matches no route, and the frontend's catch-all{path: '**', redirectTo: ''}silently lands the user on "My eForms". The host only ever adds plugin menu templates on start; it never removes them. So dropping the entry fromGetNavigationMenualone would leave the existing dead items in place.Tests
DeadReportsMenuCleanupTests(Testcontainers MariaDB, runsConfigurethe way the host does). It checks:Configurewithout a registeredBaseDbContextdoes not throwNavigationMenuTests:GetNavigationMenuandHeaderMenuno longer contain the reports link or E2E id.Not verified
Refs #2136
🤖 Generated with Claude Code