Re: RM3694-If database is already connected and click on database then connect database should not displayed in Menu

2020-05-03 Thread Khushboo Vashi
Hi Satish,

On Thu, Apr 30, 2020 at 8:29 PM Satish V  wrote:

> Hi Khushboo,
>
> In the attached patch,
> Fixed pep8 and made use of 'gettext' inside "database.js" file...
> Regarding *res.info ='Database already connected', **we
> are appending the database name and server name in front of 'res.info
> ' string in the very next line. So using this 'Database
> already connected' text directly inside alertify will stop it from showing
> the info pertaining to the server and database. -* no changes are done
> about res.info.
>
> The database disconnection error comes without a database name. To
reproduce this issue, perform the steps in this RM and then try to
disconnect the database.
Also, please give the proper variable name as we discussed.

Thanks,
Khushboo

Thanks

> Sathish
>
> On Thu, Apr 30, 2020 at 7:40 AM Khushboo Vashi <
> khushboo.va...@enterprisedb.com> wrote:
>
>> Hi Satish,
>>
>> Some minor comments:
>>
>> - Fix PEP8 issues.
>> - Use gettext in database.js file for the info message.
>> - No need to assign text value in res object (res.info = 'Database
>> already connected.'), use this text directly in Alertify.info.
>>
>> Thanks,
>> Khushboo
>>
>>
>>
>>
>>
>> On Thu, Apr 30, 2020 at 1:59 PM Satish V 
>> wrote:
>>
>>> Hi,
>>>
>>> I made the changes to the code such that conn.connect() will happen only
>>> when there is no prior connection exist. In short, connection via context
>>> menu will not trigger this conn.connect().
>>> In the client side code, instead of error alert, info alert is used to
>>> inform the user.
>>>
>>> Kindly review the patch and suggest the changes if required.
>>>
>>> Thanks,
>>> Sathish V
>>>
>>> On Thu, Apr 30, 2020 at 2:43 AM Khushboo Vashi <
>>> khushboo.va...@enterprisedb.com> wrote:
>>>


 On Thu, Apr 30, 2020 at 12:04 PM Aditya Toshniwal <
 aditya.toshni...@enterprisedb.com> wrote:

> Hi,
>
> On Thu, Apr 30, 2020 at 11:55 AM Khushboo Vashi <
> khushboo.va...@enterprisedb.com> wrote:
>
>>
>>
>> On Thu, Apr 30, 2020 at 10:55 AM Aditya Toshniwal <
>> aditya.toshni...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> On Thu, Apr 30, 2020 at 10:48 AM Khushboo Vashi <
>>> khushboo.va...@enterprisedb.com> wrote:
>>>


 On Thu, Apr 30, 2020 at 10:14 AM Aditya Toshniwal <
 aditya.toshni...@enterprisedb.com> wrote:

> Hi,
>
>
> On Thu, Apr 30, 2020 at 9:41 AM Satish V <
> satis...@enterprisedb.com> wrote:
>
>> Hi Kushboo,
>>
>> Thanks for the update. I will check the same and make
>> appropriate changes.
>>
>> Thanks,
>> Sathish
>>
>> On Thu, Apr 30, 2020 at 9:20 AM Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>> Hi Satish,
>>>
>>> As per the RM, the fix is supposed to be at the front-end but it
>>> seems difficult at the moment as on the selection of the database, 
>>> we
>>> connect it and at the same time the context menu is being called.
>>> As you have tried to fix at the backend, some of the review
>>> comments are below.
>>>
>>> 1.  If the database is already connected, no need to call
>>> conn.connect again.
>>>
>>>
>>> info_already_connected = conn.connected()
>>>
>>> status, errmsg = conn.connect()
>>>
>>> I've noticed conn.connected() is misleading sometimes. Let's say
> if the PG server is stopped and no query is fired from pgadmin after 
> that,
> then conn.connected() will still give True. It is updated only
> when a query is fired to the PG server. I would suggest let it connect
> again as there is no harm and this function is very important. We 
> don't
> want to mess it up for the sake of a message.
>
 It's true that conn.connected() is misleading but we already get
 the connection before checking conn.connected() with conn =
 manager.connection(did=did, auto_reconnect=True).
 So, if the database server is stopped, it will throw the error.

>>> I just checked the manager.connection function, and it is not
>>> connecting or checking. It will just give the connection object stored 
>>> in
>>> the memory.
>>>
>> :).
>>
>>
>> databases/__init__.py : def connect()
>>
>>
>> manager = get_driver(PG_DEFAULT_DRIVER).connection_manager(sid)
>>
>> conn = manager.connection(did=did, auto_reconnect=True)
>>
>>
>>
>> Above 2 lines will handle which I just just mentioned above.
>>
> I didn't find any code which will call the connect, apart
> from auto_reconnect being used when we execute some query. Nevertheless, I
> still believe we should not

[pgAdmin][5469] SSL mode dropdown hover in create server dialog is not consistent with other select2

2020-05-03 Thread Ganesh Jaybhay
Hi Hackers,

Please find the attached minor patch to fix the issue with select2 hover
consistency for SSL mode field(SSL tab) in create server dialog.

Please review.

Regards,
Ganesh Jaybhay
diff --git a/web/pgadmin/browser/server_groups/servers/static/js/server.js b/web/pgadmin/browser/server_groups/servers/static/js/server.js
index 57f8991..1c07609 100644
--- a/web/pgadmin/browser/server_groups/servers/static/js/server.js
+++ b/web/pgadmin/browser/server_groups/servers/static/js/server.js
@@ -821,7 +821,11 @@ define('pgadmin.node.server', [
   mode: ['properties', 'edit', 'create'], readonly: 'isConnected',
   group: gettext('Connection'),
 },{
-  id: 'sslmode', label: gettext('SSL mode'), type: 'options', group: gettext('SSL'),
+  id: 'sslmode', label: gettext('SSL mode'), control: 'select2', group: gettext('SSL'),
+  select2: {
+allowClear: false,
+minimumResultsForSearch: Infinity,
+  },
   mode: ['properties', 'edit', 'create'], disabled: 'isConnected',
   'options': [
 {label: gettext('Allow'), value: 'allow'},


Re: Patch to remove Python 2.7 support in the macOS Appbundle

2020-05-03 Thread Akshay Joshi
Hi Dave

On Fri, May 1, 2020 at 5:21 PM Dave Page  wrote:

> Akshay, are you happy with this patch?
>

   The patch is not applied to the latest code.

>
> On Mon, Apr 27, 2020 at 3:30 PM Dave Page  wrote:
>
>>
>>
>> On Mon, Apr 27, 2020 at 3:28 PM Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> The code looks good to me. The package building was tested by Neel and
>>> we found that the venv was built with Python 3+ but the runtime was built
>>> against Python 2.7.
>>> As per Dave, Neel may have not used a venv of the correct version as it
>>> is working fine on Dav'e system. So, we can commit the patch.
>>>
>>
>> Yeah, that's not ideal, but the same problem exists today. I need to
>> spend some time figuring out how to make that more robust.
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: 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
>


-- 
*Thanks & Regards*
*Akshay Joshi*

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