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:
@@ -46,7 +46,6 @@ export default function Ideas() {
|
||||
const [clusterFilter, setClusterFilter] = useState('');
|
||||
const [structureFilter, setStructureFilter] = useState('');
|
||||
const [typeFilter, setTypeFilter] = useState('');
|
||||
const [entityTypeFilter, setEntityTypeFilter] = useState(''); // Stage 3: Entity type filter
|
||||
const [selectedIds, setSelectedIds] = useState<string[]>([]);
|
||||
|
||||
// Pagination state
|
||||
@@ -66,8 +65,8 @@ export default function Ideas() {
|
||||
const [formData, setFormData] = useState<ContentIdeaCreateData>({
|
||||
idea_title: '',
|
||||
description: '',
|
||||
content_structure: 'blog_post',
|
||||
content_type: 'blog_post',
|
||||
content_structure: 'article',
|
||||
content_type: 'post',
|
||||
target_keywords: '',
|
||||
keyword_cluster_id: null,
|
||||
status: 'new',
|
||||
@@ -103,7 +102,6 @@ export default function Ideas() {
|
||||
...(clusterFilter && { keyword_cluster_id: clusterFilter }),
|
||||
...(structureFilter && { content_structure: structureFilter }),
|
||||
...(typeFilter && { content_type: typeFilter }),
|
||||
...(entityTypeFilter && { site_entity_type: entityTypeFilter }), // Stage 3: Entity type filter
|
||||
page: currentPage,
|
||||
page_size: pageSize,
|
||||
ordering,
|
||||
@@ -124,7 +122,7 @@ export default function Ideas() {
|
||||
setShowContent(true);
|
||||
setLoading(false);
|
||||
}
|
||||
}, [currentPage, statusFilter, clusterFilter, structureFilter, typeFilter, entityTypeFilter, sortBy, sortDirection, searchTerm, activeSector, pageSize]);
|
||||
}, [currentPage, statusFilter, clusterFilter, structureFilter, typeFilter, sortBy, sortDirection, searchTerm, activeSector, pageSize]);
|
||||
|
||||
useEffect(() => {
|
||||
loadIdeas();
|
||||
@@ -322,7 +320,6 @@ export default function Ideas() {
|
||||
keyword_cluster_id: clusterFilter,
|
||||
content_structure: structureFilter,
|
||||
content_type: typeFilter,
|
||||
site_entity_type: entityTypeFilter, // Stage 3: Entity type filter
|
||||
}}
|
||||
onFilterChange={(key, value) => {
|
||||
const stringValue = value === null || value === undefined ? '' : String(value);
|
||||
@@ -340,9 +337,6 @@ export default function Ideas() {
|
||||
} else if (key === 'content_type') {
|
||||
setTypeFilter(stringValue);
|
||||
setCurrentPage(1);
|
||||
} else if (key === 'site_entity_type') { // Stage 3: Entity type filter
|
||||
setEntityTypeFilter(stringValue);
|
||||
setCurrentPage(1);
|
||||
}
|
||||
setCurrentPage(1);
|
||||
}}
|
||||
@@ -351,8 +345,8 @@ export default function Ideas() {
|
||||
setFormData({
|
||||
idea_title: row.idea_title || '',
|
||||
description: row.description || '',
|
||||
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',
|
||||
target_keywords: row.target_keywords || '',
|
||||
keyword_cluster_id: row.keyword_cluster_id || null,
|
||||
status: row.status || 'new',
|
||||
|
||||
Reference in New Issue
Block a user