From aa4f992e300a60b3e6919b19d5aec829f3c59fbb Mon Sep 17 00:00:00 2001 From: Akshay Joshi Date: Tue, 15 Nov 2022 13:59:12 +0530 Subject: [PATCH] Ensure that autocomplete works properly with objects starting with double quotes. #5281 --- docs/en_US/release_notes_6_16.rst | 2 ++ .../tools/sqleditor/static/js/components/sections/Query.jsx | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/en_US/release_notes_6_16.rst b/docs/en_US/release_notes_6_16.rst index c5c36e95c..3eaeae50d 100644 --- a/docs/en_US/release_notes_6_16.rst +++ b/docs/en_US/release_notes_6_16.rst @@ -34,6 +34,7 @@ Bug fixes | `Issue #5122 `_ - Ensure that the spinner should be visible on the browser tree on node refresh. | `Issue #5149 `_ - Ensure the Generate ERD option is hidden if the connection to the database is not allowed. | `Issue #5206 `_ - Reposition the select dropdown when the browser is resized. + | `Issue #5281 `_ - Ensure that autocomplete works properly with objects starting with double quotes. | `Issue #5344 `_ - Ensure that pgAdmin routes should have the SCRIPT_NAME prefix. | `Issue #5424 `_ - Ensure that the appropriate permissions are set on the key file before trying an SSL connection with the server in server mode. | `Issue #5429 `_ - Fixed an issue where parameters for roles were not visible. @@ -44,4 +45,5 @@ Bug fixes | `Issue #5473 `_ - Fixed an issue where AutoComplete was not working correctly due to incorrect regex. | `Issue #5475 `_ - Fixed an issue where the 'Confirm on close or refresh' setting was ignored when closing the query/ERD tool opened in the new tab. | `Issue #5507 `_ - Fixed an issue where pgadmin does not respect reverse proxy any more. + | `Issue #5521 `_ - Fixed SocketIO calls when pgAdmin 4 server is running from a sub directory. | `Issue #5522 `_ - Ensure that the load file paths are children of the storage directory. diff --git a/web/pgadmin/tools/sqleditor/static/js/components/sections/Query.jsx b/web/pgadmin/tools/sqleditor/static/js/components/sections/Query.jsx index 509cfe023..7004f4db0 100644 --- a/web/pgadmin/tools/sqleditor/static/js/components/sections/Query.jsx +++ b/web/pgadmin/tools/sqleditor/static/js/components/sections/Query.jsx @@ -125,8 +125,9 @@ function registerAutocomplete(api, transId, sqlEditorPref, onFailure) { // This function is used to filter the data and call the callback // function with that filtered data. function setAutoCompleteData() { + const searchRe = new RegExp('^"{0,1}' + search, 'i'); let filterData = self_local.editor.state.autoCompleteList.filter((item)=>{ - return item.text.toLowerCase().startsWith(search.toLowerCase()); + return searchRe.test(item.text) }); cb({