Skip to content

Commit

Permalink
Submit label and annotation separate from other inputs to avoid futur…
Browse files Browse the repository at this point in the history
…e conflicts
  • Loading branch information
guerler committed Jan 10, 2017
1 parent 6e2a0db commit 54573f0
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 17 deletions.
24 changes: 17 additions & 7 deletions client/galaxy/scripts/mvc/workflow/workflow-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -708,27 +708,37 @@ define([
if ( content.inputs && content.inputs.length > 0 ) {
content.inputs.unshift({
type : 'text',
name : 'label',
name : '__label',
label : 'Label',
value : node.label,
help : 'Add a step label.'
help : 'Add a step label.',
onchange: function( label ) {
node.label = label;
form.trigger( 'change' );
}
});
content.inputs.push({
type : 'text',
name : 'annotation',
name : '__annotation',
label : 'Annotation',
value : node.annotation,
area : true,
help : 'Add an annotation or notes to this step. Annotations are available when a workflow is viewed.'
help : 'Add an annotation or notes to this step. Annotations are available when a workflow is viewed.',
onchange: function( annotation ) {
node.annotation = annotation;
form.trigger( 'change' );
}
});
content.onchange = function() {
Utils.request({
type : 'POST',
url : Galaxy.root + 'api/workflows/build_module',
data : {
id : node.id,
type : node.type,
inputs : form.data.create()
id : node.id,
type : node.type,
inputs : form.data.create(),
label : node.label,
annotation : node.annotation
},
success : function( data ) {
node.update_field_data( data );
Expand Down
4 changes: 2 additions & 2 deletions lib/galaxy/webapps/galaxy/api/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ def build_module( self, trans, payload={} ):
"""
type = payload.get( 'type' )
inputs = payload.get( 'inputs', {} )
annotation = inputs.get( 'annotation', '' )
label = inputs.get( 'label', '' )
annotation = payload.get( 'annotation', '' )
label = payload.get( 'label', '' )
tool_id = payload.get( 'tool_id' )
content_id = payload.get( 'content_id' )
if tool_id:
Expand Down
11 changes: 5 additions & 6 deletions lib/galaxy/workflow/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def from_dict( Class, trans, d, **kwds ):
elif "content_id" in d:
content_id = d["content_id"]
module.subworkflow = SubWorkflowModule.subworkflow_from_content_id( trans, content_id )
module.label = d.get("label", None) or None
module.label = d.get( "label", None ) or None
return module

@classmethod
Expand Down Expand Up @@ -288,12 +288,11 @@ def get_data_outputs( self ):
outputs = []
for workflow_output in self.subworkflow.workflow_outputs:
output_step = workflow_output.workflow_step
label = name = workflow_output.label
if name is None:
name = "%s:%s" % (output_step.order_index, workflow_output.output_name)
label = name
label = workflow_output.label
if label is None:
label = "%s:%s" % (output_step.order_index, workflow_output.output_name)
output = dict(
name=name,
name=label,
label=label,
extensions=['input'], # TODO
)
Expand Down
2 changes: 1 addition & 1 deletion static/maps/mvc/workflow/workflow-view.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/scripts/mvc/workflow/workflow-view.js

Large diffs are not rendered by default.

0 comments on commit 54573f0

Please sign in to comment.