Skip to content

Commit d0ebac1

Browse files
added refresh button in DAG to call api again.
1 parent 354cee3 commit d0ebac1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/ui/components/lineage/index.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import StepNode from './StepNode';
1313

1414
import './index.css';
1515
import { Analysis, Data, Model, Schema, Service, Statistic } from './icons';
16+
import { useDispatch } from '../../hooks';
17+
import { runsActions } from '../../../redux/actions';
1618

1719
interface Edge {
1820
id: string;
@@ -109,6 +111,7 @@ const getLayoutedElements = (
109111
const nodeTypes = { step: StepNode, artifact: ArtifactNode };
110112

111113
export const LayoutFlow: React.FC<any> = (graph: any) => {
114+
const dispatch = useDispatch();
112115
const {
113116
initialNodes: layoutedNodes,
114117
initialEdges: layoutedEdges,
@@ -151,6 +154,18 @@ export const LayoutFlow: React.FC<any> = (graph: any) => {
151154
return (
152155
<>
153156
<div className="controls">
157+
<button
158+
onClick={() => {
159+
console.log('checkGraph', graph.graph.runId);
160+
dispatch(
161+
runsActions.graphForRun({
162+
runId: graph.graph.runId,
163+
}),
164+
);
165+
}}
166+
>
167+
Refresh
168+
</button>
154169
<button onClick={() => onLayout('TB')}>Vertical Layout</button>
155170
<button onClick={() => onLayout('LR')}>Horizontal Layout</button>
156171
<div style={{ position: 'relative' }}>

0 commit comments

Comments
 (0)