[pgAdmin][RM4993] [Accessibility] Read-only controls and disabled controls needs to be separately identified

2020-01-22 Thread Aditya Toshniwal
Hi Hackers,

Attached is the patch to allow input controls to be set as readonly instead
of disabled.
I've also changed the code for the nodes to make sure properties tab have
readonly fields wherever applicable. This will allow tab navigation in
properties tab and also allow screen readers to read it.
Please note that, I've not visited each and every node create/edit dialog
to identify what should be readonly or what should be disabled as it
depends on business logic. The patch is mainly for the properties tab.

Kindly review.

-- 
Thanks and Regards,
Aditya Toshniwal
pgAdmin Hacker | Sr. Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"


RM4993.patch
Description: Binary data


flask db migrate error

2020-01-22 Thread Radoslaw Garbacz
Hi,

As this is my first post I'd like to thank you for your work on this
project.
Originally I posted this following question to pgsql-gui-dev and was
advised to repost here.

I have a question regarding modifying configuration db model for pgadmin4:
When trying to create a new migration file I get an error:
sqlalchemy.exc.NoSuchTableError: user_old

The command used: FLASK_APP=pgAdmin4.py flask db migrate -m "Add data
groups"
The db is initialized with: python setup.py, I also tried:
FLASK_APP=pgAdmin4.py flask db init

When commenting out (just for tests) content of
"web/migrations/versions/35f29b1701bd_.py" I get a similar error but with
"server_old".
So my question is what is the correct procedure to modify configuration db
or how to solve the mentioned issue?

Thanks in advance,

DETAILS:

* pgadmin4 version: cloned from master with latest commit on Jan 13, 2020

* Changes in "model/__init__.py":
SCHEMA_VERSION = 25
...
class DataGroup(db.Model):
"""Define a data group for the treeview"""
__tablename__ = 'datagroup'
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.Integer, db.ForeignKey('user.id'),
nullable=False)

name = db.Column(db.String(128), nullable=False)
__table_args__ = (db.UniqueConstraint('user_id', 'name'),)


* migrate command exception details:
...
 File
"/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/alembic/util/compat.py",
line 173, in load_module_py
spec.loader.exec_module(module)
  File "", line 728, in exec_module
  File "", line 219, in
_call_with_frames_removed
  File "migrations/env.py", line 94, in 
run_migrations_online()
  File "migrations/env.py", line 87, in run_migrations_online
context.run_migrations()
  File "", line 8, in run_migrations
  File
"/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/alembic/runtime/environment.py",
line 846, in run_migrations
self.get_context().run_migrations(**kw)
  File
"/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/alembic/runtime/migration.py",
line 507, in run_migrations
for step in self._migrations_fn(heads, self):
  File
"/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/alembic/command.py",
line 190, in retrieve_migrations
revision_context.run_autogenerate(rev, context)
  File
"/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/alembic/autogenerate/api.py",
line 442, in run_autogenerate
self._run_environment(rev, migration_context, True)
  File
"/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/alembic/autogenerate/api.py",
line 482, in _run_environment
autogen_context, migration_script
  File
"/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/alembic/autogenerate/compare.py",
line 25, in _populate_migration_script
_produce_net_changes(autogen_context, upgrade_ops)
  File
"/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/alembic/autogenerate/compare.py",
line 51, in _produce_net_changes
autogen_context, upgrade_ops, schemas
  File
"/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/alembic/util/langhelpers.py",
line 303, in go
fn(*arg, **kw)
  File
"/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/alembic/autogenerate/compare.py",
line 83, in _autogen_for_tables
autogen_context,
  File
"/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/alembic/autogenerate/compare.py",
line 195, in _compare_tables
inspector.reflecttable(t, None)
  File
"/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/sqlalchemy/engine/reflection.py",
line 669, in reflecttable
reflection_options,
  File
"/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/sqlalchemy/engine/reflection.py",
line 848, in _reflect_fk
**reflection_options
  File "", line 2, in __new__
  File
"/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/sqlalchemy/util/deprecations.py",
line 128, in warned
return fn(*args, **kwargs)
  File
"/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/sqlalchemy/sql/schema.py",
line 506, in __new__
metadata._remove_table(name, schema)
  File
"/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py",
line 68, in __exit__
compat.reraise(exc_type, exc_value, exc_tb)
  File
"/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/sqlalchemy/util/compat.py",
line 153, in reraise
raise value
  File
"/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/sqlalchemy/sql/schema.py",
line 501, in __new__
table._init(name, metadata, *args, **kw)
  File
"/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/sqlalchemy/sql/schema.py",
line 595, in _init
resolve_fks=resolve_fks,
  File
"/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/sqlalchemy/sql/schema.py",
line 619, in _autoload
_extend_on=_extend_on,
  File
"/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/sqlalchemy/engine/base.py",
line 1615, in run_callable
re

Re: flask db migrate error

2020-01-22 Thread Khushboo Vashi
Hi,

