fix ReferenceError in the pipeline "View in Jobs" button
The handler called onOpenChange and navigate, neither of which is in scope in PipelineRunner — they belong to TaskRunnerModal, declared further down. Clicking the button after a pipeline finished threw instead of navigating. PipelineRunner now takes an onClose prop and calls useNavigate itself. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
044aacf4d5
commit
85596da086
+5
-2
@@ -1267,10 +1267,12 @@ type PipelineRunnerProps = {
|
||||
taskDirName: string;
|
||||
context: Record<string, string>;
|
||||
cwd?: string;
|
||||
onClose: () => void;
|
||||
};
|
||||
|
||||
const PipelineRunner = ({ taskDirName, context, cwd }: PipelineRunnerProps) => {
|
||||
const PipelineRunner = ({ taskDirName, context, cwd, onClose }: PipelineRunnerProps) => {
|
||||
const pipeline = usePipelineRunner();
|
||||
const navigate = useNavigate();
|
||||
const client = useClient();
|
||||
const bottomRef = useRef<HTMLDivElement | null>(null);
|
||||
const [inputDefs, setInputDefs] = useState<Record<string, TaskInputDef> | null>(null);
|
||||
@@ -1567,7 +1569,7 @@ const PipelineRunner = ({ taskDirName, context, cwd }: PipelineRunnerProps) => {
|
||||
{pipeline.jobId && (
|
||||
<button
|
||||
onClick={() => {
|
||||
onOpenChange(false);
|
||||
onClose();
|
||||
navigate(`/jobs/${pipeline.jobId}`);
|
||||
}}
|
||||
className="flex items-center gap-1.5 text-xs text-duck-teal hover:text-duck-teal/80 transition-colors mt-1 cursor-pointer"
|
||||
@@ -1679,6 +1681,7 @@ export const TaskRunnerModal = ({
|
||||
{isPipeline ? (
|
||||
<PipelineRunner
|
||||
key="pipeline"
|
||||
onClose={() => onOpenChange(false)}
|
||||
taskDirName={task.dirName}
|
||||
context={autofillContext}
|
||||
cwd={
|
||||
|
||||
Reference in New Issue
Block a user