From 45240f3850af668465dba8f1cba46367c6993d3e Mon Sep 17 00:00:00 2001 From: Murtuza Zabuawala Date: Fri, 15 Jan 2016 19:25:45 +0530 Subject: [PATCH] Use the same schema parameter 'visible' instead of separate one (i.e. show) for both control and cell, while generating the columns and field Schema. And, it was resulting into wrong behaviour because of that. Also - includes the server changes, which was using 'show' parameter earlier for showing version, when server was connected. --- .../server_groups/servers/templates/servers/servers.js | 4 ++-- web/pgadmin/static/js/backform.pgadmin.js | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/web/pgadmin/browser/server_groups/servers/templates/servers/servers.js b/web/pgadmin/browser/server_groups/servers/templates/servers/servers.js index 74023a5f1..00c9dea9e 100644 --- a/web/pgadmin/browser/server_groups/servers/templates/servers/servers.js +++ b/web/pgadmin/browser/server_groups/servers/templates/servers/servers.js @@ -158,7 +158,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) { } },{ id: 'version', label:'{{ _('Version') }}', type: 'text', group: null, - mode: ['properties'], show: 'isConnected' + mode: ['properties'], visible: 'isConnected' },{ id: 'comment', label:'{{ _('Comments') }}', type: 'multiline', group: null, mode: ['properties', 'edit', 'create'] @@ -190,7 +190,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) { ] },{ id: 'server_type', label: '{{ _('Server Type') }}', type: 'options', - mode: ['properties'], show: 'isConnected', + mode: ['properties'], visible: 'isConnected', 'options': [{% for st in server_types %} {label: '{{ st.description }}', value: '{{ st.server_type }}'},{% endfor %} {label: '{{ _('Unknown') }}', value: ''} diff --git a/web/pgadmin/static/js/backform.pgadmin.js b/web/pgadmin/static/js/backform.pgadmin.js index bd03b235a..59edf8399 100644 --- a/web/pgadmin/static/js/backform.pgadmin.js +++ b/web/pgadmin/static/js/backform.pgadmin.js @@ -1269,8 +1269,6 @@ var o = _.extend(_.clone(s), { name: s.id, - // Do we need to show this control in this mode? - visible: evalASFunc(s.show), // This can be disabled in some cases (if not hidden) disabled: (disabled ? true : evalASFunc(s.disabled)), @@ -1285,9 +1283,8 @@ cell: cell, node_info: node_info, schema_node: schema_node, - visible: (mode == 'properties'? - (ver_in_limit ? - (s.version || true) : false) : s.version || true), + // Do we need to show this control in this mode? + visible: evalASFunc(s.visible), node: node, node_data: treeData, version_compitible: ver_in_limit