Re: [pgadmin4] Hide tabs in create table

From: Joao De Almeida Pereira <jdealmeidapereira(at)pivotal(dot)io>
To: Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [pgadmin4] Hide tabs in create table
Date: 2018-02-08 14:38:15
Message-ID: CAE+jjampW+1FeqQqDhsx34PCkfnEkeczW1qebshrMgbC5_8Lpg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Thanks Ashesh I will give it a try and see if I can me it work.

On Wed, Feb 7, 2018 at 10:04 PM Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>
wrote:

> On Thu, Feb 8, 2018 at 4:01 AM, Joao De Almeida Pereira <
> jdealmeidapereira(at)pivotal(dot)io> wrote:
>
>> Hi hackers,
>> We are trying to hide the advanced tab in the Create Table screen, and we
>> were looking into table.js file, but cannot find a way to hide it .
>>
>> Does anyone have an idea on how to do this?
>>
> Please take a look at the code in foreign_data_wrapper.js (line #151),
> where we've defined 'group' as:
>
>
>>
>> *{ id: 'security', label: gettext('Security'), type: 'group',},*
>
>
> You can also define 'visible' parameter for this type of schema.
> i.e.
>
>>
>> *{*
>> * id: 'advanced', label: gettext('Advanced'), type: 'group',
>> visible: function() { ... }**},*
>
> And, replace "group: gettext('Advanced')" with "group: 'advanced'" in all
> control schema in table.js.
>
> e.g.
> *---
> a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js*
> *+++
> b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js*
> *@@ -501,12 +501,22 @@ define('pgadmin.node.table', [*
> * return tbl_oid;*
> * },*
> * }),*
> *+ },{*
> *+ id: 'advanced', label: gettext('Advanced'), type: 'group',*
> *+ visible: function(m) {*
> *+ if(!_.isUndefined(m.node_info) &&
> !_.isUndefined(m.node_info.server)*
> *+ && !_.isUndefined(m.node_info.server.version) &&*
> *+ m.node_info.server.version > 100000)*
> *+ return true;*
> *+*
> *+ return false;*
> *+ },*
> * },{*
> * id: 'coll_inherits', label: gettext('Inherited from
> table(s)'),*
> *- type: 'text', group: gettext('Advanced'), mode:
> ['properties'],*
> *+ type: 'text', group: 'advanced', mode: ['properties'],*
> * },{*
> * id: 'inherited_tables_cnt', label: gettext('Inherited tables
> count'),*
> *- type: 'text', mode: ['properties'], group:
> gettext('Advanced'),*
> *+ type: 'text', mode: ['properties'], group: 'advanced',*
> * disabled: 'inSchema',*
> * }*
>
> The example patch - it has defined the 'advanced' group, and hide advanced
> group for server_version < 10, and then used it for 'coll_inherits', and
> 'inherited_tables_cnt'.
>
> -- Thanks, Ashesh
>
>>
>> Thanks
>> Joao
>>
>
>

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Murtuza Zabuawala 2018-02-08 18:04:19 Re: [pgAdmin4][RM#2901] Make shortcuts configurable in Debugger
Previous Message Joao De Almeida Pereira 2018-02-08 14:37:49 Re: [pgAdmin4][RM#2901] Make shortcuts configurable in Debugger