public inbox for [email protected]
help / color / mirror / Atom feedFrom: Nikhil Mohite <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin][RM-6058]: Renaming feature should be disabled for files opened in tab.
Date: Wed, 9 Dec 2020 14:34:57 +0530
Message-ID: <CAOBg0APXTK=6J3LBnJ8uzwYicD33Vf+cBUHSuyJx4gGLKj=yFg@mail.gmail.com> (raw)
Hi Team,
Please find the patch for RM-6058
<https://redmine.postgresql.org/issues/6058;: Renaming feature should be
disabled for files opened in tab.
Rename panel will be disabled when the user opens or save the file from the
query tool.
--
*Thanks & Regards,*
*Nikhil Mohite*
*Software Engineer.*
*EDB Postgres* <https://www.enterprisedb.com/;
*Mob.No: +91-7798364578.*
Attachments:
[application/octet-stream] RM_6058.patch (1.6K, 3-RM_6058.patch)
download | inline diff:
diff --git a/web/pgadmin/tools/datagrid/static/js/datagrid_panel_title.js b/web/pgadmin/tools/datagrid/static/js/datagrid_panel_title.js
index 721b583..bae5e36 100644
--- a/web/pgadmin/tools/datagrid/static/js/datagrid_panel_title.js
+++ b/web/pgadmin/tools/datagrid/static/js/datagrid_panel_title.js
@@ -9,6 +9,7 @@
import {getTreeNodeHierarchyFromIdentifier} from '../../../../static/js/tree/pgadmin_tree_node';
import gettext from 'sources/gettext';
+import $ from 'jquery';
export function getDatabaseLabel(parentData) {
return parentData.database ? parentData.database.label
@@ -52,6 +53,8 @@ export function getPanelTitle(pgBrowser, selected_item=null, custom_title=null)
export function setQueryToolDockerTitle(panel, is_query_tool, panel_title, is_file) {
let panel_icon = '', panel_tooltip = '';
+ // Enable/ Disabled the rename panel option if file is open.
+ set_renamable_option(panel, is_file);
if(is_file || is_file == 'true'){
panel_tooltip = gettext('File - ') + panel_title;
@@ -69,6 +72,17 @@ export function setQueryToolDockerTitle(panel, is_query_tool, panel_title, is_fi
panel.title('<span title="'+ _.escape(panel_tooltip) +'">'+ _.escape(panel_title) +'</span>');
panel.icon(panel_icon);
+
+}
+
+export function set_renamable_option(panel, is_file) {
+ if(is_file || is_file == 'true') {
+ panel._isRenamable = false;
+ $('.conn-info-dd').hide();
+ $('.connection-data').css({pointerEvents: 'none', cursor: 'arrow'});
+ } else {
+ panel._isRenamable = true;
+ }
}
export function generateTitle(title_placeholder, title_data) {
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: [pgAdmin][RM-6058]: Renaming feature should be disabled for files opened in tab.
In-Reply-To: <CAOBg0APXTK=6J3LBnJ8uzwYicD33Vf+cBUHSuyJx4gGLKj=yFg@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox