Conversation
obarcelonap
left a comment
There was a problem hiding this comment.
Please check the tsconfig thingy because it seems to me we're missing to commit some file(s).
Also, I'd recommend to add some simple tests (vitest) so we promote testing and we provide an example on how to write them.
| "code:fix": "ultracite fix", | ||
| "postinstall": "npx aio-commerce-lib-app hooks postinstall", | ||
| "typecheck": "npm run typecheck:actions && npm run typecheck:web-src", | ||
| "typecheck:actions": "tsc --noEmit -p tsconfig.json", |
There was a problem hiding this comment.
I don't see any tsconfig.json in the root of the app, is this necessary?
There was a problem hiding this comment.
my bad, forgot to git add those files, you're absolutely right
| "postinstall": "npx aio-commerce-lib-app hooks postinstall", | ||
| "typecheck": "npm run typecheck:actions && npm run typecheck:web-src", | ||
| "typecheck:actions": "tsc --noEmit -p tsconfig.json", | ||
| "typecheck:web-src": "tsc --noEmit -p src/commerce-backend-ui-2/web-src/tsconfig.json" |
There was a problem hiding this comment.
actually tsconfig.json is also missing under this path, seems something is off
| adminUi: { | ||
| menu: { | ||
| description: "App with Navigation Pane", | ||
| id: "CustomMenuNavigation::main", |
There was a problem hiding this comment.
prefixing is not needed as the adminuisdk extension should be able to handle collisions, my proposal:
id: SampleAppWithNavigation
There was a problem hiding this comment.
I followed the same approach of other samples to keep it aligned
| * only a single menu entry, this is how a multi-section app surfaces more | ||
| * than one view from it. | ||
| */ | ||
| export function NavigationPane() { |
There was a problem hiding this comment.
For the sake of simplicity I'd embed this into MainPage
Description
Adds a new Admin UI SDK V2 sample, admin-ui-sdk/v2/menu/custom-menu-with-navigation, demonstrating a single V2 menu extension point whose iframe page renders a left-hand navigation pane instead of relying on multiple Admin menu entries.
Related Issue
N/A
Motivation and Context
In V2, an app can register only a single Admin menu entry (adminUi.menu is one object, unlike V1's menuItems array). Existing samples only showed a basic single-page custom menu, with no reference for apps that need multiple sections. This sample fills that gap by showing the recommended pattern: an in-app navigation pane inside the one registered page, rather than trying to add more menu entries.
How Has This Been Tested?
Tested manually by deploying to an App Builder app and installing it on a Commerce instance via App Management, then verifying the menu entry appears under Content and the navigation pane correctly switches between the Overview, Settings, and About views inside the iframe.
Screenshots (if appropriate):
Types of changes
Checklist: