From c7149437fc2efe352cf86bdc137deacdb88c7e95 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Wed, 18 Mar 2015 10:44:40 -0700 Subject: [PATCH] [Tree] Show top-level node of tree, except root Show top-level nodes when instantiating tree views, except for the Root object. Supports Add dialogs in WTD-922. --- platform/commonUI/general/bundle.json | 7 ++++++- platform/commonUI/general/res/templates/tree-node.html | 2 +- platform/core/bundle.json | 5 +++++ platform/representation/src/MCTRepresentation.js | 6 +++--- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/platform/commonUI/general/bundle.json b/platform/commonUI/general/bundle.json index 359f8d22a5..f765245c1e 100644 --- a/platform/commonUI/general/bundle.json +++ b/platform/commonUI/general/bundle.json @@ -150,12 +150,17 @@ "representations": [ { "key": "tree", - "templateUrl": "templates/tree.html", + "templateUrl": "templates/subtree.html", + "uses": [ "composition" ], "type": "root", "priority": "preferred" }, { "key": "tree", + "templateUrl": "templates/tree.html" + }, + { + "key": "subtree", "templateUrl": "templates/subtree.html", "uses": [ "composition" ] }, diff --git a/platform/commonUI/general/res/templates/tree-node.html b/platform/commonUI/general/res/templates/tree-node.html index 27416597e4..9e0a82353d 100644 --- a/platform/commonUI/general/res/templates/tree-node.html +++ b/platform/commonUI/general/res/templates/tree-node.html @@ -17,7 +17,7 @@ ng-show="toggle.isActive()" ng-if="model.composition !== undefined"> - diff --git a/platform/core/bundle.json b/platform/core/bundle.json index 43871d02e8..46f4b81f72 100644 --- a/platform/core/bundle.json +++ b/platform/core/bundle.json @@ -115,6 +115,11 @@ } ] }, + { + "key": "root", + "name": "Root", + "glyph": "F" + }, { "key": "folder", "name": "Folder", diff --git a/platform/representation/src/MCTRepresentation.js b/platform/representation/src/MCTRepresentation.js index bfc5ec3b64..4d44d39c7a 100644 --- a/platform/representation/src/MCTRepresentation.js +++ b/platform/representation/src/MCTRepresentation.js @@ -37,7 +37,7 @@ define( // Assemble all representations and views // The distinction between views and representations is - // not important her (view is-a representation) + // not important here (view is-a representation) representations.concat(views).forEach(function (representation) { var key = representation.key; @@ -78,8 +78,8 @@ define( // Populate scope with any capabilities indicated by the // representation's extension definition function refreshCapabilities() { - var representation = representationMap[$scope.key], - domainObject = $scope.domainObject, + var domainObject = $scope.domainObject, + representation = lookup($scope.key, domainObject), uses = ((representation || {}).uses || []); if (domainObject) {