mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
A new flag, force_history_refresh, has been added to Tool Configurations.
When set to "True", this flag will cause the entire history to reload when one of its outputs has finished running. Default is False. This is useful, i.e., when a tool creates an indeterminate number of output datasets by dumping them into new_file_path. Example: <tool id="someTool" name="Some tool name" version="1.0.1" force_history_refresh="True"> ... </tool>
This commit is contained in:
@@ -295,6 +295,8 @@ class Tool:
|
||||
self.is_multi_byte = util.string_as_bool( root.get( "is_multi_byte", False ) )
|
||||
# Type of tool
|
||||
self.tool_type = root.get( "tool_type", None )
|
||||
#Force history to fully refresh after job execution for this tool. Useful i.e. when an indeterminate number of outputs are created by a tool.
|
||||
self.force_history_refresh = util.string_as_bool( root.get( 'force_history_refresh', 'False' ) )
|
||||
# data_source tool
|
||||
if self.tool_type == "data_source":
|
||||
self.URL_method = root.get( "URL_method", "get" ) # get is the default
|
||||
|
||||
@@ -114,9 +114,16 @@ class RootController( BaseController ):
|
||||
for id, state in zip( ids, states ):
|
||||
data = self.app.model.HistoryDatasetAssociation.get( id )
|
||||
if data.state != state:
|
||||
job_hda = data
|
||||
while job_hda.copied_from_history_dataset_association:
|
||||
job_hda = job_hda.copied_from_history_dataset_association
|
||||
force_history_refresh = False
|
||||
if job_hda.creating_job_associations:
|
||||
force_history_refresh = trans.app.toolbox.tools_by_id[ job_hda.creating_job_associations[ 0 ].job.tool_id ].force_history_refresh
|
||||
rval[id] = {
|
||||
"state": data.state,
|
||||
"html": unicode( trans.fill_template( "root/history_item.mako", data=data, hid=data.hid ), 'utf-8' )
|
||||
"html": unicode( trans.fill_template( "root/history_item.mako", data=data, hid=data.hid ), 'utf-8' ),
|
||||
"force_history_refresh": force_history_refresh
|
||||
}
|
||||
return rval
|
||||
|
||||
|
||||
@@ -186,6 +186,7 @@ ${h.js( "jquery", "jquery.cookie", "cookie_set" )}
|
||||
// Build request data
|
||||
var ids = []
|
||||
var states = []
|
||||
var force_history_refresh = false
|
||||
$.each( tracked_datasets, function ( id, state ) {
|
||||
ids.push( id );
|
||||
states.push( state );
|
||||
@@ -205,13 +206,21 @@ ${h.js( "jquery", "jquery.cookie", "cookie_set" )}
|
||||
initShowHide();
|
||||
// If new state was terminal, stop tracking
|
||||
if (( val.state == "ok") || ( val.state == "error") || ( val.state == "empty") || ( val.state == "deleted" ) || ( val.state == "discarded" )) {
|
||||
if ( val.force_history_refresh ){
|
||||
force_history_refresh = true;
|
||||
}
|
||||
delete tracked_datasets[ parseInt(id) ];
|
||||
} else {
|
||||
tracked_datasets[ parseInt(id) ] = val.state;
|
||||
}
|
||||
});
|
||||
// Keep going (if there are still any items to track)
|
||||
updater( tracked_datasets );
|
||||
if ( force_history_refresh ) {
|
||||
parent.frames.galaxy_history.location.reload();
|
||||
}
|
||||
else {
|
||||
// Keep going (if there are still any items to track)
|
||||
updater( tracked_datasets );
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
// Just retry, like the old method, should try to be smarter
|
||||
|
||||
Reference in New Issue
Block a user