minor atuoamtion page fix, and plan for compelte resuteurce of publishsign and scheduling

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-17 01:38:48 +00:00
parent 97f5ff8167
commit 47a00e8875
5 changed files with 2072 additions and 14 deletions

View File

@@ -57,7 +57,7 @@ const STAGE_CONFIG = [
{ icon: CheckCircleIcon, color: 'from-gray-700 to-gray-800', textColor: 'text-gray-700 dark:text-gray-300', bgColor: 'bg-gray-100 dark:bg-gray-800/30', hoverColor: 'hover:border-gray-500', name: 'Tasks → Content' },
{ icon: PencilIcon, color: 'from-brand-500 to-brand-600', textColor: 'text-brand-600 dark:text-brand-400', bgColor: 'bg-brand-100 dark:bg-brand-900/30', hoverColor: 'hover:border-brand-500', name: 'Content → Image Prompts' },
{ icon: FileIcon, color: 'from-purple-500 to-purple-600', textColor: 'text-purple-600 dark:text-purple-400', bgColor: 'bg-purple-100 dark:bg-purple-900/30', hoverColor: 'hover:border-purple-500', name: 'Image Prompts → Images' },
{ icon: PaperPlaneIcon, color: 'from-success-500 to-success-600', textColor: 'text-success-600 dark:text-success-400', bgColor: 'bg-success-100 dark:bg-success-900/30', hoverColor: 'hover:border-success-500', name: 'Review → Published' },
{ icon: PaperPlaneIcon, color: 'from-success-500 to-success-600', textColor: 'text-success-600 dark:text-success-400', bgColor: 'bg-success-100 dark:bg-success-900/30', hoverColor: 'hover:border-success-500', name: 'In Review → Approved' },
];
const AutomationPage: React.FC = () => {
@@ -215,6 +215,8 @@ const AutomationPage: React.FC = () => {
contentDraftRes,
contentReviewRes,
contentPublishedRes,
contentNotPublishedRes,
contentScheduledRes,
imagesTotalRes,
imagesPendingRes,
] = await Promise.all([
@@ -233,6 +235,8 @@ const AutomationPage: React.FC = () => {
fetchContent({ page_size: 1, site_id: siteId, status: 'draft' }),
fetchContent({ page_size: 1, site_id: siteId, status: 'review' }),
fetchContent({ page_size: 1, site_id: siteId, status__in: 'approved,published' }),
fetchContent({ page_size: 1, site_id: siteId, status: 'approved', site_status: 'not_published' }),
fetchContent({ page_size: 1, site_id: siteId, status: 'approved', site_status: 'scheduled' }),
fetchImages({ page_size: 1 }),
fetchImages({ page_size: 1, status: 'pending' }),
]);
@@ -247,6 +251,8 @@ const AutomationPage: React.FC = () => {
draft: contentDraftRes.count || 0,
review: contentReviewRes.count || 0,
published: contentPublishedRes.count || 0,
not_published: contentNotPublishedRes.count || 0,
scheduled: contentScheduledRes.count || 0,
},
images: { total: imagesTotalRes.count || 0, pending: imagesPendingRes.count || 0 },
});
@@ -334,6 +340,8 @@ const AutomationPage: React.FC = () => {
contentDraftRes,
contentReviewRes,
contentPublishedRes,
contentNotPublishedRes,
contentScheduledRes,
imagesTotalRes,
imagesPendingRes,
] = await Promise.all([
@@ -352,6 +360,8 @@ const AutomationPage: React.FC = () => {
fetchContent({ page_size: 1, site_id: siteId, status: 'draft' }),
fetchContent({ page_size: 1, site_id: siteId, status: 'review' }),
fetchContent({ page_size: 1, site_id: siteId, status__in: 'approved,published' }),
fetchContent({ page_size: 1, site_id: siteId, status: 'approved', site_status: 'not_published' }),
fetchContent({ page_size: 1, site_id: siteId, status: 'approved', site_status: 'scheduled' }),
fetchImages({ page_size: 1 }),
fetchImages({ page_size: 1, status: 'pending' }),
]);
@@ -366,6 +376,8 @@ const AutomationPage: React.FC = () => {
draft: contentDraftRes.count || 0,
review: contentReviewRes.count || 0,
published: contentPublishedRes.count || 0,
not_published: contentNotPublishedRes.count || 0,
scheduled: contentScheduledRes.count || 0,
},
images: { total: imagesTotalRes.count || 0, pending: imagesPendingRes.count || 0 },
});
@@ -1157,7 +1169,7 @@ const AutomationPage: React.FC = () => {
);
})}
{/* Stage 7 - Review → Published (Auto-approve) */}
{/* Stage 7 - In Review → Approved (Auto-approve) */}
{pipelineOverview[6] && (() => {
const stage7 = pipelineOverview[6];
const stageConfig = STAGE_CONFIG[6];
@@ -1259,24 +1271,36 @@ const AutomationPage: React.FC = () => {
);
})()}
{/* Approved summary card - Same layout as Stage 7 */}
<div className="rounded-2xl p-4 border-2 border-success-200 bg-gradient-to-br from-success-50 to-success-100 dark:from-success-900/10 dark:to-success-800/10 flex flex-col h-full">
{/* Header Row - Icon and Label on left, Big Count on right */}
{/* Scheduled summary card - Same layout as Stage cards */}
<div className="rounded-xl border border-gray-200 dark:border-gray-800 p-4 transition-all bg-white dark:bg-gray-900 border-l-[5px] border-l-success-500">
{/* Header Row - Icon, Label on left; Function Name on right */}
<div className="flex items-center justify-between mb-4">
<div className="flex items-center gap-2">
<div className="size-8 rounded-lg bg-gradient-to-br from-success-400 to-success-600 flex items-center justify-center shadow-md flex-shrink-0">
<CheckCircleIcon className="size-4 text-white" />
<div className="size-8 rounded-lg bg-gradient-to-br from-success-500 to-success-600 flex items-center justify-center shadow-md flex-shrink-0">
<ClockIcon className="size-4 text-white" />
</div>
<span className="text-base font-bold text-success-900 dark:text-success-100">Approved</span>
</div>
{/* Big count on right */}
<div className="text-3xl font-bold text-success-600 dark:text-success-400">
{metrics?.content?.published ?? pipelineOverview[3]?.counts?.published ?? getStageResult(4)?.published ?? 0}
<span className="text-base font-bold text-gray-900 dark:text-white">Scheduled</span>
</div>
{/* Stage Function Name - Right side, larger font */}
<div className="text-sm font-bold text-success-600 dark:text-success-400">Ready to Publish</div>
</div>
{/* Status Label - Right aligned */}
<div className="text-sm font-bold text-success-600 dark:text-success-400 mb-4 text-right">Published Content</div>
{/* Single Row: Pending & Scheduled */}
<div className="flex justify-between items-center mb-3">
<div className="text-center">
<div className="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase mb-0.5">Pending</div>
<div className={`text-xl font-bold ${(metrics?.content?.not_published ?? 0) > 0 ? 'text-gray-600 dark:text-gray-300' : 'text-gray-400 dark:text-gray-500'}`}>
{metrics?.content?.not_published ?? 0}
</div>
</div>
<div className="h-8 w-px bg-gray-200 dark:bg-gray-700"></div>
<div className="text-center">
<div className="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase mb-0.5">Scheduled</div>
<div className={`text-xl font-bold ${(metrics?.content?.scheduled ?? 0) > 0 ? 'text-success-600 dark:text-success-400' : 'text-gray-400 dark:text-gray-500'}`}>
{metrics?.content?.scheduled ?? 0}
</div>
</div>
</div>
</div>
</div>