pgAdmin 4 commit: Added shared server support for admin users. Fixes #4

2020-09-03 Thread Akshay Joshi
Added shared server support for admin users. Fixes #4979

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=b562ab768150b99947346975b63f89637ad4cea0
Author: Pradip Parkale 

Modified Files
--
docs/en_US/release_notes_4_26.rst  |   1 +
web/migrations/versions/a091c9611d20_.py   |  72 ++
web/pgadmin/__init__.py|   2 +-
.../browser/register_browser_preferences.py|  10 +
web/pgadmin/browser/server_groups/__init__.py  | 116 ++-
.../browser/server_groups/servers/__init__.py  | 475 +---
.../servers/static/img/sharedserverbad.svg |  45 ++
.../server_groups/servers/static/js/server.js  | 146 +++-
.../servers/templates/css/servers.css  |  18 +
.../servers/tests/servers_test_data.json   | 862 +
.../server_groups/servers/tests/test_add_server.py |  84 ++
.../tests/test_add_server_with_connect_timeout.py  |  47 --
.../tests/test_add_server_with_service_id.py   |  47 --
.../tests/test_add_server_with_ssh_tunnel.py   |  82 --
.../servers/tests/test_all_server_get.py   |  78 ++
.../servers/tests/test_check_connect.py| 107 +++
.../servers/tests/test_is_password_saved.py|  52 ++
.../server_groups/servers/tests/test_server_add.py |  86 --
.../servers/tests/test_server_delete.py|   7 +-
.../server_groups/servers/tests/test_server_get.py |  44 +-
.../server_groups/servers/tests/test_server_put.py |  51 +-
.../servers/tests/test_shared_server.py| 134 
.../browser/server_groups/servers/tests/utils.py   |  52 ++
.../static/img/server_group_shared.svg |  42 +
.../server_groups/static/js/server_group.js|  22 +-
.../server_groups/templates/css/server_group.css   |  17 +
web/pgadmin/browser/static/js/browser.js   |   2 +-
web/pgadmin/browser/templates/browser/js/utils.js  |   1 +
web/pgadmin/model/__init__.py  |  88 ++-
web/pgadmin/preferences/__init__.py|   2 +
web/pgadmin/preferences/static/js/preferences.js   |  24 +
web/pgadmin/tools/schema_diff/__init__.py  |  18 +-
.../schema_diff/static/js/schema_diff.backform.js  |   2 +-
.../utils/driver/psycopg2/server_manager.py|   1 +
web/regression/python_test_utils/test_utils.py | 106 +++
web/regression/test_config.json.in |   5 +
web/setup.py   |   9 +
37 files changed, 2526 insertions(+), 431 deletions(-)



pgAdmin 4 commit: Improve code coverage and API test cases for Tables.

2020-09-03 Thread Akshay Joshi
Improve code coverage and API test cases for Tables. Fixes #5774.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=3e35dc95e5c633572a24371b49011e306f18f0a0
Author: Yogesh Mahajan 

Modified Files
--
docs/en_US/release_notes_4_26.rst  |1 +
.../schemas/tables/tests/table_test_data.json  | 1934 
.../tables/tests/test_column_privileges_put.py |   96 -
.../schemas/tables/tests/test_table_add.py |  214 +--
.../schemas/tables/tests/test_table_delete.py  |   63 +-
.../tests/test_table_dependencies_dependents.py|   75 +
.../schemas/tables/tests/test_table_get.py |   59 +-
.../tests/test_table_get_existing_table_actions.py |   98 +
.../schemas/tables/tests/test_table_get_nodes.py   |   98 +
...test_table_get_pre_table_creation_parameters.py |  104 ++
.../tables/tests/test_table_get_script_sql.py  |   99 +
.../tables/tests/test_table_get_statistics.py  |   95 +
.../schemas/tables/tests/test_table_msql.py|   79 +
.../schemas/tables/tests/test_table_parameters.py  |  175 --
.../schemas/tables/tests/test_table_put.py |  143 +-
.../tables/tests/test_table_put_partition.py   |  117 ++
..._multiple.py => test_table_reset_statistics.py} |   56 +-
.../schemas/tables/tests/test_table_sql.py |   88 +
.../databases/schemas/tables/tests/utils.py|   89 +-
19 files changed, 3080 insertions(+), 603 deletions(-)



