Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
Lazy render subworkflows so the parent workflow does not error
Browse files Browse the repository at this point in the history
  • Loading branch information
mstier-nflx committed May 16, 2019
1 parent a8faa2b commit ee2489b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions ui/src/components/common/Grapher.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ class Grapher extends Component {
.on("click", function (v) {
if (innerGraph[v] != null) {
let data = vertices[v].data;

let n = innerGraph[v].edges;
let vx = innerGraph[v].vertices;
let renderedInnerGraph = innerGraph[v]();
let n = renderedInnerGraph.edges;
let vx = renderedInnerGraph.vertices;
let subg = {n: n, vx: vx, layout: layout};

p.propsDivElem.style.left = (window.innerWidth/2 + 100) + 'px';
Expand All @@ -176,7 +176,7 @@ class Grapher extends Component {
showSubGraph: true,
showSideBar: true,
subGraph: subg,
subGraphId: innerGraph[v].id
subGraphId: renderedInnerGraph.id
});
p.setState({showSubGraph: true});

Expand Down
10 changes: 6 additions & 4 deletions ui/src/components/workflow/WorkflowMetaDia.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import defaultTo from "lodash/fp/defaultTo"
class WorkflowMetaDia extends Component {
constructor(props) {
super(props);

this.state = WorkflowMetaDia.getGraphState(props);
}

Expand All @@ -18,9 +18,11 @@ class WorkflowMetaDia extends Component {
const subworkflows = {};

for (const refname in subwfs) {
let submeta = subwfs[refname].meta;
let subwfe = subwfs[refname].wfe;
subworkflows[refname] = wfe2graph.convert(subwfe, submeta);
let submeta = subwfs[refname].meta;
let subwfe = subwfs[refname].wfe;
subworkflows[refname] = () => {
return wfe2graph.convert(subwfe, submeta)
};
}

return { edges, vertices, subworkflows };
Expand Down

0 comments on commit ee2489b

Please sign in to comment.