pgAdmin 4 commit: Add a missing screenshot, and remove personal info fr

2017-11-30 Thread Dave Page
Add a missing screenshot, and remove personal info from another.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=709f646f5e0f6020afe94f844379898e38a991f4
Author: Chethana Kumar 

Modified Files
--
docs/en_US/images/role_membership.png | Bin 0 -> 57495 bytes
docs/en_US/images/role_sql.png| Bin 77136 -> 80793 bytes
2 files changed, 0 insertions(+), 0 deletions(-)



Re: [pgAdmin4][RM2922] Login desktop user only once in runtime

2017-11-30 Thread Dave Page
Hi

Does this resolve the suggestion in
https://redmine.postgresql.org/issues/2919 about creating new sessions?

On Thu, Nov 30, 2017 at 7:58 AM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> Please find attached patch to fix issue where desktop user was logged in
> each request
> in runtime.
>
> --
> *Harshal Dhumal*
> *Sr. Software Engineer*
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>



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

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


pgAdmin 4 commit: Cleanup the layout of the filter data dialogue. Fixes

2017-11-30 Thread Dave Page
Cleanup the layout of the filter data dialogue. Fixes #2924

Branch
--
master

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

Modified Files
--
web/pgadmin/tools/datagrid/static/js/datagrid.js   | 29 +++---
.../tools/datagrid/templates/datagrid/filter.html  | 11 ++--
2 files changed, 29 insertions(+), 11 deletions(-)



pgAdmin 4 commit: Fix the width of Role dialogue so tabs don't wrap.

2017-11-30 Thread Dave Page
Fix the width of Role dialogue so tabs don't wrap.

Branch
--
master

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

Modified Files
--
web/pgadmin/browser/server_groups/servers/roles/static/js/role.js | 1 +
1 file changed, 1 insertion(+)



pgAdmin 4 commit: Refuse password changes (and tell the user) if the no

2017-11-30 Thread Dave Page
Refuse password changes (and tell the user) if the notification email cannot be 
sent. Fixes #2892

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=35a5cf22d5094645b1e2e66e7d2fbe1c40847232
Author: Harshal Dhumal 

Modified Files
--
web/pgadmin/__init__.py|  29 +--
web/pgadmin/browser/__init__.py| 207 -
web/pgadmin/browser/templates/browser/index.html   |   2 +-
.../templates/security/change_password.html|   2 +-
.../templates/security/email/change_notice.html|   4 +
.../templates/security/email/change_notice.txt |   5 +
.../templates/security/forgot_password.html|   2 +-
web/pgadmin/templates/security/login_user.html |   2 +-
web/pgadmin/templates/security/reset_password.html |   2 +-
9 files changed, 234 insertions(+), 21 deletions(-)



Re: [pgAdmin4][RM2892] Handle password changes properly if error occurs during sending email

2017-11-30 Thread Dave Page
Thanks - applied with minor changes to localise the messages and make it
clear to the user that their password wasn't changed if there was an error.

On Thu, Nov 30, 2017 at 6:11 AM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> Unlike flask login-manager flask-security does not provide facility to
> pass custom view
> function to any of callbacks like change/reset/forgot password. So we
> cannot
> handle any exceptions occurred during changing/resetting password.
> Only way we can handle such exceptions is writing our own routes for these
> callbacks and
> add addition code to handle such exceptions.
>
> --
> *Harshal Dhumal*
> *Sr. Software Engineer*
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>



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

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


Re: [pgAdmin4][RM2892] Handle password changes properly if error occurs during sending email

2017-11-30 Thread Dave Page
Oh, nuts - turns out this breaks the regression tests (the Python API
tests) if they're run with SERVER_MODE = True. Can you take a look ASAP
please?

Traceback (most recent call last):
  File "regression/runtests.py", line 325, in 
test_utils.login_tester_account(test_client)
  File
"/Users/dpage/git/pgadmin4/web/regression/python_test_utils/test_utils.py",
line 53, in login_tester_account
follow_redirects=True)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
line 772, in post
return self.open(*args, **kw)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/testing.py",
line 113, in open
follow_redirects=follow_redirects)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
line 751, in open
environ, buffered=buffered)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
line 691, in resolve_redirect
buffered=buffered)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/testing.py",
line 113, in open
follow_redirects=follow_redirects)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
line 736, in open
response = self.run_wsgi_app(environ, buffered=buffered)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
line 659, in run_wsgi_app
rv = run_wsgi_app(self.application, environ, buffered=buffered)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
line 855, in run_wsgi_app
app_iter = app(environ, start_response)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 2000, in __call__
return self.wsgi_app(environ, start_response)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1991, in wsgi_app
response = self.make_response(self.handle_exception(e))
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1567, in handle_exception
reraise(exc_type, exc_value, tb)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1988, in wsgi_app
response = self.full_dispatch_request()
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1641, in full_dispatch_request
rv = self.handle_user_exception(e)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1544, in handle_user_exception
reraise(exc_type, exc_value, tb)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1639, in full_dispatch_request
rv = self.dispatch_request()
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1625, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask_login.py",
line 792, in decorated_view
return func(*args, **kwargs)
  File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/__init__.py", line