Re: Housekeeping #5774 - [Code Coverage] Improve API test cases for Table node

2020-09-03 Thread Akshay Joshi
Thanks, patch applied.

On Thu, Sep 3, 2020 at 12:12 PM Yogesh Mahajan <
yogesh.maha...@enterprisedb.com> wrote:

> Hi,
>
> Please find a patch which adds tests for table nodes. Test coverage for
> table nodes has increased from 16% to 56%.
>
>
> Thanks,
> Yogesh Mahajan
> QA - Team
> EnterpriseDB Corporation
>
> Phone: +91-9741705709
>


-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Sr. Software Architect*
*EDB Postgres *

*Mobile: +91 976-788-8246*


pgAdmin 4 commit: Fixed linter error by removing 'debugger;' keyword.

2020-09-03 Thread Akshay Joshi
Fixed linter error by removing 'debugger;' keyword.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=ed0c4037ad8e1a2cd987d2f9e86d8e18e6003db0

Modified Files
--
web/pgadmin/preferences/static/js/preferences.js | 1 -
1 file changed, 1 deletion(-)



pgAdmin 4 commit: Fixed API test cases failed due to commit for #4979.

2020-09-03 Thread Akshay Joshi
Fixed API test cases failed due to commit for #4979.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=a67f6e4f9c1ffc24d7d5ddece97689d3533912dc

Modified Files
--
.../browser/server_groups/servers/tests/test_shared_server.py| 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)



[pgAdmin][SonarQube] : Remove duplicates string literals.

2020-09-03 Thread Pradip Parkale
Hi Hackers,

Attached is a patch for removing duplicates string literals.
/server_groups/servers/roles/__init__.py  - 8 places



-- 
Thanks & Regards,
Pradip Parkale
Software Engineer | EnterpriseDB Corporation


sonar_Qube_v1.patch
Description: Binary data


Re: [pgAdmin4][Patch] - SonarQube Fixes

2020-09-03 Thread Khushboo Vashi
Hi,

Please find more fixes for the sonarqube code smells having the rule "String
literals should not be duplicated".

Thanks,
Khushboo

On Wed, Aug 19, 2020 at 2:27 PM Akshay Joshi 
wrote:

> Thanks, patch applied.
>
> On Wed, Aug 19, 2020 at 2:01 PM Khushboo Vashi <
> khushboo.va...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> Please find the attached updated patch.
>>
>>
>> On Tue, Aug 4, 2020 at 12:10 PM Akshay Joshi <
>> akshay.jo...@enterprisedb.com> wrote:
>>
>>> Hi Khushboo
>>>
>>> As per offline discussion, multiple developers declaring the constant
>>> for the same string and error messages. To avoid that only one developer
>>> should work on this task.
>>> Suggestions:
>>>
>>>- We should have a common class for Constants (which are not module
>>>specific).
>>>
>>> Made a constant.py file which contains the common Constants.
>>
>>>
>>>- For module specific constants we should not declare them as Global
>>>variables if possible declare them as the Class variable.
>>>
>>>
>>>- For common error messages(if any) we can define functions in
>>>PGChildNodeView.
>>>
>>> Already implemented.
>>
>>> Please incorporate the changes send by Yogesh.
>>>
>> I will send another patch for Yogesh's changes as needed more changes.
>>
>> Thanks,
>> Khushboo
>>
>>>
>>> On Mon, Aug 3, 2020 at 1:36 PM Khushboo Vashi <
>>> khushboo.va...@enterprisedb.com> wrote:
>>>
 Hi,

 Please find the attached patch to fix the sonarqube code smells having
 the rule "String literals should not be duplicated".

 Thanks,
 Khushboo

>>>
>>>
>>> --
>>> *Thanks & Regards*
>>> *Akshay Joshi*
>>> *pgAdmin Hacker | Sr. Software Architect*
>>> *EDB Postgres *
>>>
>>> *Mobile: +91 976-788-8246*
>>>
>>
>
> --
> *Thanks & Regards*
> *Akshay Joshi*
> *pgAdmin Hacker | Sr. Software Architect*
> *EDB Postgres *
>
> *Mobile: +91 976-788-8246*
>


