diff --git a/web/pgadmin/tools/psql/__init__.py b/web/pgadmin/tools/psql/__init__.py index cb4b4d092..feb20440d 100644 --- a/web/pgadmin/tools/psql/__init__.py +++ b/web/pgadmin/tools/psql/__init__.py @@ -108,7 +108,7 @@ def panel(trans_id): 'db': underscore_escape(data['db_name']), 'server_type': params['server_type'], 'is_enable': config.ENABLE_PSQL, - 'title': underscore_unescape(params['title']), + 'title': underscore_escape(params['title']), 'theme': params['theme'], 'o_db_name': underscore_escape(data['db_name']), 'role': underscore_escape(data['role']), diff --git a/web/pgadmin/tools/psql/static/js/PsqlModule.js b/web/pgadmin/tools/psql/static/js/PsqlModule.js index 2d3b6915b..3b309286a 100644 --- a/web/pgadmin/tools/psql/static/js/PsqlModule.js +++ b/web/pgadmin/tools/psql/static/js/PsqlModule.js @@ -143,14 +143,13 @@ export default class Psql { const [panelUrl, db_label] = this.getPanelUrls(transId, parentData); - const escapedTitle = _.escape(panelTitle); const open_new_tab = usePreferences.getState().getPreferencesForModule('browser').new_browser_tab_open; pgAdmin.Browser.Events.trigger( 'pgadmin:tool:show', `${BROWSER_PANELS.PSQL_TOOL}_${transId}`, panelUrl, - {title: escapedTitle, db: db_label}, + {title: panelTitle, db: db_label}, {title: panelTitle, icon: 'pg-font-icon icon-terminal', manualClose: false, renamable: true}, Boolean(open_new_tab?.includes('psql_tool')) ); @@ -190,7 +189,7 @@ export default class Psql { - + diff --git a/web/pgadmin/tools/sqleditor/__init__.py b/web/pgadmin/tools/sqleditor/__init__.py index 314a223dc..0e715fb3f 100644 --- a/web/pgadmin/tools/sqleditor/__init__.py +++ b/web/pgadmin/tools/sqleditor/__init__.py @@ -332,12 +332,14 @@ def panel(trans_id): params['layout'] = get_setting('SQLEditor/Layout') params['macros'] = get_user_macros() params['is_desktop_mode'] = current_app.PGADMIN_RUNTIME + params['title'] = underscore_escape(params['title']) + params['selectedNodeInfo'] = underscore_escape(params['selectedNodeInfo']) if 'database_name' in params: params['database_name'] = underscore_escape(params['database_name']) return render_template( "sqleditor/index.html", - title=underscore_unescape(params['title']), + title=underscore_escape(params['title']), params=json.dumps(params), ) diff --git a/web/pgadmin/tools/sqleditor/static/js/SQLEditorModule.js b/web/pgadmin/tools/sqleditor/static/js/SQLEditorModule.js index 262eb2aca..04ef3f449 100644 --- a/web/pgadmin/tools/sqleditor/static/js/SQLEditorModule.js +++ b/web/pgadmin/tools/sqleditor/static/js/SQLEditorModule.js @@ -221,7 +221,7 @@ export default class SQLEditor { 'pgadmin:tool:show', `${BROWSER_PANELS.QUERY_TOOL}_${trans_id}`, panel_url, - {...params, title: _.escape(panel_title.replace('\\', '\\\\')), selectedNodeInfo: JSON.stringify(selectedNodeInfo)}, + {...params, title: panel_title, selectedNodeInfo: JSON.stringify(selectedNodeInfo)}, {title: panel_title, icon: icon, tooltip: tooltip, renamable: true}, Boolean(open_new_tab?.includes('qt')) ); @@ -229,7 +229,7 @@ export default class SQLEditor { } async loadComponent(container, params) { - const selectedNodeInfo = params.selectedNodeInfo ? JSON.parse(params.selectedNodeInfo) : params.selectedNodeInfo; + const selectedNodeInfo = params.selectedNodeInfo ? JSON.parse(_.unescape(params.selectedNodeInfo)) : params.selectedNodeInfo; pgAdmin.Browser.keyboardNavigation.init(); await listenPreferenceBroadcast(); const root = ReactDOM.createRoot(container); diff --git a/web/pgadmin/tools/sqleditor/static/js/components/QueryToolDataGrid/index.jsx b/web/pgadmin/tools/sqleditor/static/js/components/QueryToolDataGrid/index.jsx index 57ec61295..1b007f2c3 100644 --- a/web/pgadmin/tools/sqleditor/static/js/components/QueryToolDataGrid/index.jsx +++ b/web/pgadmin/tools/sqleditor/static/js/components/QueryToolDataGrid/index.jsx @@ -448,6 +448,13 @@ export default function QueryToolDataGrid({columns, rows, totalRowCount, dataCha rowIdx }, true); } + + // This is needed to prevent Codemirror from triggering copy. + if(mode == 'SELECT' && (e.ctrlKey || e.metaKey) && e.key !== 'Control' && e.keyCode == 67) { + // taken care by handleCopy. + e.preventDefault(); + e.stopPropagation(); + } }} {...props} />