Fixed an issue where dynamic tab title has not applied the first time for debugger panel. Fixes #5978

This commit is contained in:
Nikhil Mohite 2020-11-19 10:25:20 +05:30 committed by Akshay Joshi
parent 5839e7cda8
commit 17ce84dd0a
5 changed files with 23 additions and 14 deletions

View File

@ -18,5 +18,6 @@ Bug fixes
*********
| `Issue #5974 <https://redmine.postgresql.org/issues/5974>`_ - Fixed an issue where the debugger's custom tab title not applied when opened in the new browser tab.
| `Issue #5978 <https://redmine.postgresql.org/issues/5978>`_ - Fixed an issue where dynamic tab title has not applied the first time for debugger panel.
| `Issue #5983 <https://redmine.postgresql.org/issues/5983>`_ - Added the appropriate server icon based on the server type in the new connection dialog.
| `Issue #5985 <https://redmine.postgresql.org/issues/5985>`_ - Fixed an issue where the process watcher dialog throws an error for the database server which is already removed.

View File

@ -539,6 +539,7 @@ def check_debugger_enabled(conn, ret_status):
:param ret_status:
:return:
"""
msg = ''
status_in, rid_tar = conn.execute_scalar(
"SELECT count(*) FROM pg_proc WHERE "
"proname = 'pldbg_get_target_info'"

View File

@ -11,11 +11,13 @@ define([
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
'alertify', 'sources/pgadmin', 'pgadmin.browser',
'backbone', 'pgadmin.backgrid', 'codemirror', 'pgadmin.backform',
'pgadmin.tools.debugger.ui', 'pgadmin.tools.debugger.utils', 'sources/utils',
'pgadmin.tools.debugger.ui', 'pgadmin.tools.debugger.utils',
'tools/datagrid/static/js/show_query_tool', 'sources/utils',
'wcdocker', 'pgadmin.browser.frame',
], function(
gettext, url_for, $, _, Alertify, pgAdmin, pgBrowser, Backbone, Backgrid,
CodeMirror, Backform, get_function_arguments, debuggerUtils, pgadminUtils,
CodeMirror, Backform, get_function_arguments, debuggerUtils, showQueryTool,
pgadminUtils,
) {
var pgTools = pgAdmin.Tools = pgAdmin.Tools || {},
wcDocker = window.wcDocker;
@ -427,7 +429,8 @@ define([
panel = pgBrowser.docker.addPanel(
'frm_debugger', wcDocker.DOCK.STACKED, dashboardPanel[0]
);
debuggerUtils.setDebuggerTitle(panel, browser_preferences, treeInfo.function.label, treeInfo.schema.label, treeInfo.database.label);
var label = treeInfo.function ? treeInfo.function.label : treeInfo.procedure.label;
debuggerUtils.setDebuggerTitle(panel, browser_preferences, label, treeInfo.schema.label, treeInfo.database.label, null, pgBrowser);
panel.focus();
@ -449,7 +452,8 @@ define([
function(evt, value) {
if(value) {
let browser_preferences = pgBrowser.get_preferences_for_module('browser');
debuggerUtils.setDebuggerTitle(panel, browser_preferences, treeInfo.function.label, treeInfo.schema.label, treeInfo.database.label, value);
var label = treeInfo.function ? treeInfo.function.label : treeInfo.procedure.label;
debuggerUtils.setDebuggerTitle(panel, browser_preferences, label, treeInfo.schema.label, treeInfo.database.label, value, pgBrowser);
}
},
// We will execute this function when user clicks on the Cancel
@ -567,7 +571,8 @@ define([
panel = pgBrowser.docker.addPanel(
'frm_debugger', wcDocker.DOCK.STACKED, dashboardPanel[0]
);
debuggerUtils.setDebuggerTitle(panel, browser_preferences, newTreeInfo.function.label, newTreeInfo.schema.label, newTreeInfo.database.label);
var label = newTreeInfo.function ? newTreeInfo.function.label : newTreeInfo.procedure.label;
debuggerUtils.setDebuggerTitle(panel, browser_preferences, label, newTreeInfo.schema.label, newTreeInfo.database.label, null, pgBrowser);
panel.focus();
@ -589,7 +594,8 @@ define([
function(evt, value) {
if(value) {
let browser_preferences = pgBrowser.get_preferences_for_module('browser');
debuggerUtils.setDebuggerTitle(panel, browser_preferences, treeInfo.function.label, treeInfo.schema.label, treeInfo.database.label, value);
var label = treeInfo.function ? treeInfo.function.label : treeInfo.procedure.label;
debuggerUtils.setDebuggerTitle(panel, browser_preferences, label, treeInfo.schema.label, treeInfo.database.label, value, pgBrowser);
}
},
// We will execute this function when user clicks on the Cancel

View File

@ -11,10 +11,10 @@ define([
'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'backbone',
'pgadmin.alertifyjs', 'sources/pgadmin', 'pgadmin.browser',
'pgadmin.backgrid', 'sources/window', 'pgadmin.tools.debugger.utils',
'tools/datagrid/static/js/show_query_tool', 'wcdocker',
'wcdocker',
], function(
gettext, url_for, $, _, Backbone, Alertify, pgAdmin, pgBrowser, Backgrid,
pgWindow, debuggerUtils, showQueryTool
pgWindow, debuggerUtils,
) {
var wcDocker = window.wcDocker;
@ -778,10 +778,8 @@ define([
'frm_debugger', wcDocker.DOCK.STACKED, dashboardPanel[0]
);
var browser_pref = pgBrowser.get_preferences_for_module('browser');
debuggerUtils.setDebuggerTitle(panel, browser_pref, treeInfo.function.label, treeInfo.schema.label, treeInfo.database.label);
showQueryTool._set_dynamic_tab(pgBrowser, browser_pref['dynamic_tabs']);
var label = treeInfo.function ? treeInfo.function.label : treeInfo.procedure.label;
debuggerUtils.setDebuggerTitle(panel, browser_pref, label, treeInfo.schema.label, treeInfo.database.label, null, pgBrowser);
panel.focus();
// Panel Closed event
@ -801,7 +799,8 @@ define([
// We will execute this function when user clicks on the OK button
function(evt, value) {
if(value) {
debuggerUtils.setDebuggerTitle(panel, self.preferences, treeInfo.function.label, treeInfo.schema.label, treeInfo.database.label, value);
var label = treeInfo.function ? treeInfo.function.label : treeInfo.procedure.label;
debuggerUtils.setDebuggerTitle(panel, self.preferences, label, treeInfo.schema.label, treeInfo.database.label, value, pgBrowser);
}
},
// We will execute this function when user clicks on the Cancel

View File

@ -7,6 +7,7 @@
//
//////////////////////////////////////////////////////////////////////////
import {generateTitle} from '../../../datagrid/static/js/datagrid_panel_title';
import {_set_dynamic_tab} from '../../../datagrid/static/js/show_query_tool';
function setFocusToDebuggerEditor(editor, command) {
const TAB = 9;
@ -43,7 +44,7 @@ function getProcedureId(treeInfoObject) {
return objectId;
}
function setDebuggerTitle(panel, preferences, function_name, schema_name, database_name, custom_title) {
function setDebuggerTitle(panel, preferences, function_name, schema_name, database_name, custom_title=null, pgBrowser=null) {
var debugger_title_placeholder = '';
if(custom_title) {
debugger_title_placeholder = custom_title;
@ -68,6 +69,7 @@ function setDebuggerTitle(panel, preferences, function_name, schema_name, databa
'type': 'debugger',
};
var title = generateTitle(debugger_title_placeholder, title_data);
_set_dynamic_tab(pgBrowser, preferences['dynamic_tabs']);
panel.title('<span>'+ title +'</span>');
}