Ensure that only the table node should be allowed to drop on the ERD tool. Fixes #6929

This commit is contained in:
Aditya Toshniwal
2021-10-19 12:01:43 +05:30
committed by Akshay Joshi
parent 9e3165c0ff
commit 9de1489322
3 changed files with 3 additions and 1 deletions

View File

@@ -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.'));