mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -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:
committed by
Akshay Joshi
parent
d2a7f7fffe
commit
c7cd57db91
@@ -537,7 +537,24 @@ export default class TableSchema extends BaseUISchema {
|
||||
tabColsResponse.then((res)=>{
|
||||
resolve((state)=>{
|
||||
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);
|
||||
return {
|
||||
adding_inherit_cols: false,
|
||||
|
||||
Reference in New Issue
Block a user