Fixed an issue where exclusion constraint cannot be created from table dialog

if the access method name is changed once. Fixes #6900
This commit is contained in:
Aditya Toshniwal 2021-10-13 11:35:19 +05:30 committed by Akshay Joshi
parent 5b9383c880
commit 9ace229152
3 changed files with 10 additions and 4 deletions

View File

@ -28,3 +28,4 @@ Bug fixes
| `Issue #6828 <https://redmine.postgresql.org/issues/6828>`_ - Fixed an issue where the tree is not scrolling to the object selected from the search result.
| `Issue #6881 <https://redmine.postgresql.org/issues/6881>`_ - Fixed an issue where the browser tree doesn't show all contents on changing resolution.
| `Issue #6882 <https://redmine.postgresql.org/issues/6882>`_ - Ensure that columns should be displayed in the order of creation instead of alphabetical order in the browser tree.
| `Issue #6900 <https://redmine.postgresql.org/issues/6900>`_ - Fixed an issue where exclusion constraint cannot be created from table dialog if the access method name is changed once.

View File

@ -47,8 +47,9 @@ export default class DepListener {
/* Called when any field changed and trigger callbacks */
getDepChange(currPath, state, actionObj) {
if(actionObj.depChangeResolved) {
state = this._getListenerData(state, {callback: actionObj.depChangeResolved}, actionObj);
/* If this comes from deferred change */
if(actionObj.listener?.callback) {
state = this._getListenerData(state, actionObj.listener, actionObj);
} else {
let allListeners = _.filter(this._depListeners, (entry)=>_.join(currPath, '|').startsWith(_.join(entry.source, '|')));
if(allListeners) {
@ -71,6 +72,7 @@ export default class DepListener {
deferredList.push({
action: actionObj,
promise: thePromise,
listener: listener,
});
}
}

View File

@ -313,7 +313,7 @@ const getDepChange = (currPath, newState, oldState, action)=>{
path: action.path,
value: action.value,
oldState: _.cloneDeep(oldState),
depChangeResolved: action.depChangeResolved,
listener: action.listener,
});
}
return newState;
@ -480,7 +480,10 @@ function SchemaDialogView({
type: SCHEMA_STATE_ACTIONS.DEFERRED_DEPCHANGE,
path: item.action.path,
depChange: item.action.depChange,
depChangeResolved: resFunc,
listener: {
...item.listener,
callback: resFunc,
},
});
});
}