Refactor content status terminology and enhance cluster serializers with idea and content counts

This commit is contained in:
Desktop
2025-11-11 18:51:32 +05:00
parent b321c99089
commit a7880c3818
10 changed files with 118 additions and 39 deletions

View File

@@ -148,20 +148,18 @@ export const createTasksPageConfig = (
sortable: true,
sortField: 'status',
render: (value: string) => {
const statusColors: Record<string, 'success' | 'warning' | 'error' | 'info'> = {
'queued': 'warning',
'in_progress': 'info',
'draft': 'warning',
'review': 'info',
'published': 'success',
'completed': 'success',
const statusColors: Record<string, 'success' | 'warning'> = {
queued: 'warning',
completed: 'success',
};
const label = value ? value.replace('_', ' ') : '';
const formatted = label ? label.charAt(0).toUpperCase() + label.slice(1) : '';
return (
<Badge
color={statusColors[value] || 'warning'}
size="sm"
>
{value?.replace('_', ' ') || value}
{formatted}
</Badge>
);
},
@@ -193,10 +191,6 @@ export const createTasksPageConfig = (
options: [
{ value: '', label: 'All Status' },
{ value: 'queued', label: 'Queued' },
{ value: 'in_progress', label: 'In Progress' },
{ value: 'draft', label: 'Draft' },
{ value: 'review', label: 'Review' },
{ value: 'published', label: 'Published' },
{ value: 'completed', label: 'Completed' },
],
},
@@ -318,10 +312,6 @@ export const createTasksPageConfig = (
handlers.setFormData({ ...handlers.formData, status: value }),
options: [
{ value: 'queued', label: 'Queued' },
{ value: 'in_progress', label: 'In Progress' },
{ value: 'draft', label: 'Draft' },
{ value: 'review', label: 'Review' },
{ value: 'published', label: 'Published' },
{ value: 'completed', label: 'Completed' },
],
},
@@ -340,16 +330,10 @@ export const createTasksPageConfig = (
calculate: (data) => data.tasks.filter((t: Task) => t.status === 'queued').length,
},
{
label: 'In Progress',
value: 0,
accentColor: 'blue' as const,
calculate: (data) => data.tasks.filter((t: Task) => t.status === 'in_progress').length,
},
{
label: 'Published',
label: 'Completed',
value: 0,
accentColor: 'green' as const,
calculate: (data) => data.tasks.filter((t: Task) => t.status === 'published').length,
calculate: (data) => data.tasks.filter((t: Task) => t.status === 'completed').length,
},
],
};