527, in index
_=gettext
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/templating.py",
line 134, in render_template
context, ctx.app)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/templating.py",
line 116, in _render
rv = template.render(context)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/jinja2/environment.py",
line 969, in render
return self.environment.handle_exception(exc_info, True)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/jinja2/environment.py",
line 742, in handle_exception
reraise(exc_type, exc_value, tb)
  File
"/Users/dpage/git/pgadmin4/web/pgadmin/browser/templates/browser/index.html",
line 1, in top-level template code
{% extends "base.html" %}
  File "/Users/dpage/git/pgadmin4/web/pgadmin/templates/base.html", line
66, in top-level template code
{% block body %}{% endblock %}
  File
"/Users/dpage/git/pgadmin4/web/pgadmin/browser/templates/browser/index.html",
line 175, in block "body"
'{{ url_for('browser.change_password') }}'
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/helpers.py",
line 332, in url_for
return appctx.app.handle_url_build_error(error, endpoint, values)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1811, in handle_url_build_error
reraise(exc_type, exc_value, tb)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/helpers.py",
line 322, in url_for
force_external=external)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/routing.py",
line 1616, in build
raise BuildError(endpoint, values, method)
werkzeug.routing.BuildError: ('browser.change_password', {}, None)
make: *** [check-

Re: [pgAdmin4][RM2892] Handle password changes properly if error occurs during sending email

2017-11-30 Thread Harshal Dhumal
sure Dave, looking in it now.

-- 
*Harshal Dhumal*
*Sr. Software Engineer*

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

On Thu, Nov 30, 2017 at 5:01 PM, Dave Page  wrote:

> Oh, nuts - turns out this breaks the regression tests (the Python API
> tests) if they're run with SERVER_MODE = True. Can you take a look ASAP
> please?
>
> Traceback (most recent call last):
>   File "regression/runtests.py", line 325, in 
> test_utils.login_tester_account(test_client)
>   File 
> "/Users/dpage/git/pgadmin4/web/regression/python_test_utils/test_utils.py",
> line 53, in login_tester_account
> follow_redirects=True)
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
> line 772, in post
> return self.open(*args, **kw)
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/testing.py",
> line 113, in open
> follow_redirects=follow_redirects)
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
> line 751, in open
> environ, buffered=buffered)
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
> line 691, in resolve_redirect
> buffered=buffered)
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/testing.py",
> line 113, in open
> follow_redirects=follow_redirects)
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
> line 736, in open
> response = self.run_wsgi_app(environ, buffered=buffered)
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
> line 659, in run_wsgi_app
> rv = run_wsgi_app(self.application, environ, buffered=buffered)
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
> line 855, in run_wsgi_app
> app_iter = app(environ, start_response)
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 2000, in __call__
> return self.wsgi_app(environ, start_response)
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 1991, in wsgi_app
> response = self.make_response(self.handle_exception(e))
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 1567, in handle_exception
> reraise(exc_type, exc_value, tb)
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 1988, in wsgi_app
> response = self.full_dispatch_request()
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 1641, in full_dispatch_request
> rv = self.handle_user_exception(e)
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 1544, in handle_user_exception
> reraise(exc_type, exc_value, tb)
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 1639, in full_dispatch_request
> rv = self.dispatch_request()
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 1625, in dispatch_request
> return self.view_functions[rule.endpoint](**req.view_args)
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask_login.py",
> line 792, in decorated_view
> return func(*args, **kwargs)
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/__init__.py", line
> 527, in index
> _=gettext
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/templating.py",
> line 134, in render_template
> context, ctx.app)
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/templating.py",
> line 116, in _render
> rv = template.render(context)
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/jinja2/environment.py", line 969, in render
> return self.environment.handle_exception(exc_info, True)
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/jinja2/environment.py", line 742, in handle_exception
> reraise(exc_type, exc_value, tb)
>   File 
> "/Users/dpage/git/pgadmin4/web/pgadmin/browser/templates/browser/index.html",
> line 1, in top-level template code
> {% extends "base.html" %}
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/templates/base.html", line
> 66, in top-level template code
> {% block body %}{% endblock %}
>   File 
> "/Users/dpage/git/pgadmin4/web/pgadmin/browser/templates/browser/index.html",
> line 175, in block "body"
> '{{ url_for('browser.change_password') }}'
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/helpers.py",
> line 332, in url_for
> return appctx.app.handle_url_build_error(error, endpoint, values)
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.

Re: [pgAdmin4][RM2922] Login desktop user only once in runtime

2017-11-30 Thread Dave Page
Thanks, applied.

On Thu, Nov 30, 2017 at 7:58 AM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> Please find attached patch to fix issue where desktop user was logged in
> each request
> in runtime.
>
> --
> *Harshal Dhumal*
> *Sr. Software Engineer*
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>



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

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


pgAdmin 4 commit: Don't login the user with every request in desktop mo

2017-11-30 Thread Dave Page
Don't login the user with every request in desktop mode. Just do it once. Fixes 
#2922

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=f3256aef712faee6744c404415ff9afc8c248490
Author: Harshal Dhumal 

