public inbox for [email protected]
help / color / mirror / Atom feedFrom: Aditya Toshniwal <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin][RM6929] Error Message displayed if user drag sequence in ERD
Date: Tue, 19 Oct 2021 10:33:08 +0530
Message-ID: <CAM9w-_kGhkyZijFgPnq5=YNLvZx+ZYygo7Ko6B6MuS4+bwSKzw@mail.gmail.com> (raw)
Hi Hackers,
Please review the attached patch which will not allow one to drop any node
except table on ERD.
--
Thanks,
Aditya Toshniwal
pgAdmin Hacker | Software Architect | *edbpostgres.com*
<http://edbpostgres.com;
"Don't Complain about Heat, Plant a TREE"
Attachments:
[application/octet-stream] RM6929.patch (1.4K, 3-RM6929.patch)
download | inline diff:
diff --git a/web/pgadmin/browser/static/js/browser.js b/web/pgadmin/browser/static/js/browser.js
index f88fb6584..3d86c96f7 100644
--- a/web/pgadmin/browser/static/js/browser.js
+++ b/web/pgadmin/browser/static/js/browser.js
@@ -68,6 +68,7 @@ define('pgadmin.browser', [
return {
text: text,
objUrl: generateNodeUrl.call(pgBrowser.Nodes[data._type], treeNodeInfo, 'properties', data, true),
+ nodeType: data._type,
cur: {
from: text.length,
to: text.length,
diff --git a/web/pgadmin/tools/erd/static/js/erd_tool/ui_components/BodyWidget.jsx b/web/pgadmin/tools/erd/static/js/erd_tool/ui_components/BodyWidget.jsx
index 106ba4989..cb5f1e2be 100644
--- a/web/pgadmin/tools/erd/static/js/erd_tool/ui_components/BodyWidget.jsx
+++ b/web/pgadmin/tools/erd/static/js/erd_tool/ui_components/BodyWidget.jsx
@@ -371,7 +371,7 @@ export default class BodyWidget extends React.Component {
onDropNode(e) {
let nodeDropData = JSON.parse(e.dataTransfer.getData('text'));
- if(nodeDropData.objUrl) {
+ if(nodeDropData.objUrl && nodeDropData.nodeType === 'table') {
let matchUrl = `/${this.props.params.sgid}/${this.props.params.sid}/${this.props.params.did}/`;
if(nodeDropData.objUrl.indexOf(matchUrl) == -1) {
this.props.alertify.error(gettext('Cannot drop table from outside of the current database.'));
view thread (2+ messages) latest in thread
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][RM6929] Error Message displayed if user drag sequence in ERD
In-Reply-To: <CAM9w-_kGhkyZijFgPnq5=YNLvZx+ZYygo7Ko6B6MuS4+bwSKzw@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