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

@@ -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,
},
});
});
}