mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Port browser tree to React. Fixes #6129
This commit is contained in:
committed by
Akshay Joshi
parent
d983225683
commit
483e2ca8d0
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
import Alertify from 'pgadmin.alertifyjs';
|
||||
import {getTreeNodeHierarchyFromIdentifier} from 'sources/tree/pgadmin_tree_node';
|
||||
import {getPanelTitle} from 'tools/datagrid/static/js/datagrid_panel_title';
|
||||
import {getRandomInt, registerDetachEvent} from 'sources/utils';
|
||||
|
||||
@@ -98,10 +97,9 @@ export function initialize(gettext, url_for, $, _, pgAdmin, csrfToken, pgBrowser
|
||||
return isEnabled;
|
||||
},
|
||||
|
||||
// Callback to draw schema diff for objects
|
||||
// Callback to draw ERD Tool for objects
|
||||
showErdTool: function(data, aciTreeIdentifier, gen=false) {
|
||||
const node = pgBrowser.treeMenu.findNodeByDomElement(aciTreeIdentifier);
|
||||
if (node === undefined || !node.getData()) {
|
||||
if (aciTreeIdentifier === undefined) {
|
||||
Alertify.alert(
|
||||
gettext('ERD Error'),
|
||||
gettext('No object selected.')
|
||||
@@ -109,10 +107,7 @@ export function initialize(gettext, url_for, $, _, pgAdmin, csrfToken, pgBrowser
|
||||
return;
|
||||
}
|
||||
|
||||
const parentData = getTreeNodeHierarchyFromIdentifier.call(
|
||||
pgBrowser,
|
||||
aciTreeIdentifier
|
||||
);
|
||||
const parentData = pgBrowser.tree.getTreeNodeHierarchy(aciTreeIdentifier);
|
||||
|
||||
if(_.isUndefined(parentData.database)) {
|
||||
Alertify.alert(
|
||||
|
||||
Reference in New Issue
Block a user