feat: render side-loaded menu entries between Home and Account (#48)#70
Merged
Merged
Conversation
Move the host-contributed nav component out of the Administrator-only block so it renders immediately after Home and before the Account group, for all users. Order is now: Home -> side-loaded -> Account -> Administration. The contributed component gates its own role-specific entries. Since the entries are no longer admin-scoped, rename the extension point AppFoundationLayoutOptions.AdminMenu -> Menu, keeping AdminMenu as an [Obsolete] forwarding alias so existing hosts keep compiling. Closes #48
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.
Closes #48.
What
The host-contributed nav component (
Layout.AdminMenu<DynamicComponent>) was rendered inside theAuthorizeView Roles="Administrator"block, above the Administration group — so it only showed for admins, near the bottom. It now renders immediately after Home and before the Account group, for all users.New order:
Home→ side-loaded entries →Account→Administration.The contributed component is responsible for gating any role-specific entries (e.g. with its own
AuthorizeView), as noted in the updated XML doc.Rename (per the issue's note)
Since the entries are no longer administrator-scoped,
AppFoundationLayoutOptions.AdminMenuis renamed toMenu. To avoid breaking existing hosts (e.g. andregoepel.dev),AdminMenuis kept as an[Obsolete]forwarding alias:NavMenureadsLayout.Menu, so there's no obsolete-usage warning in the foundation; a consumer still settingAdminMenucompiles (with a deprecation warning) and behaves identically.Tests
AppFoundationLayoutOptionsTestsverifies theAdminMenu↔Menuforwarding both ways.Verification
dotnet build -c Release— 0 errors, 0 warnings.dotnet test -c Release— 88/88 (1 new).Note
There's no bUnit test for
NavMenupositioning (rendering it needsIQuerySession/SetupCompletion,IIdentityFeatureProvider, auth state, and JS interop — the repo doesn't test it today), so the ordering is verified by the markup change. Happy to add a heavier component test if you'd like coverage there.