pgAdmin 4 commit: Added support for OAuth 2 authentication. Fixes #5940

2021-07-06 Thread Akshay Joshi
Added support for OAuth 2 authentication. Fixes #5940

Initial patch sent by: Florian Sabonchi

Branch
--
master

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

Modified Files
--
DEPENDENCIES   |   1 +
docs/en_US/getting_started.rst |   1 +
docs/en_US/images/oauth2_login.png | Bin 0 -> 112129 bytes
docs/en_US/kerberos.rst|  11 ++
docs/en_US/oauth2.rst  |  61 +++
docs/en_US/release_notes_5_5.rst   |   1 +
requirements.txt   |   2 +
web/config.py  |  48 +-
web/pgadmin/__init__.py|  21 ++-
web/pgadmin/authenticate/__init__.py   | 181 ++---
web/pgadmin/authenticate/internal.py   |   6 +-
web/pgadmin/authenticate/kerberos.py   | 126 +-
web/pgadmin/authenticate/oauth2.py | 172 
web/pgadmin/authenticate/static/js/kerberos.js |  13 +-
web/pgadmin/browser/__init__.py|  27 ++-
.../servers/tests/test_role_dependencies_sql.py|  10 +-
.../browser/templates/browser/js/constants.js  |   3 +-
.../browser/tests/test_kerberos_with_mocking.py|  22 +--
web/pgadmin/browser/tests/test_ldap_login.py   |   6 +-
.../browser/tests/test_ldap_with_mocking.py|  16 +-
web/pgadmin/browser/tests/test_login.py|   3 +-
web/pgadmin/browser/tests/test_master_password.py  |   2 +
.../browser/tests/test_oauth2_with_mocking.py  | 147 +
web/pgadmin/misc/bgprocess/processes.py|   2 +-
web/pgadmin/static/scss/_pgadmin.style.scss|   3 +
web/pgadmin/templates/security/login_user.html |  11 +-
web/pgadmin/tools/user_management/__init__.py  |   2 +-
.../user_management/static/js/user_management.js   |  13 +-
web/pgadmin/utils/constants.py |   4 +-
web/pgadmin/utils/driver/psycopg2/connection.py|   6 +-
web/pgadmin/utils/master_password.py   |  10 +-
.../python_test_utils/csrf_test_client.py  |  27 +--
web/regression/python_test_utils/test_utils.py |   6 +-
web/regression/runtests.py |   3 +-
web/yarn.lock  |   4 +-
35 files changed, 747 insertions(+), 224 deletions(-)



Re: [pgAdmin][Patch] - RM #5940 - Add support for Oauth 2 authentication

2021-07-06 Thread Akshay Joshi
Thanks, the patch applied.

On Tue, Jul 6, 2021 at 12:01 PM Khushboo Vashi <
khushboo.va...@enterprisedb.com> wrote:

> Hi Akshay,
>
> Please find the attached updated patch.
>
> Thanks,
> Khushboo
> On Mon, Jul 5, 2021 at 5:39 PM Akshay Joshi 
> wrote:
>
>> Hi Khushboo
>>
>> Following are the review comments:
>>
>> *Scenario *: AUTHENTICATION_SOURCES = ['oauth2', 'internal']
>>
>>- Don't set the OAUTH2_DISPLAY_NAME, Login button shows 'Login with
>>None' which should be change. Maybe placeholder like > name>.
>>
>> Fixed
>
>>
>>-
>>- Enter the email address and password. Click on the "Login with ..."
>>button, internal server error displayed on the page, we should throw a
>>proper error message.
>>
>> Fixed
>
>>
>>-
>>
>> *Code Review:*
>>
>>- Empty "__init__.py" file is added in the web folder, I think that
>>is not required.
>>
>> By mistake, it was added.
>
>>
>>- Any reason to change *messages.pot* file manually? It will be
>>updated when we update the message catalog.
>>
>> I must have run make docs, removed.
>
>>
>>- Fixed SonarQube issues in the new file 'oauth2.py' and
>>'test_oauth2_with_mocking.py'. Remove unused imports from both files.
>>
>> Fixed
>
>>
>>- Add copyright header to "kerberos.js" file.
>>
>> Fixed
>
>>
>> *Documentation*:
>>
>>- Remove "of the" from the description of OAUTH2_NAME it is
>>duplicated.
>>- String "Authorisation" should be "Authorization".
>>- Instead of providing "Oauth2 secret", "Oauth2 base url"  can we
>>provide some more detailed information?
>>
>>
>> Fixed.
>
>> *Note*: I haven't tested the patch with the proper OAuth2 configuration.
>>
>> On Mon, Jun 28, 2021 at 4:52 PM Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> Please find the attached rebased patch.
>>>
>>> Thanks,
>>> Khushboo
>>>
>>> On Thu, Jun 17, 2021 at 4:22 PM Khushboo Vashi <
>>> khushboo.va...@enterprisedb.com> wrote:
>>>
 Hi,

 Please find the attached patch for the RM #5940 - Add support for Oauth
 2 authentication.

 The patch includes:

 - Pluggable Oauth 2 authentication support with the multiple providers
 - Configurable support for Master Key in Oauth2 and Kerberos
 authentication, so user can save the database server password
 - Introduced the separate module/blueprint for kerberos and Oauth2
 under authentication module for the readability and maintainability

 Note: The initial patch for Oauth2 authentication was sent by Florian
 Sabonchi, I have worked on top of it.


 Thanks,
 Khushboo


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

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

*Mobile: +91 976-788-8246*


Re: [pgAdmin][RM-6569]: [Housekeeping][React] Port catalog objects to react

2021-07-06 Thread Akshay Joshi
Hi Nikhil

Jasmine test cases are failing, can you please fix and resend the patch.

On Mon, Jul 5, 2021 at 11:48 AM Akshay Joshi 
wrote:

> Hi Aditya
>
> Can you please review it?
>
> On Fri, Jul 2, 2021 at 1:42 PM Nikhil Mohite <
> nikhil.moh...@enterprisedb.com> wrote:
>
>> Hi Hackers,
>>
>> Please find the attached patch for RM-6569
>> :  Port catalog objects to
>> react
>>
>>
>> --
>> *Thanks & Regards,*
>> *Nikhil Mohite*
>> *Software Engineer.*
>> *EDB Postgres* 
>> *Mob.No: +91-7798364578.*
>>
>
>
> --
> *Thanks & Regards*
> *Akshay Joshi*
> *pgAdmin Hacker | Principal Software Architect*
> *EDB Postgres *
>
> *Mobile: +91 976-788-8246*
>


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

*Mobile: +91 976-788-8246*


Re: [pgAdmin][Patch] - Housekeeping #6582 - [React] Port Extension object to react

2021-07-06 Thread Akshay Joshi
Thanks, the patch applied.

On Tue, Jul 6, 2021 at 11:58 AM Yogesh Mahajan <
yogesh.maha...@enterprisedb.com> wrote:

> Hi,
>
> Please find the updated patch.(..v2.patch)
>
> Thanks,
> Yogesh Mahajan
> EnterpriseDB
>
>
> On Tue, Jul 6, 2021 at 11:05 AM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Hi Yogesh
>>
>> Porting is not reflected at all still the old dialog is visible. Please
>> check and resend the updated patch.
>>
>> On Mon, Jul 5, 2021 at 8:40 PM Yogesh Mahajan <
>> yogesh.maha...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> Please find the attached patch for extension port dialogue.
>>>
>>> Thanks,
>>> Yogesh Mahajan
>>> EnterpriseDB
>>>
>>
>>
>> --
>> *Thanks & Regards*
>> *Akshay Joshi*
>> *pgAdmin Hacker | Principal Software Architect*
>> *EDB Postgres *
>>
>> *Mobile: +91 976-788-8246*
>>
>

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

*Mobile: +91 976-788-8246*


Re: [pgAdmin][RM6398]: Detaching query editor panel gives a blank white panel.

2021-07-06 Thread Pradip Parkale
Hi Akshay,
Please find the updated patch.

On Fri, Jun 25, 2021 at 11:40 AM Akshay Joshi 
wrote:

> Thanks, the patch applied.
>
> On Thu, Jun 24, 2021 at 9:16 PM Pradip Parkale <
> pradip.park...@enterprisedb.com> wrote:
>
>> Hi Akshay,
>> Please find the updated patch. I have moved the function into the utility
>> file now.
>>
>> On Thu, Jun 24, 2021 at 7:56 PM Akshay Joshi <
>> akshay.jo...@enterprisedb.com> wrote:
>>
>>> Hi Pradip
>>>
>>> I have seen that we have duplicated code for resize_the_queryTool,
>>> resize_the_erdtool, resize_the_psql, and in debugger_ui.js file. I
>>> would suggest making a common function somewhere in the utils and call that
>>> function. In the future, if we need to change the code we will have to
>>> change it in four different places.
>>>
>>> Please resend the patch after fixing the above issue.
>>>
>>> On Thu, Jun 24, 2021 at 7:00 PM Pradip Parkale <
>>> pradip.park...@enterprisedb.com> wrote:
>>>
 Hi Akshay,

 Please find attached for debugger and ERD tool which was missing in
 my previous patch.

 On Wed, Jun 23, 2021 at 11:50 AM Akshay Joshi <
 akshay.jo...@enterprisedb.com> wrote:

