Remove obsolete migration and workflow files; delete Site Builder Wizard references and related components. Update documentation to reflect the removal of the WorkflowState model and streamline the site building process.

This commit is contained in:
IGNY8 VPS (Salman)
2025-11-21 00:59:34 +00:00
parent 6bb918bad6
commit c8adfe06d1
23 changed files with 1914 additions and 3493 deletions

View File

@@ -32,7 +32,6 @@ import {
} from "../../services/api";
import { useSiteStore } from "../../store/siteStore";
import { useSectorStore } from "../../store/sectorStore";
import Alert from "../../components/ui/alert/Alert";
interface DashboardStats {
keywords: {
@@ -73,7 +72,6 @@ export default function PlannerDashboard() {
const [stats, setStats] = useState<DashboardStats | null>(null);
const [loading, setLoading] = useState(true);
const [lastUpdated, setLastUpdated] = useState<Date>(new Date());
const [incompleteBlueprints, setIncompleteBlueprints] = useState<SiteBlueprint[]>([]);
// Fetch real data
const fetchDashboardData = async () => {
@@ -88,15 +86,6 @@ export default function PlannerDashboard() {
activeSite?.id ? fetchSiteBlueprints({ site_id: activeSite.id, page_size: 100 }) : Promise.resolve({ results: [] })
]);
// Check for incomplete blueprints
if (blueprintsRes.results) {
const incomplete = blueprintsRes.results.filter((bp: SiteBlueprint) => {
const workflow = bp.workflow_state;
return workflow && !workflow.completed && workflow.blocking_reason;
});
setIncompleteBlueprints(incomplete);
}
const keywords = keywordsRes.results || [];
const mappedKeywords = keywords.filter(k => k.cluster && k.cluster.length > 0);
const unmappedKeywords = keywords.filter(k => !k.cluster || k.cluster.length === 0);
@@ -472,37 +461,6 @@ export default function PlannerDashboard() {
onRefresh={fetchDashboardData}
/>
{/* Incomplete Blueprints Banner */}
{incompleteBlueprints.length > 0 && (
<Alert variant="warning" className="mb-6">
<div className="flex items-start justify-between">
<div className="flex-1">
<strong className="block mb-2">Incomplete Site Builder Workflows</strong>
<p className="text-sm mb-3">
{incompleteBlueprints.length} blueprint{incompleteBlueprints.length > 1 ? 's' : ''} {incompleteBlueprints.length > 1 ? 'have' : 'has'} incomplete workflows that need attention:
</p>
<ul className="list-disc list-inside space-y-1 text-sm mb-3">
{incompleteBlueprints.map((bp) => (
<li key={bp.id}>
<Link
to={`/sites/builder/workflow/${bp.id}`}
className="text-blue-600 dark:text-blue-400 hover:underline"
>
{bp.name}
</Link>
{bp.workflow_state?.blocking_reason && (
<span className="text-gray-600 dark:text-gray-400 ml-2">
- {bp.workflow_state.blocking_reason}
</span>
)}
</li>
))}
</ul>
</div>
</div>
</Alert>
)}
<div className="space-y-6">
{/* Key Metrics */}
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">

View File

@@ -2140,7 +2140,6 @@ export interface SiteBlueprint {
created_at: string;
updated_at: string;
pages?: PageBlueprint[];
workflow_state?: WorkflowState;
gating_messages?: string[];
}
@@ -2158,65 +2157,6 @@ export interface PageBlueprint {
updated_at: string;
}
export interface WorkflowState {
current_step: string;
completed: boolean;
blocking_reason?: string;
steps: Array<{
step: string;
status: string;
code?: string;
message?: string;
updated_at?: string;
}>;
updated_at: string;
}
export interface WizardContext {
workflow: WorkflowState;
cluster_summary: {
attached_count: number;
coverage_counts: Record<string, number>;
clusters: Array<{
id: number;
name: string;
keyword_count: number;
volume: number;
context_type?: string;
dimension_meta?: Record<string, any>;
coverage_status: string;
role: string;
metadata?: Record<string, any>;
suggested_taxonomies?: string[];
attribute_hints?: string[];
}>;
};
taxonomy_summary: {
total_taxonomies: number;
counts_by_type: Record<string, number>;
taxonomies: Array<{
id: number;
name: string;
slug: string;
taxonomy_type: string;
description?: string;
cluster_ids: number[];
metadata?: Record<string, any>;
external_reference?: string;
}>;
};
sitemap_summary?: {
pages_total: number;
pages_by_status: Record<string, number>;
pages_by_type: Record<string, number>;
};
next_actions?: {
step: string | null;
status: string;
message: string | null;
code: string | null;
};
}
export async function fetchSiteBlueprints(filters?: {
site_id?: number;
@@ -2431,21 +2371,6 @@ export async function updateSiteBlueprint(id: number, data: Partial<SiteBlueprin
});
}
export async function fetchWizardContext(blueprintId: number): Promise<WizardContext> {
return fetchAPI(`/v1/site-builder/blueprints/${blueprintId}/workflow/context/`);
}
export async function updateWorkflowStep(
blueprintId: number,
step: string,
status: string,
metadata?: Record<string, any>
): Promise<WorkflowState> {
return fetchAPI(`/v1/site-builder/blueprints/${blueprintId}/workflow/step/`, {
method: 'POST',
body: JSON.stringify({ step, status, metadata }),
});
}
// Cluster attachment endpoints
export async function attachClustersToBlueprint(