This is an automated email from the git hooks/post-receive script. New commit to branch feature/7894-affichage-hierarchie-projet in repository coselmar. See http://git.codelutin.com/coselmar.git commit e2e19491cc45be4f372ea1e3c940c69cfa1f5097 Author: Yannick Martel <martel@©odelutin.com> Date: Tue Jan 12 17:54:51 2016 +0100 refs #7894 add links on hierarchy graph nodes --- .../coselmar/services/v1/QuestionsWebService.java | 4 +-- .../src/main/webapp/css/d3-collapsible-tree.css | 32 +++++++++++----------- .../src/main/webapp/js/coselmar-controllers.js | 15 ++++++++-- .../src/main/webapp/js/d3-2waytree-graph.js | 10 +++++-- 4 files changed, 37 insertions(+), 24 deletions(-) diff --git a/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/QuestionsWebService.java b/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/QuestionsWebService.java index 90f3333..ab44a86 100644 --- a/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/QuestionsWebService.java +++ b/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/QuestionsWebService.java @@ -1312,7 +1312,7 @@ public class QuestionsWebService extends CoselmarWebServiceSupport { for (Question parent : parents) { QuestionTreeNode ancestor = new QuestionTreeNode(); String parentId = parent.getTopiaId(); - ancestor.setId(parentId); + ancestor.setId(getShortIdFromFull(parentId)); ancestor.setTitle(parent.getTitle()); ancestor.setThemes(Sets.newHashSet(parent.getTheme())); Date deadline = parent.getDeadline(); @@ -1355,7 +1355,7 @@ public class QuestionsWebService extends CoselmarWebServiceSupport { for (Question child : children) { QuestionTreeNode descendant = new QuestionTreeNode(); String parentId = child.getTopiaId(); - descendant.setId(parentId); + descendant.setId(getShortIdFromFull(parentId)); descendant.setTitle(child.getTitle()); descendant.setThemes(Sets.newHashSet(child.getTheme())); Date deadline = child.getDeadline(); diff --git a/coselmar-ui/src/main/webapp/css/d3-collapsible-tree.css b/coselmar-ui/src/main/webapp/css/d3-collapsible-tree.css index ff67aeb..c951a95 100644 --- a/coselmar-ui/src/main/webapp/css/d3-collapsible-tree.css +++ b/coselmar-ui/src/main/webapp/css/d3-collapsible-tree.css @@ -91,19 +91,19 @@ a:hover { color: #999; } - .node circle { - cursor: pointer; - fill: #fff; - stroke: steelblue; - stroke-width: 1.5px; - } - - .node text { - font-size: 11px; - } - - path.link { - fill: none; - stroke: #ccc; - stroke-width: 1.5px; - } \ No newline at end of file +.node circle { + cursor: pointer; + fill: #fff; + stroke: steelblue; + stroke-width: 1.5px; +} + +.node text { + font-size: 11px; +} + +path.link { + fill: none; + stroke: #ccc; + stroke-width: 1.5px; +} \ No newline at end of file diff --git a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js index d830f2e..621a56e 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -1625,7 +1625,10 @@ coselmarControllers.controller('ModalQuestionHierarchyCtrl', function ($scope, $ $scope.depth = 2; $scope.ancestors = []; $scope.descendants = []; - $scope.hierarchyTree = { name : $scope.question.title, parents : [], children : [] }; + $scope.hierarchyTree = { name : $scope.question.title, + url : "#/questions/" + $scope.question.id, + tooltip : $scope.question.themes.join(), + parents : [], children : [] }; $scope.ancestorsReady = false; $scope.descendantsReady = false; @@ -1645,7 +1648,10 @@ coselmarControllers.controller('ModalQuestionHierarchyCtrl', function ($scope, $ $scope.ancestors = ancestors; // load parents angular.forEach($scope.ancestors, function(value, key) { - var parent = { name : value.title, isparent: true }; + var parent = { name : value.title, + url : "#/questions/" + value.id, + tooltip : value.themes.join(), + isparent: true }; var subParents = loadParents(value, $scope.depth - 1); if (subParents.length > 0) { parent.parents = subParents; @@ -1663,7 +1669,10 @@ coselmarControllers.controller('ModalQuestionHierarchyCtrl', function ($scope, $ $scope.descendants = descendants; // load children angular.forEach($scope.descendants, function(value, key) { - var child = { name : value.title, isparent: false }; + var child = { name : value.title, + url : "#/questions/" + value.id, + tooltip : value.themes.join(), + isparent: false }; var subChildren = loadChildren(value, $scope.depth); if (subChildren.length > 0) { child.children = subChildren; diff --git a/coselmar-ui/src/main/webapp/js/d3-2waytree-graph.js b/coselmar-ui/src/main/webapp/js/d3-2waytree-graph.js index 56e44e0..ea2d66b 100644 --- a/coselmar-ui/src/main/webapp/js/d3-2waytree-graph.js +++ b/coselmar-ui/src/main/webapp/js/d3-2waytree-graph.js @@ -26,7 +26,6 @@ var CollapsibleTree = function(elt) { // .attr("transform", "translate(" + m[0] + "," + m[3] + ")"); // top-bottom .attr("transform", "translate(0,"+h/2+")"); // bidirectional-tree - var that = { init: function(data) { var that = this; @@ -94,11 +93,16 @@ var CollapsibleTree = function(elt) { return "rotate(45)"; } else { return "rotate(45)"; - } + } } }) + .style("fill-opacity", 1e-6) + .append("svg:a") + .attr("xlink:href", function (d) { return d.url; }) + .attr("target", "_blank") + .attr("uib-tooltip", function(d) { return d.tooltip}) .text(function(d) { return d.name; }) - .style("fill-opacity", 1e-6); + ; // Transition nodes to their new position. var nodeUpdate = node.transition() -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.