@@ -25,6 +25,7 @@ export const Relationships = ({ entity, search = "", onVisibleCountChange }: IRe
2525 const [ typeFilter , setTypeFilter ] = useState < string > ( "all" )
2626 const [ searchQuery , setSearchQuery ] = useState ( "" )
2727 const [ hideImplicitRelationships , setHideImplicitRelationships ] = useState < boolean > ( true )
28+ const [ hideOutOfSolutionRelationships , setHideOutOfSolutionRelationships ] = useState < boolean > ( true )
2829
2930 const theme = useTheme ( ) ;
3031
@@ -88,6 +89,11 @@ export const Relationships = ({ entity, search = "", onVisibleCountChange }: IRe
8889
8990 filteredRelationships = filteredRelationships . filter ( rel => rel . IsExplicit || ! hideImplicitRelationships ) ;
9091
92+ // Filter out relationships where related table is not in solution
93+ if ( hideOutOfSolutionRelationships ) {
94+ filteredRelationships = filteredRelationships . filter ( rel => isEntityInSolution ( rel . TableSchema ) ) ;
95+ }
96+
9197 if ( ! sortColumn || ! sortDirection ) return filteredRelationships
9298
9399 return [ ...filteredRelationships ] . sort ( ( a , b ) => {
@@ -225,6 +231,21 @@ export const Relationships = ({ entity, search = "", onVisibleCountChange }: IRe
225231 }
226232 </ Button >
227233 </ Tooltip >
234+ < Tooltip title = { hideOutOfSolutionRelationships ? "Show relationships to tables not in solution" : "Hide relationships to tables not in solution" } >
235+ < Button
236+ variant = "outlined"
237+ size = "small"
238+ onClick = { ( ) => setHideOutOfSolutionRelationships ( ! hideOutOfSolutionRelationships ) }
239+ className = "min-w-0 p-0 h-8 w-8 md:h-10 md:w-10"
240+ sx = { {
241+ borderColor : 'border.main'
242+ } }
243+ >
244+ {
245+ hideOutOfSolutionRelationships ? < ContentPasteOffRounded className = "text-xs md:text-base" /> : < ContentPasteSearchRounded className = "text-xs md:text-base" />
246+ }
247+ </ Button >
248+ </ Tooltip >
228249 { ( searchQuery || typeFilter !== "all" ) && (
229250 < Button
230251 variant = "text"
@@ -441,6 +462,8 @@ export const Relationships = ({ entity, search = "", onVisibleCountChange }: IRe
441462 </ TableCell >
442463 < TableCell className = "break-words py-1 md:py-1.5 text-xs md:text-sm" >
443464 { relationship . RelationshipSchema }
465+ { relationship . IntersectEntitySchemaName &&
466+ ( < Typography variant = "body2" className = "text-xs md:text-sm text-secondary" > < b > Intersecting table:</ b > { relationship . IntersectEntitySchemaName } </ Typography > ) }
444467 </ TableCell >
445468 </ TableRow >
446469 ) }
0 commit comments