mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed an issue on refreshing files in Query Tool. Fixes #6069
This commit is contained in:
committed by
Akshay Joshi
parent
d55555c544
commit
0fcfe63092
@@ -32,6 +32,7 @@ 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.
|
||||
| `Issue #6061 <https://redmine.postgresql.org/issues/6061>`_ - Fixed extra parentheses issue around joins for Views.
|
||||
| `Issue #6065 <https://redmine.postgresql.org/issues/6065>`_ - Fixed accessibility issues in schema diff module.
|
||||
| `Issue #6069 <https://redmine.postgresql.org/issues/6069>`_ - Fixed an issue on refreshing files in Query Tool.
|
||||
| `Issue #6077 <https://redmine.postgresql.org/issues/6077>`_ - Fixed accessibility issues in various dialogs.
|
||||
| `Issue #6084 <https://redmine.postgresql.org/issues/6084>`_ - Fixed TypeError exception in schema diff when selected any identical object.
|
||||
| `Issue #6096 <https://redmine.postgresql.org/issues/6096>`_ - Updated deployment documentation, refer correctly to uWSGI where Gunicorn had been referenced.
|
||||
|
@@ -137,45 +137,51 @@ module.exports = Alertify.dialog('createModeDlg', function() {
|
||||
return permission;
|
||||
},
|
||||
callback: function(closeEvent) {
|
||||
closeEvent.cancel = false;
|
||||
if (closeEvent.button.text == gettext('Create')) {
|
||||
var newFile = $('.storage_dialog #uploader .input-path').val(),
|
||||
file_data = {
|
||||
'path': $('.currentpath').val(),
|
||||
},
|
||||
innerbody,
|
||||
ext = $('.allowed_file_types select').val();
|
||||
var act_variable = document.activeElement.id;
|
||||
if(act_variable != 'refresh_list') {
|
||||
var newFile = $('.storage_dialog #uploader .input-path').val(),
|
||||
file_data = {
|
||||
'path': $('.currentpath').val(),
|
||||
},
|
||||
innerbody,
|
||||
ext = $('.allowed_file_types select').val();
|
||||
|
||||
/*
|
||||
Add the file extension if necessary, and if the file type selector
|
||||
isn't set to "All Files". If there's no . at all in the path, or
|
||||
there is a . already but it's not following the last /, AND the
|
||||
extension isn't *, then we add the extension.
|
||||
*/
|
||||
if ((!newFile.includes('.') ||
|
||||
newFile.split('.').pop() != ext) &&
|
||||
ext != '*') {
|
||||
newFile = newFile + '.' + ext;
|
||||
$('.storage_dialog #uploader .input-path').val(newFile);
|
||||
}
|
||||
/*
|
||||
Add the file extension if necessary, and if the file type selector
|
||||
isn't set to "All Files". If there's no . at all in the path, or
|
||||
there is a . already but it's not following the last /, AND the
|
||||
extension isn't *, then we add the extension.
|
||||
*/
|
||||
if ((!newFile.includes('.') ||
|
||||
newFile.split('.').pop() != ext) &&
|
||||
ext != '*') {
|
||||
newFile = newFile + '.' + ext;
|
||||
$('.storage_dialog #uploader .input-path').val(newFile);
|
||||
}
|
||||
|
||||
if (!this.check_permission(newFile)) {
|
||||
closeEvent.cancel = true;
|
||||
return;
|
||||
}
|
||||
if (!this.check_permission(newFile)) {
|
||||
closeEvent.cancel = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_.isUndefined(newFile) && newFile !== '' && this.is_file_exist()) {
|
||||
this.replace_file();
|
||||
this.$container.find('.replace_file').find('.btn_yes').trigger('focus');
|
||||
closeEvent.cancel = true;
|
||||
if (!_.isUndefined(newFile) && newFile !== '' && this.is_file_exist()) {
|
||||
this.replace_file();
|
||||
this.$container.find('.replace_file').find('.btn_yes').trigger('focus');
|
||||
closeEvent.cancel = true;
|
||||
} else {
|
||||
pgAdmin.Browser.Events.trigger('pgadmin-storage:finish_btn:create_file', newFile);
|
||||
innerbody = $(this.elements.body).find('.storage_content');
|
||||
$(innerbody).find('*').off();
|
||||
innerbody.remove();
|
||||
removeTransId(this.trans_id);
|
||||
}
|
||||
|
||||
set_last_traversed_dir(file_data, this.trans_id);
|
||||
} else {
|
||||
pgAdmin.Browser.Events.trigger('pgadmin-storage:finish_btn:create_file', newFile);
|
||||
innerbody = $(this.elements.body).find('.storage_content');
|
||||
$(innerbody).find('*').off();
|
||||
innerbody.remove();
|
||||
removeTransId(this.trans_id);
|
||||
closeEvent.cancel = true;
|
||||
}
|
||||
|
||||
set_last_traversed_dir(file_data, this.trans_id);
|
||||
} else if (closeEvent.button.text == gettext('Cancel')) {
|
||||
innerbody = $(this.elements.body).find('.storage_content');
|
||||
$(innerbody).find('*').off();
|
||||
|
@@ -108,21 +108,26 @@ module.exports = Alertify.dialog('fileSelectionDlg', function() {
|
||||
},
|
||||
callback: function(closeEvent) {
|
||||
var innerbody;
|
||||
|
||||
closeEvent.cancel = false;
|
||||
if (closeEvent.button.text == gettext('Select')) {
|
||||
var newFile = $('.storage_dialog #uploader .input-path').val(),
|
||||
file_data = {
|
||||
'path': $('.currentpath').val(),
|
||||
};
|
||||
var act_variable = document.activeElement.id;
|
||||
if(act_variable !='refresh_list') {
|
||||
var newFile = $('.storage_dialog #uploader .input-path').val(),
|
||||
file_data = {
|
||||
'path': $('.currentpath').val(),
|
||||
};
|
||||
|
||||
pgAdmin.Browser.Events.trigger('pgadmin-storage:finish_btn:' + this.dialog_type, newFile);
|
||||
innerbody = $(this.elements.body).find('.storage_content');
|
||||
$(innerbody).find('*').off();
|
||||
innerbody.remove();
|
||||
removeTransId(this.trans_id);
|
||||
// Ajax call to store the last directory visited once user press select button
|
||||
pgAdmin.Browser.Events.trigger('pgadmin-storage:finish_btn:' + this.dialog_type, newFile);
|
||||
innerbody = $(this.elements.body).find('.storage_content');
|
||||
$(innerbody).find('*').off();
|
||||
innerbody.remove();
|
||||
removeTransId(this.trans_id);
|
||||
// Ajax call to store the last directory visited once user press select button
|
||||
|
||||
set_last_traversed_dir(file_data, this.trans_id);
|
||||
set_last_traversed_dir(file_data, this.trans_id);
|
||||
} else {
|
||||
closeEvent.cancel = true;
|
||||
}
|
||||
} else if (closeEvent.button.text == gettext('Cancel')) {
|
||||
innerbody = $(this.elements.body).find('.storage_content');
|
||||
$(innerbody).find('*').off();
|
||||
|
@@ -1584,12 +1584,14 @@ define([
|
||||
if (config.options.dialog_type == 'create_file') {
|
||||
var status = checkPermission(path);
|
||||
if (status) {
|
||||
$('.file_manager').trigger('enter-key');
|
||||
//$('.file_manager').trigger('enter-key');
|
||||
$('.file_manager_ok').trigger('click');
|
||||
}
|
||||
} else if (config.options.dialog_type == 'select_file') {
|
||||
var file_status = getFileInfo(path);
|
||||
if (file_status) {
|
||||
$('.file_manager').trigger('enter-key');
|
||||
$('.file_manager_ok').trigger('click');
|
||||
//$('.file_manager').trigger('enter-key');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@
|
||||
<input class="mode" name="mode" type="hidden" value="add"/>
|
||||
<input class="currentpath" name="currentpath" type="hidden"/>
|
||||
<button type="button" title="{{ _('Refresh') }}" class="btn btn-sm btn-primary-icon refresh"
|
||||
tabindex="0" aria-label="refresh">
|
||||
tabindex="0" aria-label="refresh" id="refresh_list">
|
||||
<span class="fa fa-sync-alt sql-icon-lg"></span>
|
||||
</button>
|
||||
<button type="button" title="{{ _('Download File') }}" class="btn btn-sm btn-primary-icon download"
|
||||
|
Reference in New Issue
Block a user