Sonar_Qube_Fixes.patch
Description: Binary data


Re: [pgAdmin][SonarQube] : Remove duplicates string literals.

2020-09-03 Thread Akshay Joshi
Hi Pradip

Following are the review comments:

   - ROLE_NOT_FOUND already in wrapped in gettext() then no need to use
   like gone(_(ROLE_NOT_FOUND)). In fact, can we use

   self.not_found_error_msg()instead of new constant.

   - Same with ERROR_FETCHING_ROLE_INFORMATION it's already in gettext,
   also we can use this constant for string "

   Error retrieving roles from the database server"



On Thu, Sep 3, 2020 at 4:30 PM Pradip Parkale <
pradip.park...@enterprisedb.com> wrote:

> Hi Hackers,
>
> Attached is a patch for removing duplicates string literals.
> /server_groups/servers/roles/__init__.py  - 8 places
>
>
>
> --
> Thanks & Regards,
> Pradip Parkale
> Software Engineer | EnterpriseDB Corporation
>


-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Sr. Software Architect*
*EDB Postgres *

*Mobile: +91 976-788-8246*


pgAdmin 4 commit: Fixed cognitive complexity issues reported by SonarQu

2020-09-03 Thread Akshay Joshi
Fixed cognitive complexity issues reported by SonarQube.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=974d395a488f8e9a64586bbc6a15201e3f1b0321
Author: Aditya Toshniwal 

Modified Files
--
web/pgadmin/misc/file_manager/__init__.py  |  41 +++---
web/pgadmin/tools/grant_wizard/__init__.py | 228 +++--
web/pgadmin/tools/sqleditor/__init__.py| 125 
3 files changed, 202 insertions(+), 192 deletions(-)



pgAdmin 4 commit: Fixed primary key/unique constraint icon issue.

2020-09-03 Thread Akshay Joshi
Fixed primary key/unique constraint icon issue.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=eaa90ee8eb6a4a39f379e050eb20927f4bbba7ce

Modified Files
--
.../schemas/tables/constraints/index_constraint/__init__.py | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)



pgAdmin 4 commit: Fixed code smell 'String literals should not be dupli

2020-09-03 Thread Akshay Joshi
Fixed code smell 'String literals should not be duplicated'.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=31bbdd6a126c93815a960453d0644747e2f33099
Author: Khushboo Vashi 

Modified Files
--
.../servers/databases/schemas/utils.py | 30 +---
web/pgadmin/misc/file_manager/__init__.py  | 40 ++
web/pgadmin/tools/schema_diff/__init__.py  | 17 -
web/pgadmin/tools/sqleditor/__init__.py| 37 +---
web/pgadmin/tools/sqleditor/static/js/sqleditor.js |  2 +-
web/pgadmin/tools/sqleditor/utils/filter_dialog.py |  5 +--
.../tools/sqleditor/utils/start_running_query.py   |  5 +--
web/pgadmin/utils/constants.py | 11 ++
8 files changed, 79 insertions(+), 68 deletions(-)



Re: [pgAdmin4][Patch] - SonarQube Fixes

2020-09-03 Thread Akshay Joshi
Thanks, patch applied.

On Thu, Sep 3, 2020 at 4:39 PM Khushboo Vashi <
khushboo.va...@enterprisedb.com> wrote:

> Hi,
>
> Please find more fixes for the sonarqube code smells having the rule "String
> literals should not be duplicated".
>
> Thanks,
> Khushboo
>
> On Wed, Aug 19, 2020 at 2:27 PM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Thanks, patch applied.
>>
>> On Wed, Aug 19, 2020 at 2:01 PM Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> Please find the attached updated patch.
>>>
>>>
>>> On Tue, Aug 4, 2020 at 12:10 PM Akshay Joshi <
>>> akshay.jo...@enterprisedb.com> wrote:
>>>
 Hi Khushboo

 As per offline discussion, multiple developers declaring the constant
 for the same string and error messages. To avoid that only one developer
 should work on this task.
 Suggestions:

