Ensure that the rename panel should be disabled when the SQL file opened in the query tool. Fixes #6058

This commit is contained in:
Nikhil Mohite 2020-12-10 18:13:04 +05:30 committed by Akshay Joshi
parent c7ae5024d5
commit c79614786f
4 changed files with 35 additions and 1 deletions

View File

@ -11,6 +11,7 @@ notes for it.
.. toctree::
:maxdepth: 1
release_notes_4_30
release_notes_4_29
release_notes_4_28
release_notes_4_27

View File

@ -16,7 +16,6 @@ Housekeeping
| `Issue #5328 <https://redmine.postgresql.org/issues/5328>`_ - Improve code coverage and API test cases for Foreign Tables.
| `Issue #5337 <https://redmine.postgresql.org/issues/5337>`_ - Improve code coverage and API test cases for Views and Materialized Views.
| `Issue #5343 <https://redmine.postgresql.org/issues/5343>`_ - Improve code coverage and API test cases for Debugger.
| `Issue #6033 <https://redmine.postgresql.org/issues/6033>`_ - Update the cryptography python package for Python 3.5 and above.
| `Issue #6062 <https://redmine.postgresql.org/issues/6062>`_ - Ensure that code coverage should cover class and function declarations.
Bug fixes

View File

@ -0,0 +1,20 @@
************
Version 4.30
************
Release date: 2021-01-07
This release contains a number of bug fixes and new features since the release of pgAdmin4 4.29.
New features
************
Housekeeping
************
Bug fixes
*********
| `Issue #6058 <https://redmine.postgresql.org/issues/6058>`_ - Ensure that the rename panel should be disabled when the SQL file opened in the query tool.

View File

@ -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) {