feat(dashboard,nav): edit-knop op productlijst + zichtbare product-switch
- nav-bar: vervang `router.push(/products/{id})` door `router.refresh()` na
setActiveProductAction; voeg success-toast toe. Maakt de actieve-product
switch zichtbaar zonder context-switch naar de detail-page; client-cache
wordt nu correct geinvalideerd.
- product-list (dashboard): integreer EditProductButton naast Activeer/Actief.
Owner én members kunnen editten (per productAccessFilter); demo-modus
rendert disabled+tooltip.
- edit-product-button: optionele isDemo + size + variant props; wraps
DemoTooltip; e.stopPropagation om card-click te voorkomen.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d8e6a68d69
commit
a839ac76c6
3 changed files with 40 additions and 19 deletions
|
|
@ -10,6 +10,7 @@ import { CodeBadge } from '@/components/shared/code-badge'
|
|||
import { DemoTooltip } from '@/components/shared/demo-tooltip'
|
||||
import { restoreProductAction } from '@/actions/products'
|
||||
import { setActiveProductAction } from '@/actions/active-product'
|
||||
import { EditProductButton } from '@/components/products/edit-product-button'
|
||||
|
||||
interface Product {
|
||||
id: string
|
||||
|
|
@ -17,6 +18,8 @@ interface Product {
|
|||
code: string | null
|
||||
description: string | null
|
||||
repo_url: string | null
|
||||
definition_of_done: string | null
|
||||
auto_pr: boolean
|
||||
}
|
||||
|
||||
interface ProductListProps {
|
||||
|
|
@ -100,19 +103,23 @@ export function ProductList({ products, isDemo, showArchived = false, activeProd
|
|||
</a>
|
||||
)}
|
||||
{!showArchived && (
|
||||
product.id === activeProductId
|
||||
? <Badge className="bg-primary-container text-primary-container-foreground text-xs px-2 py-0">Actief</Badge>
|
||||
: (
|
||||
<DemoTooltip show={isDemo}>
|
||||
<button
|
||||
onClick={(e) => { e.stopPropagation(); if (!isDemo) handleActivate(product.id) }}
|
||||
className="text-xs text-primary hover:underline disabled:opacity-40 disabled:cursor-not-allowed disabled:no-underline"
|
||||
disabled={isDemo}
|
||||
>
|
||||
Activeer
|
||||
</button>
|
||||
</DemoTooltip>
|
||||
)
|
||||
<>
|
||||
<EditProductButton product={product} isDemo={isDemo} />
|
||||
{product.id === activeProductId
|
||||
? <Badge className="bg-primary-container text-primary-container-foreground text-xs px-2 py-0">Actief</Badge>
|
||||
: (
|
||||
<DemoTooltip show={isDemo}>
|
||||
<button
|
||||
onClick={(e) => { e.stopPropagation(); if (!isDemo) handleActivate(product.id) }}
|
||||
className="text-xs text-primary hover:underline disabled:opacity-40 disabled:cursor-not-allowed disabled:no-underline"
|
||||
disabled={isDemo}
|
||||
>
|
||||
Activeer
|
||||
</button>
|
||||
</DemoTooltip>
|
||||
)
|
||||
}
|
||||
</>
|
||||
)}
|
||||
{showArchived && (
|
||||
<DemoTooltip show={isDemo}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue