From 4244c908e55617e32f6fb8185590203a7307ae74 Mon Sep 17 00:00:00 2001 From: DaKheera47 Date: Mon, 15 Dec 2025 01:19:01 +0000 Subject: [PATCH] ensure that a "discovered" job must have a score --- orchestrator/src/client/App.tsx | 32 ----- orchestrator/src/client/api/client.ts | 13 +- orchestrator/src/client/components/Header.tsx | 106 ++++++++-------- .../src/client/components/JobList.tsx | 22 +--- orchestrator/src/server/api/routes.ts | 33 ----- .../src/server/pipeline/orchestrator.ts | 113 ++++-------------- orchestrator/src/server/pipeline/progress.ts | 12 +- orchestrator/src/server/repositories/jobs.ts | 16 ++- 8 files changed, 96 insertions(+), 251 deletions(-) diff --git a/orchestrator/src/client/App.tsx b/orchestrator/src/client/App.tsx index 60a363c..79f686f 100644 --- a/orchestrator/src/client/App.tsx +++ b/orchestrator/src/client/App.tsx @@ -26,7 +26,6 @@ export const App: React.FC = () => { const [isLoading, setIsLoading] = useState(true); const [isPipelineRunning, setIsPipelineRunning] = useState(false); const [processingJobId, setProcessingJobId] = useState(null); - const [isProcessingAll, setIsProcessingAll] = useState(false); const [pipelineSources, setPipelineSources] = useState(() => { try { const raw = localStorage.getItem(PIPELINE_SOURCES_STORAGE_KEY); @@ -159,35 +158,6 @@ export const App: React.FC = () => { } }; - const handleProcessAll = async () => { - try { - setIsProcessingAll(true); - const result = await api.processAllDiscovered(); - toast.message("Processing jobs", { description: `Processing ${result.count} jobs in background...` }); - - const pollInterval = setInterval(async () => { - try { - const data = await api.getJobs(); - setJobs(data.jobs); - setStats(data.byStatus); - - const stillDiscovered = data.byStatus.discovered + data.byStatus.processing; - if (stillDiscovered === 0) { - clearInterval(pollInterval); - setIsProcessingAll(false); - toast.success("All jobs processed"); - } - } catch { - // Ignore errors - } - }, 3000); - } catch (error) { - setIsProcessingAll(false); - const message = error instanceof Error ? error.message : "Failed to process jobs"; - toast.error(message); - } - }; - return ( <>
{ onApply={handleApply} onReject={handleReject} onProcess={handleProcess} - onProcessAll={handleProcessAll} processingJobId={processingJobId} - isProcessingAll={isProcessingAll} /> diff --git a/orchestrator/src/client/api/client.ts b/orchestrator/src/client/api/client.ts index 5f26054..6f09f0d 100644 --- a/orchestrator/src/client/api/client.ts +++ b/orchestrator/src/client/api/client.ts @@ -107,15 +107,4 @@ export async function clearDatabase(): Promise<{ }); } -// Bulk operations -export async function processAllDiscovered(): Promise<{ - message: string; - count: number; -}> { - return fetchApi<{ - message: string; - count: number; - }>('/jobs/process-discovered', { - method: 'POST', - }); -} +// Bulk operations (intentionally none - processing is manual) diff --git a/orchestrator/src/client/components/Header.tsx b/orchestrator/src/client/components/Header.tsx index 605e3f9..a34b5fd 100644 --- a/orchestrator/src/client/components/Header.tsx +++ b/orchestrator/src/client/components/Header.tsx @@ -112,62 +112,60 @@ export const Header: React.FC = ({ Refresh -
- + - - - + + + Sources + + {orderedSources.map((source) => ( + toggleSource(source, Boolean(checked))} > - - - - - Sources - - {orderedSources.map((source) => ( - toggleSource(source, Boolean(checked))} - > - {sourceLabel[source]} - - ))} - - onPipelineSourcesChange(orderedSources)}> - All sources - - onPipelineSourcesChange(["gradcracker"])}> - Gradcracker only - - onPipelineSourcesChange(["indeed", "linkedin"])}> - Indeed + LinkedIn only - - - -
+ {sourceLabel[source]} + + ))} + + onPipelineSourcesChange(orderedSources)}> + All sources + + onPipelineSourcesChange(["gradcracker"])}> + Gradcracker only + + onPipelineSourcesChange(["indeed", "linkedin"])}> + Indeed + LinkedIn only + + +
diff --git a/orchestrator/src/client/components/JobList.tsx b/orchestrator/src/client/components/JobList.tsx index 07ac840..23b1dac 100644 --- a/orchestrator/src/client/components/JobList.tsx +++ b/orchestrator/src/client/components/JobList.tsx @@ -3,7 +3,7 @@ */ import React, { useEffect, useMemo, useState } from "react"; -import { LayoutGrid, Loader2, RefreshCcw, Search, Table2 } from "lucide-react"; +import { LayoutGrid, Search, Table2 } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Card, CardContent } from "@/components/ui/card"; @@ -19,9 +19,7 @@ interface JobListProps { onApply: (id: string) => void; onReject: (id: string) => void; onProcess: (id: string) => void; - onProcessAll: () => void; processingJobId: string | null; - isProcessingAll: boolean; } type FilterTab = "ready" | "discovered" | "applied" | "all"; @@ -156,9 +154,7 @@ export const JobList: React.FC = ({ onApply, onReject, onProcess, - onProcessAll, processingJobId, - isProcessingAll, }) => { const [activeTab, setActiveTab] = useState("ready"); const [searchQuery, setSearchQuery] = useState(""); @@ -252,22 +248,6 @@ export const JobList: React.FC = ({
- {activeTab === "discovered" && counts.discovered > 0 && ( - - )} -