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:
parent
86e69fc457
commit
83d4415e45
1 changed files with 8 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue