Skip to content

Commit

Permalink
fix: 🐛 Fix bug merge conflit with pull MarquezProject#2525
Browse files Browse the repository at this point in the history
Signed-off-by: Xavier-Cliquennois <Xavier-Cliquennois@users.noreply.github.com>
Signed-off-by: Xavier-Cliquennois <xavier.cliquennois@wearegraphite.io>
  • Loading branch information
Xavier-Cliquennois authored and Xavier-Cliquennois committed Jul 26, 2023
1 parent cb1efe4 commit fa33830
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions web/src/components/lineage/Lineage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ export interface LineageProps extends StateProps, DispatchProps {}
let g: graphlib.Graph<MqNode>

const Lineage: React.FC<LineageProps> = (props: LineageProps) => {
console.log('Lineage props', props.depth)

React.useEffect(() => {
console.log('props.lineage', props.lineage)
}, [props.lineage])
Expand All @@ -156,6 +158,7 @@ const Lineage: React.FC<LineageProps> = (props: LineageProps) => {
const mounted = React.useRef<boolean>(false)

const prevLineage = React.useRef<LineageGraph>()
const prevDepth = React.useRef<number>()
const prevSelectedNode = React.useRef<string>()

React.useEffect(() => {
Expand All @@ -168,6 +171,7 @@ const Lineage: React.FC<LineageProps> = (props: LineageProps) => {
nodeName
)
props.setSelectedNode(nodeId)
console.log('depth in init', props.depth)
props.fetchLineage(
nodeType.toUpperCase() as JobOrDataset,
namespace,
Expand All @@ -179,7 +183,8 @@ const Lineage: React.FC<LineageProps> = (props: LineageProps) => {
} else {
// on update
if (
JSON.stringify(props.lineage) !== JSON.stringify(prevLineage.current) &&
(JSON.stringify(props.lineage) !== JSON.stringify(prevLineage.current) ||
props.depth !== prevDepth.current) &&
props.selectedNode
) {
g = initGraph()
Expand All @@ -191,7 +196,11 @@ const Lineage: React.FC<LineageProps> = (props: LineageProps) => {
})
})
}
if (props.selectedNode !== prevSelectedNode.current) {
if (
props.selectedNode !== prevSelectedNode.current
|| props.depth !== prevDepth.current
) {
console.log('depth in update', props.depth)
props.fetchLineage(
nodeType?.toUpperCase() as JobOrDataset,
namespace || '',
Expand All @@ -202,6 +211,7 @@ const Lineage: React.FC<LineageProps> = (props: LineageProps) => {
}

prevLineage.current = props.lineage
prevDepth.current = props.depth
prevSelectedNode.current = props.selectedNode
}
})
Expand Down

0 comments on commit fa33830

Please sign in to comment.