feat(ideas): lijst-filter matcht op primair én secundaire producten

Breidt productFilter-logica in IdeaList uit: naast product_id
wordt ook idea.secondary_products gecheckt, zodat ideeën zichtbaar
blijven bij filteren op een secundair gekoppeld product.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scrum4Me Agent 2026-05-06 02:29:11 +02:00 committed by Madhura68
parent 86e69fc457
commit 83d4415e45

View file

@ -87,8 +87,14 @@ export function IdeaList({ ideas, products, isDemo }: IdeaListProps) {
return ideas.filter((idea) => {
if (q && !idea.title.toLowerCase().includes(q)) return false
if (productFilter !== 'all') {
if (productFilter === 'none' && idea.product_id !== null) return false
if (productFilter !== 'none' && idea.product_id !== productFilter) return false
if (productFilter === 'none') {
if (idea.product_id !== null) return false
} else {
const matchesPrimary = idea.product_id === productFilter
const matchesSecondary =
idea.secondary_products?.some((sp) => sp.product_id === productFilter) ?? false
if (!matchesPrimary && !matchesSecondary) return false
}
}
if (statusFilter.size > 0 && !statusFilter.has(idea.status)) return false
return true