Modified Files
--
web/pgadmin/__init__.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)



Patch for pgAdmin docs (role_dialog.rst, resource_group_dialog.rst)

2017-11-30 Thread Susan Douglas
Hi All,

I've attached a patch that updates the following files (correcting minor 
problems, adding missing tabs, etc.):

resource_group_dialog.rst
role_dialog.rst

Dave has checked in the screenshots that go with these updates - Let me know if 
there are any problems!

Thanks!

-- Susan



pgadmin4_doc.patch
Description: Binary data


Re: Patch for pgAdmin docs (role_dialog.rst, resource_group_dialog.rst)

2017-11-30 Thread Dave Page
Hi

On Thu, Nov 30, 2017 at 12:04 PM, Susan Douglas <
susan.doug...@enterprisedb.com> wrote:

> Hi All,
>
> I've attached a patch that updates the following files (correcting minor
> problems, adding missing tabs, etc.):
>
> resource_group_dialog.rst
> role_dialog.rst
>
> Dave has checked in the screenshots that go with these updates - Let me
> know if there are any problems!
>
> Thanks!
>

Unfortunately the patch doesn't apply. Did you remember to update your repo
before creating it?

(pgadmin4)piranha:pgadmin4 dpage$ git apply ~/Downloads/pgadmin4_doc.patch
/Users/dpage/Downloads/pgadmin4_doc.patch:10: trailing whitespace.
Fields used to create a resource group are located on the *General* tab.
The *SQL* tab displays the SQL code generated by your selections on the
*Resource Group* dialog.
/Users/dpage/Downloads/pgadmin4_doc.patch:27: trailing whitespace.
Your entries in the *Resource Group* dialog generate a SQL command. Use the
*SQL* tab for review; revisit the *General* tab to make any changes to the
SQL command.
/Users/dpage/Downloads/pgadmin4_doc.patch:36: trailing whitespace.
* Click the Info button (*i*) to access online SQL syntax reference
material.
/Users/dpage/Downloads/pgadmin4_doc.patch:37: trailing whitespace.
* Click the Help button (*?*) to access online documentation about Resource
Groups.
/Users/dpage/Downloads/pgadmin4_doc.patch:50: trailing whitespace.
The *Login/Group Role* dialog organizes the creation and management of
roles through the following dialog tabs: *General*, *Definition*,
*Privileges*, *Parameters*, and *Security*. The *SQL* tab displays the SQL
code generated by dialog selections.
error: patch failed: docs/en_US/resource_group_dialog.rst:8
error: docs/en_US/resource_group_dialog.rst: patch does not apply
error: patch failed: docs/en_US/role_dialog.rst:6
error: docs/en_US/role_dialog.rst: patch does not apply


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

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


Re: [pgAdmin4][Patch]: RM #2849 - Allow editing of data on tables with OIDs but no primary key

2017-11-30 Thread Khushboo Vashi
Hi,

Please find the attached updated patch.

On Mon, Nov 27, 2017 at 5:15 PM, Dave Page  wrote:

> Hi
>
> On Thu, Nov 23, 2017 at 1:28 PM, Khushboo Vashi <
> khushboo.va...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> Please find the attached patch for RM #2849: Allow editing of data on
>> tables with OIDs but no primary key.
>>
>
> I like that if I add a new row or rows and hit Save, the OIDs are fetched
> immediately. However;
>
> - It marks the row as read-only. We do that currently because we don't
> return the key info on Save, and thus require a Refresh before any further
> editing. However, if we have the OID, we can edit again immediately.
>
> Fixed

> - If we can return the new OIDs on Save, can't we do the same for primary
> key values? That would be consistent with OIDs, and would remove the need
> to disable rows, leading to a much nicer use experience I think.
>
> Implemented

> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>

Thanks,
Khushboo
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/9.2_plus/nodes.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/9.2_plus/nodes.sql
index f3353d6..2c3e573 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/9.2_plus/nodes.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/9.2_plus/nodes.sql
@@ -15,9 +15,13 @@ WHERE
 {% if clid %}
 AND att.attnum = {{ clid|qtLiteral }}
 {% endif %}
