Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kkisW-0000xw-Bx for pgadmin-hackers@arkaria.postgresql.org; Thu, 03 Dec 2020 07:18:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kkisT-0007NT-IM for pgadmin-hackers@arkaria.postgresql.org; Thu, 03 Dec 2020 07:18:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kkisT-0007NG-AE for pgadmin-hackers@lists.postgresql.org; Thu, 03 Dec 2020 07:18:09 +0000 Received: from mail-oi1-x232.google.com ([2607:f8b0:4864:20::232]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kkisO-0003cc-EH for pgadmin-hackers@lists.postgresql.org; Thu, 03 Dec 2020 07:18:07 +0000 Received: by mail-oi1-x232.google.com with SMTP id s18so1242862oih.1 for ; Wed, 02 Dec 2020 23:18:03 -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=ihNbVBqU3sP5XD6CUY7Y8HwC9i/Fjr8g7qAGAQ3nOdQ=; b=Jhp6ErvdH59UvlJtMgiIvfiLV7ZkRJXqJTLkGLfeUT4gPWos7P1DGzmIfVaJC/8PTk JsreO4dlRCgGJMGBp621RXROvKAeC+sB3vHCwn93tMUU6C/ydmHiDLVKaT+E2XzxJUVA UY6qRPuXVCJh2khr+QF+qNbxyoBUsfVVGiygutx1exgmZABKwKtTirAysxY7bOxOfGA6 tQlMWqCfK47mBd7Umtohn+tGHAuxPl52/136XnboQGsdWyZZZhYHaDwG8krD2KRsLyhg FOQLruyAxvhxzZCCsHz9VKHlg14o3ERtvom7uKQugGXUnYrqbkev1lMsHMlNwp6SXyWu HwIQ== 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=ihNbVBqU3sP5XD6CUY7Y8HwC9i/Fjr8g7qAGAQ3nOdQ=; b=KYwQqETx/qlQcQdI6OzsMYky5QKm5c8WyXjnlJQfwG05EfAWl6SjE5wup5S2PCK+JR tPgh9Uaj9jqgO90tX4FINNJrevmey4J65ABpLwZ0c78esdFKk67RX2UGVf3LvTeOr30V 9jXYPPH/Kp/wtcN/9V/ST7CBZ/4u1WdK1ASVPzOD6EeLYIQmZwndxaM6nht+k37eeW7H jXR68zSpOG6LYFz29Xl0TLq3UEBbZ7eeFFZeNlztAZeqCsJ1eJPPBaY2D0XbebPQBP/d 9M4JsBpsDb8jaiIetpTx9P31igbXWPrI8wy+RYN5j21Kijrrweadl6eFAGXjV+wCI44c Ywvg== X-Gm-Message-State: AOAM530hyUk9e4aMeN7MVfZNxaxe+r2/GvsTZqmYhv1+54VZFvI4Em/+ ATs8HI081odnYL9Lv17RUqdBYR/hDKfUbsN3Ga4avuSbmRF4jo3JXadRjXa5EREicb+T7i73BM6 vYtPY3c4GCHYSqJUI1EtBhLs2twZVkm6Azvm5aR6bZ+7T3B4Hg2GBjTvXXLHrBGE5Rbd1PSahFb /xPEZKog14uAPRGW6Y6Wpn5M3/NUNpeVNV03QXEQKTjG1KlbL6ntW3eKcpvCzSIJ56cSst/svIc Bi8nJNXQsBa X-Google-Smtp-Source: ABdhPJwDPVSNR6yqE8Hc66bTNI3IVpREYnvQxfFHfqma60Czu+87Y5Yq9al0meRqk7EnhDsoXu6bFHIIIwQelVvUBgs= X-Received: by 2002:aca:ec97:: with SMTP id k145mr980213oih.163.1606979882267; Wed, 02 Dec 2020 23:18:02 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Murtuza Zabuawala Date: Thu, 3 Dec 2020 12:47:46 +0530 Message-ID: Subject: Re: pgAdmin 4 commit: Fixed an issue where the validation error message is To: Rahul Shirsat Cc: Akshay Joshi , pgadmin-hackers , Dave Page Content-Type: multipart/alternative; boundary="0000000000000b4a8205b58a2919" X-CLOUD-SEC-AV-Info: enterprisedb,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 --0000000000000b4a8205b58a2919 Content-Type: text/plain; charset="UTF-8" On Thu, Dec 3, 2020 at 12:29 PM Rahul Shirsat < rahul.shirsat@enterprisedb.com> wrote: > > > On Thu, Dec 3, 2020 at 11:18 AM Murtuza Zabuawala < > murtuza.zabuawala@enterprisedb.com> wrote: > >> Hello, >> >> Another observation, >> >> + if(msg && handler) { >> + msg = msg || _.values(handler.errorModel.attributes)[0]; >> + >> + handler.trigger('pgadmin-session:model:invalid', msg, handler); >> + $(parentTr).addClass('error-in-grid'); >> + } >> + return this; >> + }, 120); >> + }, >> >> Here we are only making the model invalid, there is no logic to make it >> valid again. >> > > If there are multiple model errors in the list, and if user changes any > of them, it used to clear every other invalid models in the list. To avoid > this to happen, only invalid models are highlighted, rest others are taken > care of by the child valid events running in parallel. > This is causing issues when we have a nested collection control (ie: Subnode control under Subnode control), the error model is not getting cleared in that case because we do not have logic to make it valid here in settimeout, so the save button in the parent model is not getting enabled. > >> >> >> On Thu, Dec 3, 2020 at 11:09 AM Murtuza Zabuawala < >> murtuza.zabuawala@enterprisedb.com> wrote: >> >>> Hello, >>> >>> What is the reason for adding delay *setTimeout(, 120)*? >>> >>> This is causing issues in automation testing and makes buttons >>> enable/disable with slight delay. >>> >>> Timeout was added for the reason that, even if the current changed > model is valid, it should also check the rest of the invalid models in the > list. Slight delay was added, so even if the current model becomes valid, > it should highlight the invalid one iterating over the inner model list. > This is causing issue in automation tests because it introduced delay in the buttons enable/disable state in the parent collection. > -- >>> Regards, >>> Murtuza Zabuawala >>> *EDB* >>> *POWER TO POSTGRES* >>> https://www.edbpostgres.com >>> >>> >>> On Fri, Oct 30, 2020 at 3:10 PM Akshay Joshi < >>> akshay.joshi@enterprisedb.com> wrote: >>> >>>> Fixed an issue where the validation error message is shown twice. Fixes >>>> #5736 >>>> >>>> Branch >>>> ------ >>>> master >>>> >>>> Details >>>> ------- >>>> >>>> https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=183c83f0d2b2cb8dd33f9e8c41a030bc4cdaa4b2 >>>> Author: Rahul Shirsat >>>> >>>> Modified Files >>>> -------------- >>>> docs/en_US/release_notes_4_28.rst | 1 + >>>> web/pgadmin/browser/static/js/datamodel.js | 75 >>>> +++++++++++++++++++++++++++++- >>>> web/pgadmin/static/js/backform.pgadmin.js | 24 ++++------ >>>> web/pgadmin/static/scss/_alert.scss | 6 +++ >>>> 4 files changed, 90 insertions(+), 16 deletions(-) >>>> >>>> > > -- > *Rahul Shirsat* > Software Engineer | EnterpriseDB Corporation. > --0000000000000b4a8205b58a2919 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
<= div dir=3D"ltr">

