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 1iefC2-0006SD-2J for pgadmin-hackers@arkaria.postgresql.org; Tue, 10 Dec 2019 13:04:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iefC0-0001mo-Lo for pgadmin-hackers@arkaria.postgresql.org; Tue, 10 Dec 2019 13:04:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iefC0-0001mh-1l for pgadmin-hackers@lists.postgresql.org; Tue, 10 Dec 2019 13:04:44 +0000 Received: from mail-ed1-x541.google.com ([2a00:1450:4864:20::541]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iefBv-0000Re-Mn for pgadmin-hackers@postgresql.org; Tue, 10 Dec 2019 13:04:42 +0000 Received: by mail-ed1-x541.google.com with SMTP id j17so15908794edp.3 for ; Tue, 10 Dec 2019 05:04:39 -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=/Z7zcxlKq+nluHQnro3mxmPK8DO1D5TLjN6SNVCjcCo=; b=ERSZuIxNgOFjz7MqNnaV/Zqy/76XWLNXuYfafPvVKwsvf40h27UZFcYChXfbb6yIQW 5cmn8lArI+k0mSh824JcrnHK22KPr1Q8Lk6OrzKBO+YHFzflpkCQx+lhpYWiOC0mRcD6 t1j5Qnyzzhs4wx2ZwY5Uf/TYUecCZDMTr0TSV4y2USbU2CjO17Ouh8s6Z9eoeOq3mIy8 cQjrG+mkT4586PCMkk8TkqGd07pTlGAbhpwGH8BnkdHUV43mAvH60q/zwkOfBIt2Fk3h y7Ic0XjEb33DgAO8dCtW2zaE6EDu7TTZ6GNRlcBhfNpBTDYAqOuzIth5qTz6PA2/ZTRu E3cg== 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=/Z7zcxlKq+nluHQnro3mxmPK8DO1D5TLjN6SNVCjcCo=; b=YLRbt7A3GvSGT0Ohq1As80uv/4Ha7RBLJ3hi8rMdhmzHe05iSJDg2Zv9eFDiSU2pNF 3w2IcxxNKUlHLww+PBasRGv7S0KjutqVwYGmBRxn0akBC0EFNhXvSnuZYbBAF8afg0qm iHyqOY46tQtey5ZslILV3fZS58zdXMdybrcDXNdcw+JvFHA1p8zTPjWGy56zFaGfopJZ UU5FOP4WnIa/l4HcrrA7P4oLk7M/9adM0t+Vb25jslUeGPkyaUYb9CR/3+7SO7vVYTW4 H1sMCGsChtVcxP5Z5VOXvvVB0Dv2a14xnqJ2k5eq8JyCwf2a9vLqmAGtoW9u6ENAcKZr BIqw== X-Gm-Message-State: APjAAAVFSxkWvY4F12urTGjH8Hq8eWqnsqMVyhs/2UeexrNqyODGSE3R O7ey0NsgoAkNS3X4+bZCOBsYr9XfJRQDKuqA3cTVFS8IBrfgT6bQdQ/FRXMJhPI1Gy56DLBZ5ra HEBxxMg102M5+CrBJQMzto0yf4OtH/zkerkh7k5keBaL/g3w2EBihUDW3LtlNq4KdzvpX5ncoVO lq+NYpt3G+wRootf9MfA6yEkSJ5L3w209q1yxwliE5ppMt3IVZF0I= X-Google-Smtp-Source: APXvYqzW2kGoh3M8WqK9OolJrx5uhSG25USFrHqfEx6iV1+E6sh6C9hvQtkOVonzZ4nFj5r3ZoUBdm1Qfexaac7QXts= X-Received: by 2002:a17:906:7708:: with SMTP id q8mr3543282ejm.33.1575983078135; Tue, 10 Dec 2019 05:04:38 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Aditya Toshniwal Date: Tue, 10 Dec 2019 18:34:26 +0530 Message-ID: Subject: Re: Re : [BUG #4943] To: Karan Takalkar Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary="0000000000008b76ea0599592731" 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 --0000000000008b76ea0599592731 Content-Type: text/plain; charset="UTF-8" [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 >>>> 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" >>>> >>> --0000000000008b76ea0599592731 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
[please use reply all to reply]

You can add more variables to the response along with i= nfo 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 lo= t of dependencies on it and most of regression tests use:
if db_c= on["info"] =3D=3D "Database connected.": .
I am now modifying the Alertify.success script* directly respo= nsible for the popup, i could append the database name in the message but a= m having trouble finding the variable to supply server name.
The file and location of function is :
* (web/pgadmin/brow= ser/server_groups/servers/databases/static/js/database.js line 523)

the message should be:
Alertify.success(&qu= ot;(?server_name_variable?}+'/'+data.label+' - '+res.info")<= /div>

data.label contains database name
res.info is = the jason response coming from databases __init__.py connect function ; whi= ch is "Database connected."


I have updated the success message.= =C2=A0
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,<= /div>
=
It is good to know that you're contributing.
I would suggest {serv= er 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 -=C2=A0web/p= gadmin/browser/server_groups/servers/__init__.py)


On Mon, Dec 9, = 2019 at 3:11 PM Karan Takalkar <kara= n1533os@gmail.com> wrote:
Hi,

I have = been working on #4943 ("Database co= nnected" success message itself is not enough) added by you on pgAdmin= 4 issues.
I want to kno= w what details of database should be included in success message.(i have ad= ded 'did')
=
The success messag= e can be modified by altering json response in the connect method in file P= GADMIN_SRC/web/pgadmin/browser/server_groups/servers/databases/__init__.py.=
please have a look at = the screenshots attached.

original:
info=3D_( "Database c= onnected.")
new:
info=3D_("= Postgres version/{0} Database 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"
--0000000000008b76ea0599592731--