-{### To show system objects ###}
-{% if not show_sys_objects %}
+{### To show system objects ###}
+{% if not show_sys_objects and not has_oids %}
 AND att.attnum > 0
-{% endif %}
+{% endif %}
+{### To show oids in view data ###}
+{% if has_oids %}
+AND (att.attnum > 0 OR (att.attname = 'oid' AND att.attnum < 0))
+{% endif %}
 AND att.attisdropped IS FALSE
 ORDER BY att.attnum
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/default/nodes.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/default/nodes.sql
index 4f1de2a..584f7b1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/default/nodes.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/default/nodes.sql
@@ -16,8 +16,12 @@ WHERE
 AND att.attnum = {{ clid|qtLiteral }}
 {% endif %}
 {### To show system objects ###}
-{% if not show_sys_objects %}
+{% if not show_sys_objects and not has_oids %}
 AND att.attnum > 0
 {% endif %}
+{### To show oids in view data ###}
+{% if has_oids %}
+AND (att.attnum > 0 OR (att.attname = 'oid' AND att.attnum < 0))
+{% endif %}
 AND att.attisdropped IS FALSE
 ORDER BY att.attnum
diff --git a/web/pgadmin/tools/sqleditor/__init__.py b/web/pgadmin/tools/sqleditor/__init__.py
index 8dcb444..363d6f8 100644
--- a/web/pgadmin/tools/sqleditor/__init__.py
+++ b/web/pgadmin/tools/sqleditor/__init__.py
@@ -433,6 +433,9 @@ def start_view_data(trans_id):
 sql = trans_obj.get_sql()
 pk_names, primary_keys = trans_obj.get_primary_keys(default_conn)
 
+# Fetch OIDs status
+has_oids = trans_obj.has_oids(default_conn)
+
 # Fetch the applied filter.
 filter_applied = trans_obj.is_filter_applied()
 
@@ -444,6 +447,10 @@ def start_view_data(trans_id):
 
 # Store the primary keys to the session object
 session_obj['primary_keys'] = primary_keys
+
+# Store the OIDs status into session object
+session_obj['has_oids'] = has_oids
+
 update_session_grid_transaction(trans_id, session_obj)
 
 # Execute sql asynchronously
@@ -655,6 +662,8 @@ def poll(trans_id):
 types = {}
 client_primary_key = None
 rset = None
+has_oids = False
+oids = None
 
 # Check the transaction and connection status
 status, error_msg, conn, trans_obj, session_obj = check_transaction_status(trans_id)
@@ -680,6 +689,11 @@ def poll(trans_id):
 if 'primary_keys' in session_obj:
 primary_keys = session_obj['primary_keys']
 
+if 'has_oids' in session_obj:
+has_oids = session_obj['has_oids']
+if has_oids:
+oids = {'oid': 'oid'}
+
 # Fetch column information
 columns_info = conn.get_column_info()
 client_primary_key = generate_client_primary_key_name(
@@ -698,7 +712,8 @@ def poll(trans_id):
 
 SQL = render_template("/".join([template_path,
 'nodes.sql']),
-  tid=command_obj.obj_id

pgAdmin 4 commit: Doc updates for resource groups and roles.

2017-11-30 Thread Dave Page
Doc updates for resource groups and roles.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=54389595da90513a60b08775d30a1e667f6c9633
Author: Susan Douglas 

Modified Files
--
docs/en_US/resource_group_dialog.rst | 15 ---
docs/en_US/role_dialog.rst   | 32 
2 files changed, 24 insertions(+), 23 deletions(-)



Re: Patch for pgAdmin docs (role_dialog.rst, resource_group_dialog.rst)

2017-11-30 Thread Susan Douglas
Hi All,

Dave helped me through this problem on chat... Thanks!

-- Susan



> On Nov 30, 2017, at 7:09 AM, Dave Page  wrote:
> 
> Hi
> 
> On Thu, Nov 30, 2017 at 12:04 PM, Susan Douglas 
> mailto:susan.doug...@enterprisedb.com>> 
> wrote:
> Hi All,
> 
> I've attached a patch that updates the following files (correcting minor 
> problems, adding missing tabs, etc.):
> 
> resource_group_dialog.rst
> role_dialog.rst
> 
> Dave has checked in the screenshots that go with these updates - Let me know 
> if there are any problems!
> 
> Thanks!
> 
> Unfortunately the patch doesn't apply. Did you remember to update your repo 
> before creating it?
> 
> (pgadmin4)piranha:pgadmin4 dpage$ git apply ~/Downloads/pgadmin4_doc.patch 
> /Users/dpage/Downloads/pgadmin4_doc.patch:10: trailing whitespace.
> Fields used to create a resource group are located on the *General* tab.  The 
> *SQL* tab displays the SQL code generated by your selections on the *Resource 
> Group* dialog. 
> /Users/dpage/Downloads/pgadmin4_doc.patch:27: trailing whitespace.
> Your entries in the *Resource Group* dialog generate a SQL command. Use the 
> *SQL* tab for review; revisit the *General* tab to make any changes to the 
> SQL command. 
> /Users/dpage/Downloads/pgadmin4_doc.patch:36: trailing whitespace.
> * Click the Info button (*i*) to access online SQL syntax reference material. 
> /Users/dpage/Downloads/pgadmin4_doc.patch:37: trailing whitespace.
> * Click the Help button (*?*) to access online documentation about Resource 
> Groups. 
> /Users/dpage/Downloads/pgadmin4_doc.patch:50: trailing whitespace.
> The *Login/Group Role* dialog organizes the creation and management of roles 
> through the following dialog tabs: *General*, *Definition*, *Privileges*, 
> *Parameters*, and *Security*. The *SQL* tab displays the SQL code generated 
> by dialog selections. 
> error: patch failed: docs/en_US/resource_group_dialog.rst:8
> error: docs/en_US/resource_group_dialog.rst: patch does not apply
> error: patch failed: docs/en_US/role_dialog.rst:6
> error: docs/en_US/role_dialog.rst: patch does not apply 
> 
> 
> -- 
> Dave Page
> Blog: http://pgsnake.blogspot.com 
> Twitter: @pgsnake
> 
> EnterpriseDB UK: http://www.enterprisedb.com 
> The Enterprise PostgreSQL Company



[pgAdmin4][Patch]: To fix the issue in Debugger module

2017-11-30 Thread Murtuza Zabuawala
Hi,

PFA patch to fix the issue where debugger failed to run when user tries to
debug the function which call itself recursively.
RM#2524

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/tools/debugger/templates/debugger/sql/v1/continue.sql 
b/web/pgadmin/tools/debugger/templates/debugger/sql/v1/continue.sql
index ff51aa9..6eaac13 100644
--- a/web/pgadmin/tools/debugger/templates/debugger/sql/v1/continue.sql
+++ b/web/pgadmin/tools/debugger/templates/debugger/sql/v1/continue.sql
@@ -6,6 +6,6 @@ SELECT
 (SELECT
 s.args
 FROM pldbg_get_stack({{session_id}}::INTEGER) s
-WHERE s.func = p.func AND s.pkg = p.pkg) AS args
+WHERE s.func = p.func AND s.pkg = p.pkg ORDER BY s.level LIMIT 1) AS args
 FROM pldbg_continue({{session_id}}::INTEGER) p
-{% endif %}
\ No newline at end of file
+{% endif %}
diff --git 
a/web/pgadmin/tools/debugger/templates/debugger/sql/v1/select_frame.sql 
b/web/pgadmin/tools/debugger/templates/debugger/sql/v1/select_frame.sql
index c70def7..f887417 100644
--- a/web/pgadmin/tools/debugger/templates/debugger/sql/v1/select_frame.sql
+++ b/web/pgadmin/tools/debugger/templates/debugger/sql/v1/select_frame.sql
@@ -7,6 +7,6 @@ SELECT
 (SELECT
 s.args
  FROM pldbg_get_stack({{session_id}}::INTEGER) s
- WHERE s.func = p.func AND s.pkg = p.pkg) AS args
+ WHERE s.func = p.func AND s.pkg = p.pkg ORDER BY s.level LIMIT 1) AS args
 FROM pldbg_select_frame({{session_id}}::INTEGER, {{frame_id}}::INTEGER) p
-{% endif %}
\ No newline at end of file
+{% endif %}
diff --git a/web/pgadmin/tools/debugger/templates/debugger/sql/v1/step_into.sql 
b/web/pgadmin/tools/debugger/templates/debugger/sql/v1/step_into.sql
index 676bbe0..dfbf19c 100644
--- a/web/pgadmin/tools/debugger/templates/debugger/sql/v1/step_into.sql
+++ b/web/pgadmin/tools/debugger/templates/debugger/sql/v1/step_into.sql
@@ -6,6 +6,6 @@ SELECT
 (SELECT
 s.args
  FROM pldbg_get_stack({{session_id}}::INTEGER) s
- WHERE s.func = p.func AND s.pkg = p.pkg) AS args
+ WHERE s.func = p.func AND s.pkg = p.pkg ORDER BY s.level LIMIT 1) AS args
 FROM pldbg_step_into({{session_id}}::INTEGER) p
-{% endif %}
\ No newline at end of file
+{% endif %}
diff --git a/web/pgadmin/tools/debugger/templates/debugger/sql/v1/step_over.sql 
b/web/pgadmin/tools/debugger/templates/debugger/sql/v1/step_over.sql
index 572aa80..4b9848b 100644
--- a/web/pgadmin/tools/debugger/templates/debugger/sql/v1/step_over.sql
+++ b/web/pgadmin/tools/debugger/templates/debugger/sql/v1/step_over.sql
@@ -6,6 +6,6 @@ SELECT
 (SELECT
 s.args
 FROM pldbg_get_stack({{session_id}}::INTEGER) s
-WHERE s.func = p.func AND s.pkg = p.pkg) AS args
+WHERE s.func = p.func AND s.pkg = p.pkg ORDER BY s.level LIMIT 1) AS args
 FROM pldbg_step_over({{session_id}}::INTEGER) p
-{% endif %}
\ No newline at end of file
+{% endif %}
diff --git 
a/web/pgadmin/tools/debugger/templates/debugger/sql/v1/wait_for_breakpoint.sql 
b/web/pgadmin/tools/debugger/templates/debugger/sql/v1/wait_for_breakpoint.sql
index eb98625..a1eb1fd 100644
--- 
a/web/pgadmin/tools/debugger/templates/debugger/sql/v1/wait_for_breakpoint.sql
+++ 
b/web/pgadmin/tools/debugger/templates/debugger/sql/v1/wait_for_breakpoint.sql
@@ -6,6 +6,6 @@ SELECT
 (SELECT
 s.args
  FROM pldbg_get_stack({{session_id}}::INTEGER) s
- WHERE s.func = p.func AND s.pkg = p.pkg) AS args
+ WHERE s.func = p.func AND s.pkg = p.pkg ORDER BY s.level LIMIT 1) AS args
 FROM pldbg_wait_for_breakpoint({{session_id}}::INTEGER) p;
-{% endif %}
\ No newline at end of file
+{% endif %}
diff --git a/web/pgadmin/tools/debugger/templates/debugger/sql/v2/continue.sql 
b/web/pgadmin/tools/debugger/templates/debugger/sql/v2/continue.sql
index 3cbeeab..67fd863 100644
--- a/web/pgadmin/tools/debugger/templates/debugger/sql/v2/continue.sql
+++ b/web/pgadmin/tools/debugger/templates/debugger/sql/v2/continue.sql
@@ -6,6 +6,6 @@ SELECT
 (SELECT
 s.args
 FROM pldbg_get_stack({{session_id}}::INTEGER) s
-WHERE s.func = p.func) AS args
+WHERE s.func = p.func ORDER BY s.level LIMIT 1) AS args
 FROM pldbg_continue({{session_id}}::INTEGER) p
