From f6f5039e7da3d8be794658667d2efa52c1e5b38b Mon Sep 17 00:00:00 2001 From: Michael Hackstein Date: Mon, 22 Jul 2013 14:14:24 +0200 Subject: [PATCH] GraphViewer: Fixed a bug in the JSONAdapter, which caused the UI Tests to Fail, as the _id was not generated properly anymore --- html/admin/js/graphViewer/graph/JSONAdapter.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/html/admin/js/graphViewer/graph/JSONAdapter.js b/html/admin/js/graphViewer/graph/JSONAdapter.js index 8a72670424..4badc4e236 100644 --- a/html/admin/js/graphViewer/graph/JSONAdapter.js +++ b/html/admin/js/graphViewer/graph/JSONAdapter.js @@ -124,7 +124,7 @@ function JSONAdapter(jsonPath, nodes, edges, width, height) { } var n = findNode(node); if (!n) { - n = insertNode(node); + n = absAdapter.insertNode(node); } else { n.children = node.children; } @@ -132,11 +132,16 @@ function JSONAdapter(jsonPath, nodes, edges, width, height) { n._centrality = c; }); _.each(n.children, function(c) { - var check = findNode(c); + var check = findNode(c), e; if (!check) { - check = insertNode(c); + check = absAdapter.insertNode(c); } - insertEdge(n, check); + e = { + _from: n._id, + _to: check._id, + _id: n._id + "-" + check._id + }; + absAdapter.insertEdge(e); self.requestCentralityChildren(check._id, function(c) { n._centrality = c; });