Files
pgadmin4/web/pgadmin/tools/erd/static/js/erd_tool/index.js
Aditya Toshniwal a92c1b43a2 1) Added support for advanced table fields like the foreign key, primary key in the ERD tool. Fixes #6081
2) Added index creation when generating SQL in the ERD tool. Fixes #6529
2021-10-11 17:42:14 +05:30

51 lines
1.2 KiB
JavaScript

/////////////////////////////////////////////////////////////
//
// pgAdmin 4 - PostgreSQL Tools
//
// Copyright (C) 2013 - 2021, The pgAdmin Development Team
// This software is released under the PostgreSQL Licence
//
//////////////////////////////////////////////////////////////
import React from 'react';
import ReactDOM from 'react-dom';
import _ from 'lodash';
import BodyWidget from './ui_components/BodyWidget';
import getDialog from './dialogs';
import Alertify from 'pgadmin.alertifyjs';
import pgWindow from 'sources/window';
import pgAdmin from 'sources/pgadmin';
export default class ERDTool {
constructor(container, params) {
this.container = document.querySelector(container);
this.params = params;
}
getPreferencesForModule() {
}
render() {
/* Mount the React ERD tool to the container */
let panel = null;
_.each(pgWindow.pgAdmin.Browser.docker.findPanels('frm_erdtool'), function(p) {
if (p.isVisible()) {
panel = p;
}
});
ReactDOM.render(
<BodyWidget
params={this.params}
getDialog={getDialog}
pgWindow={pgWindow}
pgAdmin={pgAdmin}
panel={panel}
alertify={Alertify} />,
this.container
);
}
}