public inbox for [email protected]
help / color / mirror / Atom feedFrom: Aditya Toshniwal <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin][RM6900] Unable to create exclusion constraint from table properties
Date: Tue, 12 Oct 2021 18:50:08 +0530
Message-ID: <CAM9w-_=gedmwV617Oq31dwdh1RFZq+4ugLuu4pw7Pto4RYX8AQ@mail.gmail.com> (raw)
Hi Hackers,
Attached patch fixes the issue where exclusion constraint cannot be created
from table dialog if the access method name is changed once.
The dialog is certainly not crashing, and not stuck. On access method
change, instead of removing ex const columns, it is removing table columns.
Please review.
--
Thanks,
Aditya Toshniwal
pgAdmin Hacker | Software Architect | *edbpostgres.com*
<http://edbpostgres.com;
"Don't Complain about Heat, Plant a TREE"
Attachments:
[application/octet-stream] RM6900.patch (2.0K, 3-RM6900.patch)
download | inline diff:
diff --git a/web/pgadmin/static/js/SchemaView/DepListener.js b/web/pgadmin/static/js/SchemaView/DepListener.js
index 84fdf77be..dd3418b1b 100644
--- a/web/pgadmin/static/js/SchemaView/DepListener.js
+++ b/web/pgadmin/static/js/SchemaView/DepListener.js
@@ -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,
});
}
}
diff --git a/web/pgadmin/static/js/SchemaView/index.jsx b/web/pgadmin/static/js/SchemaView/index.jsx
index d78ba7a7b..1f326f0da 100644
--- a/web/pgadmin/static/js/SchemaView/index.jsx
+++ b/web/pgadmin/static/js/SchemaView/index.jsx
@@ -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,
+ },
});
});
}
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: [pgAdmin][RM6900] Unable to create exclusion constraint from table properties
In-Reply-To: <CAM9w-_=gedmwV617Oq31dwdh1RFZq+4ugLuu4pw7Pto4RYX8AQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox