Merge changes from release_15.03

This commit is contained in:
Dannon Baker
2015-03-06 15:52:09 -05:00
4 changed files with 55 additions and 13 deletions
@@ -133,12 +133,12 @@ define(['utils/utils', 'utils/deferred', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc',
highlight: function (input_id, message, silent) {
// get input field
var input_element = this.element_list[input_id];
// check input element
if (input_element) {
// mark error
input_element.error(message || 'Please verify this parameter.');
// scroll to first input element
if (!silent) {
$('html, body').animate({
@@ -153,7 +153,7 @@ define(['utils/utils', 'utils/deferred', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc',
_errors: function(options) {
// hide previous error statements
this.trigger('reset');
// highlight all errors
if (options && options.errors) {
var error_messages = this.tree.matchResponse(options.errors);
@@ -193,7 +193,7 @@ define(['utils/utils', 'utils/deferred', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc',
// here we update the tool version (some tools encode the version also in the id)
self.options.id = self.options.id.replace(self.options.version, this.version);
self.options.version = this.version;
// rebuild the model and form
self.deferred.reset();
self.deferred.execute(function(){self._buildModel()});
@@ -223,7 +223,7 @@ define(['utils/utils', 'utils/deferred', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc',
window.open(options.biostar_url + '/p/new/post/');
}
});
// create search button
menu_button.addMenu({
icon : 'fa-search',
@@ -295,6 +295,20 @@ define(['utils/utils', 'utils/deferred', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc',
});
}
// add remap button
if (this.options.job_id && this.options.job_remap) {
options.inputs['rerun_remap_job_id'] = {
label : 'Resume dependencies from this job',
name : 'rerun_remap_job_id',
type : 'select',
display : 'radio',
ignore : '__ignore__',
value : '__ignore__',
options : [['Yes', this.options.job_id], ['No', '__ignore__']],
help : 'The previous run of this tool failed and other tools were waiting for it to finish successfully. Use this option to resume those tools using the new output(s) of this tool run.'
}
}
// create tool form section
this.section = new ToolSection.View(self, {
inputs : options.inputs
+16 -2
View File
@@ -1215,7 +1215,8 @@ class Tool( object, Dictifiable ):
if 'rerun_remap_job_id' in incoming:
try:
rerun_remap_job_id = trans.app.security.decode_id( incoming[ 'rerun_remap_job_id' ] )
except Exception:
except Exception, exception:
log.error( str( exception ) )
message = 'Failure executing tool (attempting to rerun invalid job).'
return 'message.mako', dict( status='error', message=message, refresh_frames=[] )
@@ -2296,6 +2297,7 @@ class Tool( object, Dictifiable ):
params_to_incoming( kwd, self.inputs, job_params, trans.app, to_html=False )
except Exception, exception:
trans.response.status = 500
log.error( str( exception ) )
return { 'error': str( exception ) }
# create parameter object
@@ -2555,7 +2557,8 @@ class Tool( object, Dictifiable ):
'versions' : tool_versions,
'requirements' : tool_requirements,
'errors' : state_errors,
'state_inputs' : state_inputs
'state_inputs' : state_inputs,
'job_remap' : self._get_job_remap(job)
})
# check for errors
@@ -2565,6 +2568,17 @@ class Tool( object, Dictifiable ):
# return enriched tool model
return tool_model
def _get_job_remap ( self, job):
if job:
if job.state == job.states.ERROR:
try:
if [ hda.dependent_jobs for hda in [ jtod.dataset for jtod in job.output_datasets ] if hda.dependent_jobs ]:
return True
except Exception, exception:
log.error( str( exception ) )
pass
return False
def _map_source_to_history(self, trans, tool_inputs, params):
# Need to remap dataset parameters. Job parameters point to original
# dataset used; parameter should be the analygous dataset in the
+19 -5
View File
@@ -133,12 +133,12 @@ define(['utils/utils', 'utils/deferred', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc',
highlight: function (input_id, message, silent) {
// get input field
var input_element = this.element_list[input_id];
// check input element
if (input_element) {
// mark error
input_element.error(message || 'Please verify this parameter.');
// scroll to first input element
if (!silent) {
$('html, body').animate({
@@ -153,7 +153,7 @@ define(['utils/utils', 'utils/deferred', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc',
_errors: function(options) {
// hide previous error statements
this.trigger('reset');
// highlight all errors
if (options && options.errors) {
var error_messages = this.tree.matchResponse(options.errors);
@@ -193,7 +193,7 @@ define(['utils/utils', 'utils/deferred', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc',
// here we update the tool version (some tools encode the version also in the id)
self.options.id = self.options.id.replace(self.options.version, this.version);
self.options.version = this.version;
// rebuild the model and form
self.deferred.reset();
self.deferred.execute(function(){self._buildModel()});
@@ -223,7 +223,7 @@ define(['utils/utils', 'utils/deferred', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc',
window.open(options.biostar_url + '/p/new/post/');
}
});
// create search button
menu_button.addMenu({
icon : 'fa-search',
@@ -295,6 +295,20 @@ define(['utils/utils', 'utils/deferred', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc',
});
}
// add remap button
if (this.options.job_id && this.options.job_remap) {
options.inputs['rerun_remap_job_id'] = {
label : 'Resume dependencies from this job',
name : 'rerun_remap_job_id',
type : 'select',
display : 'radio',
ignore : '__ignore__',
value : '__ignore__',
options : [['Yes', this.options.job_id], ['No', '__ignore__']],
help : 'The previous run of this tool failed and other tools were waiting for it to finish successfully. Use this option to resume those tools using the new output(s) of this tool run.'
}
}
// create tool form section
this.section = new ToolSection.View(self, {
inputs : options.inputs
File diff suppressed because one or more lines are too long