-{% endif %}
\ No newline at end of file
+{% endif %}
diff --git 
a/web/pgadmin/tools/debugger/templates/debugger/sql/v2/select_frame.sql 
b/web/pgadmin/tools/debugger/templates/debugger/sql/v2/select_frame.sql
index ac2bc77..4ae0356 100644
--- a/web/pgadmin/tools/debugger/templates/debugger/sql/v2/select_frame.sql
+++ b/web/pgadmin/tools/debugger/templates/debugger/sql/v2/select_frame.sql
@@ -6,6 +6,6 @@ SELECT
 (SELECT
 s.args
  FROM pldbg_get_stack({{session_id}}::INTEGER) s
- WHERE s.func = p.func) AS args
+ WHERE s.func = p.func ORDER BY s.level LIMIT 1) AS args
 FROM pldbg_select_frame({{session_id}}::INTEGER, {{frame_id}}::INTEGER) p
-{% endif %}
\ No newline at end of file
+{% endif %}
diff --git a/web/pgadmi

Re: [pgAdmin4][RM2892] Handle password changes properly if error occurs during sending email

2017-11-30 Thread Harshal Dhumal
Hi Dave,

Please find patch to fix testsuite.

Changes:
1. Set config parameters SECURITY_RECOVERABLE and SECURITY_CHANGEABLE to
True if SERVER_MODE is True
while running testsuite (Though we have set these parameters to True in
create_app function but regression testsuite
initialises (imports) browser module before the app instance is created.)