> Thanks, the patch applied.
>
> On Wed, Jun 16, 2021 at 11:29 PM Pradip Parkale <
> pradip.park...@enterprisedb.com> wrote:
>
>> Hi Hackers,
>>
>> Please find the attached patch for #6398.Detaching query editor panel
>> gives a blank white panel.
>>
>>
>> --
>> Thanks & Regards,
>> Pradip Parkale
>> Software Engineer | EnterpriseDB Corporation
>>
>
>
> --
> *Thanks & Regards*
> *Akshay Joshi*
> *pgAdmin Hacker | Principal Software Architect*
> *EDB Postgres *
>
> *Mobile: +91 976-788-8246*
>


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

>>>
>>>
>>> --
>>> *Thanks & Regards*
>>> *Akshay Joshi*
>>> *pgAdmin Hacker | Principal Software Architect*
>>> *EDB Postgres *
>>>
>>> *Mobile: +91 976-788-8246*
>>>
>>
>>
>> --
>> Thanks & Regards,
>> Pradip Parkale
>> Software Engineer | EnterpriseDB Corporation
>>
>
>
> --
> *Thanks & Regards*
> *Akshay Joshi*
> *pgAdmin Hacker | Principal Software Architect*
> *EDB Postgres *
>
> *Mobile: +91 976-788-8246*
>


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


RM6398_v4.patch
Description: Binary data


[pgAdmin4][patch] Remove extra brackets in CREATE Script and DDL Comparison

2021-07-06 Thread zhangj...@fujitsu.com
Hi, all

Extra brackets appear in CREATE Script and DDL Comparison,
please refer to the attachment error1.png and error2.png for details.

■ scenario
The step is as follow:
1) Connect to pg9.6 or pg9.5
2) The SQL to create the trigger is as follows.
-
CREATE TRIGGER tg1
BEFORE INSERT
ON public.tb1
FOR EACH ROW
WHEN (new.c1 > 0)
EXECUTE PROCEDURE public.tf1();
-

3) Right click  tg1
4) Click CREATE Script

The SQL shown in 'Query Editor' is as follows.
-
CREATE TRIGGER tg1
BEFORE INSERT
ON public.tb1
FOR EACH ROW
WHEN ((new.c1 > 0))   brackets appears twice.
EXECUTE PROCEDURE public.tf1();


■ The detail of cause:
file: 
web\pgadmin\browser\server_groups\servers\databases\schemas\tables\templates\triggers\sql\pg\default\create.sql

WHEN ({{ data.whenclause }}){% endif %}

There are already brackets in data.whenclause.

■ The summary of correction
file: 
web\pgadmin\browser\server_groups\servers\databases\schemas\tables\templates\triggers\sql\pg\default\create.sql
- WHEN ({{ data.whenclause }}){% endif %}
+ WHEN {% if not data.oid %}({% endif %}{{ data.whenclause }}{% if not data.oid 
%}){% endif %}{% endif %}

Refer to the following code for the correction method.
file: 
web\pgadmin\browser\server_groups\servers\databases\schemas\tables\templates\triggers\sql\pg\10_plus\create.sql
WHEN {% if not data.oid %}({% endif %}{{ data.whenclause }}{% if not data.oid 
%}){% endif %}{% endif %}

Here is a patch for create.sql
Please review.

Best Regards!
Zhangjie





create_sql.patch
Description: create_sql.patch


Re: [pgAdmin4][patch] Remove extra brackets in CREATE Script and DDL Comparison

2021-07-06 Thread Khushboo Vashi
Patch looks good to me.

On Tue, Jul 6, 2021 at 3:15 PM zhangj...@fujitsu.com 
wrote:

> Hi, all
>
> Extra brackets appear in CREATE Script and DDL Comparison,
> please refer to the attachment error1.png and error2.png for details.
>
> ■ scenario
> The step is as follow:
> 1) Connect to pg9.6 or pg9.5
> 2) The SQL to create the trigger is as follows.
> -
> CREATE TRIGGER tg1
> BEFORE INSERT
> ON public.tb1
> FOR EACH ROW
> WHEN (new.c1 > 0)
> EXECUTE PROCEDURE public.tf1();
> -
>
> 3) Right click  tg1
> 4) Click CREATE Script
>
> The SQL shown in 'Query Editor' is as follows.
> -
> CREATE TRIGGER tg1
> BEFORE INSERT
> ON public.tb1
> FOR EACH ROW
> WHEN ((new.c1 > 0))   brackets appears twice.
> EXECUTE PROCEDURE public.tf1();
> 
>
> ■ The detail of cause:
> file:
> web\pgadmin\browser\server_groups\servers\databases\schemas\tables\templates\triggers\sql\pg\default\create.sql
>
> WHEN ({{ data.whenclause }}){% endif %}
>
> There are already brackets in data.whenclause.
>
> ■ The summary of correction
> file:
> web\pgadmin\browser\server_groups\servers\databases\schemas\tables\templates\triggers\sql\pg\default\create.sql
> - WHEN ({{ data.whenclause }}){% endif %}
> + WHEN {% if not data.oid %}({% endif %}{{ data.whenclause }}{% if not
> data.oid %}){% endif %}{% endif %}
>
> Refer to the following code for the correction method.
> file:
> web\pgadmin\browser\server_groups\servers\databases\schemas\tables\templates\triggers\sql\pg\10_plus\create.sql
> WHEN {% if not data.oid %}({% endif %}{{ data.whenclause }}{% if not
> data.oid %}){% endif %}{% endif %}
>
> Here is a patch for create.sql
> Please review.
>
> Best Regards!
> Zhangjie
>
>
>
>


Re: [pgAdmin][RM-6536]: Browse button: Directory issues

2021-07-06 Thread Nikhil Mohite
Hi Akshay,

Please find the updated patch for RM-6536, Resolved the issue if user
select folder "Select" button is not getting enabled in "Select folder"
dialog.

Regards,
Nikhil Mohite

On Mon, Jun 28, 2021 at 6:55 PM Akshay Joshi 
wrote:

> Thanks, the patch applied.
>
> On Mon, Jun 28, 2021 at 6:30 PM Nikhil Mohite <
> nikhil.moh...@enterprisedb.com> wrote:
>
>> Hi Hackers,
>>
>> Please find the attached patch for RM-6536
>> :  Browse button: Directory
>> issues.
>>
>>
>> --
>> *Thanks & Regards,*
>> *Nikhil Mohite*
>> *Software Engineer.*
>> *EDB Postgres* 
>> *Mob.No: +91-7798364578.*
>>
>
>
> --
> *Thanks & Regards*
> *Akshay Joshi*
> *pgAdmin Hacker | Principal Software Architect*
> *EDB Postgres *
>
> *Mobile: +91 976-788-8246*
>


RM-6536_v2.patch
Description: Binary data


pgAdmin 4 commit: 1) Set the default value of the long-running threshol

2021-07-06 Thread Akshay Joshi
1) Set the default value of the long-running threshold to 2 minutes for warning 
and 5 minutes for the alert.

2) Use $color-danger for the alert threshold.

Branch
--
master

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

Modified Files
--
web/pgadmin/dashboard/__init__.py| 2 +-
web/pgadmin/static/scss/_backgrid.overrides.scss | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)



pgAdmin 4 commit: Remove extra brackets in CREATE script and DDL compar

2021-07-06 Thread Akshay Joshi
Remove extra brackets in CREATE script and DDL comparison for trigger node.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=39a845ad314a09fe8624e1596074d60f9116020d
Author: Identifier Anonymous 

Modified Files
--
.../schemas/tables/templates/triggers/sql/gpdb/default/create.sql   | 2 +-
.../schemas/tables/templates/triggers/sql/pg/default/create.sql | 2 +-
.../schemas/tables/templates/triggers/sql/ppas/default/create.sql   | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)



pgAdmin 4 commit: Fixed an issue where Schema Diff and Debugger give a

2021-07-06 Thread Akshay Joshi
Fixed an issue where Schema Diff and Debugger give a blank white panel.

refs #6398

Branch
--
master

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

Modified Files
--
web/pgadmin/tools/debugger/static/js/debugger.js   | 1 +
web/pgadmin/tools/schema_diff/static/js/schema_diff.js | 6 --
2 files changed, 5 insertions(+), 2 deletions(-)



pgAdmin 4 commit: Resolved the issue when the user selects the folder '

2021-07-06 Thread Akshay Joshi
Resolved the issue when the user selects the folder 'Select' button is not 
getting enabled for 'Select folder' dialog.

refs #6536

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=669bdc7e3803778287e1716cb315edff9ba0f2c2
Author: Nikhil Mohite 

Modified Files
--
web/pgadmin/misc/file_manager/static/js/utility.js | 26 +-
1 file changed, 20 insertions(+), 6 deletions(-)



Re: [patch][pgAdmin] RM3893 pgadmin4 Reassign/Drop Owned

2021-07-06 Thread Akshay Joshi
Hi Rahul

On Tue, Jul 6, 2021 at 7:13 PM Rahul Shirsat 
wrote:

> Hi Akshay,
>
> As discussed in the review meeting, following are the review comments
> fixation:
>
>
>- Label change - "Role operation" to "Reassign/Drop Own"
>
>IIRC, we have finalized "Operation" then from where
"Reassign/Drop Own" comes from?

>
>- Alert msg changes-
>   - Change the alert message to "Reassign owned executed
>   successfully!" & "Drop owned executed successfully!" respectively.
>- Change the "Drop with" option to "Cascade" and provide the "Yes/No"
>option.
>
> It should be "Cascade?".

>
>- Include the SQL tab.
>
>Wrong SQL's are generated. I have two users "user1" and
"user2". I selected "user2" but all the queries created for "user1"

   [image: Screenshot 2021-07-06 at 8.00.49 PM.png]

> Also, added test cases for SQL tab.
>
> On Mon, Jun 28, 2021 at 6:55 PM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Thanks, the patch applied.
>>
>> On Mon, Jun 28, 2021 at 2:00 PM Rahul Shirsat <
>> rahul.shir...@enterprisedb.com> wrote:
>>
>>> Hi Akshay,
>>>
>>> On Thu, Jun 24, 2021 at 2:32 PM Akshay Joshi <
>>> akshay.jo...@enterprisedb.com> wrote:
>>>
 Hi Rahul

 Following are the review comments:

- The context menu should be renamed to 'Reassign/Drop Owned...'
instead of 'Reassign/Drop role'.

  Done
>>>

- Remove " role" from the dialog header. It should be
"Reassign/Drop Owned - "

  Done
>>>

- We have only two operations "Reassign and Drop", so instead of
using Radio modern can we use switch control? Though radio modern also
looks good.

 @Dave what do you think?

  Keeping the radio modern as discussed.
>>>

- By default, Reassign operation should be selected.

  Done
>>>

- After successfully reassign/drop we should show aleritfy notifier
"Reassign owned successfully" or "Drop owned successfully".

  Done
>>>

-
- "Roles dropped successfully!" string should be modified to "Drop
owned successfully!".

  Done
>>>

- Add validation if the database or reassign object is not
selected, show them on GUI.

  Done
>>>

- Connection to the database should be released(disconnected) after
the execution of the query.

  This has been taken care of.
>>>

- From Postgres 9.5 onwards we have "*CURRENT_USER | SESSION_USER*"
please check that as well. From Postgres 14 *CURRENT_ROLE* is also
there.

  All of the above 3 options added. CURRENT_ROLE will be visible on UI
>>> when connected to postgres >= v14. Also added test cases for the same.
>>>

- DROP OWNED query have *[ CASCADE | RESTRICT ] *which was not
there even in pgadmin III, add support this would be good. Create two
switch control for cascade and restrict and depending on that create the
SQL query.

  These options too are added now as a switch case.
>>>

- Documentation and screenshot update required after the above
changes. The "Reassign/Drop Own" string should be replaced with
"Reassign/Drop Owned" in the documentation.

  Updated the documentations as well.
>>>
>>>  *Sorry for previously adding this option* - I have removed the SQL tab
>>> as REASSIGN/DROP OWNED are single line and not necessarily required to be
>>> viewed by the user (referring to Delete Object or Drop Cascade options of
>>> other pg_catalog objects).
>>>

 On Mon, Jun 21, 2021 at 4:37 PM Rahul Shirsat <
 rahul.shir...@enterprisedb.com> wrote:

> Hi Hackers,
>
> Please find the patch which includes the reassign/drop own feature.
>
> This also includes documentation of the feature.
>
> --
> *Rahul Shirsat*
> Senior Software Engineer | EnterpriseDB Corporation.
>


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

 *Mobile: +91 976-788-8246*

>>>
>>>
>>> --
>>> *Rahul Shirsat*
>>> Senior Software Engineer | EnterpriseDB Corporation.
>>>
>>
>>
>> --
>> *Thanks & Regards*
>> *Akshay Joshi*
>> *pgAdmin Hacker | Principal Software Architect*
>> *EDB Postgres *
>>
>> *Mobile: +91 976-788-8246*
>>
>
>
> --
> *Rahul Shirsat*
> Senior Software Engineer | EnterpriseDB Corporation.
>


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

*Mobile: +91 976-788-8246*


Re: [pgAdmin][RM-6536]: Browse button: Directory issues

2021-07-06 Thread Akshay Joshi
Thanks, the patch applied.

On Tue, Jul 6, 2021 at 5:49 PM Nikhil Mohite 
wrote:

> Hi Akshay,
>
> Please find the updated patch for RM-6536, Resolved the issue if user
> select folder "Select" button is not getting enabled in "Select folder"
> dialog.
>
> Regards,
> Nikhil Mohite
>
> On Mon, Jun 28, 2021 at 6:55 PM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Thanks, the patch applied.
>>
>> On Mon, Jun 28, 2021 at 6:30 PM Nikhil Mohite <
>> nikhil.moh...@enterprisedb.com> wrote:
>>
>>> Hi Hackers,
>>>
>>> Please find the attached patch for RM-6536
>>> :  Browse button: Directory
>>> issues.
>>>
>>>
>>> --
>>> *Thanks & Regards,*
>>> *Nikhil Mohite*
>>> *Software Engineer.*
>>> *EDB Postgres* 
>>> *Mob.No: +91-7798364578.*
>>>
>>
>>
>> --
>> *Thanks & Regards*
>> *Akshay Joshi*
>> *pgAdmin Hacker | Principal Software Architect*
>> *EDB Postgres *
>>
>> *Mobile: +91 976-788-8246*
>>
>

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

*Mobile: +91 976-788-8246*


Re: [pgAdmin4][patch] Remove extra brackets in CREATE Script and DDL Comparison

