fitlers fixes

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-15 06:03:06 +00:00
parent 75785aa642
commit 51292bb1b3
17 changed files with 895 additions and 99 deletions

View File

@@ -238,7 +238,9 @@ export const createIdeasPageConfig = (
type: 'select',
options: [
{ value: '', label: 'All Status' },
...(handlers.statusOptions && handlers.statusOptions.length > 0
// Use dynamic options if loaded (even if empty array)
// Only fall back to defaults if statusOptions is undefined (not loaded yet)
...(handlers.statusOptions !== undefined
? handlers.statusOptions
: [
{ value: 'new', label: 'New' },
@@ -254,7 +256,9 @@ export const createIdeasPageConfig = (
type: 'select',
options: [
{ value: '', label: 'All Structures' },
...(handlers.contentStructureOptions && handlers.contentStructureOptions.length > 0
// Use dynamic options if loaded (even if empty array)
// Only fall back to defaults if contentStructureOptions is undefined (not loaded yet)
...(handlers.contentStructureOptions !== undefined
? handlers.contentStructureOptions
: [
{ value: 'article', label: 'Article' },
@@ -281,7 +285,9 @@ export const createIdeasPageConfig = (
type: 'select',
options: [
{ value: '', label: 'All Types' },
...(handlers.contentTypeOptions && handlers.contentTypeOptions.length > 0
// Use dynamic options if loaded (even if empty array)
// Only fall back to defaults if contentTypeOptions is undefined (not loaded yet)
...(handlers.contentTypeOptions !== undefined
? handlers.contentTypeOptions
: [
{ value: 'post', label: 'Post' },
@@ -299,7 +305,9 @@ export const createIdeasPageConfig = (
dynamicOptions: 'clusters',
options: [
{ value: '', label: 'All Clusters' },
...(handlers.clusterOptions && handlers.clusterOptions.length > 0
// Use dynamic cluster options if loaded (even if empty array)
// Only fall back to full clusters list if clusterOptions is undefined (not loaded yet)
...(handlers.clusterOptions !== undefined
? handlers.clusterOptions
: handlers.clusters.map((c) => ({ value: c.id.toString(), label: c.name }))
),