Commit 5ca1d0f1 authored by Mathieu Giraud's avatar Mathieu Giraud

Merge branch...

Merge branch 'feature-c/3079-l-export-de-rapport-monitor-plante-s-il-n-y-a-qu-un-seul-sample' into 'dev'

Resolve "L'export de rapport (monitor) plante s'il n'y a qu'un seul sample"

Closes #3079

See merge request !403
parents f975b1af bb80dc01
Pipeline #97283 passed with stages
in 10 minutes and 28 seconds
......@@ -114,11 +114,28 @@ Model_loader.prototype = {
.update_selected_system()
self.dataFileName = document.getElementById(id)
.files[0].name;
self.check_export_monitor()
}
},
/**
* disable export monitor button if only one sample is present (add disable class)
*/
check_export_monitor: function(){
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 +198,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 +231,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 +374,7 @@ Model_loader.prototype = {
//remove incomplete similarity matrix (TODO: fix fuse.py)
this.similarity = undefined;
this.check_export_monitor()
return this
}
......
# coding: utf-8
load 'vidjil_browser.rb'
load 'browser_test.rb'
#browser test suite
class TestExport < BrowserTest
def setup
super
end
def after_tests
end
def test_00_export_disable
# If only one sample, the button report monitor should be disable
set_browser("/doc/analysis-example1.vidjil")
if $b.driver.capabilities.browser_name == 'chrome'
skip "Issue #3699 must be solved first"
end
$b.menu_item_export('export_sample_report')
assert ( $b.a(:id => "export_monitor_report", :class => 'disabledClass').exists?), ">> export monitor is disable if only one samples is open"
end
def test_01_export_available
# If only one sample, the button report monitor should be enable
set_browser("/doc/analysis-example.vidjil")
if $b.driver.capabilities.browser_name == 'chrome'
skip "Issue #3699 must be solved first"
end
$b.menu_item_export('export_sample_report')
assert (not $b.a(:id => "export_monitor_report", :class => 'disabledClass').exists?), ">> export monitor available if 2 samples are present"
$b.menu_item_export('export_sample_report').click
assert ( $b.window(index: 1).exists?), "No new window should have openened"
end
# Not really a test
def test_zz_close
close_everything
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment