Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ifHG1-0008Ce-Mm for pgadmin-hackers@arkaria.postgresql.org; Thu, 12 Dec 2019 05:43:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ifHG0-0007Zl-Dd for pgadmin-hackers@arkaria.postgresql.org; Thu, 12 Dec 2019 05:43:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ifHG0-0007Ze-1l for pgadmin-hackers@lists.postgresql.org; Thu, 12 Dec 2019 05:43:24 +0000 Received: from mail-il1-x144.google.com ([2607:f8b0:4864:20::144]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ifHFw-00027L-JE for pgadmin-hackers@postgresql.org; Thu, 12 Dec 2019 05:43:23 +0000 Received: by mail-il1-x144.google.com with SMTP id b15so964130ila.7 for ; Wed, 11 Dec 2019 21:43:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KglaGOntU939c0gkOIMCdrF7nJRKESULmw333SAvMMo=; b=EExVJ/breWo7pupJ33gncEXEW98WR8vL+nnxCfU8bbDAbjSpVa6gz8GanB3xv2gSzq gLjXIeCGiAN1jf6p9lhfxLjI6ZTd2bD1pJEcpVDOvLGO2IIohS8+UZRFuppSAUq4Ypkp 4KUmNRDbTfdn0699dSqzToHDEIE6bPf2WBrOXBDndbZdfsnMm5LPjk9a9LhbPyku30TX BBggfc9p3lkA3R9oFjgTCVdYtU5yaZOc8Fn82OZqgdLF4RtMQx2XCWaGvAQnJoPw12YH pewB1ZwtUVDt+OiEi28vCoaRsBEIwtS05qbvEVUrFQjRNjKUyy0hRSfKKGd4u1JUGntp +JDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KglaGOntU939c0gkOIMCdrF7nJRKESULmw333SAvMMo=; b=hR1ZWVRmtPy85z5r9cLQnacaV750I7wnqpotWrC/c2o4+SUgX0Es1rRHmBfOMQmzMz jhCHJyvjl5tcPXlhE3tUlEr9iAYCpbrrmUB/c7gOk32rqJkq7GYVnOm/91DD62X1PzVg kMQFj5fqZm0urELCD1geQcfStG0rIK567hlj9vs1wA93jbuIlWAQCGkoXPofxfFqArvz ziP0JUTH9HrGNVXFfd+NnoF1jYMDWBp/Hd2t4un7f/L50GP+WLe+B43FoT4HJmfQPeTx 7ihJK5IPOb1smLeOjASuo2CZ2ZpBP1cAJdlfBH7WCSsx260LzYqh6gMp6CBwgKtd2Up+ Pg2w== X-Gm-Message-State: APjAAAVgyqEfkE1oRAdQKAxrHMkb8m5nqJaFX+VkFpGKenpyRtVYehvD dLIAeKhWHwyoto1uVghJ1gcOMCptgsZ9YKrK1bc5GZtBvj+n1WLD/gdCgjdsKBd4jEydr21hghx Le4OOqqn2/0rnOa538qClbVuLmdc+I8zMloeqeRKm0PQKqija/A4gjJFgvrsVQQR+50FBYLFf4/ wupIqQNn2jrD15x8VXu/7w3NeY/ifIY0NsxgDdeTbbZ1JatG4WLW8= X-Google-Smtp-Source: APXvYqwUgrRhelaAoMbm/p32jI9/O8h8RlRpGzoyVV2sliHvJaFtB7kAkyfMRhhXQm577E+mW6q3WILGljNw6XFQCA0= X-Received: by 2002:a92:89c2:: with SMTP id w63mr6736199ilk.252.1576129398568; Wed, 11 Dec 2019 21:43:18 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Akshay Joshi Date: Thu, 12 Dec 2019 11:13:07 +0530 Message-ID: Subject: Re: Re : [BUG #4943] To: Aditya Toshniwal Cc: Karan Takalkar , pgadmin-hackers Content-Type: multipart/alternative; boundary="000000000000ec155405997b3839" X-CLOUD-SEC-AV-Info: edb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000ec155405997b3839 Content-Type: text/plain; charset="UTF-8" Thanks, patch applied. On Wed, Dec 11, 2019 at 5:41 PM Aditya Toshniwal < aditya.toshniwal@enterprisedb.com> wrote: > Hi, > > I've updated your patch further to escape the info prefix so that it > doesn't break if db name is something like - "". > Fixed a pep8 issue. > Otherwise, the patch looks good to me and test cases works fine. > > > On Wed, Dec 11, 2019 at 5:19 PM Karan Takalkar > wrote: > >> Hi, >> >> I have updated the disconnect messages. >> Databases/extension tests are failing , i have attached the log below. >> They are also failing if i undo the modifications. >> i do not know if this a problem with my setup or i maybe not following a >> convention. >> Please check the updated patch. >> >> Regards, >> Karan >> >> On Wed, Dec 11, 2019 at 3:03 PM Aditya Toshniwal < >> aditya.toshniwal@enterprisedb.com> wrote: >> >>> Hi Karan, >>> >>> I've updated your patch a bit. Kindly test and share the logs if test >>> cases fail. >>> Test cases seems to be working fine for me. Kindly also change >>> disconnected messages. >>> >>> On Tue, Dec 10, 2019 at 6:51 PM Karan Takalkar >>> wrote: >>> >>>> Hi, >>>> >>>> "add more variables to the response along with info and use those in >>>> the front end" >>>> i have already implemented that , but am still failing (7) test cases >>>> particularly in the databases/extensions tests(5). >>>> i had run regression tests for browser node.(and all it's sub >>>> directories). >>>> Please check the patch attached. >>>> >>>> On Tue, Dec 10, 2019 at 6:34 PM Aditya Toshniwal < >>>> aditya.toshniwal@enterprisedb.com> wrote: >>>> >>>>> [please use reply all to reply] >>>>> >>>>> You can add more variables to the response along with info and use >>>>> those in the front end. >>>>> >>>>> On Tue, Dec 10, 2019, 18:24 Karan Takalkar >>>>> wrote: >>>>> >>>>>> Hi >>>>>> >>>>>> I had been naively modifying jason response of connect function in >>>>>> databases __init__.py, later realized there are a lot of dependencies on it >>>>>> and most of regression tests use: >>>>>> if db_con["info"] == "Database connected.": . >>>>>> >>>>>> I am now modifying the Alertify.success script* directly responsible >>>>>> for the popup, i could append the database name in the message but am >>>>>> having trouble finding the *variable to supply server name.* >>>>>> The file and location of function is : >>>>>> * >>>>>> (web/pgadmin/browser/server_groups/servers/databases/static/js/database.js >>>>>> line 523) >>>>>> >>>>>> the message should be: >>>>>> Alertify.success("(?server_name_variable?}+'/'+data.label+' - '+ >>>>>> res.info") >>>>>> >>>>>> data.label contains database name >>>>>> res.info is the jason response coming from databases __init__.py >>>>>> connect function ; which is "Database connected." >>>>>> >>>>>> On Mon, Dec 9, 2019 at 8:35 PM Aditya Toshniwal < >>>>>> aditya.toshniwal@enterprisedb.com> wrote: >>>>>> >>>>>>> Hi Karan, >>>>>>> >>>>>>> Kindly add a hyphen between the message and names, create a patch to >>>>>>> pgAdmin hackers(check cc). >>>>>>> Kindly also run the test cases and pep8 before sending. >>>>>>> >>>>>>> On Mon, Dec 9, 2019, 20:17 Karan Takalkar >>>>>>> wrote: >>>>>>> >>>>>>>> I have updated the success message. >>>>>>>> Please check the screenshots attached. >>>>>>>> Should i make a patch? >>>>>>>> >>>>>>>> Regards, >>>>>>>> Karan >>>>>>>> >>>>>>>> On Mon, 9 Dec, 2019, 3:25 PM Aditya Toshniwal, < >>>>>>>> aditya.toshniwal@enterprisedb.com> wrote: >>>>>>>> >>>>>>>>> ++pgadmin-hackers >>>>>>>>> >>>>>>>>> Hi Karan, >>>>>>>>> >>>>>>>>> It is good to know that you're contributing. >>>>>>>>> I would suggest {server name}/{db name} as name instead of did is >>>>>>>>> better for UX. You can get the db name from conn object and server name >>>>>>>>> using the sid (refer >>>>>>>>> - web/pgadmin/browser/server_groups/servers/__init__.py) >>>>>>>>> >>>>>>>>> >>>>>>>>> On Mon, Dec 9, 2019 at 3:11 PM Karan Takalkar < >>>>>>>>> karan1533os@gmail.com> wrote: >>>>>>>>> >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> I have been working on #4943 ("Database connected" success >>>>>>>>>> message itself is not enough) added by you on pgAdmin4 issues. >>>>>>>>>> I want to know what details of database should be included in >>>>>>>>>> success message.(i have added 'did') >>>>>>>>>> >>>>>>>>>> The success message can be modified by altering json response in >>>>>>>>>> the connect method in file >>>>>>>>>> PGADMIN_SRC/web/pgadmin/browser/server_groups/servers/databases/__init__.py. >>>>>>>>>> please have a look at the screenshots attached. >>>>>>>>>> >>>>>>>>>> original: >>>>>>>>>> info=_( "Database connected.") >>>>>>>>>> new: >>>>>>>>>> info=_("Postgres version/{0} Database connected.".format(did)) >>>>>>>>>> >>>>>>>>>> Regards, >>>>>>>>>> Karan >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> Thanks and Regards, >>>>>>>>> Aditya Toshniwal >>>>>>>>> Sr. Software Engineer | EnterpriseDB India | Pune >>>>>>>>> "Don't Complain about Heat, Plant a TREE" >>>>>>>>> >>>>>>>> >>> >>> -- >>> Thanks and Regards, >>> Aditya Toshniwal >>> Sr. Software Engineer | EnterpriseDB India | Pune >>> "Don't Complain about Heat, Plant a TREE" >>> >> > > -- > Thanks and Regards, > Aditya Toshniwal > 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* --000000000000ec155405997b3839 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks, patch applied.

On Wed, Dec 11, 2019 at 5:41 PM Adit= ya Toshniwal <adity= a.toshniwal@enterprisedb.com> wrote:
Hi,

I've updated your patc= h further to escape the info prefix so that it doesn't break if db name= is something like - "<script>alert(1)</script>". Fix= ed a pep8 issue.
Otherwise, the patch looks=C2=A0good to me and test cases = works fine.


On Wed, Dec 11, 2019 at 5:19 PM Karan Takalkar <karan1533os@gmail.= com> wrote:
Hi,

I have updated the di= sconnect messages.
Databases/extension tests are failing , i have= attached the log below.
They are also failing if i undo the modi= fications.
i do not know if this a=C2=A0 problem with my set= up or i maybe not following a convention.
Please check the update= d patch.

Regards,
Karan
<= br>
On Wed,= Dec 11, 2019 at 3:03 PM Aditya Toshniwal <aditya.toshniwal@enterprisedb.com= > wrote:
=
Hi Karan,

I've updated your patch a bit. Kindly test a= nd share the logs if test cases fail.
Test cases seems to be working fine f= or me. Kindly also change disconnected messages.

On Tue, Dec 10, 2019= at 6:51 PM Karan Takalkar <karan1533os@gmail.com> wrote:
Hi,
"add more variables to the response along with info and us= e those in the front end"
i have already implemented that , = but am still failing (7)=C2=A0 test cases particularly in the databases/ext= ensions tests(5).
i had run regression tests for browser node.(an= d all it's sub directories).
Please check the patch attached.=

On Tue, Dec 10, 2019 at 6:34 PM Aditya Toshniwal <aditya.toshniwal= @enterprisedb.com> wrote:
[please use reply all to reply]

You can add more variables to the res= ponse along with info and use those in the front end.

On Tue, Dec 10, = 2019, 18:24 Karan Takalkar <karan1533os@gmail.com> wrote:
Hi

=
I had been naively modifying jason response of connect function = in databases __init__.py, later realized there are a lot of dependencies on= it and most of regression tests use:
if db_con["info"]= =3D=3D "Database connected.": .

I am no= w modifying the Alertify.success script* directly responsible for the popup= , i could append the database name in the message but am having trouble fin= ding the variable to supply server name.
The file and loca= tion of function is :
* (web/pgadmin/browser/server_groups/se= rvers/databases/static/js/database.js line 523)

th= e message should be:
Alertify.success("(?server_name_var= iable?}+'/'+data.label+' - '+res.info")

=
data.label contains database name
res.info is the jason response c= oming from databases __init__.py connect function ; which is "Database= connected."

On Mon, Dec 9, 2019 at 8:35 PM Aditya Toshniwal = <aditya.toshniwal@enterprisedb.com> wrote:
Hi Ka= ran,

Kindly add a hyphen betwe= en the message and names, create a patch to pgAdmin hackers(check cc).
Kindly also run the test cases and pep8 before sending.<= /div>

On Mon, Dec 9, 2019, 20:17 Karan Takalkar <karan1533os@gmail.com= > wrote:
=
I have updated the success message.=C2=A0
Please check the screenshots attached.
Should i ma= ke a patch?

Regards,
Karan

On Mon, 9 Dec, 2019, 3:25 PM Aditya Toshniwa= l, <aditya.toshniwal@enterprisedb.c= om> wrote:
++pgadmin-hackers

Hi Karan,

It is good to know = that you're contributing.
I would suggest {server name}/{db name} as na= me instead of did is better for UX. You can get the db name from conn objec= t and server name using the sid (refer -=C2=A0web/pgadmin/browser/server_gr= oups/servers/__init__.py)


On Mon, Dec 9, 2019 at 3:11 PM Karan Ta= kalkar <karan1533os@gmail.com>= ; wrote:
Hi,

I have been working on #4943 (<= span style=3D"font-weight:normal">"Database connected" success me= ssage itself is not enough) added by you on pgAdmin4 issues.
I want to know what details of databa= se should be included in success message.(i have added 'did')

The success message can be modified by alt= ering json response in the connect method in file PGADMIN_SRC/web/pgadmin/b= rowser/server_groups/servers/databases/__init__.py.
please have a look at the screenshots attached= .

orig= inal:
info=3D_( "Database connected.")<= /span>
new:
info=3D_("Postgres version/{0} Dat= abase connected.".format(did))

Regards,
Karan


--
Th= anks and Regards,
Aditya = Toshniwal
Sr. Software Engineer |=C2=A0EnterpriseDB India |=C2=A0Pune
"Don't Complain a= bout Heat, Plant a TREE"


--
Th= anks and Regards,
Aditya = Toshniwal
Sr. Software Engineer |=C2=A0EnterpriseDB India |=C2=A0Pune
"Don't Complain a= bout Heat, Plant a TREE"


--
Th= anks and Regards,
Aditya = Toshniwal
Sr. Software Engineer |=C2=A0EnterpriseDB India |=C2=A0Pune
"Don't Complain a= bout Heat, Plant a TREE"


--
Thanks & Regards
=
Akshay Joshi
Sr. Software Architect
EnterpriseDB Software India Private Limited
=
Mobile: += 91 976-788-8246
--000000000000ec155405997b3839--