4 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/489a1fac832e/ Changeset: 489a1fac832e User: jmchilton Date: 2014-03-04 18:49:35 Summary: Fix node type being sent to prebuild_node in galaxy.workflow_editor.js. Affected #: 1 file diff -r bd2561df7d11308bd717cadd0158d26fbcf7e4dc -r 489a1fac832e0a10cdf77e9afa64b0a71b8f7774 static/scripts/galaxy.workflow_editor.canvas.js --- a/static/scripts/galaxy.workflow_editor.canvas.js +++ b/static/scripts/galaxy.workflow_editor.canvas.js @@ -605,7 +605,7 @@ // First pass, nodes var using_workflow_outputs = false; $.each( data.steps, function( id, step ) { - var node = prebuild_node( "tool", step.name, step.tool_id ); + var node = prebuild_node( step.type, step.name, step.tool_id ); node.init_field_data( step ); if ( step.position ) { node.element.css( { top: step.position.top, left: step.position.left } ); https://bitbucket.org/galaxy/galaxy-central/commits/ef7be9474145/ Changeset: ef7be9474145 User: jmchilton Date: 2014-03-04 18:49:35 Summary: Eliminate code dup. in workflow editor for building connectors. Affected #: 1 file diff -r 489a1fac832e0a10cdf77e9afa64b0a71b8f7774 -r ef7be94741451e43dca891603b3c06ebf06311a5 static/scripts/galaxy.workflow_editor.canvas.js --- a/static/scripts/galaxy.workflow_editor.canvas.js +++ b/static/scripts/galaxy.workflow_editor.canvas.js @@ -634,21 +634,16 @@ var node = wf.nodes[id]; $.each( step.input_connections, function( k, v ) { if ( v ) { - if ($.isArray(v)) { - $.each( v, function (l,x ) { - var other_node = wf.nodes[ x.id ]; - var c = new Connector(); - c.connect( other_node.output_terminals[ x.output_name ], - node.input_terminals[ k ] ); - c.redraw(); - }); - } else { - var other_node = wf.nodes[ v.id ]; + if ( ! $.isArray( v ) ) { + v = [ v ]; + } + $.each( v, function( l, x ) { + var other_node = wf.nodes[ x.id ]; var c = new Connector(); - c.connect( other_node.output_terminals[ v.output_name ], + c.connect( other_node.output_terminals[ x.output_name ], node.input_terminals[ k ] ); c.redraw(); - } + }); } }); if(using_workflow_outputs && node.type === 'tool'){ https://bitbucket.org/galaxy/galaxy-central/commits/69ee2351526c/ Changeset: 69ee2351526c User: jmchilton Date: 2014-03-04 18:49:35 Summary: Eliminate code dup. in workflow editor for building input terminals. Affected #: 1 file diff -r ef7be94741451e43dca891603b3c06ebf06311a5 -r 69ee2351526c97d6a0d4016bfbb76cc8051a12f3 static/scripts/galaxy.workflow_editor.canvas.js --- a/static/scripts/galaxy.workflow_editor.canvas.js +++ b/static/scripts/galaxy.workflow_editor.canvas.js @@ -171,6 +171,11 @@ this.tool_errors = {}; } $.extend( Node.prototype, { + new_input_terminal : function( input ) { + var t = $("<div class='terminal input-terminal'></div>"); + this.enable_input_terminal( t, input.name, input.extensions, input.multiple ); + return t; + }, enable_input_terminal : function( elements, name, types, multiple ) { var node = this; $(elements).each( function() { @@ -317,8 +322,7 @@ b.find( "div" ).remove(); var ibox = $("<div class='inputs'></div>").appendTo( b ); $.each( data.data_inputs, function( i, input ) { - var t = $("<div class='terminal input-terminal'></div>"); - node.enable_input_terminal( t, input.name, input.extensions, input.multiple ); + var t = node.new_input_terminal( input ); var ib = $("<div class='form-row dataRow input-data-row' name='" + input.name + "'>" + input.label + "</div>" ); ib.css({ position:'absolute', left: -1000, @@ -420,8 +424,7 @@ var new_body = $("<div class='inputs'></div>"); var old = old_body.find( "div.input-data-row"); $.each( data.data_inputs, function( i, input ) { - var t = $("<div class='terminal input-terminal'></div>"); - node.enable_input_terminal( t, input.name, input.extensions, input.multiple ); + var t = node.new_input_terminal( input ); // If already connected save old connection old_body.find( "div[name='" + input.name + "']" ).each( function() { $(this).find( ".input-terminal" ).each( function() { https://bitbucket.org/galaxy/galaxy-central/commits/36fa1ad1fc17/ Changeset: 36fa1ad1fc17 User: jmchilton Date: 2014-03-04 18:49:35 Summary: Refactor out optional data selection handling. Reused a few times downstream for dataset collections. Affected #: 1 file diff -r 69ee2351526c97d6a0d4016bfbb76cc8051a12f3 -r 36fa1ad1fc17939b68d10339a7cead7d21803a11 lib/galaxy/tools/parameters/basic.py --- a/lib/galaxy/tools/parameters/basic.py +++ b/lib/galaxy/tools/parameters/basic.py @@ -1644,18 +1644,7 @@ # Also collect children via association object dataset_collector( hda.children, hid ) dataset_collector( history.active_datasets_children_and_roles, None ) - - set_selected = field.get_selected( return_label=True, return_value=True, multi=False ) is not None - # Ensure than an item is always selected - if self.optional: - if set_selected: - field.add_option( "Selection is Optional", 'None', False ) - else: - field.add_option( "Selection is Optional", 'None', True ) - elif not set_selected and bool( field.options ): - # Select the last item - a, b, c = field.options[-1] - field.options[-1] = a, b, True + self._ensure_selection( field ) return field def get_initial_value( self, trans, context, history=None ): @@ -1835,6 +1824,19 @@ assert history is not None, "%s requires a history" % class_name return history + def _ensure_selection( self, field ): + set_selected = field.get_selected( return_label=True, return_value=True, multi=False ) is not None + # Ensure than an item is always selected + if self.optional: + if set_selected: + field.add_option( "Selection is Optional", 'None', False ) + else: + field.add_option( "Selection is Optional", 'None', True ) + elif not set_selected and bool( field.options ): + # Select the last item + a, b, c = field.options[-1] + field.options[-1] = a, b, True + class HiddenDataToolParameter( HiddenToolParameter, DataToolParameter ): """ Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.