2021-07-06 Thread Akshay Joshi
Thanks, the patch applied.

On Tue, Jul 6, 2021 at 3:15 PM zhangj...@fujitsu.com 
wrote:

> Hi, all
>
> Extra brackets appear in CREATE Script and DDL Comparison,
> please refer to the attachment error1.png and error2.png for details.
>
> ■ scenario
> The step is as follow:
> 1) Connect to pg9.6 or pg9.5
> 2) The SQL to create the trigger is as follows.
> -
> CREATE TRIGGER tg1
> BEFORE INSERT
> ON public.tb1
> FOR EACH ROW
> WHEN (new.c1 > 0)
> EXECUTE PROCEDURE public.tf1();
> -
>
> 3) Right click  tg1
> 4) Click CREATE Script
>
> The SQL shown in 'Query Editor' is as follows.
> -
> CREATE TRIGGER tg1
> BEFORE INSERT
> ON public.tb1
> FOR EACH ROW
> WHEN ((new.c1 > 0))   brackets appears twice.
> EXECUTE PROCEDURE public.tf1();
> 
>
> ■ The detail of cause:
> file:
> web\pgadmin\browser\server_groups\servers\databases\schemas\tables\templates\triggers\sql\pg\default\create.sql
>
> WHEN ({{ data.whenclause }}){% endif %}
>
> There are already brackets in data.whenclause.
>
> ■ The summary of correction
> file:
> web\pgadmin\browser\server_groups\servers\databases\schemas\tables\templates\triggers\sql\pg\default\create.sql
> - WHEN ({{ data.whenclause }}){% endif %}
> + WHEN {% if not data.oid %}({% endif %}{{ data.whenclause }}{% if not
> data.oid %}){% endif %}{% endif %}
>
> Refer to the following code for the correction method.
> file:
> web\pgadmin\browser\server_groups\servers\databases\schemas\tables\templates\triggers\sql\pg\10_plus\create.sql
> WHEN {% if not data.oid %}({% endif %}{{ data.whenclause }}{% if not
> data.oid %}){% endif %}{% endif %}
>
> Here is a patch for create.sql
> Please review.
>
> Best Regards!
> Zhangjie
>
>
>
>

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

*Mobile: +91 976-788-8246*


Re: [pgAdmin][RM6398]: Detaching query editor panel gives a blank white panel.

2021-07-06 Thread Akshay Joshi
Thanks, the patch applied.

On Tue, Jul 6, 2021 at 3:00 PM Pradip Parkale <
pradip.park...@enterprisedb.com> wrote:

> Hi Akshay,
> Please find the updated patch.
>
> On Fri, Jun 25, 2021 at 11:40 AM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Thanks, the patch applied.
>>
>> On Thu, Jun 24, 2021 at 9:16 PM Pradip Parkale <
>> pradip.park...@enterprisedb.com> wrote:
>>
>>> Hi Akshay,
>>> Please find the updated patch. I have moved the function into the
>>> utility file now.
>>>
>>> On Thu, Jun 24, 2021 at 7:56 PM Akshay Joshi <
>>> akshay.jo...@enterprisedb.com> wrote:
>>>
 Hi Pradip

 I have seen that we have duplicated code for resize_the_queryTool,
 resize_the_erdtool, resize_the_psql, and in debugger_ui.js file. I
 would suggest making a common function somewhere in the utils and call that
 function. In the future, if we need to change the code we will have to
 change it in four different places.

 Please resend the patch after fixing the above issue.

 On Thu, Jun 24, 2021 at 7:00 PM Pradip Parkale <
 pradip.park...@enterprisedb.com> wrote:

> Hi Akshay,
>
> Please find attached for debugger and ERD tool which was missing in
> my previous patch.
>
> On Wed, Jun 23, 2021 at 11:50 AM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Thanks, the patch applied.
>>
>> On Wed, Jun 16, 2021 at 11:29 PM Pradip Parkale <
>> pradip.park...@enterprisedb.com> wrote:
>>
>>> Hi Hackers,
>>>
>>> Please find the attached patch for #6398.Detaching query editor
>>> panel gives a blank white panel.
>>>
>>>
>>> --
>>> Thanks & Regards,
>>> Pradip Parkale
>>> Software Engineer | EnterpriseDB Corporation
>>>
>>
>>
>> --
>> *Thanks & Regards*
>> *Akshay Joshi*
>> *pgAdmin Hacker | Principal Software Architect*
>> *EDB Postgres *
>>
>> *Mobile: +91 976-788-8246*
>>
>
>
> --
> Thanks & Regards,
> Pradip Parkale
> Software Engineer | EnterpriseDB Corporation
>


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

 *Mobile: +91 976-788-8246*

