diff --git a/docs/en_US/release_notes_5_5.rst b/docs/en_US/release_notes_5_5.rst index a3d3533ff..00535c2d1 100644 --- a/docs/en_US/release_notes_5_5.rst +++ b/docs/en_US/release_notes_5_5.rst @@ -22,4 +22,5 @@ Bug fixes | `Issue #6398 `_ - Fixed an issue where detaching the query editor panel gives a blank white panel. | `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 #6541 `_ - Ensure that setting 'Open in new browser tab' should be visible, it should not be based on the value of 'ENABLE_PSQL'. diff --git a/web/pgadmin/static/js/sqleditor/new_connection_dialog_model.js b/web/pgadmin/static/js/sqleditor/new_connection_dialog_model.js index 4f282da8b..471b98e93 100644 --- a/web/pgadmin/static/js/sqleditor/new_connection_dialog_model.js +++ b/web/pgadmin/static/js/sqleditor/new_connection_dialog_model.js @@ -382,7 +382,11 @@ export default function newConnectionDialogModel(response, sgid, sid, handler, c && m.get('server') !== '') { setTimeout(function() { if(self_local.options.length) { - m.set('database', self_local.options[0].value); + self_local.options.forEach(db => { + if (db.selected) { + m.set('database', db.value); + } + }); } }, 10); return false; diff --git a/web/pgadmin/tools/sqleditor/__init__.py b/web/pgadmin/tools/sqleditor/__init__.py index c7ec52277..f2625ae78 100644 --- a/web/pgadmin/tools/sqleditor/__init__.py +++ b/web/pgadmin/tools/sqleditor/__init__.py @@ -1620,9 +1620,13 @@ def get_new_connection_database(sgid, sid=None): db_restrictions=db_disp_res ) status, databases = conn.execute_dict(sql, params) + _db = manager.db database_list = [ - {'label': database['name'], 'value': database['did']} for - database in databases['rows']] + { + 'label': database['name'], + 'value': database['did'], + 'selected': True if database['name'] == _db else False + } for database in databases['rows']] else: status = False