lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject lucene-solr:master: SOLR-8626: 404 error when clicking nodes in cloud graph view in angular UI.
Date Tue, 28 Jun 2016 11:12:47 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/master 2a1ec2d4d -> 9cbd54087


SOLR-8626: 404 error when clicking nodes in cloud graph view in angular UI.

This closes #23


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/9cbd5408
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/9cbd5408
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/9cbd5408

Branch: refs/heads/master
Commit: 9cbd54087ceafcc0eada370c9ce5bce05e1a462d
Parents: 2a1ec2d
Author: Shalin Shekhar Mangar <shalin@apache.org>
Authored: Tue Jun 28 16:43:00 2016 +0530
Committer: Shalin Shekhar Mangar <shalin@apache.org>
Committed: Tue Jun 28 16:43:00 2016 +0530

----------------------------------------------------------------------
 solr/CHANGES.txt                                |  2 +
 solr/webapp/web/js/angular/controllers/cloud.js | 48 ++++++++++++++------
 2 files changed, 35 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9cbd5408/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 1ab2376..ee8babe 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -84,6 +84,8 @@ Bug Fixes
 
 * SOLR-9237: DefaultSolrHighlighter.doHighlightingByFastVectorHighlighter can't be overidden
(janhoy)
 
+* SOLR-8626: 404 error when clicking nodes in cloud graph view in angular UI. (janhoy, Trey
Grainger via shalin)
+
 Optimizations
 ----------------------
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9cbd5408/solr/webapp/web/js/angular/controllers/cloud.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/angular/controllers/cloud.js b/solr/webapp/web/js/angular/controllers/cloud.js
index cb6a50d..c150c5a 100644
--- a/solr/webapp/web/js/angular/controllers/cloud.js
+++ b/solr/webapp/web/js/angular/controllers/cloud.js
@@ -313,6 +313,32 @@ solrAdminApp.directive('graph', function(Constants) {
                 }
             });
 
+
+            function setNodeNavigationBehavior(node, view){
+                node
+                .attr('data-href', function (d) {
+                    if (d.type == "node"){
+                        return getNodeUrl(d, view);
+                    }
+                    else{
+                        return "";
+                    }
+                })
+                .on('click', function(d) {
+                    if (d.data.type == "node"){
+                        location.href = getNodeUrl(d, view);
+                    }
+                });
+            }
+
+            function getNodeUrl(d, view){
+                var url = d.name + Constants.ROOT_URL + "#/~cloud";
+                if (view != undefined){
+                    url += "?view=" + view;
+                }
+                return url;
+            }
+
             var flatGraph = function(element, graphData, leafCount) {
                 var w = element.width(),
                     h = leafCount * 20;
@@ -358,14 +384,10 @@ solrAdminApp.directive('graph', function(Constants) {
                     })
                     .attr('text-anchor', function (d) {
                         return 0 === d.depth ? 'end' : 'start';
-                    })
-                    .attr('data-href', function (d) {
-                        return d.name + Constants.ROOT_URL + "#/~cloud";
-                    })
-                    .text(helper_node_text)
-                    .on('click', function(d,i) {
-                        location.href = d.name+Constants.ROOT_URL+"#/~cloud";
-                    });
+                    })                    
+                    .text(helper_node_text);
+
+                setNodeNavigationBehavior(node);
             };
 
             var radialGraph = function(element, graphData, leafCount) {
@@ -417,13 +439,9 @@ solrAdminApp.directive('graph', function(Constants) {
                     .attr('transform', function (d) {
                         return d.x < 180 ? null : 'rotate(180)';
                     })
-                    .attr('data-href', function (d) {
-                        return d.name;
-                    })
-                    .text(helper_node_text)
-                    .on('click', function(d,i) {
-                        location.href = d.name+Constants.ROOT_URL+"#/~cloud";
-                    });
+                    .text(helper_node_text);
+
+                setNodeNavigationBehavior(node, "rgraph");
             }
         }
     };


Mime
View raw message