mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-22 08:46:39 -06:00
Fixed an issue where referenced table drop-down should be disabled in
foreign key -> columns after one row is added. Fixes #6906
This commit is contained in:
parent
e1020aefdd
commit
3d5d507f4b
@ -11,6 +11,7 @@ notes for it.
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
release_notes_6_3
|
||||
release_notes_6_2
|
||||
release_notes_6_1
|
||||
release_notes_6_0
|
||||
|
20
docs/en_US/release_notes_6_3.rst
Normal file
20
docs/en_US/release_notes_6_3.rst
Normal file
@ -0,0 +1,20 @@
|
||||
************
|
||||
Version 6.3
|
||||
************
|
||||
|
||||
Release date: 2021-12-16
|
||||
|
||||
This release contains a number of bug fixes and new features since the release of pgAdmin4 6.2.
|
||||
|
||||
New features
|
||||
************
|
||||
|
||||
|
||||
Housekeeping
|
||||
************
|
||||
|
||||
|
||||
Bug fixes
|
||||
*********
|
||||
|
||||
| `Issue #6906 <https://redmine.postgresql.org/issues/6906>`_ - Fixed an issue where referenced table drop-down should be disabled in foreign key -> columns after one row is added.
|
@ -37,6 +37,7 @@ class ForeignKeyHeaderSchema extends BaseUISchema {
|
||||
local_column: undefined,
|
||||
references: undefined,
|
||||
referenced: undefined,
|
||||
_disable_references: false,
|
||||
});
|
||||
|
||||
this.fieldOptions = fieldOptions;
|
||||
@ -48,12 +49,12 @@ class ForeignKeyHeaderSchema extends BaseUISchema {
|
||||
}
|
||||
|
||||
addDisabled(state) {
|
||||
return !(state.local_column && state.references && state.referenced);
|
||||
return !(state.local_column && (state.references || this.origData.references) && state.referenced);
|
||||
}
|
||||
|
||||
/* Data to ForeignKeyColumnSchema will added using the header form */
|
||||
getNewData(data) {
|
||||
let references_table_name = _.find(this.refTables, (t)=>t.value==data.references)?.label;
|
||||
let references_table_name = _.find(this.refTables, (t)=>t.value==data.references || t.value == this.origData.references)?.label;
|
||||
return {
|
||||
local_column: data.local_column,
|
||||
referenced: data.referenced,
|
||||
@ -73,6 +74,9 @@ class ForeignKeyHeaderSchema extends BaseUISchema {
|
||||
options: this.fieldOptions.references,
|
||||
optionsReloadBasis: this.fieldOptions.references?.map ? _.join(this.fieldOptions.references.map((c)=>c.label), ',') : null,
|
||||
optionsLoaded: (rows)=>obj.refTables=rows,
|
||||
disabled: (state) => {
|
||||
return state._disable_references ? true : false;
|
||||
}
|
||||
},{
|
||||
id: 'referenced', label: gettext('Referencing'), editable: false, deps: ['references'],
|
||||
type: (state)=>{
|
||||
@ -82,6 +86,9 @@ class ForeignKeyHeaderSchema extends BaseUISchema {
|
||||
optionsReloadBasis: state.references,
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
id: '_disable_references', label: '', type: 'switch', visible: false
|
||||
}];
|
||||
}
|
||||
}
|
||||
@ -358,6 +365,12 @@ export default class ForeignKeySchema extends BaseUISchema {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(actionObj.type == SCHEMA_STATE_ACTIONS.ADD_ROW) {
|
||||
obj.fkHeaderSchema.origData.references = null;
|
||||
// Set references value.
|
||||
obj.fkHeaderSchema.origData.references = obj.fkHeaderSchema.sessData.references;
|
||||
obj.fkHeaderSchema.origData._disable_references = true;
|
||||
}
|
||||
return {columns: currColumns};
|
||||
},
|
||||
},{
|
||||
|
Loading…
Reference in New Issue
Block a user