>>>
>>>
>>> --
>>> Thanks & Regards,
>>> Pradip Parkale
>>> Software Engineer | EnterpriseDB Corporation
>>>
>>
>>
>> --
>> *Thanks & Regards*
>> *Akshay Joshi*
>> *pgAdmin Hacker | Principal Software Architect*
>> *EDB Postgres *
>>
>> *Mobile: +91 976-788-8246*
>>
>
>
> --
> Thanks & Regards,
> Pradip Parkale
> Software Engineer | EnterpriseDB Corporation
>


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

*Mobile: +91 976-788-8246*


Re: [pgAdmin][RM-6569]: [Housekeeping][React] Port catalog objects to react

2021-07-06 Thread Nikhil Mohite
Hi Akshay,

Please find the updated patch for RM-6569, Resolved issue of falling
Jasmine test cases.

On Tue, Jul 6, 2021 at 2:25 PM Akshay Joshi 
wrote:

> Hi Nikhil
>
> Jasmine test cases are failing, can you please fix and resend the patch.
>
> On Mon, Jul 5, 2021 at 11:48 AM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Hi Aditya
>>
>> Can you please review it?
>>
>> On Fri, Jul 2, 2021 at 1:42 PM Nikhil Mohite <
>> nikhil.moh...@enterprisedb.com> wrote:
>>
>>> Hi Hackers,
>>>
>>> Please find the attached patch for RM-6569
>>> :  Port catalog objects to
>>> react
>>>
>>>
>>> --
>>> *Thanks & Regards,*
>>> *Nikhil Mohite*
>>> *Software Engineer.*
>>> *EDB Postgres* 
>>> *Mob.No: +91-7798364578.*
>>>
>>
>>
>> --
>> *Thanks & Regards*
>> *Akshay Joshi*
>> *pgAdmin Hacker | Principal Software Architect*
>> *EDB Postgres *
>>
>> *Mobile: +91 976-788-8246*
>>
>
>
> --
> *Thanks & Regards*
> *Akshay Joshi*
> *pgAdmin Hacker | Principal Software Architect*
> *EDB Postgres *
>
> *Mobile: +91 976-788-8246*
>


RM-6569_v2.patch
Description: Binary data


pgAdmin 4 commit: 1) Modified some labels and controls.

2021-07-06 Thread Akshay Joshi
1) Modified some labels and controls.

2) Fixed issue where the same user is showing in SQL query.

3) Added SQL tab in the dialog.

refs #3893

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=8edd5946e55016b90be119f746ea79fd92201b26
Author: Rahul Shirsat 

Modified Files
--
docs/en_US/images/role_drop_dialog.png | Bin 57831 -> 57694 bytes
docs/en_US/images/role_drop_dialog_sql.png | Bin 0 -> 24573 bytes
docs/en_US/images/role_reassign_dialog.png | Bin 60164 -> 59219 bytes
docs/en_US/images/role_reassign_dialog_sql.png | Bin 0 -> 25452 bytes
docs/en_US/role_reassign_dialog.rst|  26 +++--
.../server_groups/servers/roles/__init__.py|  60 +-
.../server_groups/servers/roles/static/js/role.js  |  44 +++-
.../servers/roles/tests/role_test_data.json| 122 +
.../roles/tests/test_role_reassign_own_sql.py  |  71 
9 files changed, 309 insertions(+), 14 deletions(-)



Re: [patch][pgAdmin] RM3893 pgadmin4 Reassign/Drop Owned

2021-07-06 Thread Akshay Joshi
Thanks, the patch applied.

On Tue, Jul 6, 2021 at 9:47 PM Rahul Shirsat 
wrote:

> Hi Akshay,
>
> Please find the updated patch.
>
> On Tue, Jul 6, 2021 at 8:07 PM Akshay Joshi 
> wrote:
>
>> Hi Rahul
>>
>> On Tue, Jul 6, 2021 at 7:13 PM Rahul Shirsat <
>> rahul.shir...@enterprisedb.com> wrote:
>>
>>> Hi Akshay,
>>>
>>> As discussed in the review meeting, following are the review comments
>>> fixation:
>>>
>>>
>>>- Label change - "Role operation" to "Reassign/Drop Own"
>>>
>>>IIRC, we have finalized "Operation" then from where
>> "Reassign/Drop Own" comes from?
>>
>
>  My Bad. I just missed out on updating the feedback list at the end. Now
> it is corrected.
>
>>
>>>- Alert msg changes-
>>>   - Change the alert message to "Reassign owned executed
>>>   successfully!" & "Drop owned executed successfully!" respectively.
>>>- Change the "Drop with" option to "Cascade" and provide the
>>>"Yes/No" option.
>>>
>>> It should be "Cascade?".
>>
>   This has been corrected.
>
>>
>>>- Include the SQL tab.
>>>
>>>Wrong SQL's are generated. I have two users "user1" and
>> "user2". I selected "user2" but all the queries created for "user1"
>>
>>[image: Screenshot 2021-07-06 at 8.00.49 PM.png]
>>
>  I have fixed this issue.
>
> Also, added test cases for SQL tab.
>>>
>>> On Mon, Jun 28, 2021 at 6:55 PM Akshay Joshi <
>>> akshay.jo...@enterprisedb.com> wrote:
>>>
 Thanks, the patch applied.

 On Mon, Jun 28, 2021 at 2:00 PM Rahul Shirsat <
 rahul.shir...@enterprisedb.com> wrote:

