Fixed an issue where ERD auto-layout should: #6592 (#8167)

- Always generate right-angled links
- Switch port to Left/Right for the best link route.
This commit is contained in:
Aditya Toshniwal
2024-11-22 16:26:50 +05:30
committed by GitHub
parent ec197c68b8
commit 042888f5d7
9 changed files with 53 additions and 22 deletions

View File

@@ -3,7 +3,7 @@ import CustomPropTypes from '../../../../pgadmin/static/js/custom_prop_types';
export * from '@mui/material';
// mock popper
// eslint-disable-next-line no-unused-vars
export const Popper = React.forwardRef((props, _ref)=>{
const ele = useRef();
return <div ref={ele} data-test="material-popper">{props.children}</div>;

View File

@@ -2,7 +2,7 @@ import React, { useRef } from 'react';
import PropTypes from 'prop-types';
export * from 'react-data-grid';
// eslint-disable-next-line no-unused-vars
const ReactDataGrid = React.forwardRef((props, _ref)=>{
const ele = useRef();
return <div id={props.id} ref={ele} data-test="react-data-grid"/>;

View File

@@ -230,7 +230,7 @@ describe('ERDCore', ()=>{
}));
});
it('deserializeData', (done)=>{
it('deserializeData', ()=>{
let nodesDict = {};
TEST_TABLES_DATA.forEach((table)=>{
nodesDict[`id-${table.name}`] = {
@@ -269,11 +269,6 @@ describe('ERDCore', ()=>{
erdCoreObj.deserializeData(TEST_TABLES_DATA);
expect(erdCoreObj.addNode).toHaveBeenCalledTimes(TEST_TABLES_DATA.length);
expect(erdCoreObj.addLink).toHaveBeenCalledTimes(1);
setTimeout(()=>{
expect(erdCoreObj.dagreDistributeNodes).toHaveBeenCalled();
done();
}, 500);
});
it('clearSelection', ()=>{