Fixing PR review comments

This commit is contained in:
anuprulez
2017-06-10 19:31:55 +02:00
parent b52042ef8e
commit 5cc46a95c9
5 changed files with 19 additions and 40 deletions
+10 -10
View File
@@ -14,7 +14,8 @@ var jQuery = require( 'jquery' ),
Workflows = require( 'mvc/workflow/workflow' ),
WorkflowsConfigureMenu = require( 'mvc/workflow/workflow-configure-menu' ),
ToolFormComposite = require( 'mvc/tool/tool-form-composite' ),
Utils = require( 'utils/utils' );
Utils = require( 'utils/utils' ),
Ui = require( 'mvc/ui/ui-misc' );
/** define the 'Analyze Data'/analysis/main/home page for Galaxy
* * has a masthead
@@ -198,17 +199,16 @@ window.app = function app( options, bootstrapped ){
/** load workflow by its url in run mode */
_loadWorkflow: function() {
var self = this;
self.page.$( '#galaxy-main' ).hide();
self.page.$( "#center-panel" ).show();
Utils.get({
url : Galaxy.root + 'workflow/run_workflow?id=' + Utils.getQueryString( 'id' ),
success : function( response ) {
var form = new ToolFormComposite.View( response );
self.page.$( "#center-panel" ).empty().append( form.$el )
url: Galaxy.root + 'api/workflows/' + Utils.getQueryString( 'id' ) + '/download',
data: { 'style': 'run' },
success: function( response ) {
self.page.display( new ToolFormComposite.View( response ) );
},
error : function( response ) {
var $el_error = "<div class='response-message errormessage'><p>Error occurred while loading the resource.</p></div>";
self.page.$( "#center-panel" ).empty().append( $el_error );
error: function( response ) {
var error_msg = "Error occurred while loading the resource.",
options = { 'message': error_msg, 'status': 'error', 'persistent': true, 'cls': 'errormessage' };
self.page.display( new Ui.Message( options ) );
}
});
}
@@ -910,10 +910,10 @@ class WorkflowController( BaseUIController, SharableMixin, UsesStoredWorkflowMix
return trans.response.send_redirect( redirect_url )
else:
return {
'url' : url,
'message' : message,
'status' : status,
'myexperiment_target_url' : myexperiment_target_url
'url': url,
'message': message,
'status': status,
'myexperiment_target_url': myexperiment_target_url
}
@web.expose
@@ -953,27 +953,6 @@ class WorkflowController( BaseUIController, SharableMixin, UsesStoredWorkflowMix
% ( escape( workflow_name ), url_for( controller='workflow', action='editor', id=workflow_id ),
url_for( controller='workflow', action='run', id=workflow_id ) ) )
@web.expose
@web.json
def run_workflow( self, trans, id, history_id=None, **kwargs ):
history = None
try:
if history_id is not None:
history_manager = histories.HistoryManager( trans.app )
history = history_manager.get_owned( trans.security.decode_id( history_id ), trans.user, current_history=trans.history )
else:
history = trans.get_history()
if history is None:
raise exceptions.MessageException( 'History unavailable. Please specify a valid history id' )
except Exception as e:
raise exceptions.MessageException( '[history_id=%s] Failed to retrieve history. %s.' % ( history_id, str( e ) ) )
trans.history = history
workflow_manager = workflows.WorkflowsManager( trans.app )
workflow_contents_manager = workflows.WorkflowContentsManager( trans.app )
stored = workflow_manager.get_stored_accessible_workflow( trans, id )
workflow_dict = workflow_contents_manager.workflow_to_dict( trans, stored, style='run' )
return workflow_dict
def get_item( self, trans, id ):
return self.get_stored_workflow( trans, id )
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long