On Wed, Jan 22, 2020 at 9:06 PM Radoslaw Garbacz <
radoslaw.garb...@xtremedatainc.com> wrote:

> Hi,
>
> As this is my first post I'd like to thank you for your work on this
> project.
> Originally I posted this following question to pgsql-gui-dev and was
> advised to repost here.
>
> I have a question regarding modifying configuration db model for pgadmin4:
> When trying to create a new migration file I get an error:
> sqlalchemy.exc.NoSuchTableError: user_old
>
> You can get the proper steps for the database migration from the README
file with the "Create Database Migrations" section. (file location:
/README).

Thanks,
Khushboo

The command used: FLASK_APP=pgAdmin4.py flask db migrate -m "Add data
> groups"
> The db is initialized with: python setup.py, I also tried:
> FLASK_APP=pgAdmin4.py flask db init
>
> When commenting out (just for tests) content of
> "web/migrations/versions/35f29b1701bd_.py" I get a similar error but with
> "server_old".
> So my question is what is the correct procedure to modify configuration db
> or how to solve the mentioned issue?
>
> Thanks in advance,
>
> DETAILS:
>
> * pgadmin4 version: cloned from master with latest commit on Jan 13, 2020
>
> * Changes in "model/__init__.py":
> SCHEMA_VERSION = 25
> ...
> class DataGroup(db.Model):
> """Define a data group for the treeview"""
> __tablename__ = 'datagroup'
> id = db.Column(db.Integer, primary_key=True)
> user_id = db.Column(db.Integer, db.ForeignKey('user.id'),
> nullable=False)
>
> name = db.Column(db.String(128), nullable=False)
> __table_args__ = (db.UniqueConstraint('user_id', 'name'),)
>
>
> * migrate command exception details:
> ...
>  File
> "/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/alembic/util/compat.py",
> line 173, in load_module_py
> spec.loader.exec_module(module)
>   File "", line 728, in exec_module
>   File "", line 219, in
> _call_with_frames_removed
>   File "migrations/env.py", line 94, in 
> run_migrations_online()
>   File "migrations/env.py", line 87, in run_migrations_online
> context.run_migrations()
>   File "", line 8, in run_migrations
>   File
> "/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/alembic/runtime/environment.py",
> line 846, in run_migrations
> self.get_context().run_migrations(**kw)
>   File
> "/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/alembic/runtime/migration.py",
> line 507, in run_migrations
> for step in self._migrations_fn(heads, self):
>   File
> "/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/alembic/command.py",
> line 190, in retrieve_migrations
> revision_context.run_autogenerate(rev, context)
>   File
> "/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/alembic/autogenerate/api.py",
> line 442, in run_autogenerate
> self._run_environment(rev, migration_context, True)
>   File
> "/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/alembic/autogenerate/api.py",
> line 482, in _run_environment
> autogen_context, migration_script
>   File
> "/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/alembic/autogenerate/compare.py",
> line 25, in _populate_migration_script
> _produce_net_changes(autogen_context, upgrade_ops)
>   File
> "/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/alembic/autogenerate/compare.py",
> line 51, in _produce_net_changes
> autogen_context, upgrade_ops, schemas
>   File
> "/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/alembic/util/langhelpers.py",
> line 303, in go
> fn(*arg, **kw)
>   File
> "/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/alembic/autogenerate/compare.py",
> line 83, in _autogen_for_tables
> autogen_context,
>   File
> "/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/alembic/autogenerate/compare.py",
> line 195, in _compare_tables
> inspector.reflecttable(t, None)
>   File
> "/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/sqlalchemy/engine/reflection.py",
> line 669, in reflecttable
> reflection_options,
>   File
> "/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/sqlalchemy/engine/reflection.py",
> line 848, in _reflect_fk
> **reflection_options
>   File "", line 2, in __new__
>   File
> "/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/sqlalchemy/util/deprecations.py",
> line 128, in warned
> return fn(*args, **kwargs)
>   File
> "/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/sqlalchemy/sql/schema.py",
> line 506, in __new__
> metadata._remove_table(name, schema)
>   File
> "/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py",
> line 68, in __exit__
> compat.reraise(exc_type, exc_value, exc_tb)
>   File
> "/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/sqlalchemy/util/compat.py",
> line 153, in reraise
> raise value
>   File
> "/home/rga/.virtualenvs/pgadmin4/lib/python3.7/site-packages/sqlalc

