mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge pull request #2355 from guerler/revise_template_001
Build job success messages within tool form view
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
/**
|
||||
This is the regular tool form.
|
||||
*/
|
||||
define(['utils/utils', 'mvc/ui/ui-misc', 'mvc/tool/tool-form-base', 'mvc/tool/tool-template'],
|
||||
function( Utils, Ui, ToolFormBase, ToolTemplate ) {
|
||||
define([ 'utils/utils', 'mvc/ui/ui-misc', 'mvc/tool/tool-form-base' ],
|
||||
function( Utils, Ui, ToolFormBase ) {
|
||||
var View = ToolFormBase.extend({
|
||||
initialize: function( options ) {
|
||||
var self = this;
|
||||
ToolFormBase.prototype.initialize.call( this, Utils.merge({
|
||||
customize : function( options ) {
|
||||
customize: function( options ) {
|
||||
// build execute button
|
||||
options.buttons = {
|
||||
execute : execute_btn = new Ui.Button({
|
||||
execute: execute_btn = new Ui.Button({
|
||||
icon : 'fa-check',
|
||||
tooltip : 'Execute: ' + options.name + ' (' + options.version + ')',
|
||||
title : 'Execute',
|
||||
@@ -74,7 +74,7 @@ define(['utils/utils', 'mvc/ui/ui-misc', 'mvc/tool/tool-form-base', 'mvc/tool/to
|
||||
data : job_def,
|
||||
success : function( response ) {
|
||||
callback && callback();
|
||||
self.$el.empty().append( ToolTemplate.success( response ) );
|
||||
self.$el.empty().append( self._templateSuccess( response ) );
|
||||
parent.Galaxy && parent.Galaxy.currHistoryPanel && parent.Galaxy.currHistoryPanel.refreshContents();
|
||||
},
|
||||
error : function( response ) {
|
||||
@@ -87,12 +87,13 @@ define(['utils/utils', 'mvc/ui/ui-misc', 'mvc/tool/tool-form-base', 'mvc/tool/to
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
self.modal.show({
|
||||
var modal = parent.Galaxy.modal;
|
||||
modal && modal.show({
|
||||
title : 'Job submission failed',
|
||||
body : ( response && response.err_msg ) || ToolTemplate.error( job_def ),
|
||||
body : ( response && response.err_msg ) || self._templateError( job_def ),
|
||||
buttons : {
|
||||
'Close' : function() {
|
||||
self.modal.hide();
|
||||
modal.hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -141,6 +142,28 @@ define(['utils/utils', 'mvc/ui/ui-misc', 'mvc/tool/tool-form-base', 'mvc/tool/to
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
_templateSuccess: function( response ) {
|
||||
if ( response.jobs && response.jobs.length > 0 ) {
|
||||
var njobs = response.jobs.length;
|
||||
var njobs_text = njobs == 1 ? '1 job has' : njobs + ' jobs have';
|
||||
var $message = $( '<div/>' ).addClass( 'donemessagelarge' )
|
||||
.append( $( '<p/>' ).text( njobs_text + ' been successfully added to the queue - resulting in the following datasets:' ) );
|
||||
_.each( response.outputs, function( output ) {
|
||||
$message.append( $( '<p/>' ).addClass( 'messagerow' ).append( $( '<b/>' ).text( output.hid + ': ' + output.name ) ) );
|
||||
});
|
||||
$message.append( $( '<p/>' ).append( '<b/>' ).text( 'You can check the status of queued jobs and view the resulting data by refreshing the History pane. When the job has been run the status will change from \'running\' to \'finished\' if completed successfully or \'error\' if problems were encountered.' ) );
|
||||
return $message;
|
||||
} else {
|
||||
return this._templateError( response );
|
||||
}
|
||||
},
|
||||
|
||||
_templateError: function( response ) {
|
||||
return $( '<div/>' ).addClass( 'errormessagelarge' )
|
||||
.append( $( '<p/>' ).text( 'The server could not complete the request. Please contact the Galaxy Team if this error persists.' ) )
|
||||
.append( $( '<pre/>' ).text( JSON.stringify( response, null, 4 ) ) );
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -757,6 +757,9 @@ input[type="submit"], button {
|
||||
background-image: url(error_large.png);
|
||||
background-repeat: no-repeat;
|
||||
background-position: 10px 8px;
|
||||
.messagerow {
|
||||
padding: 10px 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.errormessagelarge {
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"tool-form.js","sources":["../../../src/mvc/tool/tool-form.js"],"names":["define","Utils","Ui","ToolFormBase","ToolTemplate","View","extend","initialize","options","self","this","prototype","call","merge","customize","buttons","execute","execute_btn","Button","icon","tooltip","name","version","title","cls","floating","onclick","wait","portlet","disable","submit","unwait","enable","job_id","job_remap","inputs","label","type","display","ignore","value","help","callback","job_def","tool_id","id","tool_version","data","create","trigger","validate","Galaxy","emit","debug","action","root","$f","$","attr","method","enctype","_","each","key","append","hide","appendTo","remove","request","url","success","response","$el","empty","parent","currHistoryPanel","refreshContents","error","err_data","error_messages","matchResponse","input_id","highlight","modal","show","body","err_msg","Close","job_inputs","batch_n","batch_src","job_input_id","input_value","match","input_field","field_list","input_def","input_list","optional","batch","n","values","length","src"],"mappings":"AAGAA,QAAQ,cAAe,iBAAkB,0BAA2B,0BAChE,SAAUC,EAAOC,EAAIC,EAAcC,GACnC,GAAIC,GAAOF,EAAaG,QACpBC,WAAY,SAAUC,GAClB,GAAIC,GAAOC,IACXP,GAAaQ,UAAUJ,WAAWK,KAAMF,KAAMT,EAAMY,OAChDC,UAAkB,SAAUN,GAExBA,EAAQO,SACJC,QAAUC,YAAc,GAAIf,GAAGgB,QAC3BC,KAAW,WACXC,QAAW,YAAcZ,EAAQa,KAAO,KAAOb,EAAQc,QAAU,IACjEC,MAAW,UACXC,IAAW,4BACXC,SAAW,QACXC,QAAW,WACPT,YAAYU,OACZlB,EAAKmB,QAAQC,UACbpB,EAAKqB,OAAQtB,EAAS,WAClBS,YAAYc,SACZtB,EAAKmB,QAAQI,eAMxBxB,EAAQyB,QAAUzB,EAAQ0B,YAC3B1B,EAAQ2B,OAA6B,oBACjCC,MAAc,oCACdf,KAAc,qBACdgB,KAAc,SACdC,QAAc,QACdC,OAAc,aACdC,MAAc,aACdhC,UAAkB,MAAOA,EAAQyB,SAAY,KAAM,eACnDQ,KAAc,uLAI3BjC,KAOPsB,OAAQ,SAAUtB,EAASkC,GACvB,GAAIjC,GAAOC,KACPiC,GACAC,QAAkBpC,EAAQqC,GAC1BC,aAAkBtC,EA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ACtBsD,EAAc,GACdC,EAAc,IAClB,KAAM,GAAIC,KAAgBH,GAAa,CACnC,GAAII,GAAcJ,EAAYG,GAC1BV,EAAcvE,KAAKqC,KAAK8C,MAAOF,GAC/BG,EAAcpF,KAAKqF,WAAYd,GAC/Be,EAActF,KAAKuF,WAAYhB,EACnC,IAAMA,GAAae,GAAcF,EAAjC,CAIA,IAAME,EAAUE,UAA2B,MAAfN,EAExB,MADAlF,MAAKwE,UAAWD,IACT,CAEX,IAAKW,GAAeA,EAAYO,MAAQ,CACpC,GAAIC,GAAIR,EAAYS,OAAOC,OACvBC,EAAMH,EAAI,GAAKR,EAAYS,OAAQ,IAAOT,EAAYS,OAAQ,GAAIE,GACtE,IAAKA,EACD,GAAmB,OAAdb,EACDA,EAAYa,MACT,IAAKb,IAAca,EAEtB,MADA7F,MAAKwE,UAAWD,EAAU,mFACnB,CAGf,IAAiB,KAAZQ,EACDA,EAAUW,MACP,IAAKX,IAAYW,EAEpB,MADA1F,MAAKwE,UAAWD,EAAU,gHAAkHmB,EAAI,wDAA0DX,EAAU,UAC7M,OAtBXtC,QAAOC,KAAKC,MAAM,wBAAyB,oCA0BnD,OAAO,IAIf,QACIhD,KAAMA"}
|
||||
{"version":3,"file":"tool-form.js","sources":["../../../src/mvc/tool/tool-form.js"],"names":["define","Utils","Ui","ToolFormBase","View","extend","initialize","options","self","this","prototype","call","merge","customize","buttons","execute","execute_btn","Button","icon","tooltip","name","version","title","cls","floating","onclick","wait","portlet","disable","submit","unwait","enable","job_id","job_remap","inputs","label","type","display","ignore","value","help","callback","job_def","tool_id","id","tool_version","data","create","trigger","validate","Galaxy","emit","debug","action","root","$f","$","attr","method","enctype","_","each","key","append","hide","appendTo","remove","request","url","success","response","$el","empty","_templateSuccess","parent","currHistoryPanel","refreshContents","error","err_data","error_messages","matchResponse","input_id","highlight","modal","show","body","err_msg","_templateError","Close","job_inputs","batch_n","batch_src","job_input_id","input_value","match","input_field","field_list","input_def","input_list","optional","batch","n","values","length","src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OAAOC,OACvBC,EAAMH,EAAI,GAAKR,EAAYS,OAAQ,IAAOT,EAAYS,OAAQ,GAAIE,GACtE,IAAKA,EACD,GAAmB,OAAdb,EACDA,EAAYa,MACT,IAAKb,IAAca,EAEtB,MADA/F,MAAKyE,UAAWD,EAAU,mFACnB,CAGf,IAAiB,KAAZS,EACDA,EAAUW,MACP,IAAKX,IAAYW,EAEpB,MADA5F,MAAKyE,UAAWD,EAAU,gHAAkHoB,EAAI,wDAA0DX,EAAU,UAC7M,OAtBXxC,QAAOC,KAAKC,MAAM,wBAAyB,oCA0BnD,OAAO,GAGXqB,iBAAkB,SAAUH,GACxB,GAAKA,EAASmC,MAAQnC,EAASmC,KAAKF,OAAS,EAAI,CAC7C,GAAIG,GAAQpC,EAASmC,KAAKF,OACtBI,EAAsB,GAATD,EAAa,YAAcA,EAAQ,aAChDE,EAAWpD,EAAG,UAAWqD,SAAU,oBACtB9C,OAAQP,EAAG,QAASsD,KAAMH,EAAa,gFAKxD,OAJA/C,GAAEC,KAAMS,EAASyC,QAAS,SAAUC,GAChCJ,EAAS7C,OAAQP,EAAG,QAASqD,SAAU,cAAe9C,OAAQP,EAAG,QAASsD,KAAME,EAAOC,IAAM,KAAOD,EAAO5F,UAE/GwF,EAAS7C,OAAQP,EAAG,QAASO,OAAQ,QAAS+C,KAAM,yPAC7CF,EAEP,MAAOnG,MAAK8E,eAAgBjB,IAIpCiB,eAAgB,SAAUjB,GACtB,MAAQd,GAAG,UAAWqD,SAAU,qBAC3B9C,OAAQP,EAAG,QAASsD,KAAM,sGAC1B/C,OAAQP,EAAG,UAAWsD,KAAMI,KAAKC,UAAW7C,EAAU,KAAM,OAIzE,QACIlE,KAAMA"}
|
||||
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
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
|
||||
define(["utils/utils","mvc/ui/ui-misc","mvc/tool/tool-form-base","mvc/tool/tool-template"],function(a,b,c,d){var e=c.extend({initialize:function(d){var e=this;c.prototype.initialize.call(this,a.merge({customize:function(a){a.buttons={execute:execute_btn=new b.Button({icon:"fa-check",tooltip:"Execute: "+a.name+" ("+a.version+")",title:"Execute",cls:"ui-button btn btn-primary",floating:"clear",onclick:function(){execute_btn.wait(),e.portlet.disable(),e.submit(a,function(){execute_btn.unwait(),e.portlet.enable()})}})},a.job_id&&a.job_remap&&(a.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",a.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."})}},d))},submit:function(b,c){var e=this,f={tool_id:b.id,tool_version:b.version,inputs:this.data.create()};if(this.trigger("reset"),!e.validate(f))return Galaxy.emit.debug("tool-form::submit()","Submission canceled. Validation failed."),void(c&&c());if(b.action!==Galaxy.root+"tool_runner/index"){var g=$("<form/>").attr({action:b.action,method:b.method,enctype:b.enctype});return _.each(f.inputs,function(a,b){g.append($("<input/>").attr({name:b,value:a}))}),g.hide().appendTo("body").submit().remove(),void(c&&c())}Galaxy.emit.debug("tool-form::submit()","Validation complete.",f),a.request({type:"POST",url:Galaxy.root+"api/tools",data:f,success:function(a){c&&c(),e.$el.empty().append(d.success(a)),parent.Galaxy&&parent.Galaxy.currHistoryPanel&&parent.Galaxy.currHistoryPanel.refreshContents()},error:function(a){if(c&&c(),Galaxy.emit.debug("tool-form::submit","Submission failed.",a),a&&a.err_data){var b=e.data.matchResponse(a.err_data);for(var g in b){e.highlight(g,b[g]);break}}else e.modal.show({title:"Job submission failed",body:a&&a.err_msg||d.error(f),buttons:{Close:function(){e.modal.hide()}}})}})},validate:function(a){var b=a.inputs,c=-1,d=null;for(var e in b){var f=b[e],g=this.data.match(e),h=this.field_list[g],i=this.input_list[g];if(g&&i&&h){if(!i.optional&&null==f)return this.highlight(g),!1;if(f&&f.batch){var j=f.values.length,k=j>0&&f.values[0]&&f.values[0].src;if(k)if(null===d)d=k;else if(d!==k)return this.highlight(g,"Please select either dataset or dataset list fields for all batch mode fields."),!1;if(-1===c)c=j;else if(c!==j)return this.highlight(g,"Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>"+j+"</b> selection(s) while a previous field contains <b>"+c+"</b>."),!1}}else Galaxy.emit.debug("tool-form::validate()","Retrieving input objects failed.")}return!0}});return{View:e}});
|
||||
define(["utils/utils","mvc/ui/ui-misc","mvc/tool/tool-form-base"],function(a,b,c){var d=c.extend({initialize:function(d){var e=this;c.prototype.initialize.call(this,a.merge({customize:function(a){a.buttons={execute:execute_btn=new b.Button({icon:"fa-check",tooltip:"Execute: "+a.name+" ("+a.version+")",title:"Execute",cls:"ui-button btn btn-primary",floating:"clear",onclick:function(){execute_btn.wait(),e.portlet.disable(),e.submit(a,function(){execute_btn.unwait(),e.portlet.enable()})}})},a.job_id&&a.job_remap&&(a.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",a.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."})}},d))},submit:function(b,c){var d=this,e={tool_id:b.id,tool_version:b.version,inputs:this.data.create()};if(this.trigger("reset"),!d.validate(e))return Galaxy.emit.debug("tool-form::submit()","Submission canceled. Validation failed."),void(c&&c());if(b.action!==Galaxy.root+"tool_runner/index"){var f=$("<form/>").attr({action:b.action,method:b.method,enctype:b.enctype});return _.each(e.inputs,function(a,b){f.append($("<input/>").attr({name:b,value:a}))}),f.hide().appendTo("body").submit().remove(),void(c&&c())}Galaxy.emit.debug("tool-form::submit()","Validation complete.",e),a.request({type:"POST",url:Galaxy.root+"api/tools",data:e,success:function(a){c&&c(),d.$el.empty().append(d._templateSuccess(a)),parent.Galaxy&&parent.Galaxy.currHistoryPanel&&parent.Galaxy.currHistoryPanel.refreshContents()},error:function(a){if(c&&c(),Galaxy.emit.debug("tool-form::submit","Submission failed.",a),a&&a.err_data){var b=d.data.matchResponse(a.err_data);for(var f in b){d.highlight(f,b[f]);break}}else{var g=parent.Galaxy.modal;g&&g.show({title:"Job submission failed",body:a&&a.err_msg||d._templateError(e),buttons:{Close:function(){g.hide()}}})}}})},validate:function(a){var b=a.inputs,c=-1,d=null;for(var e in b){var f=b[e],g=this.data.match(e),h=this.field_list[g],i=this.input_list[g];if(g&&i&&h){if(!i.optional&&null==f)return this.highlight(g),!1;if(f&&f.batch){var j=f.values.length,k=j>0&&f.values[0]&&f.values[0].src;if(k)if(null===d)d=k;else if(d!==k)return this.highlight(g,"Please select either dataset or dataset list fields for all batch mode fields."),!1;if(-1===c)c=j;else if(c!==j)return this.highlight(g,"Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>"+j+"</b> selection(s) while a previous field contains <b>"+c+"</b>."),!1}}else Galaxy.emit.debug("tool-form::validate()","Retrieving input objects failed.")}return!0},_templateSuccess:function(a){if(a.jobs&&a.jobs.length>0){var b=a.jobs.length,c=1==b?"1 job has":b+" jobs have",d=$("<div/>").addClass("donemessagelarge").append($("<p/>").text(c+" been successfully added to the queue - resulting in the following datasets:"));return _.each(a.outputs,function(a){d.append($("<p/>").addClass("messagerow").append($("<b/>").text(a.hid+": "+a.name)))}),d.append($("<p/>").append("<b/>").text("You can check the status of queued jobs and view the resulting data by refreshing the History pane. When the job has been run the status will change from 'running' to 'finished' if completed successfully or 'error' if problems were encountered.")),d}return this._templateError(a)},_templateError:function(a){return $("<div/>").addClass("errormessagelarge").append($("<p/>").text("The server could not complete the request. Please contact the Galaxy Team if this error persists.")).append($("<pre/>").text(JSON.stringify(a,null,4)))}});return{View:d}});
|
||||
//# sourceMappingURL=../../../maps/mvc/tool/tool-form.js.map
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user