Fix multiple Query Tool, ERD title related issues.

This commit is contained in:
Aditya Toshniwal
2023-07-13 20:06:24 +05:30
parent de7eb73867
commit 4676961fc4
6 changed files with 13 additions and 11 deletions

View File

@@ -961,7 +961,7 @@ class ERDTool extends React.Component {
return (
<Box ref={this.containerRef} height="100%">
<ConnectionBar status={this.state.conn_status} bgcolor={this.props.params.bgcolor}
fgcolor={this.props.params.fgcolor} title={this.props.params.title}/>
fgcolor={this.props.params.fgcolor} title={_.unescape(this.props.params.title)}/>
<MainToolBar preferences={this.state.preferences} eventBus={this.eventBus}
fillColor={this.state.fill_color} textColor={this.state.text_color}
notation={this.state.cardinality_notation} onNotationChange={this.onNotationChange}

View File

@@ -331,7 +331,7 @@ export default class SQLEditor {
queryToolForm +=`
</form>
<script>
document.getElementById("title").value = "${_.escape(panel_title.replace('\\', '\\\\'))}";
document.getElementById("title").value = "${_.escape(panel_title)}";
document.getElementById("queryToolForm").submit();
</script>
`;

View File

@@ -95,6 +95,7 @@ export default function QueryToolComponent({params, pgWindow, pgAdmin, selectedN
connection_status_msg: '',
params: {
...params,
title: _.unescape(params.title),
is_query_tool: params.is_query_tool == 'true' ? true : false,
node_name: retrieveNodeName(selectedNodeInfo),
},
@@ -684,6 +685,7 @@ export default function QueryToolComponent({params, pgWindow, pgAdmin, selectedN
database: {
_id: selectedConn.did,
label: selectedConn.database_name,
_label: selectedConn.database_name,
},
};

View File

@@ -15,7 +15,7 @@ import Notify from '../../../../static/js/helpers/Notifier';
const pgAdmin = pgWindow.pgAdmin;
export function getDatabaseLabel(parentData) {
return parentData.database ? parentData.database.label
return parentData.database ? parentData.database._label
: parentData.server?.db;
}