Subject: [pgAdmin4][Patch]: SQL Tab Validation

From: Khushboo Vashi <[email-masked]>
Date: Tue, 3 May 2016 15:46:44 +0530

Hi,

Do not send the request to the server if a model contains any error on
selection of the SQL Tab, while creating/updating any Node.

Please find the attached patch for the same.

Thanks,
Khushboo
diff --git a/web/pgadmin/static/js/backform.pgadmin.js b/web/pgadmin/static/js/backform.pgadmin.js
index ab2f2fb..dbdd6cc 100644
--- a/web/pgadmin/static/js/backform.pgadmin.js
+++ b/web/pgadmin/static/js/backform.pgadmin.js
@@ -1394,8 +1394,9 @@
       // Fetch the information only if the SQL tab is visible at the moment.
       if (this.dialog && obj.shown == this.tabIndex) {
 
-        // We will send request to sever only if something is changed in model
-        if(this.model.sessChanged()) {
+        // We will send a request to the sever only if something has changed
+        // in a model and also it does not contain any error.
+        if(this.model.sessChanged() && _.size(this.model.errorModel.attributes) == 0) {
 
           var self = this,
             node = self.field.get('schema_node'),

-- 
Sent via pgadmin-hackers mailing list ([email-masked])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

---

From: Ashesh Vashi <[email-masked]>
Date: Tue, 10 May 2016 12:36:23 +0530

Thanks - committed after few tweaks.
We will show 'incomplete definition' message instead of 'no change', which
was included in your patch.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company
<http://www.enterprisedb.com>

*http://www.linkedin.com/in/asheshvashi*
<http://www.linkedin.com/in/asheshvashi>