From 5c6d00d54576b9475cf502c402dfda8db5f04b12 Mon Sep 17 00:00:00 2001 From: Nikhil Mohite Date: Mon, 28 Jun 2021 18:46:41 +0530 Subject: [PATCH] Fixed directory selection issue with the folder dialog. Fixes #6536 --- docs/en_US/release_notes_5_5.rst | 1 + web/pgadmin/misc/file_manager/static/js/utility.js | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/docs/en_US/release_notes_5_5.rst b/docs/en_US/release_notes_5_5.rst index 04a2622a1..68ad40597 100644 --- a/docs/en_US/release_notes_5_5.rst +++ b/docs/en_US/release_notes_5_5.rst @@ -25,6 +25,7 @@ Bug fixes | `Issue #6448 `_ - Fixed an issue in the search object when searching in 'all types' or 'subscription' if the user doesn't have access to the subscription. | `Issue #6489 `_ - Fixed an issue where Execute/Refresh button should not be disabled when we run the empty query. | `Issue #6505 `_ - Fixed an issue where the New Connection Drop Down has lost default maintenance database, auto-select, and tab-through functionality. +| `Issue #6536 `_ - Fixed directory selection issue with the folder dialog. | `Issue #6541 `_ - Ensure that setting 'Open in new browser tab' should be visible, it should not be based on the value of 'ENABLE_PSQL'. | `Issue #6547 `_ - Fixed copy/paste issues for PSQL tool terminal. | `Issue #6555 `_ - Fixed Czech translation string for 'Login' keyword. diff --git a/web/pgadmin/misc/file_manager/static/js/utility.js b/web/pgadmin/misc/file_manager/static/js/utility.js index c5c90f609..092339d5b 100644 --- a/web/pgadmin/misc/file_manager/static/js/utility.js +++ b/web/pgadmin/misc/file_manager/static/js/utility.js @@ -410,6 +410,13 @@ define([ $('.file_manager_ok').attr('disabled', true); Alertify.error(data.Error); } + + // Disable select button if user select file. + if (pgAdmin.FileUtils.data.Capabilities.includes('select_folder')) { + $('.file_manager_ok').addClass('disabled'); + $('.file_manager_ok').attr('disabled', true); + } + }); return is_file_valid; }; @@ -655,6 +662,13 @@ define([ file_type = ''; } var capabilities = pgAdmin.FileUtils.data.Capabilities; + + // Enable select button if user select folder. + if (pgAdmin.FileUtils.data.Capabilities.includes('select_folder')) { + $('.file_manager_ok').removeClass('disabled'); + $('.file_manager_ok').attr('disabled', false); + } + // Update location for status, upload, & new folder functions. pgAdmin.FileUtils.setUploader(path); if(user_input) {