diff --git a/docs/en_US/release_notes.rst b/docs/en_US/release_notes.rst index 4b0f2cc31..38981cd2e 100644 --- a/docs/en_US/release_notes.rst +++ b/docs/en_US/release_notes.rst @@ -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 diff --git a/docs/en_US/release_notes_6_3.rst b/docs/en_US/release_notes_6_3.rst new file mode 100644 index 000000000..5c777702f --- /dev/null +++ b/docs/en_US/release_notes_6_3.rst @@ -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 `_ - Fixed an issue where referenced table drop-down should be disabled in foreign key -> columns after one row is added. diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.ui.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.ui.js index 4aae23bdb..7cfd3b5d4 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.ui.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.ui.js @@ -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}; }, },{