Skip to content

Commit 8305eba

Browse files
mgasnerprha
authored andcommitted
[0.7.14] Add tooltip for disabled re-executions
Summary: Inform the user when a run cannot be reexecuted because the pipeline is not present in the current repository. {F140800} Test Plan: Manual Reviewers: max, sashank Reviewed By: max Subscribers: prha Differential Revision: https://dagster.phacility.com/D2984
1 parent eb9bf96 commit 8305eba

3 files changed

Lines changed: 53 additions & 32 deletions

File tree

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- Dagit now allows re-executing arbitrary step subset via step selector syntax, regardless of whether
88
the previous pipeline failed or not.
99
- Added a search filter for the root Assets page
10+
- Adds tooltip explanations for disabled run actions
1011

1112
**Bugfix**
1213

js_modules/dagit/src/runs/RunActionButtons.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const REEXECUTE_SUBSET_TITLE = `Selected Step Subset`;
3434
const REEXECUTE_FROM_FAILURE_TITLE = "From Failure";
3535

3636
// Descriptions of re-execute options
37-
const REEXECUTE_PIPELINE_UNKNOWN =
37+
export const REEXECUTE_PIPELINE_UNKNOWN =
3838
"Re-execute is unavailable because the pipeline is not present in the current repository.";
3939

4040
const REEXECUTE_FULL_PIPELINE_DESCRIPTION =

js_modules/dagit/src/runs/RunTable.tsx

Lines changed: 51 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ import {
99
Popover,
1010
MenuDivider,
1111
NonIdealState,
12-
Intent
12+
Intent,
13+
Tooltip,
14+
Position
1315
} from "@blueprintjs/core";
1416
import {
1517
Details,
@@ -42,6 +44,7 @@ import { useMutation, useLazyQuery } from "react-apollo";
4244
import { RUNS_ROOT_QUERY, RunsQueryVariablesContext } from "./RunsRoot";
4345
import PythonErrorInfo from "../PythonErrorInfo";
4446
import { TokenizingFieldValue } from "../TokenizingField";
47+
import { REEXECUTE_PIPELINE_UNKNOWN } from "./RunActionButtons";
4548

4649
interface 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+
6268
export 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

Comments
 (0)