Skip to content

Commit

Permalink
Fix when scan rest column list limits return type of scans
Browse files Browse the repository at this point in the history
  • Loading branch information
hodgem authored and revmic committed Nov 19, 2015
1 parent b68f2aa commit 9f6ea72
Showing 1 changed file with 32 additions and 16 deletions.
48 changes: 32 additions & 16 deletions src/main/scripts/viewer/gxnat/vis/AjaxViewableTree.js
Expand Up @@ -129,23 +129,39 @@ function(viewableFolderUrl, AjaxViewableTreeSubClass, runCallback, opt_doneCallb

var restColumns = AjaxViewableTreeSubClass.prototype.restColumns;
var columnsVar = (typeof restColumns !== 'undefined' && restColumns.length > 0) ? ('?columns=' + restColumns) : '';

gxnat.jsonGet(viewableFolderUrl + columnsVar, function(viewablesJson){
if (!goog.isArray(viewablesJson)) {
//runCallback(viewablesJson);
//return;
}
AjaxViewableTreeSubClass.prototype.populateRestDataObject(viewablesJson,viewableFolderUrl,function(){
goog.array.forEach(viewablesJson, function(viewable){
//window.console.log("VIEWABLE:", viewable);
runCallback(viewable)
})
if (opt_doneCallback){
//window.console.log("done callback", opt_doneCallback);
opt_doneCallback();
var reqCallback = function(viewablesJson){
AjaxViewableTreeSubClass.prototype.populateRestDataObject(viewablesJson,viewableFolderUrl,function(){
goog.array.forEach(viewablesJson, function(viewable){
//window.console.log("VIEWABLE:", viewable);
runCallback(viewable)
});
if (opt_doneCallback){
//window.console.log("done callback", opt_doneCallback);
opt_doneCallback();
}
});
};
gxnat.jsonGet(viewableFolderUrl + columnsVar, function(viewablesJson) {
// Make sure columns doesn't contain values that restrict scan return type
if (columnsVar.length>0) {
gxnat.jsonGet(viewableFolderUrl, function(viewablesJsonNC) {
goog.array.forEach(viewablesJsonNC, function(viewableNC){
var hasMatch = goog.array.some(viewablesJson, function(viewable){
if (viewable.ID==viewableNC.ID) {
return true;
}
return false;
});
if (!hasMatch) {
viewablesJson.push(viewableNC);
}
});
reqCallback(viewablesJson);
});
} else {
reqCallback(viewablesJson);
}
});
})
});
}


Expand Down

0 comments on commit 9f6ea72

Please sign in to comment.