99 Popover ,
1010 MenuDivider ,
1111 NonIdealState ,
12- Intent
12+ Intent ,
13+ Tooltip ,
14+ Position
1315} from "@blueprintjs/core" ;
1416import {
1517 Details ,
@@ -42,6 +44,7 @@ import { useMutation, useLazyQuery } from "react-apollo";
4244import { RUNS_ROOT_QUERY , RunsQueryVariablesContext } from "./RunsRoot" ;
4345import PythonErrorInfo from "../PythonErrorInfo" ;
4446import { TokenizingFieldValue } from "../TokenizingField" ;
47+ import { REEXECUTE_PIPELINE_UNKNOWN } from "./RunActionButtons" ;
4548
4649interface RunTableProps {
4750 runs : RunTableRunFragment [ ] ;
@@ -59,6 +62,9 @@ const PipelineEnvironmentYamlQuery = gql`
5962 }
6063` ;
6164
65+ const OPEN_PLAYGROUND_UNKNOWN =
66+ "Playground is unavailable because the pipeline is not present in the current repository." ;
67+
6268export class RunTable extends React . Component < RunTableProps > {
6369 static fragments = {
6470 RunTableRunFragment : gql `
@@ -373,36 +379,50 @@ const RunActionsMenu: React.FunctionComponent<{
373379 />
374380 < MenuDivider />
375381
376- < MenuItem
377- text = "Open in Playground..."
378- disabled = { ! infoReady }
379- icon = "edit"
380- target = "_blank"
381- href = { `/playground/${ run . pipeline . name } /setup?${ qs . stringify ( {
382- mode : run . mode ,
383- config : envYaml ,
384- solidSubset :
385- run . pipeline . __typename === "Pipeline"
386- ? run . pipeline . solids . map ( s => s . name )
387- : [ ]
388- } ) } `}
389- />
390- < MenuItem
391- text = "Re-execute"
392- disabled = { ! infoReady }
393- icon = "repeat"
394- onClick = { async ( ) => {
395- const result = await reexecute ( {
396- variables : getReexecutionVariables ( {
397- run,
398- envYaml
399- } )
400- } ) ;
401- handleReexecutionResult ( run . pipeline . name , result , {
402- openInNewWindow : false
403- } ) ;
404- } }
405- />
382+ < Tooltip
383+ content = { OPEN_PLAYGROUND_UNKNOWN }
384+ position = { Position . BOTTOM }
385+ disabled = { infoReady }
386+ wrapperTagName = "div"
387+ >
388+ < MenuItem
389+ text = "Open in Playground..."
390+ disabled = { ! infoReady }
391+ icon = "edit"
392+ target = "_blank"
393+ href = { `/playground/${ run . pipeline . name } /setup?${ qs . stringify ( {
394+ mode : run . mode ,
395+ config : envYaml ,
396+ solidSubset :
397+ run . pipeline . __typename === "Pipeline"
398+ ? run . pipeline . solids . map ( s => s . name )
399+ : [ ]
400+ } ) } `}
401+ />
402+ </ Tooltip >
403+ < Tooltip
404+ content = { REEXECUTE_PIPELINE_UNKNOWN }
405+ position = { Position . BOTTOM }
406+ disabled = { infoReady }
407+ wrapperTagName = "div"
408+ >
409+ < MenuItem
410+ text = "Re-execute"
411+ disabled = { ! infoReady }
412+ icon = "repeat"
413+ onClick = { async ( ) => {
414+ const result = await reexecute ( {
415+ variables : getReexecutionVariables ( {
416+ run,
417+ envYaml
418+ } )
419+ } ) ;
420+ handleReexecutionResult ( run . pipeline . name , result , {
421+ openInNewWindow : false
422+ } ) ;
423+ } }
424+ />
425+ </ Tooltip >
406426 < MenuItem
407427 text = "Cancel"
408428 icon = "stop"
0 commit comments