fixes but still nto fixed
This commit is contained in:
@@ -86,6 +86,11 @@ export const createIdeasPageConfig = (
|
||||
typeFilter: string;
|
||||
setTypeFilter: (value: string) => void;
|
||||
setCurrentPage: (page: number) => void;
|
||||
// Dynamic filter options
|
||||
statusOptions?: Array<{ value: string; label: string }>;
|
||||
contentTypeOptions?: Array<{ value: string; label: string }>;
|
||||
contentStructureOptions?: Array<{ value: string; label: string }>;
|
||||
clusterOptions?: Array<{ value: string; label: string }>;
|
||||
}
|
||||
): IdeasPageConfig => {
|
||||
const showSectorColumn = !handlers.activeSector; // Show when viewing all sectors
|
||||
@@ -233,9 +238,14 @@ export const createIdeasPageConfig = (
|
||||
type: 'select',
|
||||
options: [
|
||||
{ value: '', label: 'All Status' },
|
||||
{ value: 'new', label: 'New' },
|
||||
{ value: 'queued', label: 'Queued' },
|
||||
{ value: 'completed', label: 'Completed' },
|
||||
...(handlers.statusOptions && handlers.statusOptions.length > 0
|
||||
? handlers.statusOptions
|
||||
: [
|
||||
{ value: 'new', label: 'New' },
|
||||
{ value: 'queued', label: 'Queued' },
|
||||
{ value: 'completed', label: 'Completed' },
|
||||
]
|
||||
),
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -244,24 +254,25 @@ export const createIdeasPageConfig = (
|
||||
type: 'select',
|
||||
options: [
|
||||
{ value: '', label: 'All Structures' },
|
||||
// Post
|
||||
{ value: 'article', label: 'Article' },
|
||||
{ value: 'guide', label: 'Guide' },
|
||||
{ value: 'comparison', label: 'Comparison' },
|
||||
{ value: 'review', label: 'Review' },
|
||||
{ value: 'listicle', label: 'Listicle' },
|
||||
// Page
|
||||
{ value: 'landing_page', label: 'Landing Page' },
|
||||
{ value: 'business_page', label: 'Business Page' },
|
||||
{ value: 'service_page', label: 'Service Page' },
|
||||
{ value: 'general', label: 'General' },
|
||||
{ value: 'cluster_hub', label: 'Cluster Hub' },
|
||||
// Product
|
||||
{ value: 'product_page', label: 'Product Page' },
|
||||
// Taxonomy
|
||||
{ value: 'category_archive', label: 'Category Archive' },
|
||||
{ value: 'tag_archive', label: 'Tag Archive' },
|
||||
{ value: 'attribute_archive', label: 'Attribute Archive' },
|
||||
...(handlers.contentStructureOptions && handlers.contentStructureOptions.length > 0
|
||||
? handlers.contentStructureOptions
|
||||
: [
|
||||
{ value: 'article', label: 'Article' },
|
||||
{ value: 'guide', label: 'Guide' },
|
||||
{ value: 'comparison', label: 'Comparison' },
|
||||
{ value: 'review', label: 'Review' },
|
||||
{ value: 'listicle', label: 'Listicle' },
|
||||
{ value: 'landing_page', label: 'Landing Page' },
|
||||
{ value: 'business_page', label: 'Business Page' },
|
||||
{ value: 'service_page', label: 'Service Page' },
|
||||
{ value: 'general', label: 'General' },
|
||||
{ value: 'cluster_hub', label: 'Cluster Hub' },
|
||||
{ value: 'product_page', label: 'Product Page' },
|
||||
{ value: 'category_archive', label: 'Category Archive' },
|
||||
{ value: 'tag_archive', label: 'Tag Archive' },
|
||||
{ value: 'attribute_archive', label: 'Attribute Archive' },
|
||||
]
|
||||
),
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -270,23 +281,29 @@ export const createIdeasPageConfig = (
|
||||
type: 'select',
|
||||
options: [
|
||||
{ value: '', label: 'All Types' },
|
||||
{ value: 'post', label: 'Post' },
|
||||
{ value: 'page', label: 'Page' },
|
||||
{ value: 'product', label: 'Product' },
|
||||
{ value: 'taxonomy', label: 'Taxonomy' },
|
||||
...(handlers.contentTypeOptions && handlers.contentTypeOptions.length > 0
|
||||
? handlers.contentTypeOptions
|
||||
: [
|
||||
{ value: 'post', label: 'Post' },
|
||||
{ value: 'page', label: 'Page' },
|
||||
{ value: 'product', label: 'Product' },
|
||||
{ value: 'taxonomy', label: 'Taxonomy' },
|
||||
]
|
||||
),
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'keyword_cluster_id',
|
||||
label: 'Cluster',
|
||||
type: 'select',
|
||||
options: (() => {
|
||||
return [
|
||||
{ value: '', label: 'All Clusters' },
|
||||
...handlers.clusters.map((c) => ({ value: c.id.toString(), label: c.name })),
|
||||
];
|
||||
})(),
|
||||
dynamicOptions: 'clusters',
|
||||
options: [
|
||||
{ value: '', label: 'All Clusters' },
|
||||
...(handlers.clusterOptions && handlers.clusterOptions.length > 0
|
||||
? handlers.clusterOptions
|
||||
: handlers.clusters.map((c) => ({ value: c.id.toString(), label: c.name }))
|
||||
),
|
||||
],
|
||||
},
|
||||
],
|
||||
formFields: (clusters: Array<{ id: number; name: string }>) => [
|
||||
|
||||
@@ -140,6 +140,7 @@ export const createKeywordsPageConfig = (
|
||||
countryOptions?: Array<{ value: string; label: string }>;
|
||||
statusOptions?: Array<{ value: string; label: string }>;
|
||||
clusterOptions?: Array<{ value: string; label: string }>;
|
||||
difficultyOptions?: Array<{ value: string; label: string }>;
|
||||
}
|
||||
): KeywordsPageConfig => {
|
||||
const showSectorColumn = !handlers.activeSector; // Show when viewing all sectors
|
||||
@@ -308,11 +309,16 @@ export const createKeywordsPageConfig = (
|
||||
type: 'select',
|
||||
options: [
|
||||
{ value: '', label: 'All Difficulty' },
|
||||
{ value: '1', label: '1 - Very Easy' },
|
||||
{ value: '2', label: '2 - Easy' },
|
||||
{ value: '3', label: '3 - Medium' },
|
||||
{ value: '4', label: '4 - Hard' },
|
||||
{ value: '5', label: '5 - Very Hard' },
|
||||
...(handlers.difficultyOptions && handlers.difficultyOptions.length > 0
|
||||
? handlers.difficultyOptions
|
||||
: [
|
||||
{ value: '1', label: '1 - Very Easy' },
|
||||
{ value: '2', label: '2 - Easy' },
|
||||
{ value: '3', label: '3 - Medium' },
|
||||
{ value: '4', label: '4 - Hard' },
|
||||
{ value: '5', label: '5 - Very Hard' },
|
||||
]
|
||||
),
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -448,19 +454,6 @@ export const createKeywordsPageConfig = (
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
key: 'cluster_id',
|
||||
label: 'Cluster',
|
||||
type: 'select',
|
||||
options: (() => {
|
||||
// Dynamically generate options from current clusters
|
||||
return [
|
||||
{ value: '', label: 'All Clusters' },
|
||||
...handlers.clusters.map((c) => ({ value: c.id.toString(), label: c.name })),
|
||||
];
|
||||
})(),
|
||||
className: 'w-40',
|
||||
},
|
||||
],
|
||||
headerMetrics: [
|
||||
{
|
||||
|
||||
@@ -1,8 +1,87 @@
|
||||
/**
|
||||
* Structure mapping configuration
|
||||
* Maps content types to their valid structures and provides label mappings
|
||||
* Also contains shared filter options for reuse across pages
|
||||
*/
|
||||
|
||||
// ============================================================================
|
||||
// SHARED FILTER OPTIONS - Use these in page configs to avoid duplication
|
||||
// ============================================================================
|
||||
|
||||
/** Status options for Keywords page */
|
||||
export const KEYWORD_STATUS_OPTIONS = [
|
||||
{ value: '', label: 'All Status' },
|
||||
{ value: 'new', label: 'New' },
|
||||
{ value: 'mapped', label: 'Mapped' },
|
||||
];
|
||||
|
||||
/** Status options for Clusters page */
|
||||
export const CLUSTER_STATUS_OPTIONS = [
|
||||
{ value: '', label: 'All Status' },
|
||||
{ value: 'new', label: 'New' },
|
||||
{ value: 'mapped', label: 'Mapped' },
|
||||
];
|
||||
|
||||
/** Status options for Ideas page */
|
||||
export const IDEAS_STATUS_OPTIONS = [
|
||||
{ value: '', label: 'All Status' },
|
||||
{ value: 'new', label: 'New' },
|
||||
{ value: 'queued', label: 'Queued' },
|
||||
{ value: 'completed', label: 'Completed' },
|
||||
];
|
||||
|
||||
/** Status options for Content/Review/Approved pages */
|
||||
export const CONTENT_STATUS_OPTIONS = [
|
||||
{ value: '', label: 'All Status' },
|
||||
{ value: 'draft', label: 'Draft' },
|
||||
{ value: 'review', label: 'Review' },
|
||||
{ value: 'approved', label: 'Approved' },
|
||||
{ value: 'published', label: 'Published' },
|
||||
];
|
||||
|
||||
/** Site status options for content publishing */
|
||||
export const SITE_STATUS_OPTIONS = [
|
||||
{ value: '', label: 'All Site Status' },
|
||||
{ value: 'not_published', label: 'Not Published' },
|
||||
{ value: 'scheduled', label: 'Scheduled' },
|
||||
{ value: 'publishing', label: 'Publishing' },
|
||||
{ value: 'published', label: 'Published' },
|
||||
{ value: 'failed', label: 'Failed' },
|
||||
];
|
||||
|
||||
/** Source options for content */
|
||||
export const SOURCE_OPTIONS = [
|
||||
{ value: '', label: 'All Sources' },
|
||||
{ value: 'igny8', label: 'IGNY8' },
|
||||
{ value: 'wordpress', label: 'WordPress' },
|
||||
];
|
||||
|
||||
/** Country options - used for keywords */
|
||||
export const COUNTRY_OPTIONS = [
|
||||
{ value: '', label: 'All Countries' },
|
||||
{ value: 'US', label: 'United States' },
|
||||
{ value: 'CA', label: 'Canada' },
|
||||
{ value: 'GB', label: 'United Kingdom' },
|
||||
{ value: 'AE', label: 'United Arab Emirates' },
|
||||
{ value: 'AU', label: 'Australia' },
|
||||
{ value: 'IN', label: 'India' },
|
||||
{ value: 'PK', label: 'Pakistan' },
|
||||
];
|
||||
|
||||
/** Difficulty options (1-5 scale) */
|
||||
export const DIFFICULTY_OPTIONS = [
|
||||
{ value: '', label: 'All Difficulty' },
|
||||
{ value: '1', label: '1 - Very Easy' },
|
||||
{ value: '2', label: '2 - Easy' },
|
||||
{ value: '3', label: '3 - Medium' },
|
||||
{ value: '4', label: '4 - Hard' },
|
||||
{ value: '5', label: '5 - Very Hard' },
|
||||
];
|
||||
|
||||
// ============================================================================
|
||||
// CONTENT TYPE AND STRUCTURE OPTIONS
|
||||
// ============================================================================
|
||||
|
||||
export const CONTENT_TYPE_OPTIONS = [
|
||||
{ value: 'post', label: 'Post' },
|
||||
{ value: 'page', label: 'Page' },
|
||||
@@ -10,6 +89,35 @@ export const CONTENT_TYPE_OPTIONS = [
|
||||
{ value: 'taxonomy', label: 'Taxonomy' },
|
||||
];
|
||||
|
||||
/** Content type filter options (with "All" option) */
|
||||
export const CONTENT_TYPE_FILTER_OPTIONS = [
|
||||
{ value: '', label: 'All Types' },
|
||||
...CONTENT_TYPE_OPTIONS,
|
||||
];
|
||||
|
||||
/** Content structure filter options (with "All" option) */
|
||||
export const CONTENT_STRUCTURE_FILTER_OPTIONS = [
|
||||
{ value: '', label: 'All Structures' },
|
||||
// Post structures
|
||||
{ value: 'article', label: 'Article' },
|
||||
{ value: 'guide', label: 'Guide' },
|
||||
{ value: 'comparison', label: 'Comparison' },
|
||||
{ value: 'review', label: 'Review' },
|
||||
{ value: 'listicle', label: 'Listicle' },
|
||||
// Page structures
|
||||
{ value: 'landing_page', label: 'Landing Page' },
|
||||
{ value: 'business_page', label: 'Business Page' },
|
||||
{ value: 'service_page', label: 'Service Page' },
|
||||
{ value: 'general', label: 'General' },
|
||||
{ value: 'cluster_hub', label: 'Cluster Hub' },
|
||||
// Product structures
|
||||
{ value: 'product_page', label: 'Product Page' },
|
||||
// Taxonomy structures
|
||||
{ value: 'category_archive', label: 'Category Archive' },
|
||||
{ value: 'tag_archive', label: 'Tag Archive' },
|
||||
{ value: 'attribute_archive', label: 'Attribute Archive' },
|
||||
];
|
||||
|
||||
export const CONTENT_STRUCTURE_BY_TYPE: Record<string, Array<{ value: string; label: string }>> = {
|
||||
post: [
|
||||
{ value: 'article', label: 'Article' },
|
||||
|
||||
Reference in New Issue
Block a user