@@ -10,7 +10,9 @@ import PipelineIO from "@/components/shared/Execution/PipelineIO";
1010import { InfoBox } from "@/components/shared/InfoBox" ;
1111import { LoadingScreen } from "@/components/shared/LoadingScreen" ;
1212import { StatusBar } from "@/components/shared/Status" ;
13- import { TaskImplementation } from "@/components/shared/TaskDetails" ;
13+ import { useState } from "react" ;
14+
15+ import { Icon } from "@/components/ui/icon" ;
1416import { BlockStack , InlineStack } from "@/components/ui/layout" ;
1517import { Text } from "@/components/ui/typography" ;
1618import { useCheckComponentSpecFromPath } from "@/hooks/useCheckComponentSpecFromPath" ;
@@ -26,6 +28,10 @@ import {
2628 isExecutionComplete ,
2729} from "@/utils/executionStatus" ;
2830
31+ import { componentSpecToText } from "@/utils/yaml" ;
32+
33+ import TooltipButton from "../shared/Buttons/TooltipButton" ;
34+ import { CodeViewer } from "../shared/CodeViewer" ;
2935import { CancelPipelineRunButton } from "./components/CancelPipelineRunButton" ;
3036import { ClonePipelineButton } from "./components/ClonePipelineButton" ;
3137import { InspectPipelineButton } from "./components/InspectPipelineButton" ;
@@ -44,6 +50,8 @@ export const RunDetails = () => {
4450 } = useExecutionData ( ) ;
4551 const { data : currentUserDetails } = useUserDetails ( ) ;
4652
53+ const [ isYamlFullscreen , setIsYamlFullscreen ] = useState ( false ) ;
54+
4755 const editorRoute = componentSpec . name
4856 ? `/editor/${ encodeURIComponent ( componentSpec . name ) } `
4957 : "" ;
@@ -96,11 +104,13 @@ export const RunDetails = () => {
96104 const actions : ActionOrReactNode [ ] = [ ] ;
97105
98106 actions . push (
99- < TaskImplementation
100- displayName = { componentSpec . name ?? "Pipeline" }
101- componentSpec = { componentSpec }
102- showInlineContent = { false }
103- /> ,
107+ < TooltipButton
108+ variant = "outline"
109+ tooltip = "View YAML"
110+ onClick = { ( ) => setIsYamlFullscreen ( true ) }
111+ >
112+ < Icon name = "FileCodeCorner" />
113+ </ TooltipButton > ,
104114 ) ;
105115
106116 if ( canAccessEditorSpec && componentSpec . name ) {
@@ -128,56 +138,67 @@ export const RunDetails = () => {
128138 }
129139
130140 return (
131- < BlockStack gap = "6" className = "p-2 h-full" >
132- < CopyText className = "text-lg font-semibold" >
133- { componentSpec . name ?? "Unnamed Pipeline" }
134- </ CopyText >
135-
136- < ActionBlock actions = { actions } />
137-
138- { metadata && (
139- < ListBlock
140- title = "Run Info"
141- items = { [
142- { label : "Run Id" , value : metadata . id } ,
143- { label : "Execution Id" , value : metadata . root_execution_id } ,
144- { label : "Created by" , value : metadata . created_by ?? undefined } ,
145- {
146- label : "Created at" ,
147- value : metadata . created_at
148- ? new Date ( metadata . created_at ) . toLocaleString ( )
149- : undefined ,
150- } ,
151- ] }
152- marker = "none"
153- />
154- ) }
155-
156- { componentSpec . description && (
157- < TextBlock title = "Description" text = { componentSpec . description } />
158- ) }
159-
160- < ContentBlock title = "Status" >
161- < InlineStack gap = "2" blockAlign = "center" className = "mb-1" >
162- < Text size = "sm" weight = "semibold" >
163- { statusLabel }
164- </ Text >
165- </ InlineStack >
166- < StatusBar executionStatusStats = { executionStatusStats } />
167- </ ContentBlock >
168-
169- { Object . keys ( annotations ) . length > 0 && (
170- < ListBlock
171- title = "Annotations"
172- items = { Object . entries ( annotations ) . map ( ( [ key , value ] ) => ( {
173- label : key ,
174- value : String ( value ) ,
175- } ) ) }
176- marker = "none"
141+ < >
142+ < BlockStack gap = "6" className = "p-2 h-full" >
143+ < CopyText className = "text-lg font-semibold" >
144+ { componentSpec . name ?? "Unnamed Pipeline" }
145+ </ CopyText >
146+
147+ < ActionBlock actions = { actions } />
148+
149+ { metadata && (
150+ < ListBlock
151+ title = "Run Info"
152+ items = { [
153+ { label : "Run Id" , value : metadata . id } ,
154+ { label : "Execution Id" , value : metadata . root_execution_id } ,
155+ { label : "Created by" , value : metadata . created_by ?? undefined } ,
156+ {
157+ label : "Created at" ,
158+ value : metadata . created_at
159+ ? new Date ( metadata . created_at ) . toLocaleString ( )
160+ : undefined ,
161+ } ,
162+ ] }
163+ marker = "none"
164+ />
165+ ) }
166+
167+ { componentSpec . description && (
168+ < TextBlock title = "Description" text = { componentSpec . description } />
169+ ) }
170+
171+ < ContentBlock title = "Status" >
172+ < InlineStack gap = "2" blockAlign = "center" className = "mb-1" >
173+ < Text size = "sm" weight = "semibold" >
174+ { statusLabel }
175+ </ Text >
176+ </ InlineStack >
177+ < StatusBar executionStatusStats = { executionStatusStats } />
178+ </ ContentBlock >
179+
180+ { Object . keys ( annotations ) . length > 0 && (
181+ < ListBlock
182+ title = "Annotations"
183+ items = { Object . entries ( annotations ) . map ( ( [ key , value ] ) => ( {
184+ label : key ,
185+ value : String ( value ) ,
186+ } ) ) }
187+ marker = "none"
188+ />
189+ ) }
190+
191+ < PipelineIO readOnly />
192+ </ BlockStack >
193+ { isYamlFullscreen && (
194+ < CodeViewer
195+ code = { componentSpecToText ( componentSpec ) }
196+ language = "yaml"
197+ filename = { componentSpec . name ?? "pipeline.yaml" }
198+ isFullscreen = { isYamlFullscreen }
199+ onClose = { ( ) => setIsYamlFullscreen ( false ) }
177200 />
178201 ) }
179-
180- < PipelineIO readOnly />
181- </ BlockStack >
202+ </ >
182203 ) ;
183204} ;
0 commit comments