mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-22 08:46:39 -06:00
Ensure that columns should be merged if the newly added column is present in the parent table. Fixes #6780
This commit is contained in:
parent
d2a7f7fffe
commit
c7cd57db91
@ -11,6 +11,7 @@ notes for it.
|
|||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
|
|
||||||
|
release_notes_6_2
|
||||||
release_notes_6_1
|
release_notes_6_1
|
||||||
release_notes_6_0
|
release_notes_6_0
|
||||||
release_notes_5_7
|
release_notes_5_7
|
||||||
|
21
docs/en_US/release_notes_6_2.rst
Normal file
21
docs/en_US/release_notes_6_2.rst
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
************
|
||||||
|
Version 6.2
|
||||||
|
************
|
||||||
|
|
||||||
|
Release date: 2021-11-18
|
||||||
|
|
||||||
|
This release contains a number of bug fixes and new features since the release of pgAdmin4 6.1.
|
||||||
|
|
||||||
|
New features
|
||||||
|
************
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Housekeeping
|
||||||
|
************
|
||||||
|
|
||||||
|
|
||||||
|
Bug fixes
|
||||||
|
*********
|
||||||
|
|
||||||
|
| `Issue #6780 <https://redmine.postgresql.org/issues/6780>`_ - Ensure that columns should be merged if the newly added column is present in the parent table.
|
@ -537,7 +537,24 @@ export default class TableSchema extends BaseUISchema {
|
|||||||
tabColsResponse.then((res)=>{
|
tabColsResponse.then((res)=>{
|
||||||
resolve((state)=>{
|
resolve((state)=>{
|
||||||
let finalCols = res.map((col)=>obj.columnsSchema.getNewData(col));
|
let finalCols = res.map((col)=>obj.columnsSchema.getNewData(col));
|
||||||
finalCols = [...state.columns, ...finalCols];
|
let currentSelectedCols = [];
|
||||||
|
if (!_.isEmpty(state.columns)){
|
||||||
|
currentSelectedCols = state.columns;
|
||||||
|
}
|
||||||
|
let colNameList = [];
|
||||||
|
state.columns.forEach((col=>{
|
||||||
|
colNameList.push(col.name);
|
||||||
|
}));
|
||||||
|
for (let col of Object.values(finalCols)) {
|
||||||
|
if(!colNameList.includes(col.name)){
|
||||||
|
currentSelectedCols.push(col);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!_.isEmpty(currentSelectedCols)){
|
||||||
|
finalCols = currentSelectedCols;
|
||||||
|
}
|
||||||
|
|
||||||
obj.changeColumnOptions(finalCols);
|
obj.changeColumnOptions(finalCols);
|
||||||
return {
|
return {
|
||||||
adding_inherit_cols: false,
|
adding_inherit_cols: false,
|
||||||
|
@ -277,10 +277,10 @@ describe('TableSchema', ()=>{
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
deferredPromise.then((depChange)=>{
|
deferredPromise.then((depChange)=>{
|
||||||
let finalCols = [newCol, newCol];
|
let finalCols = [newCol];
|
||||||
expect(depChange(state)).toEqual({
|
expect(depChange(state)).toEqual({
|
||||||
adding_inherit_cols: false,
|
adding_inherit_cols: false,
|
||||||
columns: [newCol, newCol],
|
columns: [newCol],
|
||||||
});
|
});
|
||||||
expect(schemaObj.changeColumnOptions).toHaveBeenCalledWith(finalCols);
|
expect(schemaObj.changeColumnOptions).toHaveBeenCalledWith(finalCols);
|
||||||
done();
|
done();
|
||||||
|
Loading…
Reference in New Issue
Block a user