...
  View open merge request
Commits (8)
......@@ -114,11 +114,30 @@ Model_loader.prototype = {
.update_selected_system()
self.dataFileName = document.getElementById(id)
.files[0].name;
self.check_export_monitor()
}
},
/**
* [check_export_monitor description]
* @return {[type]} [description]
*/
check_export_monitor: function(){
// disable export monitor button if only one sample is present
var div = document.getElementById("export_monitor_report")
if (div) {
if (this.samples.names.length >1){
div.classList.remove( "disabledClass" )
} else {
div.classList.add( "disabledClass" )
}
}
},
/**
* load the selected analysis file in the model
* @param {string} analysis - id of the form (html element) linking to the analysis file
......@@ -181,6 +200,8 @@ Model_loader.prototype = {
.initClones()
self.update_selected_system()
self.dataFileName = url_split[url_split.length-1]
self.check_export_monitor()
// self.applyUrlParams(paramsDict);
callback()
},
......@@ -212,6 +233,7 @@ Model_loader.prototype = {
self.parseJsonAnalysis(result)
self.initClones()
self.analysisFileName = url_split[url_split.length-1]
self.check_export_monitor()
},
error: function () {
self.update()
......@@ -354,7 +376,7 @@ Model_loader.prototype = {
//remove incomplete similarity matrix (TODO: fix fuse.py)
this.similarity = undefined;
this.check_export_monitor()
return this
}
......
......@@ -65,6 +65,7 @@ class TestMultilocus < BrowserTest
#assert ( $b.clone_in_graph('25').exists?), ">>fail init : clone 0 missing in graph"
assert ( $b.clone_in_list('25').text.include? '0.129%' ) , ">>fail init : wrong clone size "
end
def test_02_fold_left_menu
......@@ -415,6 +416,16 @@ class TestMultilocus < BrowserTest
assert ($b.window(:title => /Mastering the Vidjil web application/)), "Tutorial is opened"
end
def test_20_export_disable
begin
$b.menu_item_export
assert ( $b.div(:id => "export_monitor_report", :class => 'disabledClass').exists?), ">> export monitor is disable if only one samples is open"
$b.menu_item_export.click
assert ( not $b.window(index: 1).exists?), "No new window should have openened"
end
end
# Not really a test
def test_zz_close
close_everything
......