publish to wp

This commit is contained in:
alorig
2025-11-28 12:35:02 +05:00
parent 081f94ffdb
commit f76e791de7
8 changed files with 664 additions and 51 deletions

View File

@@ -258,13 +258,7 @@ const tableActionsConfigs: Record<string, TableActionsConfig> = {
icon: EditIcon,
variant: 'primary',
},
{
key: 'publish',
label: 'Publish to WordPress',
icon: <CheckCircleIcon className="w-5 h-5 text-success-500" />,
variant: 'success',
shouldShow: (row: any) => !row.external_id, // Only show if not published
},
{
key: 'view_on_wordpress',
label: 'View on WordPress',
@@ -272,13 +266,7 @@ const tableActionsConfigs: Record<string, TableActionsConfig> = {
variant: 'secondary',
shouldShow: (row: any) => !!row.external_id, // Only show if published
},
{
key: 'unpublish',
label: 'Unpublish',
icon: <TrashBinIcon className="w-5 h-5" />,
variant: 'secondary',
shouldShow: (row: any) => !!row.external_id, // Only show if published
},
{
key: 'generate_image_prompts',
label: 'Generate Image Prompts',
@@ -333,6 +321,18 @@ const tableActionsConfigs: Record<string, TableActionsConfig> = {
},
'/writer/images': {
rowActions: [
{
key: 'publish_wordpress',
label: 'Publish to WordPress',
icon: <ArrowRightIcon className="w-5 h-5" />,
variant: 'success',
shouldShow: (row: any) => {
// Only show if images are generated and not already published/publishing
return row.status === 'complete' &&
(!row.wordpress_status ||
(row.wordpress_status !== 'published' && row.wordpress_status !== 'publishing'));
},
},
{
key: 'update_status',
label: 'Update Status',
@@ -340,7 +340,14 @@ const tableActionsConfigs: Record<string, TableActionsConfig> = {
variant: 'primary',
},
],
bulkActions: [],
bulkActions: [
{
key: 'bulk_publish_wordpress',
label: 'Publish Ready to WordPress',
icon: <ArrowRightIcon className="w-5 h-5" />,
variant: 'success',
},
],
},
// Default config (fallback)
default: {