Re: [pgAdmin4][RM#5107] Add tab navigation for tabs under explain panel in query tool

2020-01-22 Thread Akshay Joshi
Hi Ganesh

Following are the review comments:

   - Focus is going on Table headers but it is not visible.
   - Need to handle keyboard events on table header for sorting.
   - Add tabindex property for the table rows.
   - Add keyboard events to select the file from the file dialog.


On Tue, Jan 21, 2020 at 6:26 PM Ganesh Jaybhay <
ganesh.jayb...@enterprisedb.com> wrote:

> Hi Hackers,
>
> Please find the attached minor fix for tab navigation on footer and
> confirmation dialog buttons from file manager dialogue
> Kindly review.
>
> Regards,
> Ganesh Jaybhay
>


-- 
*Thanks & Regards*
*Akshay Joshi*

*Sr. Software Architect*
*EnterpriseDB Software India Private Limited*
*Mobile: +91 976-788-8246*


Re: [pgAdmin][RM4993] [Accessibility] Read-only controls and disabled controls needs to be separately identified

2020-01-22 Thread Akshay Joshi
Hi Aditya

On Wed, Jan 22, 2020 at 5:46 PM Aditya Toshniwal <
aditya.toshni...@enterprisedb.com> wrote:

> Hi Hackers,
>
> Attached is the patch to allow input controls to be set as readonly
> instead of disabled.
> I've also changed the code for the nodes to make sure properties tab have
> readonly fields wherever applicable. This will allow tab navigation in
> properties tab and also allow screen readers to read it.
> Please note that, I've not visited each and every node create/edit dialog
> to identify what should be readonly or what should be disabled as it
> depends on business logic. The patch is mainly for the properties tab.
>
> Kindly review.
>
> --
> Thanks and Regards,
> Aditya Toshniwal
> pgAdmin Hacker | Sr. Software Engineer | EnterpriseDB India | Pune
> "Don't Complain about Heat, Plant a TREE"
>


-- 
*Thanks & Regards*
*Akshay Joshi*

*Sr. Software Architect*
*EnterpriseDB Software India Private Limited*
*Mobile: +91 976-788-8246*


Re: [pgAdmin][RM4993] [Accessibility] Read-only controls and disabled controls needs to be separately identified

2020-01-22 Thread Akshay Joshi
Hi Aditya

As per discussion, we should visit all the nodes create/edit dialog and
make the controls read-only wherever appropriate.

On Wed, Jan 22, 2020 at 5:46 PM Aditya Toshniwal <
aditya.toshni...@enterprisedb.com> wrote:

> Hi Hackers,
>
> Attached is the patch to allow input controls to be set as readonly
> instead of disabled.
> I've also changed the code for the nodes to make sure properties tab have
> readonly fields wherever applicable. This will allow tab navigation in
> properties tab and also allow screen readers to read it.
> Please note that, I've not visited each and every node create/edit dialog
> to identify what should be readonly or what should be disabled as it
> depends on business logic. The patch is mainly for the properties tab.
>
> Kindly review.
>
> --
> Thanks and Regards,
> Aditya Toshniwal
> pgAdmin Hacker | Sr. Software Engineer | EnterpriseDB India | Pune
> "Don't Complain about Heat, Plant a TREE"
>


-- 
*Thanks & Regards*
*Akshay Joshi*

*Sr. Software Architect*
*EnterpriseDB Software India Private Limited*
*Mobile: +91 976-788-8246*


pgadmin 4 wont start on redhat 8

2020-01-22 Thread Andre Steyn
I get these messages each time i startup, i have removed and re-installed,
but get the same issues

[root@localhost ~]# systemctl status pgadmin4.service
● pgadmin4.service - pgAdmin4 Server Mode
   Loaded: loaded (/usr/lib/systemd/system/pgadmin4.service; enabled;
vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2020-01-23 08:25:36 SAST;
1h 14min ago
 Docs: https://www.pgadmin.org/docs/
 Main PID: 5237 (code=exited, status=1/FAILURE)

Jan 23 08:25:36 localhost.localdomain python3[5237]:
self.get_context().run_migrations(**kw)
Jan 23 08:25:36 localhost.localdomain python3[5237]:   File
"/usr/lib/python3.6/site-packages/alembic/runtime/migration.py", line 362,
in run_migrations
Jan 23 08:25:36 localhost.localdomain python3[5237]:
step.migration_fn(**kw)
Jan 23 08:25:36 localhost.localdomain python3[5237]:   File
"/usr/lib/python3.6/site-packages/pgadmin4-web/migrations/versions/fdc58d9bd449_.py",
line 43, in upgrade
Jan 23 08:25:36 localhost.localdomain python3[5237]: email, password =
user_info()
Jan 23 08:25:36 localhost.localdomain python3[5237]:   File
"/usr/lib/python3.6/site-packages/pgadmin4-web/pgadmin/setup/user_info.py",
line 55, in user_info
Jan 23 08:25:36 localhost.localdomain python3[5237]: email =
input("Email address: ")
Jan 23 08:25:36 localhost.localdomain python3[5237]: EOFError: EOF when
reading a line
Jan 23 08:25:36 localhost.localdomain systemd[1]: pgadmin4.service: Main
process exited, code=exited, status=1/FAILURE
Jan 23 08:25:36 localhost.localdomain systemd[1]: pgadmin4.service: Failed
with result 'exit-code'.

-- 

* can you please assist?*


Regards
--

*Andre Steyn *| NTR | Email:  mailto:tuddy...@gmail.com 



[image: cid:image001.jpg@01C922E1.F264D450]



“*Intellectual growth should commence at birth and cease only at
death*” - Albert
Einstein