Section 3-8 - #MIgration Runs -

Multiple Migfeat: Update publishing terminology and add publishing settings

- Changed references from "WordPress" to "Site" across multiple components for consistency.
- Introduced a new "Publishing" tab in Site Settings to manage automatic content approval and publishing behavior.
- Added publishing settings model to the backend with fields for auto-approval, auto-publish, and publishing limits.
- Implemented Celery tasks for scheduling and processing automated content publishing.
- Enhanced Writer Dashboard to include metrics for content published to the site and scheduled for publishing.
This commit is contained in:
IGNY8 VPS (Salman)
2026-01-01 07:10:03 +00:00
parent f81fffc9a6
commit 0340016932
21 changed files with 1200 additions and 36 deletions

View File

@@ -43,6 +43,8 @@ interface WriterStats {
total: number;
drafts: number;
published: number;
publishedToSite: number;
scheduledForPublish: number;
totalWordCount: number;
avgWordCount: number;
byContentType: Record<string, number>;
@@ -109,12 +111,17 @@ export default function WriterDashboard() {
const content = contentRes.results || [];
let drafts = 0;
let published = 0;
let publishedToSite = 0;
let scheduledForPublish = 0;
let contentTotalWordCount = 0;
const contentByType: Record<string, number> = {};
content.forEach(c => {
if (c.status === 'draft') drafts++;
else if (c.status === 'published') published++;
// Count site_status for external publishing metrics
if (c.site_status === 'published') publishedToSite++;
else if (c.site_status === 'scheduled') scheduledForPublish++;
if (c.word_count) contentTotalWordCount += c.word_count;
});
@@ -162,6 +169,8 @@ export default function WriterDashboard() {
total: content.length,
drafts,
published,
publishedToSite,
scheduledForPublish,
totalWordCount: contentTotalWordCount,
avgWordCount: contentAvgWordCount,
byContentType: contentByType
@@ -237,13 +246,13 @@ export default function WriterDashboard() {
metric: `${stats?.images.pending || 0} pending`,
},
{
title: "Published",
description: "Published content and posts",
title: "Published to Site",
description: "Content published to external site",
icon: PaperPlaneIcon,
color: "from-[var(--color-purple)] to-[var(--color-purple-dark)]",
path: "/writer/published",
count: stats?.content.published || 0,
metric: "View all published",
count: stats?.content.publishedToSite || 0,
metric: stats?.content.scheduledForPublish ? `${stats.content.scheduledForPublish} scheduled` : "None scheduled",
},
{
title: "Taxonomies",
@@ -269,7 +278,7 @@ export default function WriterDashboard() {
{
id: 1,
type: "Content Published",
description: `${stats?.content.published || 0} pieces published to WordPress`,
description: `${stats?.content.published || 0} pieces published to site`,
timestamp: new Date(Date.now() - 30 * 60 * 1000),
icon: PaperPlaneIcon,
color: "text-success-600",
@@ -723,7 +732,7 @@ export default function WriterDashboard() {
</div>
<div className="flex-1 text-left">
<h4 className="font-semibold text-gray-900 mb-1">Publish Content</h4>
<p className="text-sm text-gray-600">Publish to WordPress</p>
<p className="text-sm text-gray-600">Publish to Site</p>
</div>
<ArrowRightIcon className="h-5 w-5 text-gray-400 group-hover:text-purple-500 transition" />
</Link>