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

@@ -49,7 +49,6 @@ export default function Tasks() {
const [structureFilter, setStructureFilter] = useState('');
const [typeFilter, setTypeFilter] = useState('');
const [sourceFilter, setSourceFilter] = useState('');
const [entityTypeFilter, setEntityTypeFilter] = useState(''); // Stage 3: Entity type filter
const [selectedIds, setSelectedIds] = useState<string[]>([]);
// Pagination state
@@ -71,8 +70,8 @@ export default function Tasks() {
description: '',
keywords: '',
cluster_id: null,
content_structure: 'blog_post',
content_type: 'blog_post',
content_structure: 'article',
content_type: 'post',
status: 'queued',
word_count: 0,
});
@@ -145,7 +144,6 @@ export default function Tasks() {
...(clusterFilter && { cluster_id: clusterFilter }),
...(structureFilter && { content_structure: structureFilter }),
...(typeFilter && { content_type: typeFilter }),
...(entityTypeFilter && { entity_type: entityTypeFilter }), // Stage 3: Entity type filter
page: currentPage,
page_size: pageSize,
ordering,
@@ -533,8 +531,8 @@ export default function Tasks() {
description: '',
keywords: '',
cluster_id: null,
content_structure: 'blog_post',
content_type: 'blog_post',
content_structure: 'article',
content_type: 'post',
status: 'queued',
word_count: 0,
});
@@ -588,7 +586,6 @@ export default function Tasks() {
content_structure: structureFilter,
content_type: typeFilter,
source: sourceFilter,
entity_type: entityTypeFilter, // Stage 3: Entity type filter
}}
onFilterChange={(key, value) => {
const stringValue = value === null || value === undefined ? '' : String(value);
@@ -604,8 +601,6 @@ export default function Tasks() {
setTypeFilter(stringValue);
} else if (key === 'source') {
setSourceFilter(stringValue);
} else if (key === 'entity_type') { // Stage 3: Entity type filter
setEntityTypeFilter(stringValue);
}
setCurrentPage(1);
}}
@@ -616,8 +611,8 @@ export default function Tasks() {
description: row.description || '',
keywords: row.keywords || '',
cluster_id: row.cluster_id || null,
content_structure: row.content_structure || 'blog_post',
content_type: row.content_type || 'blog_post',
content_structure: row.content_structure || 'article',
content_type: row.content_type || 'post',
status: row.status || 'queued',
word_count: row.word_count || 0,
});