<= /div>


On Thu, Dec 3, 2020 at 12:29 PM Rahul Shir= sat <rahul.shirsat@ent= erprisedb.com> wrote:


On Thu, Dec 3, 2020 at 11:18 AM Murtuza Zabuawala <murtuz= a.zabuawala@enterprisedb.com> wrote:
Hello,

An= other observation,

+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if(msg= =C2=A0&&=C2=A0handler)=C2=A0{
+=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0msg=C2=A0=3D=C2=A0msg=C2=A0||=C2=A0_.value= s(handler.errorModel.attributes)[0];
+
+=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0handler.trigger('pgadmin-session= :model:invalid',=C2=A0msg,=C2=A0handler);
+=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0$(parentTr).addClass('error-in-g= rid');
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0}
<= div style=3D"font-family:monospace;white-space:pre-wrap;color:rgb(0,136,0)"= >+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return=C2=A0this;
= +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0},=C2=A0120);
+=C2=A0=C2= =A0=C2=A0=C2=A0},

Here we are only making the model invalid, the= re is no logic to make it valid again.
=
=C2=A0
=C2=A0If there are multiple model errors in the list,= and if user changes any of them, it used to clear every other=C2=A0invalid= models in the list. To avoid this to happen, only=C2=A0invalid models are = highlighted, rest others=C2=A0are taken care of by the child valid events r= unning in parallel.

This is causing issues when we have a nested collection control (i= e: Subnode control under Subnode control), the error model is not getting c= leared in that case because we do not have logic to make it valid here in s= ettimeout, so the save button in the parent model is not getting enabled.



On Thu, Dec 3, 2020 at 11:09 AM Murtuza Zabuawala <murtuza.za= buawala@enterprisedb.com> wrote:
= Hello,

What is the reason for adding delay=C2=A0setTimeout(<func>, 12= 0)?

This is causing issues in automation testing and makes buttons enable/= disable with slight delay.

=C2=A0 =C2=A0 =C2=A0Timeout was added for the reason that, eve= n if the current changed model is valid, it should also check the rest of t= he invalid models in the list. Slight delay was added, so even if the curre= nt model becomes valid, it should highlight the invalid one iterating over = the inner model list.

This is causing issue in automation tests because it introduced= delay in the buttons enable/disable state in the parent collection.
<= br>
=C2=A0
--
Regards,
Murtuza Zabuawala
EDB<= /div>
POWER TO POSTGRES<= /b>

On Fri, Oct 30, 2020 at 3:10 PM Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Fixed an issue where the validation = error message is shown twice. Fixes #5736

Branch
------
master

Details
-------
https://git.postgresql.org/gitweb?p=3Dpgadmin4.git;a=3Dcommitdi= ff;h=3D183c83f0d2b2cb8dd33f9e8c41a030bc4cdaa4b2
Author: Rahul Shirsat <rahul.shirsat@enterprisedb.com>

Modified Files
--------------
docs/en_US/release_notes_4_28.rst=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0= 1 +
web/pgadmin/browser/static/js/datamodel.js | 75 +++++++++++++++++++++++++++= ++-
web/pgadmin/static/js/backform.pgadmin.js=C2=A0 | 24 ++++------
web/pgadmin/static/scss/_alert.scss=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 6 ++= +
4 files changed, 90 insertions(+), 16 deletions(-)



--
Rahul Shirsat
Software Engineer=C2= =A0|=C2=A0EnterpriseDB=C2=A0Corporation.
--0000000000000b4a8205b58a2919--