Thread: pgAdmin 4 commit: Fixed an issue where the validation error message is
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 <rahul.shirsat@enterprisedb.com> 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(-)
Re: pgAdmin 4 commit: Fixed an issue where the validation error message is
From
Murtuza Zabuawala
Date:
Hello,
What is the reason for adding delay setTimeout(<func>, 120)?
This is causing issues in automation testing and makes buttons enable/disable with slight delay.
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 <rahul.shirsat@enterprisedb.com>
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(-)
Re: pgAdmin 4 commit: Fixed an issue where the validation error message is
From
Murtuza Zabuawala
Date:
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.
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(<func>, 120)?This is causing issues in automation testing and makes buttons enable/disable with slight delay.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 <rahul.shirsat@enterprisedb.com>
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(-)
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.
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(<func>, 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.
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 <rahul.shirsat@enterprisedb.com>
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.
Re: pgAdmin 4 commit: Fixed an issue where the validation error message is
From
Murtuza Zabuawala
Date:
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(<func>, 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.
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 <rahul.shirsat@enterprisedb.com>
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 ShirsatSoftware Engineer | EnterpriseDB Corporation.