@orsetra/shared-ui 1.10.8 → 1.10.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -324,12 +324,11 @@ function Sidebar({ currentMenu, sidebarMenus = {}, main_base_url = "", sectionLa
324
324
  ? item.id === activeItemId
325
325
  : (pathname === itemPath || pathname.startsWith(`${itemPath}/`))
326
326
 
327
- // Resolved once so the anchor's `href` attribute itself is already correct — not just
328
- // the JS click handler — so middle-click / right-click "open in new tab" (which bypass
329
- // onClick entirely) don't navigate to a literal "${envAlias}"-style broken URL.
330
- const templateResolution = item.target === "_blank" ? resolveTemplateVars(item.href) : null
331
- const isDisabled = !!templateResolution && !templateResolution.isResolved
332
- const resolvedHref = templateResolution ? templateResolution.href : item.href
327
+ // Resolved unconditionally so middle-click/right-click (which bypass onClick) never
328
+ // navigate to a literal "${envAlias}"-style unresolved URL.
329
+ const templateResolution = resolveTemplateVars(item.href)
330
+ const isDisabled = !templateResolution.isResolved
331
+ const resolvedHref = templateResolution.href
333
332
 
334
333
  const handleClick = (e: React.MouseEvent) => {
335
334
  if (isDisabled) {
@@ -383,8 +382,10 @@ function Sidebar({ currentMenu, sidebarMenus = {}, main_base_url = "", sectionLa
383
382
  ) : (
384
383
  <Link
385
384
  key={item.id}
386
- href={item.href}
385
+ href={isDisabled ? "#" : resolvedHref}
387
386
  onClick={handleClick}
387
+ aria-disabled={isDisabled}
388
+ title={isDisabled ? "Select a project/environment first" : undefined}
388
389
  className={linkCls}
389
390
  >
390
391
  {linkContent}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orsetra/shared-ui",
3
- "version": "1.10.8",
3
+ "version": "1.10.9",
4
4
  "description": "Shared UI components for Orsetra platform",
5
5
  "main": "./index.ts",
6
6
  "types": "./index.ts",