diff --git a/packages/zapp/console/src/components/Executions/ExecutionDetails/Timeline/ExecutionTimeline.tsx b/packages/zapp/console/src/components/Executions/ExecutionDetails/Timeline/ExecutionTimeline.tsx index e71eb0e02..b7d72ab85 100644 --- a/packages/zapp/console/src/components/Executions/ExecutionDetails/Timeline/ExecutionTimeline.tsx +++ b/packages/zapp/console/src/components/Executions/ExecutionDetails/Timeline/ExecutionTimeline.tsx @@ -83,6 +83,10 @@ export const ExecutionTimeline: React.FC = ({ chartTimezone, initialNod const nodeExecutionsById = useContext(NodeExecutionsByIdContext); const { chartInterval: chartTimeInterval } = useScaleContext(); + useEffect(() => { + setOriginalNodes(initialNodes); + }, [initialNodes]); + useEffect(() => { const plainNodes = convertToPlainNodes(originalNodes); const updatedShownNodesMap = plainNodes.map((node) => { diff --git a/packages/zapp/console/src/components/WorkflowGraph/WorkflowGraph.tsx b/packages/zapp/console/src/components/WorkflowGraph/WorkflowGraph.tsx index 5038160c2..d99c2bdc0 100644 --- a/packages/zapp/console/src/components/WorkflowGraph/WorkflowGraph.tsx +++ b/packages/zapp/console/src/components/WorkflowGraph/WorkflowGraph.tsx @@ -5,6 +5,7 @@ import { NonIdealState } from 'components/common/NonIdealState'; import { CompiledNode } from 'models/Node/types'; import { TaskExecutionPhase } from 'models/Execution/enums'; import { dNode } from 'models/Graph/types'; +import t from './strings'; export interface WorkflowGraphProps { onNodeSelectionChanged: (selectedNodes: string[]) => void; @@ -32,7 +33,12 @@ export const WorkflowGraph: React.FC = ({ initialNodes, }) => { if (error) { - return ; + return ; + } + + // If the dag is empty, show the message, instead of trying to display it + if (!mergedDag) { + return ; } return ( diff --git a/packages/zapp/console/src/components/WorkflowGraph/strings.ts b/packages/zapp/console/src/components/WorkflowGraph/strings.ts new file mode 100644 index 000000000..00e2364d5 --- /dev/null +++ b/packages/zapp/console/src/components/WorkflowGraph/strings.ts @@ -0,0 +1,9 @@ +import { createLocalizedString } from '@flyteconsole/locale'; + +const str = { + graphErrorTitle: 'Cannot render Workflow graph', + graphErrorEmptyGraph: 'The graph is empty', +}; + +export { patternKey } from '@flyteconsole/locale'; +export default createLocalizedString(str); diff --git a/packages/zapp/console/src/components/flytegraph/ReactFlow/transformDAGToReactFlowV2.tsx b/packages/zapp/console/src/components/flytegraph/ReactFlow/transformDAGToReactFlowV2.tsx index 9c499d793..13c52bf7e 100644 --- a/packages/zapp/console/src/components/flytegraph/ReactFlow/transformDAGToReactFlowV2.tsx +++ b/packages/zapp/console/src/components/flytegraph/ReactFlow/transformDAGToReactFlowV2.tsx @@ -236,6 +236,11 @@ export const buildGraphMapping = (props): ReactFlowGraphMapping => { const parse = (props: ParseProps) => { const { contextNode, contextParent, rootParentNode, nodeDataProps } = props; let context: ReactFlowGraph | null = null; + if (!contextNode) { + debug('\t graph parse: contextNode is ', contextNode); + return; + } + contextNode.nodes .filter((n) => !!n) .map((node: dNode) => {