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;
|
taskDirName: string;
|
||||||
context: Record<string, string>;
|
context: Record<string, string>;
|
||||||
cwd?: string;
|
cwd?: string;
|
||||||
|
onClose: () => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
const PipelineRunner = ({ taskDirName, context, cwd }: PipelineRunnerProps) => {
|
const PipelineRunner = ({ taskDirName, context, cwd, onClose }: PipelineRunnerProps) => {
|
||||||
const pipeline = usePipelineRunner();
|
const pipeline = usePipelineRunner();
|
||||||
|
const navigate = useNavigate();
|
||||||
const client = useClient();
|
const client = useClient();
|
||||||
const bottomRef = useRef<HTMLDivElement | null>(null);
|
const bottomRef = useRef<HTMLDivElement | null>(null);
|
||||||
const [inputDefs, setInputDefs] = useState<Record<string, TaskInputDef> | null>(null);
|
const [inputDefs, setInputDefs] = useState<Record<string, TaskInputDef> | null>(null);
|
||||||
@@ -1567,7 +1569,7 @@ const PipelineRunner = ({ taskDirName, context, cwd }: PipelineRunnerProps) => {
|
|||||||
{pipeline.jobId && (
|
{pipeline.jobId && (
|
||||||
<button
|
<button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onOpenChange(false);
|
onClose();
|
||||||
navigate(`/jobs/${pipeline.jobId}`);
|
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"
|
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 ? (
|
{isPipeline ? (
|
||||||
<PipelineRunner
|
<PipelineRunner
|
||||||
key="pipeline"
|
key="pipeline"
|
||||||
|
onClose={() => onOpenChange(false)}
|
||||||
taskDirName={task.dirName}
|
taskDirName={task.dirName}
|
||||||
context={autofillContext}
|
context={autofillContext}
|
||||||
cwd={
|
cwd={
|
||||||
|
|||||||
Reference in New Issue
Block a user