Fixed an issue where the focus is not properly set on the filter text editor after closing the error dialog. Fixes #5809

pull/40/head
Nikhil Mohite 2021-02-04 11:45:16 +05:30 committed by Akshay Joshi
parent 02c3863e8c
commit 14036b7aeb
2 changed files with 12 additions and 5 deletions

View File

@ -23,6 +23,7 @@ Housekeeping
Bug fixes Bug fixes
********* *********
| `Issue #5809 <https://redmine.postgresql.org/issues/5809>`_ - Fixed an issue where the focus is not properly set on the filter text editor after closing the error dialog.
| `Issue #5871 <https://redmine.postgresql.org/issues/5871>`_ - Ensure that username should be visible in the 'Connect to Server' popup when service and user name both specified. | `Issue #5871 <https://redmine.postgresql.org/issues/5871>`_ - Ensure that username should be visible in the 'Connect to Server' popup when service and user name both specified.
| `Issue #6045 <https://redmine.postgresql.org/issues/6045>`_ - Fixed autocomplete issue where it is not showing any suggestions if the schema name contains escape characters. | `Issue #6045 <https://redmine.postgresql.org/issues/6045>`_ - Fixed autocomplete issue where it is not showing any suggestions if the schema name contains escape characters.
| `Issue #6087 <https://redmine.postgresql.org/issues/6087>`_ - Fixed an issue where the dependencies tab showing multiple owners for the objects having shared dependencies. | `Issue #6087 <https://redmine.postgresql.org/issues/6087>`_ - Fixed an issue where the dependencies tab showing multiple owners for the objects having shared dependencies.

View File

@ -109,6 +109,7 @@ function generateFilterValidateUrl(nodeData, parentData) {
function initFilterDialog(alertify, pgBrowser) { function initFilterDialog(alertify, pgBrowser) {
// Create filter dialog using alertify // Create filter dialog using alertify
let filter_editor = null;
if (!alertify.filterDialog) { if (!alertify.filterDialog) {
alertify.dialog('filterDialog', function factory() { alertify.dialog('filterDialog', function factory() {
return { return {
@ -183,7 +184,7 @@ function initFilterDialog(alertify, pgBrowser) {
that.__internal.buttons[2].element.disabled = true; that.__internal.buttons[2].element.disabled = true;
// Apply CodeMirror to filter text area. // Apply CodeMirror to filter text area.
this.filter_obj = CodeMirror.fromTextArea($sql_filter.get(0), { filter_editor = this.filter_obj = CodeMirror.fromTextArea($sql_filter.get(0), {
lineNumbers: true, lineNumbers: true,
mode: 'text/x-pgsql', mode: 'text/x-pgsql',
extraKeys: pgBrowser.editor_shortcut_keys, extraKeys: pgBrowser.editor_shortcut_keys,
@ -235,10 +236,15 @@ function initFilterDialog(alertify, pgBrowser) {
that.close(); // Close the dialog that.close(); // Close the dialog
} }
else { else {
alertify.alert( alertify.alert()
gettext('Validation Error'), .setting({
res.data.result 'title': gettext('Validation Error'),
); 'label':gettext('Ok'),
'message': gettext(res.data.result),
'onok': function(){
filter_editor.focus();
},
}).show();
} }
}) })
.fail(function(e) { .fail(function(e) {