public inbox for [email protected]  
help / color / mirror / Atom feed
pgadmin4 new server host rule is missing
4+ messages / 2 participants
[nested] [flat]

* pgadmin4 new server host rule is missing
@ 2016-04-14 20:18  Seçkin Alan <[email protected]>
  0 siblings, 2 replies; 4+ messages in thread

From: Seçkin Alan @ 2016-04-14 20:18 UTC (permalink / raw)
  To: pgadmin-hackers

Hi,
In model Server.host field is nullable=False but, UI Hostname/address
field can accept null value.
So,
When I click save button, in that time throw error like NOT NULL
constraint failed: server.host .

-- 
Seçkin ALAN
http://sckn.org


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


Attachments:

  [text/x-patch] servers_js.patch (824B, 2-servers_js.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/templates/servers/servers.js b/web/pgadmin/browser/server_groups/servers/templates/servers/servers.js
index 32e9399..ed9b7dc 100644
--- a/web/pgadmin/browser/server_groups/servers/templates/servers/servers.js
+++ b/web/pgadmin/browser/server_groups/servers/templates/servers/servers.js
@@ -215,6 +215,11 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
             err['name'] = '{{ _('Name can be empty!') }}';
             errmsg = errmsg || err['name'];
           }
+          if (_.isUndefined(this.get('host')) ||this.get('host') == null || String(this.get('host')).replace(/^\s+|\s+$/g, '') == '') {
+            err['host'] = '{{ _('Host can be empty!') }}';
+            errmsg = errmsg || err['host'];
+          }
+
           this.errorModel.set(err);


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pgadmin4 new server host rule is missing
@ 2016-04-14 20:46  Seçkin Alan <[email protected]>
  parent: Seçkin Alan <[email protected]>
  1 sibling, 1 reply; 4+ messages in thread

From: Seçkin Alan @ 2016-04-14 20:46 UTC (permalink / raw)
  To: pgadmin-hackers

++
change node js

full patch is attached

On Thu, Apr 14, 2016 at 11:18 PM, Seçkin Alan <[email protected]> wrote:
> Hi,
> In model Server.host field is nullable=False but, UI Hostname/address
> field can accept null value.
> So,
> When I click save button, in that time throw error like NOT NULL
> constraint failed: server.host .
>
> --
> Seçkin ALAN
> http://sckn.org



-- 
Seçkin ALAN
http://sckn.org


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


Attachments:

  [text/x-patch] servers_js_node_js.patch (1.5K, 2-servers_js_node_js.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/templates/servers/servers.js b/web/pgadmin/browser/server_groups/servers/templates/servers/servers.js
index 32e9399..ed9b7dc 100644
--- a/web/pgadmin/browser/server_groups/servers/templates/servers/servers.js
+++ b/web/pgadmin/browser/server_groups/servers/templates/servers/servers.js
@@ -215,6 +215,11 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
             err['name'] = '{{ _('Name can be empty!') }}';
             errmsg = errmsg || err['name'];
           }
+          if (_.isUndefined(this.get('host')) ||this.get('host') == null || String(this.get('host')).replace(/^\s+|\s+$/g, '') == '') {
+            err['host'] = '{{ _('Host can be empty!') }}';
+            errmsg = errmsg || err['host'];
+          }
+
           this.errorModel.set(err);
diff --git a/web/pgadmin/browser/templates/browser/js/node.js b/web/pgadmin/browser/templates/browser/js/node.js
index 98f774b..a0e071a 100644
--- a/web/pgadmin/browser/templates/browser/js/node.js
+++ b/web/pgadmin/browser/templates/browser/js/node.js
@@ -851,7 +851,7 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
                   if (d && !_.isEmpty(d)) {
                     m.save({}, {
                       attrs: d,
-                      validate: true,
+                      validate: false,
                       cache: false,
                       success: function() {
                         onSaveFunc.call();


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pgadmin4 new server host rule is missing
@ 2016-04-14 20:46  Dave Page <[email protected]>
  parent: Seçkin Alan <[email protected]>
  1 sibling, 0 replies; 4+ messages in thread

From: Dave Page @ 2016-04-14 20:46 UTC (permalink / raw)
  To: Seçkin Alan <[email protected]>; +Cc: pgadmin-hackers

Thanks - patch applied, with some improved messages for this check and
the name check..

On Thu, Apr 14, 2016 at 9:18 PM, Seçkin Alan <[email protected]> wrote:
> Hi,
> In model Server.host field is nullable=False but, UI Hostname/address
> field can accept null value.
> So,
> When I click save button, in that time throw error like NOT NULL
> constraint failed: server.host .
>
> --
> Seçkin ALAN
> http://sckn.org
>
>
> --
> Sent via pgadmin-hackers mailing list ([email protected])
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pgadmin4 new server host rule is missing
@ 2016-04-14 20:51  Dave Page <[email protected]>
  parent: Seçkin Alan <[email protected]>
  0 siblings, 0 replies; 4+ messages in thread

From: Dave Page @ 2016-04-14 20:51 UTC (permalink / raw)
  To: Seçkin Alan <[email protected]>; +Cc: pgadmin-hackers

Updated as well - thanks.

On Thu, Apr 14, 2016 at 9:46 PM, Seçkin Alan <[email protected]> wrote:
> ++
> change node js
>
> full patch is attached
>
> On Thu, Apr 14, 2016 at 11:18 PM, Seçkin Alan <[email protected]> wrote:
>> Hi,
>> In model Server.host field is nullable=False but, UI Hostname/address
>> field can accept null value.
>> So,
>> When I click save button, in that time throw error like NOT NULL
>> constraint failed: server.host .
>>
>> --
>> Seçkin ALAN
>> http://sckn.org
>
>
>
> --
> Seçkin ALAN
> http://sckn.org
>
>
> --
> Sent via pgadmin-hackers mailing list ([email protected])
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2016-04-14 20:51 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-04-14 20:18 pgadmin4 new server host rule is missing Seçkin Alan <[email protected]>
2016-04-14 20:46 ` Seçkin Alan <[email protected]>
2016-04-14 20:51   ` Dave Page <[email protected]>
2016-04-14 20:46 ` Dave Page <[email protected]>

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