feat: Complete Stage 2 frontend refactor

- Removed deprecated fields from Content and Task models, including entity_type, sync_status, and cluster_role.
- Updated Content model to include new fields: content_type, content_structure, taxonomy_terms, source, external_id, and cluster_id.
- Refactored Writer module components (Content, ContentView, Dashboard, Tasks) to align with new schema.
- Enhanced Dashboard metrics and removed unused filters.
- Implemented ClusterDetail page to display cluster information and associated content.
- Updated API service interfaces to reflect changes in data structure.
- Adjusted sorting and filtering logic across various components to accommodate new field names and types.
- Improved user experience by providing loading states and error handling in data fetching.
This commit is contained in:
IGNY8 VPS (Salman)
2025-11-25 18:17:17 +00:00
parent a5ef36016c
commit 807ced7527
19 changed files with 1045 additions and 740 deletions

View File

@@ -156,58 +156,6 @@ export const createIdeasPageConfig = (
width: '200px',
render: (_value: string, row: ContentIdea) => row.keyword_cluster_name || '-',
},
// Stage 3: Metadata columns
{
key: 'site_entity_type',
label: 'Entity Type',
sortable: true,
sortField: 'site_entity_type',
width: '120px',
defaultVisible: true,
render: (value: string, row: ContentIdea) => {
const entityType = value || (row as any).site_entity_type;
if (!entityType) {
return <span className="text-gray-400 dark:text-gray-500">-</span>;
}
const typeLabels: Record<string, string> = {
'blog_post': 'Blog Post',
'article': 'Article',
'product': 'Product',
'service': 'Service',
'taxonomy': 'Taxonomy',
'page': 'Page',
};
return (
<Badge color="info" size="sm" variant="light">
{typeLabels[entityType] || entityType}
</Badge>
);
},
},
{
key: 'cluster_role',
label: 'Role',
sortable: true,
sortField: 'cluster_role',
width: '100px',
defaultVisible: false,
render: (value: string, row: ContentIdea) => {
const role = value || (row as any).cluster_role;
if (!role) {
return <span className="text-gray-400 dark:text-gray-500">-</span>;
}
const roleColors: Record<string, 'primary' | 'success' | 'warning'> = {
'hub': 'primary',
'supporting': 'success',
'attribute': 'warning',
};
return (
<Badge color={roleColors[role] || 'primary'} size="sm" variant="light">
{role.charAt(0).toUpperCase() + role.slice(1)}
</Badge>
);
},
},
{
...statusColumn,
sortable: true,
@@ -276,37 +224,25 @@ export const createIdeasPageConfig = (
type: 'select',
options: [
{ value: '', label: 'All Structures' },
{ value: 'cluster_hub', label: 'Cluster Hub' },
{ value: 'landing_page', label: 'Landing Page' },
{ value: 'pillar_page', label: 'Pillar Page' },
{ value: 'supporting_page', label: 'Supporting Page' },
{ value: 'article', label: 'Article' },
{ value: 'listicle', label: 'Listicle' },
{ value: 'guide', label: 'Guide' },
{ value: 'comparison', label: 'Comparison' },
{ value: 'product_page', label: 'Product Page' },
],
},
{
key: 'content_type',
label: 'Type',
label: 'Content Type',
type: 'select',
options: [
{ value: '', label: 'All Types' },
{ value: 'blog_post', label: 'Blog Post' },
{ value: 'article', label: 'Article' },
{ value: 'guide', label: 'Guide' },
{ value: 'tutorial', label: 'Tutorial' },
],
},
// Stage 3: Entity type filter
{
key: 'site_entity_type',
label: 'Entity Type',
type: 'select',
options: [
{ value: '', label: 'All Entity Types' },
{ value: 'blog_post', label: 'Blog Post' },
{ value: 'article', label: 'Article' },
{ value: 'post', label: 'Post' },
{ value: 'page', label: 'Page' },
{ value: 'product', label: 'Product' },
{ value: 'service', label: 'Service' },
{ value: 'taxonomy', label: 'Taxonomy' },
{ value: 'page', label: 'Page' },
{ value: 'category', label: 'Category' },
{ value: 'tag', label: 'Tag' },
],
},
{
@@ -346,28 +282,31 @@ export const createIdeasPageConfig = (
key: 'content_structure',
label: 'Content Structure',
type: 'select',
value: handlers.formData.content_structure || 'blog_post',
value: handlers.formData.content_structure || 'article',
onChange: (value: any) =>
handlers.setFormData({ ...handlers.formData, content_structure: value }),
options: [
{ value: 'cluster_hub', label: 'Cluster Hub' },
{ value: 'landing_page', label: 'Landing Page' },
{ value: 'pillar_page', label: 'Pillar Page' },
{ value: 'supporting_page', label: 'Supporting Page' },
{ value: 'article', label: 'Article' },
{ value: 'listicle', label: 'Listicle' },
{ value: 'guide', label: 'Guide' },
{ value: 'comparison', label: 'Comparison' },
{ value: 'product_page', label: 'Product Page' },
],
},
{
key: 'content_type',
label: 'Content Type',
type: 'select',
value: handlers.formData.content_type || 'blog_post',
value: handlers.formData.content_type || 'post',
onChange: (value: any) =>
handlers.setFormData({ ...handlers.formData, content_type: value }),
options: [
{ value: 'blog_post', label: 'Blog Post' },
{ value: 'article', label: 'Article' },
{ value: 'guide', label: 'Guide' },
{ value: 'tutorial', label: 'Tutorial' },
{ value: 'post', label: 'Post' },
{ value: 'page', label: 'Page' },
{ value: 'product', label: 'Product' },
{ value: 'service', label: 'Service' },
{ value: 'category', label: 'Category' },
{ value: 'tag', label: 'Tag' },
],
},
{