11import { DockerImageCollapsible } from "@/app/runs/[id]/_Tabs/Configuration/DockerImageCollapsible" ;
22import { Codesnippet } from "@/components/CodeSnippet" ;
33import { CollapsibleCard } from "@/components/CollapsibleCard" ;
4- import { KeyValue } from "@/components/KeyValue" ;
54import { usePipelineBuild } from "@/data/pipeline-builds/all-pipeline-builds-query" ;
65import { usePipelineRun } from "@/data/pipeline-runs/pipeline-run-detail-query" ;
76import { useStepDetail } from "@/data/steps/step-detail-query" ;
8- import { renderAnyToString } from "@/lib/strings" ;
97import { AnyDict } from "@/types/common" ;
108import { BuildItemMap } from "@/types/pipeline-builds" ;
119import { Skeleton } from "@zenml-io/react-component-library" ;
12- import {
13- Tooltip ,
14- TooltipContent ,
15- TooltipProvider ,
16- TooltipTrigger
17- } from "@zenml-io/react-component-library/components/client" ;
1810import { useParams } from "react-router-dom" ;
1911import { ErrorFallback } from "../../Error" ;
2012import { NestedCollapsible } from "../../NestedCollapsible" ;
@@ -78,7 +70,11 @@ export function StepConfigTab({ stepId }: Props) {
7870
7971 return (
8072 < div className = "space-y-5" >
81- < KeyValueCard data = { data . metadata ?. config ?. parameters as AnyDict } title = "Parameters" />
73+ < NestedCollapsible
74+ isInitialOpen
75+ data = { data . metadata ?. config ?. parameters as AnyDict }
76+ title = "Parameters"
77+ />
8278 { dataImage ? < DockerImageCollapsible data = { dataImage } /> : null }
8379 < CodeSnippetCard id = { data . id } />
8480 < NestedCollapsible
@@ -91,40 +87,6 @@ export function StepConfigTab({ stepId }: Props) {
9187 ) ;
9288}
9389
94- export function KeyValueCard ( { data, title } : { title : string ; data : AnyDict } ) {
95- const hasData = Object . keys ( data ) . length > 0 ;
96-
97- if ( ! hasData )
98- return (
99- < CollapsibleCard initialOpen title = { title } >
100- < p className = "text-theme-text-secondary" > No data available</ p >
101- </ CollapsibleCard >
102- ) ;
103- return (
104- < CollapsibleCard initialOpen title = { title } >
105- < dl className = "grid grid-cols-1 gap-x-[10px] gap-y-2 md:grid-cols-3 md:gap-y-4" >
106- { Object . entries ( data ) . map (
107- ( [ key , value ] ) =>
108- typeof value !== "object" && (
109- < KeyValue
110- key = { key }
111- label = {
112- < TooltipProvider >
113- < Tooltip >
114- < TooltipTrigger className = "cursor-default truncate" > { key } </ TooltipTrigger >
115- < TooltipContent className = "max-w-[480px]" > { key } </ TooltipContent >
116- </ Tooltip >
117- </ TooltipProvider >
118- }
119- value = { < div > { renderAnyToString ( value ) } </ div > }
120- />
121- )
122- ) }
123- </ dl >
124- </ CollapsibleCard >
125- ) ;
126- }
127-
12890function CodeSnippetCard ( { id } : { id : string } ) {
12991 function returnConfigSchema ( id : string ) {
13092 return `from zenml.client import Client
0 commit comments