Hi, Please find the attached patch to fix the issue : The right panels (properties, SQL etc...) give error while clicking on the partitions of a table.
Thanks, Khushboo
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/__init__.py index 41b5336..e2fd34c 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/__init__.py @@ -240,10 +240,6 @@ class PartitionsView(BaseTableView, DataTypeReader, VacuumSettings): else: nodes.extend(module.get_nodes(**kwargs)) - # Explicitly include 'partition' module as we had excluded it during - # registration. - nodes.extend(self.blueprint.get_nodes(**kwargs)) - # Return sorted nodes based on label return make_json_response( data=sorted( diff --git a/web/pgadmin/static/js/tree/pgadmin_tree_node.js b/web/pgadmin/static/js/tree/pgadmin_tree_node.js index 00f10d2..ec59b85 100644 --- a/web/pgadmin/static/js/tree/pgadmin_tree_node.js +++ b/web/pgadmin/static/js/tree/pgadmin_tree_node.js @@ -48,12 +48,13 @@ export function getTreeNodeHierarchyFromIdentifier(aciTreeNodeIdentifier) { export function getTreeNodeHierarchy(currentNode) { let idx = 0; + let node_cnt = 0; let result = {}; do { const currentNodeData = currentNode.getData(); if (currentNodeData._type in this.Nodes && this.Nodes[currentNodeData._type].hasId) { - const nodeType = mapType(currentNodeData._type); + const nodeType = mapType(currentNodeData._type, node_cnt); if (result[nodeType] === undefined) { result[nodeType] = _.extend({}, currentNodeData, { 'priority': idx, @@ -61,12 +62,13 @@ export function getTreeNodeHierarchy(currentNode) { idx -= 1; } } + node_cnt += 1; currentNode = currentNode.hasParent() ? currentNode.parent() : null; } while (currentNode); return result; } -function mapType(type) { - return type === 'partition' ? 'table' : type; +function mapType(type, idx) { + return (type === 'partition' && idx > 0) ? 'table' : type; }