[pgAdmin4][Patch]: Fix 'Connect to Server' dialog layout

2017-09-07 Thread Murtuza Zabuawala
Hi,

PFA minor patch to fix the 'Connect to Server' dialog layout issue.
RM#2684

This issue is regression of commit: Link


--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

[image: https://community.postgresrocks.net/]

diff --git a/web/pgadmin/static/js/alertify.pgadmin.defaults.js 
b/web/pgadmin/static/js/alertify.pgadmin.defaults.js
index 5993df9..81bd7eb 100644
--- a/web/pgadmin/static/js/alertify.pgadmin.defaults.js
+++ b/web/pgadmin/static/js/alertify.pgadmin.defaults.js
@@ -94,7 +94,7 @@ function(gettext, alertify, S) {
 if (contentType) {
   try {
 if (contentType.indexOf('application/json') == 0) {
-  resp = $.parseJSON(msg);
+  var resp = $.parseJSON(msg);
 
   if (resp.result != null && (!resp.errormsg || resp.errormsg == 
'') &&
   onJSONResult && typeof(onJSONResult) == 'function') {


[pgAdmin4][Patch]: Fix CREATE Script issue in Index module

2017-09-07 Thread Murtuza Zabuawala
Hi,

PFA minor patch to fix the issue where sql from CREATE Script/SQL Panel
doesn't escape column names in Table reversed engineered sql (if table has
index) & Index reversed engineered sql.
RM#2619

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

[image: https://community.postgresrocks.net/]

diff --git 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/__init__.py
 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/__init__.py
index 670dccd..ee48ef3 100644
--- 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/__init__.py
+++ 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/__init__.py
@@ -480,7 +480,7 @@ class IndexesView(PGChildNodeView):
 status=200
 )
 
-def _column_details(self, idx, data):
+def _column_details(self, idx, data, mode='properties'):
 """
 This functional will fetch list of column details for index
 
@@ -504,8 +504,10 @@ class IndexesView(PGChildNodeView):
 cols = []
 for row in rset['rows']:
 # We need all data as collection for ColumnsModel
+# we will not strip down colname when using in SQL to display
 cols_data = {
-'colname': row['attdef'].strip('"'),
+'colname': row['attdef'] if mode == 'create' else
+row['attdef'].strip('"'),
 'collspcname': row['collnspname'],
 'op_class': row['opcname'],
 }
@@ -901,7 +903,7 @@ class IndexesView(PGChildNodeView):
 data['table'] = self.table
 
 # Add column details for current index
-data = self._column_details(idx, data)
+data = self._column_details(idx, data, 'create')
 
 SQL, name = self.get_sql(did, scid, tid, None, data)
 if not isinstance(SQL, (str, unicode)):
diff --git 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/utils.py 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/utils.py
index d212faf..d9b69ec 100644
--- 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/utils.py
+++ 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/utils.py
@@ -923,8 +923,9 @@ class BaseTableView(PGChildNodeView):
 cols = []
 for col_row in rset['rows']:
 # We need all data as collection for ColumnsModel
+# Only for displaying SQL, we can omit strip on colname
 cols_data = {
-'colname': col_row['attdef'].strip('"'),
+'colname': col_row['attdef'],
 'collspcname': col_row['collnspname'],
 'op_class': col_row['opcname'],
 }


Re: [pgAdmin4][Patch]: Run MakeFile to generate builds in production mode

2017-09-07 Thread Dave Page
Hi

On Thu, Sep 7, 2017 at 7:28 AM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi,
>
> When we run Webpack in production mode, it performs optimization on code
> while in development we don't optimize generated JS and CSS bundles as dev
> mode is for developer use.
>
> So we should run Webpack bundle in production mode when we are generating
> bundles for release mode.
>

Don't we also need a bundle target for dev mode? The patch changes "make
bundle" to run "yarn run bundle:prod"


>
> *In the second patch:*
>
> 1) Enabled "*sourced maps*" in production mode as well which will help in
> debugging issues.
>
> 2) Removed "*yarn run linter*" script when Webpack runs in production
> mode because it is for developer only to check if there are any syntax
> errors in JS modules.
>
> 3) Removed redundant script command "*yarn run bundle*" as "*yarn run
> bundle:dev*" does the same thing.
>
> Please find an attached patch.
>
> Thanks,
> Surinder
>
>


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

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


Re: [pgAdmin4][Patch]: Fix 'Connect to Server' dialog layout

2017-09-07 Thread Dave Page
 Thanks, applied.

On Thu, Sep 7, 2017 at 11:12 AM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> PFA minor patch to fix the 'Connect to Server' dialog layout issue.
> RM#2684
>
> This issue is regression of commit: Link
> 
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> [image: https://community.postgresrocks.net/]
> 
>



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

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


pgAdmin 4 commit: Fix layout of password prompt dialogue. Fixes #2684

2017-09-07 Thread Dave Page
Fix layout of password prompt dialogue. Fixes #2684

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=d5f60e1a47b122dab133f2567efaf1a6dea8b6aa
Author: Murtuza Zabuawala 

Modified Files
--
web/pgadmin/static/js/alertify.pgadmin.defaults.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



pgAdmin 4 commit: Fix quoting of index column names on tables. Fixes #2

2017-09-07 Thread Dave Page
Fix quoting of index column names on tables. Fixes #2619

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=8d248dab4c09a5c637569e3b4fb166c02ebff17a
Author: Murtuza Zabuawala 

Modified Files
--
.../servers/databases/schemas/tables/indexes/__init__.py  | 8 +---
.../server_groups/servers/databases/schemas/tables/utils.py   | 3 ++-
2 files changed, 7 insertions(+), 4 deletions(-)



Re: [pgAdmin4][Patch]: Fix CREATE Script issue in Index module

2017-09-07 Thread Dave Page
Thanks, applied.

On Thu, Sep 7, 2017 at 2:59 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> PFA minor patch to fix the issue where sql from CREATE Script/SQL Panel
> doesn't escape column names in Table reversed engineered sql (if table has
> index) & Index reversed engineered sql.
> RM#2619
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> [image: https://community.postgresrocks.net/]
> 
>



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

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


Build failed in Jenkins: pgadmin4-master-python26 #432

2017-09-07 Thread pgAdmin 4 Jenkins
See 


Changes:

[Dave Page] Fix layout of password prompt dialogue. Fixes #2684

[Dave Page] Fix quoting of index column names on tables. Fixes #2619

--
Started by an SCM change
Started by an SCM change
Started by an SCM change
Started by an SCM change
Started by an SCM change
Started by an SCM change
Started by an SCM change
Started by an SCM change
Started by an SCM change
[EnvInject] - Loading node environment variables.
Building in workspace 

 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url git://git.postgresql.org/git/pgadmin4.git # 
 > timeout=10
Cleaning workspace
 > git rev-parse --verify HEAD # timeout=10
Resetting working tree
 > git reset --hard # timeout=10
 > git clean -fdx # timeout=10
Fetching upstream changes from git://git.postgresql.org/git/pgadmin4.git
 > git --version # timeout=10
 > git fetch --tags --progress git://git.postgresql.org/git/pgadmin4.git 
 > +refs/heads/*:refs/remotes/origin/*
 > git rev-parse origin/master^{commit} # timeout=10
Checking out Revision 8d248dab4c09a5c637569e3b4fb166c02ebff17a (origin/master)
Commit message: "Fix quoting of index column names on tables. Fixes #2619"
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 8d248dab4c09a5c637569e3b4fb166c02ebff17a
 > git rev-list 263aa42725964aa8cb66aae44aabd1e13152f338 # timeout=10
[EnvInject] - Executing scripts and injecting environment variables after the 
SCM step.
[EnvInject] - Injecting as environment variables the properties content 
PYTHON_VERSION=2.6

[EnvInject] - Variables injected successfully.
[pgadmin4-master-python26] $ /bin/sh -xe /tmp/jenkins6602856437161875323.sh
+ 
EXECUTING: Create pgAdmin config

EXECUTING: Python tests

Creating Python 2.6 virtual environment...

New python executable in 

Installing setuptools, pip, wheel...done.
Running virtualenv with interpreter /usr/local/python-2.6/bin/python
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please 
upgrade your Python. A future version of pip will drop support for Python 2.6
Collecting Babel==2.3.4 (from -r requirements.txt (line 4))
  Using cached Babel-2.3.4-py2.py3-none-any.whl
Collecting beautifulsoup4==4.4.1 (from -r requirements.txt (line 5))
  Using cached beautifulsoup4-4.4.1-py2-none-any.whl
Collecting blinker==1.3 (from -r requirements.txt (line 6))
Collecting click==6.6 (from -r requirements.txt (line 7))
  Using cached click-6.6-py2.py3-none-any.whl
Collecting extras==0.0.3 (from -r requirements.txt (line 8))
Collecting fixtures==2.0.0 (from -r requirements.txt (line 9))
  Using cached fixtures-2.0.0-py2.py3-none-any.whl
Collecting Flask==0.11.1 (from -r requirements.txt (line 10))
  Using cached Flask-0.11.1-py2.py3-none-any.whl
Collecting Flask-Babel==0.11.1 (from -r requirements.txt (line 11))
Collecting Flask-Gravatar==0.4.2 (from -r requirements.txt (line 12))
  Using cached Flask_Gravatar-0.4.2-py2.py3-none-any.whl
Collecting Flask-HTMLmin==1.2 (from -r requirements.txt (line 13))
Collecting Flask-Login==0.3.2 (from -r requirements.txt (line 14))
Collecting Flask-Mail==0.9.1 (from -r requirements.txt (line 15))
Collecting Flask-Migrate==2.0.3 (from -r requirements.txt (line 16))
Collecting Flask-Principal==0.4.0 (from -r requirements.txt (line 17))
Collecting Flask-Security==1.7.5 (from -r requirements.txt (line 18))
Collecting Flask-SQLAlchemy==2.1 (from -r requirements.txt (line 19))
Collecting Flask-WTF==0.12 (from -r requirements.txt (line 20))
  Using cached Flask_WTF-0.12-py2-none-any.whl
Collecting html5lib==1.0b3 (from -r requirements.txt (line 21))
Collecting importlib==1.0.3 (from -r requirements.txt (line 22))
:318:
 SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name 
Indication) extension to TLS is not available on this platform. This may cause 
the server to present an incorrect TLS certificate, which can cause validation 
failures. You can upgrade to a newer version of Python to solve this. For more 
information, see 
https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
:122:
 InsecurePlatformWarning: A true SSLContext object is not available. This 
prevents urllib3 from configuring SSL appropriately and may cause certain SSL 
connections to fail. You can upgrade to a n

Re: [pgAdmin4][Patch]: Run MakeFile to generate builds in production mode

2017-09-07 Thread Surinder Kumar
Hi

On Thu, Sep 7, 2017 at 8:48 PM, Dave Page  wrote:

> Hi
>
> On Thu, Sep 7, 2017 at 7:28 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> When we run Webpack in production mode, it performs optimization on code
>> while in development we don't optimize generated JS and CSS bundles as dev
>> mode is for developer use.
>>
>> So we should run Webpack bundle in production mode when we are generating
>> bundles for release mode.
>>
>
> Don't we also need a bundle target for dev mode? The patch changes "make
> bundle" to run "yarn run bundle:prod"
>
​yes I think so.
We can have two Makefiles - one for dev mode and other for production mode.

>
>
>>
>> *In the second patch:*
>>
>> 1) Enabled "*sourced maps*" in production mode as well which will help
>> in debugging issues.
>>
>> 2) Removed "*yarn run linter*" script when Webpack runs in production
>> mode because it is for developer only to check if there are any syntax
>> errors in JS modules.
>>
>> 3) Removed redundant script command "*yarn run bundle*" as "*yarn run
>> bundle:dev*" does the same thing.
>>
>> Please find an attached patch.
>>
>> Thanks,
>> Surinder
>>
>>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


Re: [pgAdmin4][Patch]: Run MakeFile to generate builds in production mode

2017-09-07 Thread Dave Page
No, let's just have two targets in one makefile. It's only for our convenience.

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

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

> On 8 Sep 2017, at 05:34, Surinder Kumar  
> wrote:
> 
> Hi
> 
>> On Thu, Sep 7, 2017 at 8:48 PM, Dave Page  wrote:
>> Hi
>> 
>>> On Thu, Sep 7, 2017 at 7:28 AM, Surinder Kumar 
>>>  wrote:
>>> Hi,
>>> 
>>> When we run Webpack in production mode, it performs optimization on code 
>>> while in development we don't optimize generated JS and CSS bundles as dev 
>>> mode is for developer use.
>>> 
>>> So we should run Webpack bundle in production mode when we are generating 
>>> bundles for release mode.
>> 
>> Don't we also need a bundle target for dev mode? The patch changes "make 
>> bundle" to run "yarn run bundle:prod"
> ​yes I think so.
> We can have two Makefiles - one for dev mode and other for production mode.
>>  
>>> 
>>> In the second patch:
>>> 
>>> 1) Enabled "sourced maps" in production mode as well which will help in 
>>> debugging issues.
>>> 
>>> 2) Removed "yarn run linter" script when Webpack runs in production mode 
>>> because it is for developer only to check if there are any syntax errors in 
>>> JS modules.
>>> 
>>> 3) Removed redundant script command "yarn run bundle" as "yarn run 
>>> bundle:dev" does the same thing.
>>> 
>>> Please find an attached patch.
>>> 
>>> Thanks,
>>> Surinder
>>> 
>> 
>> 
>> 
>> -- 
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>> 
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>