- We should have a common class for Constants (which are not module
specific).

 Made a constant.py file which contains the common Constants.
>>>

- For module specific constants we should not declare them as
Global variables if possible declare them as the Class variable.


- For common error messages(if any) we can define functions in
PGChildNodeView.

 Already implemented.
>>>
 Please incorporate the changes send by Yogesh.

>>> I will send another patch for Yogesh's changes as needed more changes.
>>>
>>> Thanks,
>>> Khushboo
>>>

 On Mon, Aug 3, 2020 at 1:36 PM Khushboo Vashi <
 khushboo.va...@enterprisedb.com> wrote:

> Hi,
>
> Please find the attached patch to fix the sonarqube code smells having
> the rule "String literals should not be duplicated".
>
> Thanks,
> Khushboo
>


 --
 *Thanks & Regards*
 *Akshay Joshi*
 *pgAdmin Hacker | Sr. Software Architect*
 *EDB Postgres *

 *Mobile: +91 976-788-8246*

>>>
>>
>> --
>> *Thanks & Regards*
>> *Akshay Joshi*
>> *pgAdmin Hacker | Sr. Software Architect*
>> *EDB Postgres *
>>
>> *Mobile: +91 976-788-8246*
>>
>

-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Sr. Software Architect*
*EDB Postgres *

*Mobile: +91 976-788-8246*


Re: [pgAdmin][SonarQube] Reduce cognitive complexity

2020-09-03 Thread Akshay Joshi
Thanks, patch applied.

On Thu, Sep 3, 2020 at 3:38 PM Aditya Toshniwal <
aditya.toshni...@enterprisedb.com> wrote:

> Hi Hackers,
>
> Attached is the patch to reduce cognitive complexity as below:
> web/pgadmin/misc/file_manager/__init__.py 20 to 15
> web/pgadmin/tools/grant_wizard/__init__.py 55 to 15
> web/pgadmin/tools/sqleditor/__init__.py 33 to 15
>
> Please review.
>
> --
> Thanks,
> Aditya Toshniwal
> pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com*
> 
> "Don't Complain about Heat, Plant a TREE"
>


-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Sr. Software Architect*
*EDB Postgres *

*Mobile: +91 976-788-8246*


Re: [pgAdmin][SonarQube] : Remove duplicates string literals.

2020-09-03 Thread Pradip Parkale
Hi Akshay,

Please find the updated patch.


On Thu, Sep 3, 2020 at 6:24 PM Akshay Joshi 
wrote:

> Hi Pradip
>
> Following are the review comments:
>
>- ROLE_NOT_FOUND already in wrapped in gettext() then no need to use
>like gone(_(ROLE_NOT_FOUND)). In fact, can we use
>
>self.not_found_error_msg()instead of new constant.
>
>- Same with ERROR_FETCHING_ROLE_INFORMATION it's already in gettext,
>also we can use this constant for string "
>
>Error retrieving roles from the database server"
>
>
>
> On Thu, Sep 3, 2020 at 4:30 PM Pradip Parkale <
> pradip.park...@enterprisedb.com> wrote:
>
>> Hi Hackers,
>>
>> Attached is a patch for removing duplicates string literals.
>> /server_groups/servers/roles/__init__.py  - 8 places
>>
>>
>>
>> --
>> Thanks & Regards,
>> Pradip Parkale
>> Software Engineer | EnterpriseDB Corporation
>>
>
>
> --
> *Thanks & Regards*
> *Akshay Joshi*
> *pgAdmin Hacker | Sr. Software Architect*
> *EDB Postgres *
>
> *Mobile: +91 976-788-8246*
>


-- 
Thanks & Regards,
Pradip Parkale
Software Engineer | EnterpriseDB Corporation


sonar_Qube_v2.patch
Description: Binary data


pgAdmin 4 commit: Modified the logic to check Port is in use for runtim

2020-09-03 Thread Akshay Joshi
Modified the logic to check Port is in use for runtime. Fixes #5751.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=9ae9ccff1618e37a93e56072a3422e83fa82deb4

Modified Files
--
runtime/Runtime.cpp | 12 
1 file changed, 8 insertions(+), 4 deletions(-)