@@ -2,20 +2,25 @@ import AlertCircle from "@/assets/icons/alert-circle.svg?react";
22import { StackInfo } from "@/components/stacks/info" ;
33import { usePipelineRun } from "@/data/pipeline-runs/pipeline-run-detail-query" ;
44import { useStack } from "@/data/stacks/stack-detail-query" ;
5- import { PipelineRun } from "@/types/pipeline-runs " ;
5+ import { useStepDetail } from "@/data/steps/step-detail-query " ;
66import { Skeleton } from "@zenml-io/react-component-library" ;
77import { useParams } from "react-router-dom" ;
88import { EmptyState } from "../../EmptyState" ;
99
10- export function StackTab ( ) {
10+ type Props = {
11+ stepId : string ;
12+ } ;
13+ export function StackTab ( { stepId } : Props ) {
1114 const { runId } = useParams ( ) as { runId : string } ;
1215
13- const run = usePipelineRun ( { runId : runId } , { throwOnError : true } ) ;
16+ const run = usePipelineRun ( { runId : runId } ) ;
17+ const step = useStepDetail ( { stepId : stepId } ) ;
1418
15- if ( run . isPending ) return < Skeleton className = "h-[250px] w-full" /> ;
16- if ( run . isError ) return < p > Something went wrong fetching the run</ p > ;
19+ if ( run . isPending || step . isPending ) return < Skeleton className = "h-[250px] w-full" /> ;
20+ if ( run . isError || step . isError ) return < p > Something went wrong fetching the run</ p > ;
1721
1822 const stackId = run . data ?. body ?. stack ?. id ;
23+ const config = ( step . data . metadata ?. config . settings as { [ key : string ] : any } | undefined ) || { } ;
1924
2025 if ( ! stackId )
2126 return (
@@ -29,14 +34,14 @@ export function StackTab() {
2934 </ EmptyState >
3035 ) ;
3136
32- return < StackTabContent run = { run . data } stackId = { stackId } /> ;
37+ return < StackTabContent objectConfig = { config } stackId = { stackId } /> ;
3338}
3439
3540type StackTabContentProps = {
3641 stackId : string ;
37- run : PipelineRun ;
42+ objectConfig : Record < string , any > ;
3843} ;
39- function StackTabContent ( { stackId, run } : StackTabContentProps ) {
44+ function StackTabContent ( { stackId, objectConfig } : StackTabContentProps ) {
4045 const { data, isError, isPending } = useStack ( { stackId : stackId } ) ;
4146
4247 if ( isPending ) return < Skeleton className = "h-[250px] w-full" /> ;
@@ -45,5 +50,5 @@ function StackTabContent({ stackId, run }: StackTabContentProps) {
4550 return < p > Failed to fetch Stack</ p > ;
4651 }
4752
48- return < StackInfo stack = { data } run = { run } /> ;
53+ return < StackInfo stack = { data } objectConfig = { objectConfig } /> ;
4954}
0 commit comments