wire scan completion to pipeline page
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m50s
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m50s
After a scan completes, show a "Review in Pipeline →" link next to the status label. Nav already included the Pipeline entry from a prior task. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { useEffect, useRef, useState, useCallback } from 'react';
|
||||
import { Link } from '@tanstack/react-router';
|
||||
import { api } from '~/shared/lib/api';
|
||||
import { Button } from '~/shared/components/ui/button';
|
||||
import { Badge } from '~/shared/components/ui/badge';
|
||||
@@ -29,6 +30,7 @@ export function ScanPage() {
|
||||
const [limit, setLimit] = useState('');
|
||||
const [log, setLog] = useState<LogEntry[]>([]);
|
||||
const [statusLabel, setStatusLabel] = useState('');
|
||||
const [scanComplete, setScanComplete] = useState(false);
|
||||
const [currentItem, setCurrentItem] = useState('');
|
||||
const [progressScanned, setProgressScanned] = useState(0);
|
||||
const [progressTotal, setProgressTotal] = useState(0);
|
||||
@@ -58,6 +60,7 @@ export function ScanPage() {
|
||||
const d = b.complete;
|
||||
b.complete = null;
|
||||
setStatusLabel(`Scan complete — ${d.scanned ?? '?'} items, ${d.errors ?? 0} errors`);
|
||||
setScanComplete(true);
|
||||
setStatus((prev) => prev ? { ...prev, running: false } : prev);
|
||||
stopFlushing();
|
||||
}
|
||||
@@ -150,6 +153,7 @@ export function ScanPage() {
|
||||
setErrors(0);
|
||||
setCurrentItem('');
|
||||
setStatusLabel('Scan in progress…');
|
||||
setScanComplete(false);
|
||||
setStatus((prev) => prev ? { ...prev, running: true } : prev);
|
||||
bufRef.current = freshBuf();
|
||||
|
||||
@@ -179,6 +183,11 @@ export function ScanPage() {
|
||||
<div className="border border-gray-200 rounded-lg px-4 py-3 mb-6">
|
||||
<div className="flex items-center flex-wrap gap-2 mb-3">
|
||||
<span className="text-sm font-medium">{statusLabel || (running ? 'Scan in progress…' : 'Scan idle')}</span>
|
||||
{scanComplete && (
|
||||
<Link to="/pipeline" className="text-blue-600 hover:underline text-sm">
|
||||
Review in Pipeline →
|
||||
</Link>
|
||||
)}
|
||||
{running ? (
|
||||
<Button variant="secondary" size="sm" onClick={stopScan}>Stop</Button>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user