Re: pgAdmin 4 commit: Resolved an issue related to no proper valid/invalid - Mailing list pgadmin-hackers

From Ashesh Vashi
Subject Re: pgAdmin 4 commit: Resolved an issue related to no proper valid/invalid
Date
Msg-id CAG7mmoz9mMBdxSuG3m7_yKFwmObKapKBKu5Jsw2T=Z0kfQW8yw@mail.gmail.com
Whole thread Raw
In response to Re: pgAdmin 4 commit: Resolved an issue related to no proper valid/invalid  (Dave Page <dpage@pgadmin.org>)
List pgadmin-hackers

On Tue, Mar 15, 2016 at 8:32 PM, Dave Page <dpage@pgadmin.org> wrote:

It looks like this has broken the schema properties dialog. On opening
it, I now get:

Uncaught TypeError: Cannot read property 'server' of
undefinedpgNode.PrivilegeRoleModel.pgNode.Model.extend.schema.cell.Backgrid.Extension.NodeListByNameCell.extend.omit_selected_roles
@ privilege.js:144Backgrid.Extension.NodeAjaxOptionsCell.Backgrid.Extension.Select2Cell.extend.render
@ node.ui.js:404Backgrid.Row.Backbone.View.extend.render @
backgrid.js:1954Backgrid.Body.Backbone.View.extend.render @
backgrid.js:2459Backgrid.Grid.Backbone.View.extend.render @
backgrid.js:2860Backform.UniqueColCollectionControl.Backform.Control.extend.showGridControl
@ backform.pgadmin.js:986Backform.UniqueColCollectionControl.Backform.Control.extend.render
@ backform.pgadmin.js:923(anonymous function) @
backform.pgadmin.js:547_.each._.forEach @
underscore.js:153Collection.(anonymous function) @
backbone.js:966(anonymous function) @
backform.pgadmin.js:540_.each._.forEach @
underscore.js:153Backform.Dialog.Backform.Form.extend.render @
backform.pgadmin.js:530(anonymous function) @ node.js:201fire @
jquery-1.11.2.js:3143self.fireWith @ jquery-1.11.2.js:3255done @
jquery-1.11.2.js:9309callback @ jquery-1.11.2.js:9713
Thanks for reporting.
It could have happened to all the nodes having privilege control, with existing privileges in an object.

I was relying on the individual model to fetch the tree hierarchy information, which was not available in case when we have existing privileges information in earlier implementation.
Instead now, we rely on the top level model to fetch that information.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company


http://www.linkedin.com/in/asheshvashi


On Tue, Mar 15, 2016 at 1:38 PM, Ashesh Vashi
<ashesh.vashi@enterprisedb.com> wrote:
> Resolved an issue related to no proper valid/invalid event was
> generated for the privilege control. Also, made changes in the
> PrivilegeRoleModel, to allow to select a grantee only once for the
> current user (as grantor), and omit them from other cell objects.
>
> Valid/Invalid event was not properly triggered, whenever the child
> attribute is a collection/model within a model (nested mode/collection
> within model). This patch tried to take care of all such scenarios in
> general.
>
> Branch
> ------
> master
>
> Details
> -------
> http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=4adea4dc2596fb495c4df8129745b87c35b062a6
>
> Modified Files
> --------------
> .../server_groups/servers/static/js/privilege.js   | 187 ++++++++++++++---
> .../servers/templates/servers/servers.js           |   9 +-
> web/pgadmin/browser/static/js/datamodel.js         | 233 ++++++++++-----------
> 3 files changed, 283 insertions(+), 146 deletions(-)
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers



--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

pgadmin-hackers by date:

Previous
From: Dave Page
Date:
Subject: depends.js and sql.js
Next
From: Ashesh Vashi
Date:
Subject: Re: depends.js and sql.js