public inbox for [email protected]
help / color / mirror / Atom feed[pgAdmin][PM-6069]: Getting error while refreshing files in query tool
2+ messages / 2 participants
[nested] [flat]
* [pgAdmin][PM-6069]: Getting error while refreshing files in query tool
@ 2021-01-11 10:46 Nikhil Mohite <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Nikhil Mohite @ 2021-01-11 10:46 UTC (permalink / raw)
To: pgadmin-hackers
Hi Tema,
Please find the attached patch for RM-6069
<https://redmine.postgresql.org/issues/6069;: Getting error while
refreshing files in query tool.
--
*Thanks & Regards,*
*Nikhil Mohite*
*Software Engineer.*
*EDB Postgres* <https://www.enterprisedb.com/;
*Mob.No: +91-7798364578.*
Attachments:
[application/octet-stream] RM_6069.patch (7.9K, 3-RM_6069.patch)
download | inline diff:
diff --git a/web/pgadmin/misc/file_manager/static/js/create_dialogue.js b/web/pgadmin/misc/file_manager/static/js/create_dialogue.js
index 41c58f5c..fa08ea56 100644
--- a/web/pgadmin/misc/file_manager/static/js/create_dialogue.js
+++ b/web/pgadmin/misc/file_manager/static/js/create_dialogue.js
@@ -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();
diff --git a/web/pgadmin/misc/file_manager/static/js/select_dialogue.js b/web/pgadmin/misc/file_manager/static/js/select_dialogue.js
index b3123f91..d80f98b4 100644
--- a/web/pgadmin/misc/file_manager/static/js/select_dialogue.js
+++ b/web/pgadmin/misc/file_manager/static/js/select_dialogue.js
@@ -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();
diff --git a/web/pgadmin/misc/file_manager/static/js/utility.js b/web/pgadmin/misc/file_manager/static/js/utility.js
index 59f67259..7e335ee8 100644
--- a/web/pgadmin/misc/file_manager/static/js/utility.js
+++ b/web/pgadmin/misc/file_manager/static/js/utility.js
@@ -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');
}
}
}
diff --git a/web/pgadmin/misc/file_manager/templates/file_manager/index.html b/web/pgadmin/misc/file_manager/templates/file_manager/index.html
index b914c444..6ceefa6d 100644
--- a/web/pgadmin/misc/file_manager/templates/file_manager/index.html
+++ b/web/pgadmin/misc/file_manager/templates/file_manager/index.html
@@ -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"
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [pgAdmin][PM-6069]: Getting error while refreshing files in query tool
@ 2021-01-11 12:11 Akshay Joshi <[email protected]>
parent: Nikhil Mohite <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Akshay Joshi @ 2021-01-11 12:11 UTC (permalink / raw)
To: Nikhil Mohite <[email protected]>; +Cc: pgadmin-hackers
Thanks, patch applied.
On Mon, Jan 11, 2021 at 4:16 PM Nikhil Mohite <
[email protected]> wrote:
> Hi Tema,
>
> Please find the attached patch for RM-6069
> <https://redmine.postgresql.org/issues/6069;: Getting error while
> refreshing files in query tool.
>
>
>
> --
> *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:[~2021-01-11 12:11 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-01-11 10:46 [pgAdmin][PM-6069]: Getting error while refreshing files in query tool Nikhil Mohite <[email protected]>
2021-01-11 12:11 ` 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