public inbox for [email protected]  
help / color / mirror / Atom feed
From: Nikhil Mohite <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin][PM-6045]: Filtered Rows along with Shift+Enter submit can result in confusing UX.
Date: Wed, 3 Feb 2021 18:16:38 +0530
Message-ID: <CAOBg0APczGCKS8aOJKS6s_K+Xu94XiLW5SfbS7VcCZtpduscBA@mail.gmail.com> (raw)

Hi Team,

Please find the attached patch for RM-5809
<https://redmine.postgresql.org/issues/5809;: Filtered Rows along with
Shift+Enter submit can result in confusing UX.
Added set focus to filter text editor on the closing of the error dialog.


--
*Thanks & Regards,*
*Nikhil Mohite*
*Software Engineer.*
*EDB Postgres* <https://www.enterprisedb.com/;
*Mob.No: +91-7798364578.*


Attachments:

  [application/octet-stream] RM_5809.patch (1.8K, 3-RM_5809.patch)
  download | inline diff:
diff --git a/web/pgadmin/tools/datagrid/static/js/show_data.js b/web/pgadmin/tools/datagrid/static/js/show_data.js
index 741ecad0..75e4639a 100644
--- a/web/pgadmin/tools/datagrid/static/js/show_data.js
+++ b/web/pgadmin/tools/datagrid/static/js/show_data.js
@@ -109,6 +109,7 @@ function generateFilterValidateUrl(nodeData, parentData) {
 
 function initFilterDialog(alertify, pgBrowser) {
   // Create filter dialog using alertify
+  let filter_editor = null;
   if (!alertify.filterDialog) {
     alertify.dialog('filterDialog', function factory() {
       return {
@@ -183,7 +184,7 @@ function initFilterDialog(alertify, pgBrowser) {
           that.__internal.buttons[2].element.disabled = true;
 
           // 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,
             mode: 'text/x-pgsql',
             extraKeys: pgBrowser.editor_shortcut_keys,
@@ -235,10 +236,15 @@ function initFilterDialog(alertify, pgBrowser) {
                   that.close(); // Close the dialog
                 }
                 else {
-                  alertify.alert(
-                    gettext('Validation Error'),
-                    res.data.result
-                  );
+                  alertify.alert()
+                    .setting({
+                      'title': gettext('Validation Error 1'),
+                      'label':gettext('Ok'),
+                      'message': gettext(res.data.result),
+                      'onok': function(){
+                        filter_editor.focus();
+                      },
+                    }).show();
                 }
               })
               .fail(function(e) {


view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: [pgAdmin][PM-6045]: Filtered Rows along with Shift+Enter submit can result in confusing UX.
  In-Reply-To: <CAOBg0APczGCKS8aOJKS6s_K+Xu94XiLW5SfbS7VcCZtpduscBA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox