Fixed following issues in ERD:

1) After opening an existing project, the first table is already selected but the edit, clone, delete buttons are disabled.
 2) ERD project title gets changed when 2 ERD projects are open & anyone of it edited.
 3) Closing the ERD tab does not ask for a confirmation pop-up.
 4) Shortcut for 'Show more/Fewer details' is missing.
 5) Deleting the primary key does not delete associated links.
 6) The long table & schema name are getting out of the box.
 7) The long table name in the notes pop-up needs re-alignment.
 8) The same table name present in ERD/canvas is allowed in Add Table dialogue. Added validation in the dialog.
 9) Download image option is added, but it is not perfect yet. Image icons (table, schema, etc.) are not showing up.
 10) Rename panel option should be disabled by default. It should be enabled for the tools which implement rename functionality.
 11) The Toolbar is not visible in Safari for the ERD tool.

refs #1802
This commit is contained in:
Aditya Toshniwal
2021-01-25 17:29:54 +05:30
committed by Akshay Joshi
parent 446c2a19a5
commit 13db981445
20 changed files with 589 additions and 185 deletions

View File

@@ -73,7 +73,10 @@ describe('ERD TableNodeModel', ()=>{
});
describe('setData', ()=>{
let existPort = jasmine.createSpyObj('port', ['removeAllLinks']);
let existPort = jasmine.createSpyObj('port', {
'removeAllLinks': jasmine.createSpy('removeAllLinks'),
'getSubtype': 'notset',
});
beforeEach(()=>{
modelObj._data.columns = [
@@ -93,6 +96,7 @@ describe('ERD TableNodeModel', ()=>{
});
it('add columns', ()=>{
spyOn(existPort, 'getSubtype').and.returnValue('many');
existPort.removeAllLinks.calls.reset();
modelObj.setData({
name: 'noname',
@@ -118,29 +122,31 @@ describe('ERD TableNodeModel', ()=>{
});
it('update columns', ()=>{
spyOn(existPort, 'getSubtype').and.returnValue('many');
existPort.removeAllLinks.calls.reset();
modelObj.setData({
name: 'noname',
schema: 'erd',
columns: [
{name: 'col1', not_null:false, attnum: 0},
{name: 'col2updated', not_null:false, attnum: 1},
{name: 'col3', not_null:true, attnum: 2},
{name: 'col1', not_null:false, attnum: 0, is_primary_key: false},
{name: 'col2updated', not_null:false, attnum: 1, is_primary_key: false},
{name: 'col3', not_null:true, attnum: 2, is_primary_key: false},
],
});
expect(modelObj.getData()).toEqual({
name: 'noname',
schema: 'erd',
columns: [
{name: 'col1', not_null:false, attnum: 0},
{name: 'col2updated', not_null:false, attnum: 1},
{name: 'col3', not_null:true, attnum: 2},
{name: 'col1', not_null:false, attnum: 0, is_primary_key: false},
{name: 'col2updated', not_null:false, attnum: 1, is_primary_key: false},
{name: 'col3', not_null:true, attnum: 2, is_primary_key: false},
],
});
expect(existPort.removeAllLinks).not.toHaveBeenCalled();
});
it('remove columns', ()=>{
spyOn(existPort, 'getSubtype').and.returnValue('one');
existPort.removeAllLinks.calls.reset();
modelObj.setData({
name: 'noname',

View File

@@ -41,6 +41,10 @@ let pgAdmin = {
},
};
let pgWindow = {
pgAdmin: pgAdmin,
};
let alertify = jasmine.createSpyObj('alertify', {
'success': null,
'error': null,
@@ -124,7 +128,7 @@ describe('ERD BodyWidget', ()=>{
beforeEach(()=>{
jasmineEnzyme();
body = mount(<BodyWidget params={params} pgAdmin={pgAdmin} getDialog={getDialog} transformToSupported={()=>{}} alertify={alertify}/>);
body = mount(<BodyWidget params={params} pgAdmin={pgAdmin} pgWindow={pgWindow} getDialog={getDialog} transformToSupported={()=>{}} alertify={alertify}/>);
bodyInstance = body.instance();
});
@@ -248,7 +252,7 @@ describe('ERD BodyWidget', ()=>{
bodyInstance.addEditNode();
expect(tableDialog.show).toHaveBeenCalled();
let saveCallback = tableDialog.show.calls.mostRecent().args[5];
let saveCallback = tableDialog.show.calls.mostRecent().args[6];
let newData = {key: 'value'};
saveCallback(newData);
expect(bodyInstance.diagram.addNode).toHaveBeenCalledWith(newData);
@@ -263,7 +267,7 @@ describe('ERD BodyWidget', ()=>{
bodyInstance.addEditNode(node);
expect(tableDialog.show).toHaveBeenCalled();
saveCallback = tableDialog.show.calls.mostRecent().args[5];
saveCallback = tableDialog.show.calls.mostRecent().args[6];
newData = {key: 'value'};
saveCallback(newData);
expect(node.setData).toHaveBeenCalledWith(newData);