@@ -9,18 +9,18 @@ import History from '@spectrum-icons/workflow/History';
9
9
import InfoOutline from '@spectrum-icons/workflow/InfoOutline' ;
10
10
import Print from '@spectrum-icons/workflow/Print' ;
11
11
import { useState } from 'react' ;
12
- import { useParams } from 'react-router-dom' ;
12
+ import { useNavigate , useParams } from 'react-router-dom' ;
13
+ import CodeEditor from '../components/CodeEditor.tsx' ;
13
14
import ExecutableIdValue from '../components/ExecutableIdValue' ;
14
15
import ExecutionAbortButton from '../components/ExecutionAbortButton' ;
15
16
import ExecutionCopyOutputButton from '../components/ExecutionCopyOutputButton' ;
16
17
import ExecutionProgressBar from '../components/ExecutionProgressBar' ;
17
18
import ExecutionStatusBadge from '../components/ExecutionStatusBadge' ;
18
- import CodeEditor from '../components/CodeEditor.tsx' ;
19
19
import { appState } from '../hooks/app.ts' ;
20
20
import { useExecutionPolling } from '../hooks/execution' ;
21
21
import { useFormatter } from '../hooks/formatter' ;
22
22
import { useNavigationTab } from '../hooks/navigation' ;
23
- import { isExecutionPending } from '../utils/api.types' ;
23
+ import { isExecutableScript , isExecutionPending } from '../utils/api.types' ;
24
24
import { Objects } from '../utils/objects' ;
25
25
import { ToastTimeoutQuick } from '../utils/spectrum.ts' ;
26
26
@@ -30,6 +30,7 @@ const ExecutionView = () => {
30
30
const [ autoscrollOutput , setAutoscrollOutput ] = useState < boolean > ( true ) ;
31
31
const { execution, setExecution, loading } = useExecutionPolling ( executionId , appState . value . spaSettings . executionPollInterval ) ;
32
32
const [ selectedTab , handleTabChange ] = useNavigationTab ( 'details' ) ;
33
+ const navigate = useNavigate ( ) ;
33
34
34
35
if ( loading ) {
35
36
return (
@@ -150,6 +151,12 @@ const ExecutionView = () => {
150
151
< ButtonGroup >
151
152
< ExecutionAbortButton execution = { execution } onComplete = { setExecution } />
152
153
< ExecutionCopyOutputButton output = { executionOutput } />
154
+ { isExecutableScript ( execution . executable . id ) && (
155
+ < Button variant = "secondary" style = "fill" onPress = { ( ) => navigate ( `/scripts/view/${ encodeURIComponent ( execution ?. executable . id ) } ` ) } >
156
+ < FileCode />
157
+ < Text > Show in scripts</ Text >
158
+ </ Button >
159
+ ) }
153
160
</ ButtonGroup >
154
161
< Switch isSelected = { autoscrollOutput } isDisabled = { ! isExecutionPending ( execution . status ) } marginStart = { 20 } onChange = { ( ) => setAutoscrollOutput ( ( prev ) => ! prev ) } >
155
162
< Text > Autoscroll</ Text >
0 commit comments