mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Revise label handling in form
This commit is contained in:
@@ -179,14 +179,13 @@ define(['utils/utils',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// create input element
|
||||
var self = this;
|
||||
return new Ui.Input({
|
||||
id : 'field-' + input_def.id,
|
||||
area : input_def.area,
|
||||
onchange : function() {
|
||||
self.app.trigger('change');
|
||||
onchange : function( new_value ) {
|
||||
input_def.onchange ? input_def.onchange( new_value ) : self.app.trigger( 'change' );
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@@ -7,9 +7,8 @@ define(['utils/utils', 'mvc/tool/tool-form-base'],
|
||||
// create form view
|
||||
var View = ToolFormBase.extend({
|
||||
initialize: function(options) {
|
||||
// link this
|
||||
var self = this;
|
||||
this.hasLabelListeners = false;
|
||||
this.workflow = options.workflow;
|
||||
|
||||
// link with node representation in workflow module
|
||||
this.node = options.node;
|
||||
@@ -40,7 +39,6 @@ define(['utils/utils', 'mvc/tool/tool-form-base'],
|
||||
// module information for the tool to update the workflow
|
||||
// state stored on the client with. User needs to save
|
||||
// for this to take effect.
|
||||
self.initializeLabelListener();
|
||||
self.node.update_field_data(data);
|
||||
self.errors(data && data.tool_model)
|
||||
}
|
||||
@@ -73,29 +71,6 @@ define(['utils/utils', 'mvc/tool/tool-form-base'],
|
||||
ToolFormBase.prototype.initialize.call(this, options);
|
||||
},
|
||||
|
||||
initializeLabelListener: function() {
|
||||
var self = this;
|
||||
if(this.hasLabelListeners !== false) {
|
||||
return;
|
||||
}
|
||||
this.hasLabelListeners = [];
|
||||
var outputSections = _.where(this.options.inputs, {outputSection: true});
|
||||
var labelInputs = outputSections.map(function(entry) {
|
||||
var sectionId = entry.id;
|
||||
var outputId = entry.outputId;
|
||||
var $section = $("#" + sectionId);
|
||||
var $labelRow = $section.find(".section-row").first();
|
||||
var labelTextInput = $labelRow.find("input")[0];
|
||||
$(labelTextInput).bind('input propertychange', function() {
|
||||
var newLabel = $(labelTextInput).val();
|
||||
var workflow = self.node.app.workflow;
|
||||
workflow.attemptUpdateOutputLabel( self.node, outputId, newLabel );
|
||||
});
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
|
||||
/** Builds all sub sections
|
||||
*/
|
||||
_makeSections: function(options){
|
||||
@@ -150,6 +125,7 @@ define(['utils/utils', 'mvc/tool/tool-form-base'],
|
||||
*/
|
||||
_makeSection: function(output_id, datatypes){
|
||||
// format datatypes
|
||||
var self = this;
|
||||
var extensions = [];
|
||||
var input_terminal_names = [];
|
||||
|
||||
@@ -188,15 +164,14 @@ define(['utils/utils', 'mvc/tool/tool-form-base'],
|
||||
title : 'Configure Output: \'' + output_id + '\'',
|
||||
type : 'section',
|
||||
flat : true,
|
||||
outputSection: true,
|
||||
outputId : output_id,
|
||||
inputs : [{
|
||||
action : 'Label',
|
||||
label : 'Label',
|
||||
type : 'text',
|
||||
value : '',
|
||||
ignore : '',
|
||||
help : 'This will provide a short name to describe the output - this must be unique across workflows.'
|
||||
value : ( output = this.node.getWorkflowOutput( output_id ) ) && output.label || '',
|
||||
help : 'This will provide a short name to describe the output - this must be unique across workflows.',
|
||||
onchange : function( new_value ) {
|
||||
self.workflow.attemptUpdateOutputLabel( self.node, output_id, new_value );
|
||||
}
|
||||
},{
|
||||
action : 'RenameDatasetAction',
|
||||
pja_arg : 'newname',
|
||||
@@ -267,21 +242,13 @@ define(['utils/utils', 'mvc/tool/tool-form-base'],
|
||||
};
|
||||
|
||||
// visit input nodes and enrich by name/value pairs from server data
|
||||
var self = this;
|
||||
function visit (head, head_list) {
|
||||
head_list = head_list || [];
|
||||
head_list.push(head);
|
||||
for (var i in head.inputs) {
|
||||
var input = head.inputs[i];
|
||||
var action = input.action;
|
||||
if ( action == "Label") {
|
||||
var workflowOutput = self.node.getWorkflowOutput(output_id);
|
||||
if ( workflowOutput ) {
|
||||
input.value = workflowOutput['label'] || '';
|
||||
} else{
|
||||
input.value = '';
|
||||
}
|
||||
} else if (action) {
|
||||
if (action) {
|
||||
// construct identifier as expected by backend
|
||||
input.name = 'pja__' + output_id + '__' + input.action;
|
||||
if (input.pja_arg) {
|
||||
|
||||
@@ -617,9 +617,7 @@ EditorFormView = Backbone.View.extend({
|
||||
|
||||
// Global state for the whole workflow
|
||||
reset: function() {
|
||||
if ( this.workflow ) {
|
||||
this.workflow.remove_all();
|
||||
}
|
||||
this.workflow && this.workflow.remove_all();
|
||||
this.workflow = Globals.workflow = new Workflow( this, $("#canvas-container") );
|
||||
},
|
||||
|
||||
@@ -795,6 +793,7 @@ EditorFormView = Backbone.View.extend({
|
||||
if (node.type == 'tool' && Utils.isJSON(text)) {
|
||||
var options = JSON.parse(text);
|
||||
options.node = node;
|
||||
options.workflow = this.workflow;
|
||||
options.datatypes = this.datatypes;
|
||||
formView = new ToolForm.View(options);
|
||||
} else {
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"form-parameters.js","sources":["../../../src/mvc/form/form-parameters.js"],"names":["define","Utils","Ui","SelectContent","SelectLibrary","SelectFtp","ColorPicker","Backbone","Model","extend","types","text","select","data_column","genomebuild","data","data_collection","integer","float","boolean","drill_down","color","hidden","hidden_data","baseurl","library_data","ftpfile","initialize","app","this","create","input_def","undefined","value","default_value","field","fieldClass","type","call","incompatible","options","_fieldSelect","_fieldText","Galaxy","emit","debug","_fieldData","self","View","id","extensions","optional","multiple","onchange","trigger","is_workflow","error_text","i","option","push","label","SelectClass","Select","display","Checkbox","Radio","searchable","_fieldDrilldown","Drilldown","area","validate","$","isArray","str_value","String","Input","_fieldSlider","Slider","precise","min","max","_fieldHidden","Hidden","info","_fieldBoolean","RadioButton","_fieldColor","_fieldLibrary","_fieldFtp"],"mappings":"AAGAA,QAAQ,cACA,iBACA,+BACA,2BACA,uBACA,0BACJ,SAASC,EAAOC,EAAIC,EAAeC,EAAeC,EAAWC,GAG7D,MAAOC,UAASC,MAAMC,QAElBC,OACIC,KAAsB,aACtBC,OAAsB,eACtBC,YAAsB,eACtBC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7C,GACnB,GAAIgB,GAAOlB,IACX,OAAO,IAAI3B,GAAG2E,OAAO7B,MACjBC,GAAc,SAAWlB,EAAUkB,GACnC6B,QAAgC,SAAlB/C,EAAUM,KACxBkB,YAAcxB,EAAUwB,YACxBwB,IAAchD,EAAUgD,IACxBC,IAAcjD,EAAUiD,IACxB3B,SAAc,WACVN,EAAKnB,IAAI0B,QAAQ,cAO7B2B,aAAc,SAASlD,GACnB,MAAO,IAAI7B,GAAGgF,QACVjC,GAAc,SAAWlB,EAAUkB,GACnCkC,KAAcpD,EAAUoD,QAMhCC,cAAe,SAASrD,GACpB,GAAIgB,GAAOlB,IACX,OAAO,IAAI3B,GAAGmF,YAAYrC,MACtBC,GAAc,SAAWlB,EAAUkB,GACnClC,OAAkB6C,MAAQ,MAAO3B,MAAQ,SACvB2B,MAAQ,KAAO3B,MAAQ,UACzCoB,SAAc,WACVN,EAAKnB,IAAI0B,QAAQ,cAO7BgC,YAAa,SAASvD,GAClB,GAAIgB,GAAOlB,IACX,OAAO,IAAIvB,IACP2C,GAAc,SAAWlB,EAAUkB,GACnCI,SAAc,WACVN,EAAKnB,IAAI0B,QAAQ,cAO7BiC,cAAe,SAASxD,GACpB,GAAIgB,GAAOlB,IACX,OAAO,IAAIzB,GAAc4C,MACrBC,GAAc,SAAWlB,EAAUkB,GACnCE,SAAcpB,EAAUoB,SACxBC,SAAcrB,EAAUqB,SACxBC,SAAc,WACVN,EAAKnB,IAAI0B,QAAQ,cAO7BkC,UAAW,SAASzD,GAChB,GAAIgB,GAAOlB,IACX,OAAO,IAAIxB,GAAU2C,MACjBC,GAAc,SAAWlB,EAAUkB,GACnCE,SAAcpB,EAAUoB,SACxBC,SAAcrB,EAAUqB,SACxBC,SAAc,WACVN,EAAKnB,IAAI0B,QAAQ"}
|
||||
{"version":3,"file":"form-parameters.js","sources":["../../../src/mvc/form/form-parameters.js"],"names":["define","Utils","Ui","SelectContent","SelectLibrary","SelectFtp","ColorPicker","Backbone","Model","extend","types","text","select","data_column","genomebuild","data","data_collection","integer","float","boolean","drill_down","color","hidden","hidden_data","baseurl","library_data","ftpfile","initialize","app","this","create","input_def","undefined","value","default_value","field","fieldClass","type","call","incompatible","options","_fieldSelect","_fieldText","Galaxy","emit","debug","_fieldData","self","View","id","extensions","optional","multiple","onchange","trigger","is_workflow","error_text","i","option","push","label","SelectClass","Select","display","Checkbox","Radio","searchable","_fieldDrilldown","Drilldown","area","validate","$","isArray","str_value","String","Input","new_value","_fieldSlider","Slider","precise","min","max","_fieldHidden","Hidden","info","_fieldBoolean","RadioButton","_fieldColor","_fieldLibrary","_fieldFtp"],"mappings":"AAGAA,QAAQ,cACA,iBACA,+BACA,2BACA,uBACA,0BACJ,SAASC,EAAOC,EAAIC,EAAeC,EAAeC,EAAWC,GAG7D,MAAOC,UAASC,MAAMC,QAElBC,OACIC,KAAsB,aACtBC,OAAsB,eACtBC,YAAsB,eACtBC,YAAsB,eACtBC,KAAsB,aACtBC,gBAAsB,aACtBC,QAAsB,eACtBC,QAAsB,eACtBC,UAAsB,gBACtBC,WAAsB,kBACtBC,MAAsB,cACtBC,OAAsB,eACtBC,YAAsB,eACtBC,QAAsB,eACtBC,aAAsB,gBACtBC,QAAsB,aAI1BC,WAAY,SAASC,GACjBC,KAAKD,IAAMA,GAKfE,OAAQ,SAASC,GAEWC,SAApBD,EAAUE,QACVF,EAAUE,MAAQ,MAEUD,SAA5BD,EAAUG,gBACVH,EAAUG,cAAgBH,EAAUE,MAIxC,IAAIE,GAAQ,KACRC,EAAaP,KAAKnB,MAAMqB,EAAUM,KAkBtC,OAjBID,IAA2C,kBAAtBP,MAAKO,KAC1BD,EAAQN,KAAKO,GAAYE,KAAKT,KAAME,IAInCI,IACDN,KAAKD,IAAIW,cAAe,EAEpBJ,EADAJ,EAAUS,QACFX,KAAKY,aAAaV,GAElBF,KAAKa,WAAWX,GAE5BY,OAAOC,KAAKC,MAAM,6BAA8B,4BAA8Bd,EAAUM,KAAO,OAI/EL,SAApBD,EAAU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OlB,IACX,OAAO,IAAIvB,IACP2C,GAAc,SAAWlB,EAAUkB,GACnCI,SAAc,WACVN,EAAKnB,IAAI0B,QAAQ,cAO7BkC,cAAe,SAASzD,GACpB,GAAIgB,GAAOlB,IACX,OAAO,IAAIzB,GAAc4C,MACrBC,GAAc,SAAWlB,EAAUkB,GACnCE,SAAcpB,EAAUoB,SACxBC,SAAcrB,EAAUqB,SACxBC,SAAc,WACVN,EAAKnB,IAAI0B,QAAQ,cAO7BmC,UAAW,SAAS1D,GAChB,GAAIgB,GAAOlB,IACX,OAAO,IAAIxB,GAAU2C,MACjBC,GAAc,SAAWlB,EAAUkB,GACnCE,SAAcpB,EAAUoB,SACxBC,SAAcrB,EAAUqB,SACxBC,SAAc,WACVN,EAAKnB,IAAI0B,QAAQ"}
|
||||
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
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
|
||||
define(["utils/utils","mvc/ui/ui-misc","mvc/form/form-select-content","mvc/ui/ui-select-library","mvc/ui/ui-select-ftp","mvc/ui/ui-color-picker"],function(a,b,c,d,e,f){return Backbone.Model.extend({types:{text:"_fieldText",select:"_fieldSelect",data_column:"_fieldSelect",genomebuild:"_fieldSelect",data:"_fieldData",data_collection:"_fieldData",integer:"_fieldSlider","float":"_fieldSlider","boolean":"_fieldBoolean",drill_down:"_fieldDrilldown",color:"_fieldColor",hidden:"_fieldHidden",hidden_data:"_fieldHidden",baseurl:"_fieldHidden",library_data:"_fieldLibrary",ftpfile:"_fieldFtp"},initialize:function(a){this.app=a},create:function(a){void 0===a.value&&(a.value=null),void 0===a.default_value&&(a.default_value=a.value);var b=null,c=this.types[a.type];return c&&"function"==typeof this[c]&&(b=this[c].call(this,a)),b||(this.app.incompatible=!0,b=a.options?this._fieldSelect(a):this._fieldText(a),Galaxy.emit.debug("form-parameters::_addRow()","Auto matched field type ("+a.type+").")),void 0!==a.value&&b.value(a.value),b},_fieldData:function(a){var b=this;return new c.View(this.app,{id:"field-"+a.id,extensions:a.extensions,optional:a.optional,multiple:a.multiple,type:a.type,data:a.options,onchange:function(){b.app.trigger("change")}})},_fieldSelect:function(a){if(a.is_workflow)return this._fieldText(a);"data_column"==a.type&&(a.error_text="Missing columns in referenced dataset.");var c=[];for(var d in a.options){var e=a.options[d];c.push({label:e[0],value:e[1]})}var f=b.Select;switch(a.display){case"checkboxes":f=b.Checkbox;break;case"radio":f=b.Radio}var g=this;return new f.View({id:"field-"+a.id,data:c,error_text:a.error_text||"No options available",optional:a.optional&&null===a.default_value,multiple:a.multiple,optional:a.optional,searchable:a.searchable,onchange:function(){g.app.trigger("change")}})},_fieldDrilldown:function(a){if(a.is_workflow)return this._fieldText(a);var c=this;return new b.Drilldown.View({id:"field-"+a.id,data:a.options,display:a.display,onchange:function(){c.app.trigger("change")}})},_fieldText:function(c){if(c.options)if(c.area=c.multiple,a.validate(c.value)){if($.isArray(c.value)){var d="";for(var e in c.value){if(d+=String(c.value[e]),!c.multiple)break;d+="\n"}c.value=d}}else c.value=null;var f=this;return new b.Input({id:"field-"+c.id,area:c.area,onchange:function(){f.app.trigger("change")}})},_fieldSlider:function(a){var c=this;return new b.Slider.View({id:"field-"+a.id,precise:"float"==a.type,is_workflow:a.is_workflow,min:a.min,max:a.max,onchange:function(){c.app.trigger("change")}})},_fieldHidden:function(a){return new b.Hidden({id:"field-"+a.id,info:a.info})},_fieldBoolean:function(a){var c=this;return new b.RadioButton.View({id:"field-"+a.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:function(){c.app.trigger("change")}})},_fieldColor:function(a){var b=this;return new f({id:"field-"+a.id,onchange:function(){b.app.trigger("change")}})},_fieldLibrary:function(a){var b=this;return new d.View({id:"field-"+a.id,optional:a.optional,multiple:a.multiple,onchange:function(){b.app.trigger("change")}})},_fieldFtp:function(a){var b=this;return new e.View({id:"field-"+a.id,optional:a.optional,multiple:a.multiple,onchange:function(){b.app.trigger("change")}})}})});
|
||||
define(["utils/utils","mvc/ui/ui-misc","mvc/form/form-select-content","mvc/ui/ui-select-library","mvc/ui/ui-select-ftp","mvc/ui/ui-color-picker"],function(a,b,c,d,e,f){return Backbone.Model.extend({types:{text:"_fieldText",select:"_fieldSelect",data_column:"_fieldSelect",genomebuild:"_fieldSelect",data:"_fieldData",data_collection:"_fieldData",integer:"_fieldSlider","float":"_fieldSlider","boolean":"_fieldBoolean",drill_down:"_fieldDrilldown",color:"_fieldColor",hidden:"_fieldHidden",hidden_data:"_fieldHidden",baseurl:"_fieldHidden",library_data:"_fieldLibrary",ftpfile:"_fieldFtp"},initialize:function(a){this.app=a},create:function(a){void 0===a.value&&(a.value=null),void 0===a.default_value&&(a.default_value=a.value);var b=null,c=this.types[a.type];return c&&"function"==typeof this[c]&&(b=this[c].call(this,a)),b||(this.app.incompatible=!0,b=a.options?this._fieldSelect(a):this._fieldText(a),Galaxy.emit.debug("form-parameters::_addRow()","Auto matched field type ("+a.type+").")),void 0!==a.value&&b.value(a.value),b},_fieldData:function(a){var b=this;return new c.View(this.app,{id:"field-"+a.id,extensions:a.extensions,optional:a.optional,multiple:a.multiple,type:a.type,data:a.options,onchange:function(){b.app.trigger("change")}})},_fieldSelect:function(a){if(a.is_workflow)return this._fieldText(a);"data_column"==a.type&&(a.error_text="Missing columns in referenced dataset.");var c=[];for(var d in a.options){var e=a.options[d];c.push({label:e[0],value:e[1]})}var f=b.Select;switch(a.display){case"checkboxes":f=b.Checkbox;break;case"radio":f=b.Radio}var g=this;return new f.View({id:"field-"+a.id,data:c,error_text:a.error_text||"No options available",optional:a.optional&&null===a.default_value,multiple:a.multiple,optional:a.optional,searchable:a.searchable,onchange:function(){g.app.trigger("change")}})},_fieldDrilldown:function(a){if(a.is_workflow)return this._fieldText(a);var c=this;return new b.Drilldown.View({id:"field-"+a.id,data:a.options,display:a.display,onchange:function(){c.app.trigger("change")}})},_fieldText:function(c){if(c.options)if(c.area=c.multiple,a.validate(c.value)){if($.isArray(c.value)){var d="";for(var e in c.value){if(d+=String(c.value[e]),!c.multiple)break;d+="\n"}c.value=d}}else c.value=null;var f=this;return new b.Input({id:"field-"+c.id,area:c.area,onchange:function(a){c.onchange?c.onchange(a):f.app.trigger("change")}})},_fieldSlider:function(a){var c=this;return new b.Slider.View({id:"field-"+a.id,precise:"float"==a.type,is_workflow:a.is_workflow,min:a.min,max:a.max,onchange:function(){c.app.trigger("change")}})},_fieldHidden:function(a){return new b.Hidden({id:"field-"+a.id,info:a.info})},_fieldBoolean:function(a){var c=this;return new b.RadioButton.View({id:"field-"+a.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:function(){c.app.trigger("change")}})},_fieldColor:function(a){var b=this;return new f({id:"field-"+a.id,onchange:function(){b.app.trigger("change")}})},_fieldLibrary:function(a){var b=this;return new d.View({id:"field-"+a.id,optional:a.optional,multiple:a.multiple,onchange:function(){b.app.trigger("change")}})},_fieldFtp:function(a){var b=this;return new e.View({id:"field-"+a.id,optional:a.optional,multiple:a.multiple,onchange:function(){b.app.trigger("change")}})}})});
|
||||
//# sourceMappingURL=../../../maps/mvc/form/form-parameters.js.map
|
||||
@@ -1,2 +1,2 @@
|
||||
define(["utils/utils","mvc/tool/tool-form-base"],function(a,b){var c=b.extend({initialize:function(c){var d=this;return this.hasLabelListeners=!1,this.node=c.node,this.node?(this.post_job_actions=this.node.post_job_actions||{},c=a.merge(c,{text_enable:"Set in Advance",text_disable:"Set at Runtime",narrow:!0,initial_errors:!0,sustain_version:!0,cls:"ui-portlet-narrow",update_url:Galaxy.root+"api/workflows/build_module",update:function(a){d.initializeLabelListener(),d.node.update_field_data(a),d.errors(a&&a.tool_model)}}),a.deepeach(c.inputs,function(b){b.type&&(-1!=["data","data_collection"].indexOf(b.type)?(b.type="hidden",b.info="Data input '"+b.name+"' ("+a.textify(b.extensions&&b.extensions.toString())+")",b.value=null):(b.collapsible_value={__class__:"RuntimeValue"},b.is_workflow=b.options&&0==b.options.length||-1!=["integer","float"].indexOf(b.type)))}),a.deepeach(c.inputs,function(a){"conditional"==a.type&&(a.test_param.collapsible_value=void 0)}),this._makeSections(c),void b.prototype.initialize.call(this,c)):void Galaxy.emit.debug("tool-form-workflow::initialize()","Node not found in workflow.")},initializeLabelListener:function(){var a=this;if(this.hasLabelListeners===!1){this.hasLabelListeners=[];{var b=_.where(this.options.inputs,{outputSection:!0});b.map(function(b){var c=b.id,d=b.outputId,e=$("#"+c),f=e.find(".section-row").first(),g=f.find("input")[0];$(g).bind("input propertychange",function(){var b=$(g).val(),c=a.node.app.workflow;c.attemptUpdateOutputLabel(a.node,d,b)})})}}},_makeSections:function(b){var c=b.inputs,d=b.datatypes;c[a.uid()]={label:"Annotation / Notes",name:"annotation",type:"text",area:!0,help:"Add an annotation or note for this step. It will be shown with the workflow.",value:this.node.annotation};var e=this.node.output_terminals&&Object.keys(this.node.output_terminals)[0];if(e){c[a.uid()]={name:"pja__"+e+"__EmailAction",label:"Email notification",type:"boolean",value:String(Boolean(this.post_job_actions["EmailAction"+e])),ignore:"false",help:"An email notification will be send when the job has completed.",payload:{host:window.location.host}},c[a.uid()]={name:"pja__"+e+"__DeleteIntermediatesAction",label:"Output cleanup",type:"boolean",value:String(Boolean(this.post_job_actions["DeleteIntermediatesAction"+e])),ignore:"false",help:"Delete intermediate outputs if they are not used as input for another job."};for(var f in this.node.output_terminals)c[a.uid()]=this._makeSection(f,d)}},_makeSection:function(a,b){function c(b,d){d=d||[],d.push(b);for(var e in b.inputs){var f=b.inputs[e],h=f.action;if("Label"==h){var i=g.node.getWorkflowOutput(a);f.value=i?i.label||"":""}else if(h){if(f.name="pja__"+a+"__"+f.action,f.pja_arg&&(f.name+="__"+f.pja_arg),f.payload)for(var j in f.payload){var k=f.payload[j];f.payload[f.name+"__"+j]=k,delete k}var l=g.post_job_actions[f.action+a];if(l){for(var m in d)d[m].expanded=!0;f.value=f.pja_arg?l.action_arguments&&l.action_arguments[f.pja_arg]||f.value:"true"}}f.inputs&&c(f,d.slice(0))}}var d=[],e=[];for(key in b)d.push({0:b[key],1:b[key]});for(key in this.node.input_terminals)e.push(this.node.input_terminals[key].name);d.sort(function(a,b){return a.label>b.label?1:a.label<b.label?-1:0}),d.unshift({0:"Sequences",1:"Sequences"}),d.unshift({0:"Roadmaps",1:"Roadmaps"}),d.unshift({0:"Leave unchanged",1:"__empty__"});var f={title:"Configure Output: '"+a+"'",type:"section",flat:!0,outputSection:!0,outputId:a,inputs:[{action:"Label",label:"Label",type:"text",value:"",ignore:"",help:"This will provide a short name to describe the output - this must be unique across workflows."},{action:"RenameDatasetAction",pja_arg:"newname",label:"Rename dataset",type:"text",value:"",ignore:"",help:'This action will rename the output dataset. Click <a href="https://wiki.galaxyproject.org/Learn/AdvancedWorkflow/Variables">here</a> for more information. Valid inputs are: <strong>'+e.join(", ")+"</strong>."},{action:"ChangeDatatypeAction",pja_arg:"newtype",label:"Change datatype",type:"select",ignore:"__empty__",value:"__empty__",options:d,help:"This action will change the datatype of the output to the indicated value."},{action:"TagDatasetAction",pja_arg:"tags",label:"Tags",type:"text",value:"",ignore:"",help:"This action will set tags for the dataset."},{title:"Assign columns",type:"section",flat:!0,inputs:[{action:"ColumnSetAction",pja_arg:"chromCol",label:"Chrom column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",pja_arg:"startCol",label:"Start column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",pja_arg:"endCol",label:"End column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",pja_arg:"strandCol",label:"Strand column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",pja_arg:"nameCol",label:"Name column",type:"integer",value:"",ignore:""}],help:"This action will set column assignments in the output dataset. Blank fields are ignored."}]},g=this;return c(f),f}});return{View:c}});
|
||||
define(["utils/utils","mvc/tool/tool-form-base"],function(a,b){var c=b.extend({initialize:function(c){var d=this;return this.workflow=c.workflow,this.node=c.node,this.node?(this.post_job_actions=this.node.post_job_actions||{},c=a.merge(c,{text_enable:"Set in Advance",text_disable:"Set at Runtime",narrow:!0,initial_errors:!0,sustain_version:!0,cls:"ui-portlet-narrow",update_url:Galaxy.root+"api/workflows/build_module",update:function(a){d.node.update_field_data(a),d.errors(a&&a.tool_model)}}),a.deepeach(c.inputs,function(b){b.type&&(-1!=["data","data_collection"].indexOf(b.type)?(b.type="hidden",b.info="Data input '"+b.name+"' ("+a.textify(b.extensions&&b.extensions.toString())+")",b.value=null):(b.collapsible_value={__class__:"RuntimeValue"},b.is_workflow=b.options&&0==b.options.length||-1!=["integer","float"].indexOf(b.type)))}),a.deepeach(c.inputs,function(a){"conditional"==a.type&&(a.test_param.collapsible_value=void 0)}),this._makeSections(c),void b.prototype.initialize.call(this,c)):void Galaxy.emit.debug("tool-form-workflow::initialize()","Node not found in workflow.")},_makeSections:function(b){var c=b.inputs,d=b.datatypes;c[a.uid()]={label:"Annotation / Notes",name:"annotation",type:"text",area:!0,help:"Add an annotation or note for this step. It will be shown with the workflow.",value:this.node.annotation};var e=this.node.output_terminals&&Object.keys(this.node.output_terminals)[0];if(e){c[a.uid()]={name:"pja__"+e+"__EmailAction",label:"Email notification",type:"boolean",value:String(Boolean(this.post_job_actions["EmailAction"+e])),ignore:"false",help:"An email notification will be send when the job has completed.",payload:{host:window.location.host}},c[a.uid()]={name:"pja__"+e+"__DeleteIntermediatesAction",label:"Output cleanup",type:"boolean",value:String(Boolean(this.post_job_actions["DeleteIntermediatesAction"+e])),ignore:"false",help:"Delete intermediate outputs if they are not used as input for another job."};for(var f in this.node.output_terminals)c[a.uid()]=this._makeSection(f,d)}},_makeSection:function(a,b){function c(b,e){e=e||[],e.push(b);for(var f in b.inputs){var g=b.inputs[f],h=g.action;if(h){if(g.name="pja__"+a+"__"+g.action,g.pja_arg&&(g.name+="__"+g.pja_arg),g.payload)for(var i in g.payload){var j=g.payload[i];g.payload[g.name+"__"+i]=j,delete j}var k=d.post_job_actions[g.action+a];if(k){for(var l in e)e[l].expanded=!0;g.value=g.pja_arg?k.action_arguments&&k.action_arguments[g.pja_arg]||g.value:"true"}}g.inputs&&c(g,e.slice(0))}}var d=this,e=[],f=[];for(key in b)e.push({0:b[key],1:b[key]});for(key in this.node.input_terminals)f.push(this.node.input_terminals[key].name);e.sort(function(a,b){return a.label>b.label?1:a.label<b.label?-1:0}),e.unshift({0:"Sequences",1:"Sequences"}),e.unshift({0:"Roadmaps",1:"Roadmaps"}),e.unshift({0:"Leave unchanged",1:"__empty__"});var g={title:"Configure Output: '"+a+"'",type:"section",flat:!0,inputs:[{label:"Label",type:"text",value:(output=this.node.getWorkflowOutput(a))&&output.label||"",help:"This will provide a short name to describe the output - this must be unique across workflows.",onchange:function(b){d.workflow.attemptUpdateOutputLabel(d.node,a,b)}},{action:"RenameDatasetAction",pja_arg:"newname",label:"Rename dataset",type:"text",value:"",ignore:"",help:'This action will rename the output dataset. Click <a href="https://wiki.galaxyproject.org/Learn/AdvancedWorkflow/Variables">here</a> for more information. Valid inputs are: <strong>'+f.join(", ")+"</strong>."},{action:"ChangeDatatypeAction",pja_arg:"newtype",label:"Change datatype",type:"select",ignore:"__empty__",value:"__empty__",options:e,help:"This action will change the datatype of the output to the indicated value."},{action:"TagDatasetAction",pja_arg:"tags",label:"Tags",type:"text",value:"",ignore:"",help:"This action will set tags for the dataset."},{title:"Assign columns",type:"section",flat:!0,inputs:[{action:"ColumnSetAction",pja_arg:"chromCol",label:"Chrom column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",pja_arg:"startCol",label:"Start column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",pja_arg:"endCol",label:"End column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",pja_arg:"strandCol",label:"Strand column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",pja_arg:"nameCol",label:"Name column",type:"integer",value:"",ignore:""}],help:"This action will set column assignments in the output dataset. Blank fields are ignored."}]};return c(g),g}});return{View:c}});
|
||||
//# sourceMappingURL=../../../maps/mvc/tool/tool-form-workflow.js.map
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user