2. Updated new URL references in testsuite code.

3. Also I have changed URL */browser/forgot_password* to
*/browser/reset_password* to make it consistent
with flask-security URL (as there is no such URL /forgot in flask-security)


-- 
*Harshal Dhumal*
*Sr. Software Engineer*

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

On Thu, Nov 30, 2017 at 5:09 PM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> sure Dave, looking in it now.
>
> --
> *Harshal Dhumal*
> *Sr. Software Engineer*
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Thu, Nov 30, 2017 at 5:01 PM, Dave Page  wrote:
>
>> Oh, nuts - turns out this breaks the regression tests (the Python API
>> tests) if they're run with SERVER_MODE = True. Can you take a look ASAP
>> please?
>>
>> Traceback (most recent call last):
>>   File "regression/runtests.py", line 325, in 
>> test_utils.login_tester_account(test_client)
>>   File 
>> "/Users/dpage/git/pgadmin4/web/regression/python_test_utils/test_utils.py",
>> line 53, in login_tester_account
>> follow_redirects=True)
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
>> line 772, in post
>> return self.open(*args, **kw)
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/testing.py",
>> line 113, in open
>> follow_redirects=follow_redirects)
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
>> line 751, in open
>> environ, buffered=buffered)
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
>> line 691, in resolve_redirect
>> buffered=buffered)
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/testing.py",
>> line 113, in open
>> follow_redirects=follow_redirects)
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
>> line 736, in open
>> response = self.run_wsgi_app(environ, buffered=buffered)
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
>> line 659, in run_wsgi_app
>> rv = run_wsgi_app(self.application, environ, buffered=buffered)
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
>> line 855, in run_wsgi_app
>> app_iter = app(environ, start_response)
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 2000, in __call__
>> return self.wsgi_app(environ, start_response)
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1991, in wsgi_app
>> response = self.make_response(self.handle_exception(e))
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1567, in handle_exception
>> reraise(exc_type, exc_value, tb)
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1988, in wsgi_app
>> response = self.full_dispatch_request()
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1641, in full_dispatch_request
>> rv = self.handle_user_exception(e)
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1544, in handle_user_exception
>> reraise(exc_type, exc_value, tb)
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1639, in full_dispatch_request
>> rv = self.dispatch_request()
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1625, in dispatch_request
>> return self.view_functions[rule.endpoint](**req.view_args)
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask_login.py",
>> line 792, in decorated_view
>> return func(*args, **kwargs)
>>   File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/__init__.py", line
>> 527, in index
>> _=gettext
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/templating.py",
>> line 134, in render_template
>> context, ctx.app)
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/templating.py",
>> line 116, in _render
>> rv = template.render(context)
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/jinja2/environment.py",
>> line 969, in render
>> return self.environment.handle_exception(exc_info, True)
>

