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

@@ -777,9 +777,7 @@ export interface ContentIdea {
estimated_word_count: number;
created_at: string;
updated_at: string;
// Stage 3: Metadata fields
site_entity_type?: string | null;
cluster_role?: string | null;
// Taxonomy fields
taxonomy_id?: number | null;
taxonomy_name?: string | null;
}
@@ -892,7 +890,6 @@ export interface TasksFilters {
cluster_id?: string;
content_type?: string;
content_structure?: string;
entity_type?: string; // Stage 3: Entity type filter
page?: number;
page_size?: number;
ordering?: string;
@@ -933,11 +930,10 @@ export interface Task {
post_url?: string | null;
created_at: string;
updated_at: string;
// Stage 3: Metadata fields
entity_type?: string | null;
// Taxonomy fields
taxonomy_term_id?: number | null;
taxonomy_id?: number | null;
taxonomy_name?: string | null;
cluster_role?: string | null;
}
export interface TaskCreateData {
@@ -1985,7 +1981,10 @@ export async function deleteAuthorProfile(id: number): Promise<void> {
export interface ContentFilters {
search?: string;
status?: string;
task_id?: number;
content_type?: string;
content_structure?: string;
source?: string;
cluster_id?: number;
page?: number;
page_size?: number;
ordering?: string;
@@ -1995,34 +1994,31 @@ export interface ContentFilters {
export interface Content {
id: number;
task_id: number;
task_title?: string | null;
sector_name?: string | null;
title?: string | null;
meta_title?: string | null;
meta_description?: string | null;
primary_keyword?: string | null;
secondary_keywords?: string[];
tags?: string[];
categories?: string[];
status: string;
html_content: string;
word_count: number;
metadata: Record<string, any>;
generated_at: string;
// Core fields
title: string;
content_html: string;
content_type: string;
content_structure: string;
status: 'draft' | 'published';
source: 'igny8' | 'wordpress';
// Relations
cluster_id: number;
cluster_name?: string | null;
taxonomy_terms?: Array<{
id: number;
name: string;
taxonomy_type: string;
}>;
// WordPress integration
external_id?: string | null;
external_url?: string | null;
// Timestamps
created_at: string;
updated_at: string;
// Image support
has_image_prompts?: boolean;
has_generated_images?: boolean;
// Stage 3: Metadata fields
entity_type?: string | null;
cluster_name?: string | null;
cluster_id?: number | null;
taxonomy_name?: string | null;
taxonomy_id?: number | null;
cluster_role?: string | null;
// Additional fields used in Linker/Optimizer
source?: string;
sync_status?: string;
internal_links?: Array<{ anchor_text: string; target_content_id: number }>;
linker_version?: number;
optimization_scores?: {
@@ -2030,10 +2026,6 @@ export interface Content {
readability_score: number;
engagement_score: number;
overall_score: number;
metadata_completeness_score?: number;
has_cluster_mapping?: boolean;
has_taxonomy_mapping?: boolean;
has_attributes?: boolean;
};
}
@@ -2098,8 +2090,8 @@ export interface ContentValidationResult {
message: string;
}>;
metadata: {
has_entity_type: boolean;
entity_type: string | null;
has_content_type: boolean;
content_type: string | null;
has_cluster_mapping: boolean;
has_taxonomy_mapping: boolean;
};