public inbox for [email protected]
help / color / mirror / Atom feed[pgAdmin][RM-5991]: Renaming tabs doesn't account for the dirty editor indicator.
2+ messages / 2 participants
[nested] [flat]
* [pgAdmin][RM-5991]: Renaming tabs doesn't account for the dirty editor indicator.
@ 2020-12-01 04:33 Nikhil Mohite <[email protected]>
2020-12-01 06:08 ` Re: [pgAdmin][RM-5991]: Renaming tabs doesn't account for the dirty editor indicator. Akshay Joshi <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Nikhil Mohite @ 2020-12-01 04:33 UTC (permalink / raw)
To: pgadmin-hackers
Hi Team,
Please refer patch for RM-5991
<https://redmine.postgresql.org/issues/5991?issue_count=22&issue_position=4&next_issue_id=598...;:
Renaming
tabs doesn't account for the dirty editor indicator.
also added changes for not allow a user to add empty spaces while renaming
the panel title.
--
*Thanks & Regards,*
*Nikhil Mohite*
*Software Engineer.*
*EDB Postgres* <https://www.enterprisedb.com/;
*Mob.No: +91-7798364578.*
Attachments:
[application/octet-stream] RM_5991.patch (6.6K, 3-RM_5991.patch)
download | inline diff:
diff --git a/web/pgadmin/tools/datagrid/static/js/datagrid.js b/web/pgadmin/tools/datagrid/static/js/datagrid.js
index 4841eaf..20ed9da 100644
--- a/web/pgadmin/tools/datagrid/static/js/datagrid.js
+++ b/web/pgadmin/tools/datagrid/static/js/datagrid.js
@@ -265,11 +265,15 @@ define('pgadmin.datagrid', [
// Listen on the panelRename event.
queryToolPanel.on(wcDocker.EVENT.RENAME, function(panel_data) {
- alertify.prompt('', panel_data.$titleText[0].textContent,
+ var temp_title = panel_data.$titleText[0].textContent;
+ var is_dirty_editor = queryToolPanel.is_dirty_editor ? queryToolPanel.is_dirty_editor : false;
+ var title = queryToolPanel.is_dirty_editor ? panel_data.$titleText[0].textContent.replace(/.$/, '') : temp_title;
+ alertify.prompt('', title,
// We will execute this function when user clicks on the OK button
function(evt, value) {
+ // Remove the leading and trailing white spaces.
+ value = value.trim();
if(value) {
-
var is_file = false;
if(panel_data.$titleText[0].innerHTML.includes('File - ')) {
is_file = true;
@@ -283,6 +287,9 @@ define('pgadmin.datagrid', [
panel_titles = showData.generateDatagridTitle(pgBrowser, selected_item, value);
}
// Set title to the selected tab.
+ if (is_dirty_editor) {
+ panel_titles = panel_titles + ' *';
+ }
panelTitleFunc.setQueryToolDockerTitle(queryToolPanel, is_query_tool, _.unescape(panel_titles), is_file);
}
},
diff --git a/web/pgadmin/tools/debugger/static/js/debugger.js b/web/pgadmin/tools/debugger/static/js/debugger.js
index 9d45f17..d9da30c 100644
--- a/web/pgadmin/tools/debugger/static/js/debugger.js
+++ b/web/pgadmin/tools/debugger/static/js/debugger.js
@@ -451,6 +451,8 @@ define([
// We will execute this function when user clicks on the OK button
function(evt, value) {
if(value) {
+ // Remove the leading and trailing white spaces.
+ value = value.trim();
let browser_preferences = pgBrowser.get_preferences_for_module('browser');
var label = treeInfo.function ? treeInfo.function.label : treeInfo.procedure.label;
debuggerUtils.setDebuggerTitle(panel, browser_preferences, label, treeInfo.schema.label, treeInfo.database.label, value, pgBrowser);
@@ -593,6 +595,8 @@ define([
// We will execute this function when user clicks on the OK button
function(evt, value) {
if(value) {
+ // Remove the leading and trailing white spaces.
+ value = value.trim();
let browser_preferences = pgBrowser.get_preferences_for_module('browser');
var label = treeInfo.function ? treeInfo.function.label : treeInfo.procedure.label;
debuggerUtils.setDebuggerTitle(panel, browser_preferences, label, treeInfo.schema.label, treeInfo.database.label, value, pgBrowser);
diff --git a/web/pgadmin/tools/debugger/static/js/debugger_ui.js b/web/pgadmin/tools/debugger/static/js/debugger_ui.js
index 4af58d8..1700b7a 100644
--- a/web/pgadmin/tools/debugger/static/js/debugger_ui.js
+++ b/web/pgadmin/tools/debugger/static/js/debugger_ui.js
@@ -799,6 +799,8 @@ define([
// We will execute this function when user clicks on the OK button
function(evt, value) {
if(value) {
+ // Remove the leading and trailing white spaces.
+ value = value.trim();
var label = treeInfo.function ? treeInfo.function.label : treeInfo.procedure.label;
debuggerUtils.setDebuggerTitle(panel, self.preferences, label, treeInfo.schema.label, treeInfo.database.label, value, pgBrowser);
}
diff --git a/web/pgadmin/tools/schema_diff/static/js/schema_diff.js b/web/pgadmin/tools/schema_diff/static/js/schema_diff.js
index d90c435..85b1978 100644
--- a/web/pgadmin/tools/schema_diff/static/js/schema_diff.js
+++ b/web/pgadmin/tools/schema_diff/static/js/schema_diff.js
@@ -121,6 +121,8 @@ define('pgadmin.schemadiff', [
// We will execute this function when user clicks on the OK button
function(evt, value) {
if(value) {
+ // Remove the leading and trailing white spaces.
+ value = value.trim();
schemaDiffPanel.title('<span>'+ _.escape(value) +'</span>');
}
},
diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
index 00791fb..c8d3cbc 100644
--- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
@@ -3692,7 +3692,7 @@ define('tools.querytool', [
},
// Set panel title.
- setTitle: function(title, is_file) {
+ setTitle: function(title, is_file, is_dirty_editor=false) {
var self = this;
var open_new_tab = self.browser_preferences.new_browser_tab_open;
if(open_new_tab && open_new_tab.includes('qt')) {
@@ -3700,6 +3700,9 @@ define('tools.querytool', [
} else {
_.each(pgWindow.default.pgAdmin.Browser.docker.findPanels('frm_datagrid'), function(p) {
if (p.isVisible()) {
+ if(is_dirty_editor) {
+ p.is_dirty_editor = true;
+ }
panelTitleFunc.setQueryToolDockerTitle(p, self.is_query_tool, title, is_file);
}
});
@@ -3858,6 +3861,7 @@ define('tools.querytool', [
self.setTitle(title, true);
} else {
var open_new_tab = self.browser_preferences.new_browser_tab_open;
+ var is_dirty_editor = false;
if(open_new_tab && open_new_tab.includes('qt')) {
title = window.document.title + ' *';
} else {
@@ -3869,8 +3873,9 @@ define('tools.querytool', [
});
title = self.gridView.panel_title + ' *';
+ is_dirty_editor = true;
}
- self.setTitle(title);
+ self.setTitle(title, false, is_dirty_editor);
}
$('#btn-save-file').prop('disabled', false);
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [pgAdmin][RM-5991]: Renaming tabs doesn't account for the dirty editor indicator.
2020-12-01 04:33 [pgAdmin][RM-5991]: Renaming tabs doesn't account for the dirty editor indicator. Nikhil Mohite <[email protected]>
@ 2020-12-01 06:08 ` Akshay Joshi <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Akshay Joshi @ 2020-12-01 06:08 UTC (permalink / raw)
To: Nikhil Mohite <[email protected]>; +Cc: pgadmin-hackers
Thanks, patch applied.
On Tue, Dec 1, 2020 at 10:04 AM Nikhil Mohite <
[email protected]> wrote:
> Hi Team,
>
> Please refer patch for RM-5991
> <https://redmine.postgresql.org/issues/5991?issue_count=22&issue_position=4&next_issue_id=598...;: Renaming
> tabs doesn't account for the dirty editor indicator.
> also added changes for not allow a user to add empty spaces while renaming
> the panel title.
>
> --
> *Thanks & Regards,*
> *Nikhil Mohite*
> *Software Engineer.*
> *EDB Postgres* <https://www.enterprisedb.com/;
> *Mob.No: +91-7798364578.*
>
--
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres <http://edbpostgres.com>*
*Mobile: +91 976-788-8246*
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2020-12-01 06:08 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-12-01 04:33 [pgAdmin][RM-5991]: Renaming tabs doesn't account for the dirty editor indicator. Nikhil Mohite <[email protected]>
2020-12-01 06:08 ` Akshay Joshi <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox