Repository navigation
[6.x] Render product sources in the secondary nav - #4379
Draft
brianjhanson wants to merge 6 commits into
Draft
brianjhanson wants to merge 6 commits into
brianjhanson wants to merge 6 commits into
Conversation
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.
Puts the product types in the control panel's secondary nav, and offers Customize Sources beside them, so the products index reads the way Craft 5's did.
The index's view model already described them —
sourceNavItemsarrives on the page with an "All products" entry and a group holding each product type — but nothing consumed it, so the sidebar sat empty while the types were only reachable from the global nav.useCustomizeSources()returns an empty list for anyone the server would refuse, so the entry is only offered to those it would accept.Important
Depends on craftcms/cms#19884. Both
useAppLayoutanduseCustomizeSourcesare added to the@craftcms/cms/elementsimport map by that PR, andsubnavonly became something a page can set there — until then it was read solely from the server's own page prop, so no Vue page could supply its own nav. Without it this import fails to resolve and the index won't boot.Testing
Against a store with four product types: each appears under a "Product Types" heading in the sidebar, "All products" is selected on the index itself, and Customize Sources shows for an admin with
allowAdminChangeson.🤖 Generated with Claude Code
https://claude.ai/code/session_01NjeigCjRgjTJpnhbvyrxv8