@ -83,6 +83,14 @@ const populateEdges = () => {
return acc
} , [ ] as ColumnType [ ] )
const edgeMMTableLabel = ( modelId : string ) => {
const mmModel = metasWithIdAsKey . value [ modelId ]
if ( mmModel . title !== mmModel . table _name ) {
return ` ${ mmModel . title } ( ${ mmModel . table _name } ) `
}
return mmModel . title
}
edges . value = ltarColumns . map ( ( column ) => {
const source = column . fk _model _id !
const target = ( column . colOptions as LinkToAnotherRecordType ) . fk _related _model _id !
@ -98,8 +106,7 @@ const populateEdges = () => {
sourceColumnId = ( column . colOptions as LinkToAnotherRecordType ) . fk _parent _column _id
targetColumnId = ( column . colOptions as LinkToAnotherRecordType ) . fk _child _column _id
edgeLabel =
config . showJunctionTableNames &&
metasWithIdAsKey . value [ ( column . colOptions as LinkToAnotherRecordType ) . fk _mm _model _id ! ] . table _name
config . showJunctionTableNames && edgeMMTableLabel ( ( column . colOptions as LinkToAnotherRecordType ) . fk _mm _model _id ! )
}
if ( source !== target ) dagreGraph . setEdge ( source , target )
@ -109,7 +116,7 @@ const populateEdges = () => {
/ / r e r e n d e r a f t e r 2 0 0 m s
setTimeout ( ( ) => {
vueFlowKey . value = 1
} , 20 0)
} , 35 0)
}
return {