lucene-commits mailing list archives

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


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

This closes #23
(cherry picked from commit 9cbd540)


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

Branch: refs/heads/branch_6x
Commit: de85b9fff20cb63fd5096405adb5555521ac65ab
Parents: c8f9973
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:31 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/de85b9ff/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 99fd81c..112ceb9 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -52,6 +52,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/de85b9ff/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