public inbox for [email protected]  
help / color / mirror / Atom feed
From: Joao De Almeida Pereira <[email protected]>
To: Khushboo Vashi <[email protected]>
Cc: Dave Page <[email protected]>
Cc: [email protected]
Cc: pgadmin-hackers <[email protected]>
Subject: Re: pgAdmin 4 commit: Refactor server dialogue validation for better unit t
Date: Wed, 14 Mar 2018 16:10:53 +0000
Message-ID: <CAE+jja==RKhCxxdRmrZrWtg=X90gQ7ode=bCGRid5N7j0obUqw@mail.gmail.com> (raw)
In-Reply-To: <CAFOhELfb1KY7zhzSOYvtn3R7FYmTXN6RcZ82NsgFNAeTXuv-hQ@mail.gmail.com>
References: <[email protected]>
	<CAFOhELfb1KY7zhzSOYvtn3R7FYmTXN6RcZ82NsgFNAeTXuv-hQ@mail.gmail.com>

Hi Khushboo,
Good catch, attached you can find the fix for the problem.

Thanks
Victoria & Joao

On Wed, Mar 14, 2018 at 10:37 AM Khushboo Vashi <
[email protected]> wrote:

> Hi Joao/Victoria,
>
> I am getting an error while editing the server properties. Please refer
> the attached screen-shot for the same.
>
> Thanks,
> Khushboo
>
> On Wed, Mar 14, 2018 at 12:17 AM, Dave Page <[email protected]> wrote:
>
>> Refactor server dialogue validation for better unit testing.
>>
>> Victoria & Joao @ Pivotal.
>>
>> Branch
>> ------
>> master
>>
>> Details
>> -------
>>
>> https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=6b03cb78af607b04c75de44d635bf201babb...
>> Author: Victoria Henry <[email protected]>
>>
>> Modified Files
>> --------------
>> web/package.json                                   |   3 +-
>> .../server_groups/servers/static/js/server.js      | 113
>> ++-------------------
>> web/pgadmin/static/bundle/browser.js               |   2 +-
>> web/pgadmin/static/js/browser/index.js             |  10 ++
>> .../static/js/browser/server_groups/index.js       |  10 ++
>> .../server_groups/servers/databases/index.js       |  10 ++
>> .../js/browser/server_groups/servers/index.js      |  11 ++
>> .../server_groups/servers/model_validation.js      | 104
>> +++++++++++++++++++
>> .../server_groups/servers/model_validation_spec.js | 101
>> ++++++++++++++++++
>> web/yarn.lock                                      |  46 ++++++++-
>> 10 files changed, 299 insertions(+), 111 deletions(-)
>>
>>
>


Attachments:

  [text/x-patch] fix-trim-function.diff (1.3K, 3-fix-trim-function.diff)
  download | inline diff:
diff --git a/web/pgadmin/static/js/browser/server_groups/servers/model_validation.js b/web/pgadmin/static/js/browser/server_groups/servers/model_validation.js
index 7ab129ba..948af3d4 100644
--- a/web/pgadmin/static/js/browser/server_groups/servers/model_validation.js
+++ b/web/pgadmin/static/js/browser/server_groups/servers/model_validation.js
@@ -99,6 +99,6 @@ export class ModelValidation {
   }
 
   static isEmptyString(string) {
-    return _.isUndefined(string) || _.isNull(string) || string.trim() === '';
+    return _.isUndefined(string) || _.isNull(string) || String(string).trim() === '';
   }
 }
diff --git a/web/regression/javascript/browser/server_groups/servers/model_validation_spec.js b/web/regression/javascript/browser/server_groups/servers/model_validation_spec.js
index a05cd455..560d8b60 100644
--- a/web/regression/javascript/browser/server_groups/servers/model_validation_spec.js
+++ b/web/regression/javascript/browser/server_groups/servers/model_validation_spec.js
@@ -31,7 +31,7 @@ describe('Server#ModelValidation', () => {
         model.isNew.and.returnValue(true);
         model.allValues['name'] = 'some name';
         model.allValues['username'] = 'some username';
-        model.allValues['port'] = 'some port';
+        model.allValues['port'] = 12345;
       });
 
       describe('No service id', () => {


view thread (4+ 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], [email protected], [email protected], [email protected]
  Subject: Re: pgAdmin 4 commit: Refactor server dialogue validation for better unit t
  In-Reply-To: <CAE+jja==RKhCxxdRmrZrWtg=X90gQ7ode=bCGRid5N7j0obUqw@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