File tree Expand file tree Collapse file tree 3 files changed +24
-18
lines changed
Expand file tree Collapse file tree 3 files changed +24
-18
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,22 @@ const getMinimalEdge = (relation: BaseRelationLineageResponseV1): Edge => {
4444 } ;
4545} ;
4646
47+ const getOutputEdgeColor = (
48+ relation : OutputRelationLineageResponseV1 ,
49+ ) : string => {
50+ for ( const type of relation . types ) {
51+ switch ( type ) {
52+ case "DROP" :
53+ case "TRUNCATE" :
54+ return "red" ;
55+ case "ALTER" :
56+ case "RENAME" :
57+ return "yellow" ;
58+ }
59+ }
60+ return "green" ;
61+ } ;
62+
4763const getOutputEdge = (
4864 relation : OutputRelationLineageResponseV1 ,
4965 raw_response : LineageResponseV1 ,
@@ -79,19 +95,7 @@ const getOutputEdge = (
7995 }
8096 }
8197
82- let color = "green" ;
83- switch ( relation . type ) {
84- case "DROP" :
85- case "TRUNCATE" :
86- color = "red" ;
87- break ;
88- case "ALTER" :
89- case "RENAME" :
90- color = "yellow" ;
91- break ;
92- default :
93- color = "green" ;
94- }
98+ const color = getOutputEdgeColor ( relation ) ;
9599
96100 // Too many animated edges is heavy load for browser
97101 const totalIOEdges =
Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ const IOEdge = ({
3939 return < ReactFlowBaseEdge id = { id } path = { edgePath } { ...props } /> ;
4040 }
4141
42+ const types = ( ( data . types ?? [ ] ) as string [ ] ) . map ( ( type ) =>
43+ translate ( `edges.ioTypes.${ type } ` , { _ : type } ) ,
44+ ) ;
45+
4246 return (
4347 < >
4448 < ReactFlowBaseEdge id = { id } path = { edgePath } { ...props } />
@@ -53,13 +57,11 @@ const IOEdge = ({
5357 } }
5458 className = { `nodrag nopan ${ selected ? "selected" : "" } ` }
5559 >
56- { data . type ? (
60+ { types . length ? (
5761 < Chip
5862 size = "small"
5963 color = "secondary"
60- label = { translate ( `edges.ioTypes.${ data . type } ` , {
61- _ : data . type ,
62- } ) }
64+ label = { types . join ( ", " ) }
6365 style = { props . labelStyle }
6466 />
6567 ) : null }
Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ type OutputRelationTypeLineageResponseV1 =
190190interface OutputRelationLineageResponseV1
191191 extends BaseRelationLineageResponseV1 {
192192 last_interaction_at : string ;
193- type : OutputRelationTypeLineageResponseV1 | null ;
193+ types : OutputRelationTypeLineageResponseV1 [ ] ;
194194 num_rows : number | null ;
195195 num_bytes : number | null ;
196196 num_files : number | null ;
You can’t perform that action at this time.
0 commit comments