Merge branch 'main' into fix/sprint-eligibility-respects-closed-sprints
This commit is contained in:
commit
ba0f192380
2 changed files with 41 additions and 24 deletions
|
|
@ -16,6 +16,7 @@ vi.mock('next/navigation', () => ({
|
|||
vi.mock('@/actions/active-sprint', () => ({
|
||||
setActiveSprintAction: vi.fn(),
|
||||
switchActiveSprintAction: vi.fn(),
|
||||
clearActiveSprintAction: vi.fn(),
|
||||
}))
|
||||
|
||||
vi.mock('sonner', () => ({
|
||||
|
|
@ -37,11 +38,8 @@ type MockStoreState = {
|
|||
}
|
||||
}
|
||||
vi.mock('@/stores/user-settings/store', () => ({
|
||||
useUserSettingsStore: (selector: (s: MockStoreState) => unknown) =>
|
||||
selector({
|
||||
context: { isDemo: isDemoMock.value },
|
||||
entities: { settings: {} },
|
||||
}),
|
||||
useUserSettingsStore: (selector: (s: { context: { isDemo: boolean }; entities: { settings: { workflow: null } } }) => unknown) =>
|
||||
selector({ context: { isDemo: isDemoMock.value }, entities: { settings: { workflow: null } } }),
|
||||
}))
|
||||
|
||||
vi.mock('@/components/ui/dropdown-menu', () => {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import { toast } from 'sonner'
|
|||
import { Button } from '@/components/ui/button'
|
||||
import { Input } from '@/components/ui/input'
|
||||
import { Textarea } from '@/components/ui/textarea'
|
||||
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'
|
||||
import { getIdeaStatusBadge } from '@/lib/idea-status-colors'
|
||||
import type { IdeaStatusApi } from '@/lib/idea-status'
|
||||
import { isIdeaEditable } from '@/lib/idea-status'
|
||||
|
|
@ -363,25 +364,43 @@ function IdeaFormSection({ idea, products, isDemo, pending, secondaryProducts }:
|
|||
{products.filter((p) => p.id !== productId).length > 0 && (
|
||||
<div className="space-y-1">
|
||||
<label className="text-xs font-medium text-muted-foreground">Extra producten</label>
|
||||
<div className="space-y-1">
|
||||
{products
|
||||
.filter((p) => p.id !== productId)
|
||||
.map((p) => (
|
||||
<label key={p.id} className="flex items-center gap-2 text-sm">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={selectedSecondary.includes(p.id)}
|
||||
onChange={(e) =>
|
||||
setSelectedSecondary((prev) =>
|
||||
e.target.checked ? [...prev, p.id] : prev.filter((id) => id !== p.id),
|
||||
)
|
||||
}
|
||||
disabled={!editable || pending || submitting}
|
||||
/>
|
||||
{p.name}
|
||||
</label>
|
||||
))}
|
||||
</div>
|
||||
<Popover>
|
||||
<PopoverTrigger
|
||||
render={
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
disabled={!editable || pending || submitting}
|
||||
>
|
||||
{selectedSecondary.length > 0
|
||||
? `Extra producten (${selectedSecondary.length})`
|
||||
: 'Extra producten'}
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
<PopoverContent align="start" className="w-64 space-y-1">
|
||||
{products
|
||||
.filter((p) => p.id !== productId)
|
||||
.map((p) => (
|
||||
<label key={p.id} className="flex items-center gap-2 text-sm">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={selectedSecondary.includes(p.id)}
|
||||
onChange={(e) =>
|
||||
setSelectedSecondary((prev) =>
|
||||
e.target.checked
|
||||
? [...prev, p.id]
|
||||
: prev.filter((id) => id !== p.id),
|
||||
)
|
||||
}
|
||||
disabled={!editable || pending || submitting}
|
||||
/>
|
||||
{p.name}
|
||||
</label>
|
||||
))}
|
||||
</PopoverContent>
|
||||
</Popover>
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue