phase 4-6 - with buggy contetn calendar page
This commit is contained in:
@@ -32,6 +32,7 @@ import PublishLimitModal from '../../components/common/PublishLimitModal';
|
||||
import ScheduleContentModal from '../../components/common/ScheduleContentModal';
|
||||
import BulkScheduleModal from '../../components/common/BulkScheduleModal';
|
||||
import BulkSchedulePreviewModal from '../../components/common/BulkSchedulePreviewModal';
|
||||
import ErrorDetailsModal from '../../components/common/ErrorDetailsModal';
|
||||
|
||||
export default function Approved() {
|
||||
const toast = useToast();
|
||||
@@ -91,6 +92,10 @@ export default function Approved() {
|
||||
const [bulkScheduleItems, setBulkScheduleItems] = useState<Content[]>([]);
|
||||
const [bulkSchedulePreview, setBulkSchedulePreview] = useState<any>(null);
|
||||
|
||||
// Error details modal state
|
||||
const [showErrorDetailsModal, setShowErrorDetailsModal] = useState(false);
|
||||
const [errorContent, setErrorContent] = useState<Content | null>(null);
|
||||
|
||||
// Load dynamic filter options based on current site's data and applied filters
|
||||
// This implements cascading filters - each filter's options reflect what's available
|
||||
// given the other currently applied filters
|
||||
@@ -482,6 +487,9 @@ export default function Approved() {
|
||||
if (window.confirm(`Are you sure you want to unschedule "${row.title}"?`)) {
|
||||
await handleUnscheduleContent(row.id);
|
||||
}
|
||||
} else if (action === 'view_error') {
|
||||
setErrorContent(row);
|
||||
setShowErrorDetailsModal(true);
|
||||
} else if (action === 'edit') {
|
||||
// Navigate to content editor
|
||||
if (row.site_id) {
|
||||
@@ -609,8 +617,14 @@ export default function Approved() {
|
||||
const handleBulkAction = useCallback(async (action: string, ids: string[]) => {
|
||||
if (action === 'bulk_publish_site') {
|
||||
await handleBulkPublishToSite(ids);
|
||||
} else if (action === 'bulk_schedule_manual') {
|
||||
// Manual bulk scheduling (same time for all)
|
||||
handleBulkScheduleManual(ids);
|
||||
} else if (action === 'bulk_schedule_defaults') {
|
||||
// Schedule with site defaults
|
||||
handleBulkScheduleWithDefaults(ids);
|
||||
}
|
||||
}, [handleBulkPublishToSite]);
|
||||
}, [handleBulkPublishToSite, handleBulkScheduleManual, handleBulkScheduleWithDefaults]);
|
||||
|
||||
// Bulk status update handler
|
||||
const handleBulkUpdateStatus = useCallback(async (ids: string[], status: string) => {
|
||||
@@ -886,6 +900,28 @@ export default function Approved() {
|
||||
onChangeSettings={handleOpenSiteSettings}
|
||||
siteId={activeSite?.id || 0}
|
||||
/>
|
||||
|
||||
<ErrorDetailsModal
|
||||
isOpen={showErrorDetailsModal}
|
||||
onClose={() => {
|
||||
setShowErrorDetailsModal(false);
|
||||
setErrorContent(null);
|
||||
}}
|
||||
content={errorContent}
|
||||
site={activeSite}
|
||||
onPublishNow={() => {
|
||||
if (errorContent) {
|
||||
handleSinglePublish(errorContent);
|
||||
}
|
||||
}}
|
||||
onReschedule={() => {
|
||||
if (errorContent) {
|
||||
setScheduleContent(errorContent);
|
||||
setShowScheduleModal(true);
|
||||
}
|
||||
}}
|
||||
onFixSettings={handleOpenSiteSettings}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user