Skip to content

Commit

Permalink
[FIXED JENKINS-41669] Buildgraph view does not show for som json resp…
Browse files Browse the repository at this point in the history
…onses.
  • Loading branch information
per-bohlin committed Feb 2, 2017
1 parent 3c72beb commit c4ad929
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/webapp/scripts/buildgraph-appctrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ angular.module('buildgraphapp', [])
$scope.callAtTimeout = function() {
$http.get(ajaxPath)
.then(function(response) {
var data = JSON.parse(response.data);
var data = response.data;
/* response.data can either be parsed JSON (object) or unparsed String() object
* (or plain type string if angular implementation changes). */
if (typeof data === 'string' || data instanceof String) {
data = JSON.parse(response.data);
}
var buildGraph = JSON.parse(data.buildGraph);
if(buildGraph.isBuilding || nodesSize != buildGraph.nodesSize || isBuilding != buildGraph.isBuilding) {
nodesSize = buildGraph.nodesSize;
Expand Down

0 comments on commit c4ad929

Please sign in to comment.