pgAdmin 4 commit: Fix regression tests for password reset in server mod

2017-11-30 Thread Dave Page
Fix regression tests for password reset in server mode

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=1a4e21e6dd689aa6e5c53f1453f342529850aaa3
Author: Harshal Dhumal 

Modified Files
--
web/pgadmin/browser/__init__.py  | 8 
web/pgadmin/browser/tests/test_reset_password.py | 4 ++--
web/pgadmin/browser/tests/utils.py   | 4 ++--
web/regression/runtests.py   | 6 ++
4 files changed, 14 insertions(+), 8 deletions(-)



Re: [pgAdmin4][RM2892] Handle password changes properly if error occurs during sending email

2017-11-30 Thread Dave Page
Thanks, applied.

On Thu, Nov 30, 2017 at 1:04 PM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi Dave,
>
> Please find patch to fix testsuite.
>
> Changes:
> 1. Set config parameters SECURITY_RECOVERABLE and SECURITY_CHANGEABLE to
> True if SERVER_MODE is True
> while running testsuite (Though we have set these parameters to True in
> create_app function but regression testsuite
> initialises (imports) browser module before the app instance is created.)
>
> 2. Updated new URL references in testsuite code.
>
> 3. Also I have changed URL */browser/forgot_password* to
> */browser/reset_password* to make it consistent
> with flask-security URL (as there is no such URL /forgot in flask-security)
>
>
> --
> *Harshal Dhumal*
> *Sr. Software Engineer*
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Thu, Nov 30, 2017 at 5:09 PM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> sure Dave, looking in it now.
>>
>> --
>> *Harshal Dhumal*
>> *Sr. Software Engineer*
>>
>> EnterpriseDB India: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>> On Thu, Nov 30, 2017 at 5:01 PM, Dave Page  wrote:
>>
>>> Oh, nuts - turns out this breaks the regression tests (the Python API
>>> tests) if they're run with SERVER_MODE = True. Can you take a look ASAP
>>> please?
>>>
>>> Traceback (most recent call last):
>>>   File "regression/runtests.py", line 325, in 
>>> test_utils.login_tester_account(test_client)
>>>   File 
>>> "/Users/dpage/git/pgadmin4/web/regression/python_test_utils/test_utils.py",
>>> line 53, in login_tester_account
>>> follow_redirects=True)
>>>   File 
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
>>> line 772, in post
>>> return self.open(*args, **kw)
>>>   File 
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/testing.py",
>>> line 113, in open
>>> follow_redirects=follow_redirects)
>>>   File 
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
>>> line 751, in open
>>> environ, buffered=buffered)
>>>   File 
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
>>> line 691, in resolve_redirect
>>> buffered=buffered)
>>>   File 
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/testing.py",
>>> line 113, in open
>>> follow_redirects=follow_redirects)
>>>   File 
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
>>> line 736, in open
>>> response = self.run_wsgi_app(environ, buffered=buffered)
>>>   File 
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
>>> line 659, in run_wsgi_app
>>> rv = run_wsgi_app(self.application, environ, buffered=buffered)
>>>   File 
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
>>> line 855, in run_wsgi_app
>>> app_iter = app(environ, start_response)
>>>   File 
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>>> line 2000, in __call__
>>> return self.wsgi_app(environ, start_response)
>>>   File 
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>>> line 1991, in wsgi_app
>>> response = self.make_response(self.handle_exception(e))
>>>   File 
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>>> line 1567, in handle_exception
>>> reraise(exc_type, exc_value, tb)
>>>   File 
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>>> line 1988, in wsgi_app
>>> response = self.full_dispatch_request()
>>>   File 
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>>> line 1641, in full_dispatch_request
>>> rv = self.handle_user_exception(e)
>>>   File 
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>>> line 1544, in handle_user_exception
>>> reraise(exc_type, exc_value, tb)
>>>   File 
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>>> line 1639, in full_dispatch_request
>>> rv = self.dispatch_request()
>>>   File 
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>>> line 1625, in dispatch_request
>>> return self.view_functions[rule.endpoint](**req.view_args)
>>>   File 
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask_login.py",
>>> line 792, in decorated_view
>>> return func(*args, **kwargs)
>>>   File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/__init__.py",
>>> line 527, in index
>>> _=gettext
>>>   File 
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/templating.py",
>>> line 134, in render_template
>>> context, ctx.app)
>>>   File 
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/templating.py

Re: [pgAdmin4][RM2922] Login desktop user only once in runtime

2017-11-30 Thread Harshal Dhumal
Dave,

On Thu, Nov 30, 2017 at 3:38 PM, Dave Page  wrote:

> Hi
>
> Does this resolve the suggestion in https://redmine.postgresql.
> org/issues/2919 about creating new sessions?
>

Do you think we should allow endpoint /misc/ping to be accessible outside
of Qt application
as long as user passes PGADMIN_KEY with request? (this will require new
session to be created for each /misc/ping request)