> Hi Akshay,
>
> On Thu, Jun 24, 2021 at 2:32 PM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Hi Rahul
>>
>> Following are the review comments:
>>
>>- The context menu should be renamed to 'Reassign/Drop Owned...'
>>instead of 'Reassign/Drop role'.
>>
>>  Done
>
>>
>>- Remove " role" from the dialog header. It should be
>>"Reassign/Drop Owned - "
>>
>>  Done
>
>>
>>- We have only two operations "Reassign and Drop", so instead of
>>using Radio modern can we use switch control? Though radio modern also
>>looks good.
>>
>> @Dave what do you think?
>>
>>  Keeping the radio modern as discussed.
>
>>
>>- By default, Reassign operation should be selected.
>>
>>  Done
>
>>
>>- After successfully reassign/drop we should show
>>aleritfy notifier "Reassign owned successfully" or "Drop
>>owned successfully".
>>
>>  Done
>
>>
>>-
>>- "Roles dropped successfully!" string should be modified to
>>"Drop owned successfully!".
>>
>>  Done
>
>>
>>- Add validation if the database or reassign object is not
>>selected, show them on GUI.
>>
>>  Done
>
>>
>>- Connection to the database should be released(disconnected)
>>after the execution of the query.
>>
>>  This has been taken care of.
>
>>
>>- From Postgres 9.5 onwards we have "*CURRENT_USER | SESSION_USER*"
>>please check that as well. From Postgres 14 *CURRENT_ROLE* is
>>also there.
>>
>>  All of the above 3 options added. CURRENT_ROLE will be visible on UI
> when connected to postgres >= v14. Also added test cases for the same.
>
>>
>>- DROP OWNED query have *[ CASCADE | RESTRICT ] *which was not
>>there even in pgadmin III, add support this would be good. Create two
>>switch control for cascade and restrict and depending on that create 
>> the
>>SQL query.
>>
>>  These options too are added now as a switch case.
>
>>
>>- Documentation and screenshot update required after the above
>>changes. The "Reassign/Drop Own" string should be replaced with
>>"Reassign/Drop Owned" in the documentation.
>>
>>  Updated the documentations as well.
>
>  *Sorry for previously adding this option* - I have removed the SQL
> tab as REASSIGN/DROP OWNED are single line and not necessarily required to
> be viewed by the user (referring to Delete Object or Drop Cascade options
> of other pg_catalog objects).
>
>>
>> On Mon, Jun 21, 2021 at 4:37 PM Rahul Shirsat <
>> rahul.shir...@enterprisedb.com> wrote:
>>
>>> Hi Hackers,
>>>
>>> Please find the patch which includes the reassign/drop own feature.
>>>
>>> This also includes documentation of the feature.
>>>
>>> --
>>> *Rahul Shirsat*
>>> Senior Software Engineer | EnterpriseDB Corporation.
>>>
>>
>>
>> --
>> *Thanks & Regards*
>> *Akshay Joshi*
>> *pgAdmin Hacker | Principal Software Architect*
>> *EDB Postgres *
>>
>> *Mobile: +91 976-788-8246*
>>
>
>
> --
> *Rahul Sh

Re: [pgAdmin][RM-6569]: [Housekeeping][React] Port catalog objects to react

2021-07-06 Thread Akshay Joshi
Thanks, the patch applied.

On Wed, Jul 7, 2021 at 10:25 AM Nikhil Mohite <
nikhil.moh...@enterprisedb.com> wrote:

> Hi Akshay,
>
> Please find the updated patch for RM-6569, Resolved issue of falling
> Jasmine test cases.
>
> On Tue, Jul 6, 2021 at 2:25 PM Akshay Joshi 
> wrote:
>
>> Hi Nikhil
>>
>> Jasmine test cases are failing, can you please fix and resend the patch.
>>
>> On Mon, Jul 5, 2021 at 11:48 AM Akshay Joshi <
>> akshay.jo...@enterprisedb.com> wrote:
>>
>>> Hi Aditya
>>>
>>> Can you please review it?
>>>
>>> On Fri, Jul 2, 2021 at 1:42 PM Nikhil Mohite <
>>> nikhil.moh...@enterprisedb.com> wrote:
>>>
 Hi Hackers,

 Please find the attached patch for RM-6569
 :  Port catalog objects to
 react


 --
 *Thanks & Regards,*
 *Nikhil Mohite*
 *Software Engineer.*
 *EDB Postgres* 
 *Mob.No: +91-7798364578.*

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

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

*Mobile: +91 976-788-8246*