diff --git a/web/pgadmin/static/js/sqleditor/new_connection_dialog.js b/web/pgadmin/static/js/sqleditor/new_connection_dialog.js index 3fcd37474..13267ab96 100644 --- a/web/pgadmin/static/js/sqleditor/new_connection_dialog.js +++ b/web/pgadmin/static/js/sqleditor/new_connection_dialog.js @@ -95,7 +95,7 @@ let NewConnectionDialog = { closableByDimmer: false, modal: false, autoReset: false, - closable: true, + closable: false, }, }; }, @@ -152,14 +152,18 @@ let NewConnectionDialog = { self.statusBar.removeClass('d-none'); $(self.statusBar.find('.alert-text')).html(msg); // Disable Okay button - self.__internal.buttons[2].element.disabled = true; + if(self.__internal){ + self.__internal.buttons[2].element.disabled = true; + } }); view.listenTo(view.model, 'pgadmin-session:valid', function() { self.statusBar.addClass('d-none'); $(self.statusBar.find('.alert-text')).html(''); // Enable Okay button - self.__internal.buttons[2].element.disabled = false; + if(self.__internal) { + self.__internal.buttons[2].element.disabled = false; + } }); }); @@ -230,15 +234,18 @@ let NewConnectionDialog = { 'user': newConnCollectionModel['user'], 'role': newConnCollectionModel['role'], 'password': response.password, + 'server_name': response.server_name, + 'database_name': selected_database_name, }; handler.gridView.on_change_connection(connection_details, self); } } else { - self.close(); + Alertify.newConnectionDialog().destroy(); } }, }; }); + setTimeout(function(){ Alertify.newConnectionDialog('Connect to server.').resizeTo(pgAdmin.Browser.stdW.md,pgAdmin.Browser.stdH.md); }, 500); 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 e262d0e9d..9e0305142 100644 --- a/web/pgadmin/static/js/sqleditor/new_connection_dialog_model.js +++ b/web/pgadmin/static/js/sqleditor/new_connection_dialog_model.js @@ -31,7 +31,6 @@ export default function newConnectionDialogModel(response, sgid, sid) { }); $.ajax({ - async: false, url: url, headers: { 'Cache-Control' : 'no-cache', @@ -52,8 +51,8 @@ export default function newConnectionDialogModel(response, sgid, sid) { } else { self.field.set('options', []); } - //alertify.error(res.data.msg); } + Backform.Select2Control.prototype.render.apply(self, arguments); }).fail(function(e){ let msg = ''; if(e.status == 404) { @@ -131,7 +130,8 @@ export default function newConnectionDialogModel(response, sgid, sid) { if (closeEvent.button.text == gettext('OK')) { if(this.submit_password) { var _url = url_for('sqleditor.connect_server', {'sid': this.server_id}); - + var loadingDiv = $('#show_filter_progress'); + loadingDiv.removeClass('d-none'); $.ajax({ type: 'POST', timeout: 30000, @@ -148,8 +148,10 @@ export default function newConnectionDialogModel(response, sgid, sid) { response.server_name = obj.name; } }); + loadingDiv.addClass('d-none'); }) .fail(function(xhr) { + loadingDiv.addClass('d-none'); alertify.connectServer('Connect to server', xhr.responseJSON.result, local_self.getValueFromDOM()); }); } else { @@ -182,8 +184,9 @@ export default function newConnectionDialogModel(response, sgid, sid) { 'sid': self.getValueFromDOM(), 'usr': self.model.attributes.user, }); + var loadingDiv = $('#show_filter_progress'); + loadingDiv.removeClass('d-none'); $.ajax({ - async: false, url: url, type: 'POST', headers: { @@ -196,7 +199,9 @@ export default function newConnectionDialogModel(response, sgid, sid) { response.server_name = obj.name; } }); + loadingDiv.addClass('d-none'); }).fail(function(xhr){ + loadingDiv.addClass('d-none'); alertify.connectServer('Connect to server', xhr.responseJSON.result, self.getValueFromDOM()); }); diff --git a/web/pgadmin/tools/datagrid/templates/datagrid/index.html b/web/pgadmin/tools/datagrid/templates/datagrid/index.html index 229b4d37e..9dcd32f91 100644 --- a/web/pgadmin/tools/datagrid/templates/datagrid/index.html +++ b/web/pgadmin/tools/datagrid/templates/datagrid/index.html @@ -418,11 +418,13 @@