|
|
@ -100,7 +100,8 @@ const populateEdges = () => { |
|
|
|
const source = column.fk_model_id! |
|
|
|
const source = column.fk_model_id! |
|
|
|
const target = (column.colOptions as LinkToAnotherRecordType).fk_related_model_id! |
|
|
|
const target = (column.colOptions as LinkToAnotherRecordType).fk_related_model_id! |
|
|
|
|
|
|
|
|
|
|
|
let sourceColumnId, targetColumnId, edgeLabel |
|
|
|
let sourceColumnId, targetColumnId |
|
|
|
|
|
|
|
let edgeLabel = '' |
|
|
|
|
|
|
|
|
|
|
|
if ((column.colOptions as LinkToAnotherRecordType).type === 'hm') { |
|
|
|
if ((column.colOptions as LinkToAnotherRecordType).type === 'hm') { |
|
|
|
sourceColumnId = (column.colOptions as LinkToAnotherRecordType).fk_child_column_id |
|
|
|
sourceColumnId = (column.colOptions as LinkToAnotherRecordType).fk_child_column_id |
|
|
@ -110,14 +111,15 @@ const populateEdges = () => { |
|
|
|
if ((column.colOptions as LinkToAnotherRecordType).type === 'mm') { |
|
|
|
if ((column.colOptions as LinkToAnotherRecordType).type === 'mm') { |
|
|
|
sourceColumnId = (column.colOptions as LinkToAnotherRecordType).fk_parent_column_id |
|
|
|
sourceColumnId = (column.colOptions as LinkToAnotherRecordType).fk_parent_column_id |
|
|
|
targetColumnId = (column.colOptions as LinkToAnotherRecordType).fk_child_column_id |
|
|
|
targetColumnId = (column.colOptions as LinkToAnotherRecordType).fk_child_column_id |
|
|
|
edgeLabel = |
|
|
|
edgeLabel = config.showJunctionTableNames |
|
|
|
config.showJunctionTableNames && edgeMMTableLabel((column.colOptions as LinkToAnotherRecordType).fk_mm_model_id!) |
|
|
|
? edgeMMTableLabel((column.colOptions as LinkToAnotherRecordType).fk_mm_model_id!) |
|
|
|
|
|
|
|
: '' |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (source !== target) dagreGraph.setEdge(source, target) |
|
|
|
if (source !== target) dagreGraph.setEdge(source, target) |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
id: `e-${sourceColumnId}-${source}-${targetColumnId}-${target}`, |
|
|
|
id: `e-${sourceColumnId}-${source}-${targetColumnId}-${target}-#${edgeLabel}`, |
|
|
|
source: `${source}`, |
|
|
|
source: `${source}`, |
|
|
|
target: `${target}`, |
|
|
|
target: `${target}`, |
|
|
|
sourceHandle: `s-${sourceColumnId}-${source}`, |
|
|
|
sourceHandle: `s-${sourceColumnId}-${source}`, |
|
|
|