>
> On Thu, Nov 30, 2017 at 7:58 AM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> Please find attached patch to fix issue where desktop user was logged in
>> each request
>> in runtime.
>>
>> --
>> *Harshal Dhumal*
>> *Sr. Software Engineer*
>>
>> EnterpriseDB India: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


[pgAdmin4][Patch]: Remove default 'Altertify JS' header from debugger related error alerts

2017-11-30 Thread Murtuza Zabuawala
Hi,

PFA patch to remove default 'Altertify JS' header from debugger related
error notifications.
RM#2098

Also fixed similar issue in other modules.

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/tools/debugger/static/js/debugger.js 
b/web/pgadmin/tools/debugger/static/js/debugger.js
index d8df30c..f905044 100644
--- a/web/pgadmin/tools/debugger/static/js/debugger.js
+++ b/web/pgadmin/tools/debugger/static/js/debugger.js
@@ -208,7 +208,7 @@ define([
 try {
   var err = $.parseJSON(xhr.responseText);
   if (err.success == 0) {
-Alertify.alert(err.errormsg);
+Alertify.alert(gettext('Debugger Error'), err.errormsg);
   }
 } catch (e) {}
   }
@@ -324,7 +324,7 @@ define([
 try {
   var err = $.parseJSON(xhr.responseText);
   if (err.success == 0) {
-Alertify.alert(err.errormsg);
+Alertify.alert(gettext('Debugger Error'), err.errormsg);
   }
 } catch (e) {}
   }
diff --git a/web/pgadmin/tools/debugger/static/js/debugger_ui.js 
b/web/pgadmin/tools/debugger/static/js/debugger_ui.js
index 4460e3e..ecb7e87 100644
--- a/web/pgadmin/tools/debugger/static/js/debugger_ui.js
+++ b/web/pgadmin/tools/debugger/static/js/debugger_ui.js
@@ -211,7 +211,8 @@ define([
   },
   error: function(e) {
 Alertify.alert(
-  gettext('Debugger Set Arguments Error')
+  gettext('Debugger Error'),
+  gettext('Unable to fetch the arguments from server')
 );
   }
 });
@@ -662,7 +663,8 @@ define([
   },
   error: function(e) {
 Alertify.alert(
-  gettext('Debugger Set arguments error')
+  gettext('Debugger Error'),
+  gettext('Unable to set the arguments on the server')
 );
   }
 });
@@ -708,7 +710,8 @@ define([
   },
   error: function(e) {
 Alertify.alert(
-  gettext('Debugger Set Arguments Error')
+  gettext('Debugger Error'),
+  gettext('Unable to set the arguments on the server')
 );
   }
 });
diff --git a/web/pgadmin/tools/debugger/static/js/direct.js 
b/web/pgadmin/tools/debugger/static/js/direct.js
index 96637eb..640bcf2 100644
--- a/web/pgadmin/tools/debugger/static/js/direct.js
+++ b/web/pgadmin/tools/debugger/static/js/direct.js
@@ -660,7 +660,7 @@ define([
   try {
 var err = $.parseJSON(xhr.responseText);
 if (err.success == 0) {
-  Alertify.alert(err.errormsg);
+  Alertify.alert(gettext('Debugger Error'), err.errormsg);
 }
   } catch (e) {}
 }
diff --git a/web/pgadmin/tools/backup/static/js/backup.js 
b/web/pgadmin/tools/backup/static/js/backup.js
index 2d24b89..a6fbafe 100644
--- a/web/pgadmin/tools/backup/static/js/backup.js
+++ b/web/pgadmin/tools/backup/static/js/backup.js
@@ -380,7 +380,10 @@ TODO LIST FOR BACKUP:
   if (pgBrowser.tree.hasParent(i)) {
 i = $(pgBrowser.tree.parent(i));
   } else {
-alertify.alert(gettext("Please select server or child node from 
the browser tree."));
+alertify.alert(
+  gettext("Backup Error"),
+  gettext("Please select server or child node from the browser 
tree.")
+);
 break;
   }
 }
@@ -407,7 +410,10 @@ TODO LIST FOR BACKUP:
 return;
   }
 } else {
-  alertify.alert(S(gettext('Failed to load preference %s of module 
%s')).sprintf(preference_name, module).value());
+  alertify.alert(
+gettext('Backup Error'),
+S(gettext('Failed to load preference %s of module 
%s')).sprintf(preference_name, module).value()
+  );
   return;
 }
 
@@ -595,7 +601,10 @@ TODO LIST FOR BACKUP:
   if (pgBrowser.tree.hasParent(i)) {
 i = $(pgBrowser.tree.parent(i));
   } else {
-alertify.alert(gettext("Please select server or child node from 
tree."));
+alertify.alert(
+  gettext("Backup Error"),
+  gettext("Please select server or child node from tree.")
+);
 break;
   }
 }
@@ -618,11 +627,14 @@ TODO LIST FOR BACKUP:
 
 if(preference) {
   if (!preference.value) {
-alertify.alert(msg);
+alertify.alert(gettext('Configuration required'), msg);
 return;
   }
 } else {
-  alertify.