1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a4f509eb2883/
Changeset: a4f509eb2883
User: guerler
Date: 2014-11-17 15:42:56+00:00
Summary: ToolForm: Add switch for new tool form to configuration
Affected #: 5 files
diff -r 46087ed045d8dbb6570393d5223ba5bd0772b7e4 -r a4f509eb288327415a231c83a79a7aa324d5fe4f client/galaxy/scripts/mvc/tools/tools-form.js
--- a/client/galaxy/scripts/mvc/tools/tools-form.js
+++ b/client/galaxy/scripts/mvc/tools/tools-form.js
@@ -324,7 +324,7 @@
});
// switch to classic tool form mako if the form definition is incompatible
- if (this.incompatible) {
+ if (this.incompatible || !this.options.toolform_upgrade) {
this.$el.hide();
$('#tool-form-classic').show();
return;
diff -r 46087ed045d8dbb6570393d5223ba5bd0772b7e4 -r a4f509eb288327415a231c83a79a7aa324d5fe4f config/galaxy.ini.sample
--- a/config/galaxy.ini.sample
+++ b/config/galaxy.ini.sample
@@ -742,6 +742,9 @@
# -- Beta features
+# Use new tool form
+#toolform_upgrade = False
+
# Enable Galaxy to communicate directly with a sequencer
#enable_sequencer_communication = False
diff -r 46087ed045d8dbb6570393d5223ba5bd0772b7e4 -r a4f509eb288327415a231c83a79a7aa324d5fe4f static/scripts/mvc/tools/tools-form.js
--- a/static/scripts/mvc/tools/tools-form.js
+++ b/static/scripts/mvc/tools/tools-form.js
@@ -324,7 +324,7 @@
});
// switch to classic tool form mako if the form definition is incompatible
- if (this.incompatible) {
+ if (this.incompatible || !this.options.toolform_upgrade) {
this.$el.hide();
$('#tool-form-classic').show();
return;
diff -r 46087ed045d8dbb6570393d5223ba5bd0772b7e4 -r a4f509eb288327415a231c83a79a7aa324d5fe4f static/scripts/packed/mvc/tools/tools-form.js
--- a/static/scripts/packed/mvc/tools/tools-form.js
+++ b/static/scripts/packed/mvc/tools/tools-form.js
@@ -1,1 +1,1 @@
-define(["utils/utils","utils/deferred","mvc/ui/ui-portlet","mvc/ui/ui-misc","mvc/citation/citation-model","mvc/citation/citation-view","mvc/tools","mvc/tools/tools-template","mvc/tools/tools-content","mvc/tools/tools-section","mvc/tools/tools-tree","mvc/tools/tools-jobs"],function(i,j,h,m,k,a,e,d,f,l,c,g){var b=Backbone.View.extend({container:"body",initialize:function(o){console.debug(o);var n=this;var p=parent.Galaxy;if(p&&p.modal){this.modal=p.modal}else{this.modal=new m.Modal.View()}if(p&&p.currUser){this.is_admin=p.currUser.get("is_admin")}else{this.is_admin=false}this.options=o;this.deferred=new j();this.setElement("<div/>");$(this.container).append(this.$el);this.tree=new c(this);this.job_handler=new g(this);this.content=new f(this);this._buildForm(o)},message:function(n){$(this.container).empty();$(this.container).append(n)},reset:function(){for(var n in this.element_list){this.element_list[n].reset()}},rebuild:function(){this.tree.refresh();console.debug("tools-form::rebuild() - Rebuilding data structures.")},refresh:function(){if(!this.is_dynamic){return}var n=this;this.deferred.reset();this.deferred.execute(function(){n._updateModel()})},_buildModel:function(){var n=this;var o=galaxy_config.root+"api/tools/"+this.options.id+"/build?";if(this.options.job_id){o+="job_id="+this.options.job_id}else{if(this.options.dataset_id){o+="dataset_id="+this.options.dataset_id}else{var p=top.location.href;var q=p.indexOf("?");if(p.indexOf("tool_id=")!=-1&&q!==-1){o+=p.slice(q+1)}}}i.request({type:"GET",url:o,success:function(r){n.options=$.extend(n.options,r);n.model=r;n.inputs=r.inputs;console.debug("tools-form::initialize() - Initial tool model ready.");console.debug(r);n._buildForm()},error:function(r){console.debug("tools-form::initialize() - Initial tool model request failed.");console.debug(r)}})},_updateModel:function(){var n=this;var o=this.tree.finalize({data:function(r){if(r.values.length>0&&r.values[0]&&r.values[0].src==="hda"){return n.content.get({id:r.values[0].id,src:"hda"}).id_uncoded}return null}});console.debug("tools-form::_refreshForm() - Refreshing states.");console.debug(o);function q(u){for(var s in n.input_list){var t=n.field_list[s];var r=n.input_list[s];if(r.is_dynamic&&t.wait&&t.unwait){if(u){t.wait()}else{t.unwait()}}}}q(true);var p=this.deferred.register();i.request({type:"GET",url:galaxy_config.root+"api/tools/"+this.options.id+"/build",data:o,success:function(r){n._updateForm(r);q(false);n.deferred.done(p);console.debug("tools-form::_refreshForm() - States refreshed.");console.debug(r)},error:function(r){n.deferred.done(p);console.debug("tools-form::_refreshForm() - Refresh request failed.");console.debug(r)}})},_updateForm:function(n){var o=this;this.tree.matchModel(n,function(q,u){var p=o.input_list[q];if(p&&p.options){if(JSON.stringify(p.options)!=JSON.stringify(u.options)){p.options=u.options;var v=o.field_list[q];if(v.update){var t=[];switch(p.type){case"data":t=p.options;break;default:for(var s in u.options){var r=u.options[s];if(r.length>2){t.push({label:r[0],value:r[1]})}}}v.update(t);v.trigger("change");console.debug("Updating options for "+q)}}}})},_buildForm:function(p){var o=this;this.field_list={};this.input_list={};this.element_list={};this.model=p;this.inputs=p.inputs;var s=new m.ButtonMenu({icon:"fa-gear",tooltip:"Click to see a list of options."});if(p.biostar_url){s.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(o.options.biostar_url+"/p/new/post/")}});s.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(o.options.biostar_url+"/t/"+o.options.id+"/")}})}s.addMenu({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+galaxy_config.root+"root?tool_id="+o.options.id)}});if(this.is_admin){s.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+o.options.id+"/download"}})}this.section=new l.View(o,{inputs:this.inputs,cls:"ui-table-plain"});if(this.incompatible){this.$el.hide();$("#tool-form-classic").show();return}this.portlet=new h.View({icon:"fa-wrench",title:"<b>"+this.model.name+"</b> "+this.model.description,operations:{menu:s},buttons:{execute:new m.Button({icon:"fa-check",tooltip:"Execute the tool",title:"Execute",cls:"btn btn-primary",floating:"clear",onclick:function(){o.job_handler.submit()}})}});this.$el.empty();this.$el.append(this.portlet.$el);if(p.help!=""){this.$el.append(d.help(p.help))}if(p.citations){var r=$("<div/>");var n=new k.ToolCitationCollection();n.tool_id=p.id;var q=new a.CitationListView({el:r,collection:n});q.render();n.fetch();this.$el.append(r)}this.portlet.append(this.section.$el);this.rebuild()}});return{View:b}});
\ No newline at end of file
+define(["utils/utils","utils/deferred","mvc/ui/ui-portlet","mvc/ui/ui-misc","mvc/citation/citation-model","mvc/citation/citation-view","mvc/tools","mvc/tools/tools-template","mvc/tools/tools-content","mvc/tools/tools-section","mvc/tools/tools-tree","mvc/tools/tools-jobs"],function(i,j,h,m,k,a,e,d,f,l,c,g){var b=Backbone.View.extend({container:"body",initialize:function(o){console.debug(o);var n=this;var p=parent.Galaxy;if(p&&p.modal){this.modal=p.modal}else{this.modal=new m.Modal.View()}if(p&&p.currUser){this.is_admin=p.currUser.get("is_admin")}else{this.is_admin=false}this.options=o;this.deferred=new j();this.setElement("<div/>");$(this.container).append(this.$el);this.tree=new c(this);this.job_handler=new g(this);this.content=new f(this);this._buildForm(o)},message:function(n){$(this.container).empty();$(this.container).append(n)},reset:function(){for(var n in this.element_list){this.element_list[n].reset()}},rebuild:function(){this.tree.refresh();console.debug("tools-form::rebuild() - Rebuilding data structures.")},refresh:function(){if(!this.is_dynamic){return}var n=this;this.deferred.reset();this.deferred.execute(function(){n._updateModel()})},_buildModel:function(){var n=this;var o=galaxy_config.root+"api/tools/"+this.options.id+"/build?";if(this.options.job_id){o+="job_id="+this.options.job_id}else{if(this.options.dataset_id){o+="dataset_id="+this.options.dataset_id}else{var p=top.location.href;var q=p.indexOf("?");if(p.indexOf("tool_id=")!=-1&&q!==-1){o+=p.slice(q+1)}}}i.request({type:"GET",url:o,success:function(r){n.options=$.extend(n.options,r);n.model=r;n.inputs=r.inputs;console.debug("tools-form::initialize() - Initial tool model ready.");console.debug(r);n._buildForm()},error:function(r){console.debug("tools-form::initialize() - Initial tool model request failed.");console.debug(r)}})},_updateModel:function(){var n=this;var o=this.tree.finalize({data:function(r){if(r.values.length>0&&r.values[0]&&r.values[0].src==="hda"){return n.content.get({id:r.values[0].id,src:"hda"}).id_uncoded}return null}});console.debug("tools-form::_refreshForm() - Refreshing states.");console.debug(o);function q(u){for(var s in n.input_list){var t=n.field_list[s];var r=n.input_list[s];if(r.is_dynamic&&t.wait&&t.unwait){if(u){t.wait()}else{t.unwait()}}}}q(true);var p=this.deferred.register();i.request({type:"GET",url:galaxy_config.root+"api/tools/"+this.options.id+"/build",data:o,success:function(r){n._updateForm(r);q(false);n.deferred.done(p);console.debug("tools-form::_refreshForm() - States refreshed.");console.debug(r)},error:function(r){n.deferred.done(p);console.debug("tools-form::_refreshForm() - Refresh request failed.");console.debug(r)}})},_updateForm:function(n){var o=this;this.tree.matchModel(n,function(q,u){var p=o.input_list[q];if(p&&p.options){if(JSON.stringify(p.options)!=JSON.stringify(u.options)){p.options=u.options;var v=o.field_list[q];if(v.update){var t=[];switch(p.type){case"data":t=p.options;break;default:for(var s in u.options){var r=u.options[s];if(r.length>2){t.push({label:r[0],value:r[1]})}}}v.update(t);v.trigger("change");console.debug("Updating options for "+q)}}}})},_buildForm:function(p){var o=this;this.field_list={};this.input_list={};this.element_list={};this.model=p;this.inputs=p.inputs;var s=new m.ButtonMenu({icon:"fa-gear",tooltip:"Click to see a list of options."});if(p.biostar_url){s.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(o.options.biostar_url+"/p/new/post/")}});s.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(o.options.biostar_url+"/t/"+o.options.id+"/")}})}s.addMenu({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+galaxy_config.root+"root?tool_id="+o.options.id)}});if(this.is_admin){s.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+o.options.id+"/download"}})}this.section=new l.View(o,{inputs:this.inputs,cls:"ui-table-plain"});if(this.incompatible||!this.options.toolform_upgrade){this.$el.hide();$("#tool-form-classic").show();return}this.portlet=new h.View({icon:"fa-wrench",title:"<b>"+this.model.name+"</b> "+this.model.description,operations:{menu:s},buttons:{execute:new m.Button({icon:"fa-check",tooltip:"Execute the tool",title:"Execute",cls:"btn btn-primary",floating:"clear",onclick:function(){o.job_handler.submit()}})}});this.$el.empty();this.$el.append(this.portlet.$el);if(p.help!=""){this.$el.append(d.help(p.help))}if(p.citations){var r=$("<div/>");var n=new k.ToolCitationCollection();n.tool_id=p.id;var q=new a.CitationListView({el:r,collection:n});q.render();n.fetch();this.$el.append(r)}this.portlet.append(this.section.$el);this.rebuild()}});return{View:b}});
\ No newline at end of file
diff -r 46087ed045d8dbb6570393d5223ba5bd0772b7e4 -r a4f509eb288327415a231c83a79a7aa324d5fe4f templates/webapps/galaxy/tool_form.mako
--- a/templates/webapps/galaxy/tool_form.mako
+++ b/templates/webapps/galaxy/tool_form.mako
@@ -11,9 +11,10 @@
params['dataset_id'] = params['id']
self.form_config = controller._build_dict(trans, tool, params)
self.form_config.update({
- 'id' : tool.id,
- 'job_id' : trans.security.encode_id( job.id ) if job else None,
- 'history_id' : trans.security.encode_id( trans.history.id )
+ 'id' : tool.id,
+ 'job_id' : trans.security.encode_id( job.id ) if job else None,
+ 'history_id' : trans.security.encode_id( trans.history.id ),
+ 'toolform_upgrade' : trans.app.config.get('toolform_upgrade', False)
})
%>
${h.js("libs/bibtex", "libs/jquery/jquery-ui")}
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.
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/1af943ca6e39/
Changeset: 1af943ca6e39
Branch: stable
User: natefoo
Date: 2014-11-17 15:00:27+00:00
Summary: Update tag latest_2014.10.06 for changeset 011c8b2118be
Affected #: 1 file
diff -r 011c8b2118be778eaf1ba952730ff876d6447ba9 -r 1af943ca6e39db44bfec74a0debffbf798fc4731 .hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -20,4 +20,4 @@
ca45b78adb4152fc6e7395514d46eba6b7d0b838 release_2014.08.11
548ab24667d6206780237bd807f7d857a484c461 latest_2014.08.11
2092948937ac30ef82f71463a235c66d34987088 release_2014.10.06
-e6de07f8c01fe8802282eea1bee326c5efba1b78 latest_2014.10.06
+011c8b2118be778eaf1ba952730ff876d6447ba9 latest_2014.10.06
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.
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/011c8b2118be/
Changeset: 011c8b2118be
Branch: stable
User: jmchilton
Date: 2014-11-14 17:58:29+00:00
Summary: Fix passing nested parameter replacements to the workflow run API.
Thanks to Nicola for finding the problem https://bitbucket.org/galaxy/galaxy-central/commits/fa92c5497232444ade0e704….
Affected #: 3 files
diff -r 9c1197f1e259f7925be467f2f6f92fa3e7a5e86c -r 011c8b2118be778eaf1ba952730ff876d6447ba9 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -2556,14 +2556,20 @@
history = None
value = input.test_param.get_initial_value( trans, context, history=history )
current_case = input.get_current_case( value, trans )
- if current_case != old_current_case:
+ case_changed = current_case != old_current_case
+ if case_changed:
# Current case has changed, throw away old state
group_state = state[input.name] = {}
# TODO: we should try to preserve values if we can
self.fill_in_new_state( trans, input.cases[current_case].inputs, group_state, context )
group_errors = dict()
group_old_errors = dict()
- else:
+
+ # If we didn't just change the current case and are coming from HTML - the values
+ # in incoming represent the old values and should not be replaced. If being updated
+ # from the API (json) instead of HTML - form values below the current case
+ # may also be supplied and incoming should be preferred to case defaults.
+ if (not case_changed) or (source != "html"):
# Current case has not changed, update children
group_errors = self.update_state( trans,
input.cases[current_case].inputs,
diff -r 9c1197f1e259f7925be467f2f6f92fa3e7a5e86c -r 011c8b2118be778eaf1ba952730ff876d6447ba9 lib/galaxy/workflow/modules.py
--- a/lib/galaxy/workflow/modules.py
+++ b/lib/galaxy/workflow/modules.py
@@ -609,7 +609,7 @@
old_errors = state.inputs.pop( "__errors__", {} )
# Update the state
step_errors = tool.update_state( trans, tool.inputs, state.inputs, step_updates,
- update_only=True, old_errors=old_errors )
+ update_only=True, old_errors=old_errors, source="json" )
return state, step_errors
def execute( self, trans, progress, invocation, step ):
diff -r 9c1197f1e259f7925be467f2f6f92fa3e7a5e86c -r 011c8b2118be778eaf1ba952730ff876d6447ba9 lib/galaxy/workflow/run_request.py
--- a/lib/galaxy/workflow/run_request.py
+++ b/lib/galaxy/workflow/run_request.py
@@ -111,7 +111,32 @@
param_dict[param_dict['param']] = param_dict['value']
del param_dict[ 'param' ]
del param_dict[ 'value' ]
- return param_dict
+ # Inputs can be nested dict, but Galaxy tool code wants nesting of keys (e.g.
+ # cond1|moo=4 instead of cond1: {moo: 4} ).
+ new_params = _flatten_step_params( param_dict )
+ return new_params
+
+
+def _flatten_step_params( param_dict, prefix="" ):
+ # TODO: Temporary work around until tool code can process nested data
+ # structures. This should really happen in there so the tools API gets
+ # this functionality for free and so that repeats can be handled
+ # properly. Also the tool code walks the tool inputs so it nows what is
+ # a complex value object versus something that maps to child parameters
+ # better than the hack or searching for src and id here.
+ new_params = {}
+ keys = param_dict.keys()[:]
+ for key in keys:
+ if prefix:
+ effective_key = "%s|%s" % ( prefix, key )
+ else:
+ effective_key = key
+ value = param_dict[key]
+ if isinstance(value, dict) and not ('src' in value and 'id' in value):
+ new_params.update(_flatten_step_params( value, effective_key) )
+ else:
+ new_params[effective_key] = value
+ return new_params
def build_workflow_run_config( trans, workflow, payload ):
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.
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/31dbad21bd6b/
Changeset: 31dbad21bd6b
User: jmchilton
Date: 2014-11-14 20:23:31+00:00
Summary: Expand HOST_IP in galaxy_infrastructure_url using socket library.
Seems to allow dynamically setting correct IP for Galaxy instances inside of Bjoern's docker-in-docker setup (enabling IPython in the stable Galaxy instances).
Affected #: 1 file
diff -r 96d3d3a4fddeda7bba13d8789f215b684f3a2b09 -r 31dbad21bd6b8de1f66db0fe197b713f88e880bc lib/galaxy/config.py
--- a/lib/galaxy/config.py
+++ b/lib/galaxy/config.py
@@ -6,6 +6,8 @@
import os
import re
+import socket
+import string
import sys
import tempfile
import logging
@@ -329,6 +331,10 @@
if port:
galaxy_infrastructure_url += ":%s" % (port)
galaxy_infrastructure_url_set = False
+ if "HOST_IP" in galaxy_infrastructure_url:
+ galaxy_infrastructure_url = string.Template(galaxy_infrastructure_url).safe_substitute({
+ 'HOST_IP': socket.gethostbyname(socket.gethostname())
+ })
self.galaxy_infrastructure_url = galaxy_infrastructure_url
self.galaxy_infrastructure_url_set = galaxy_infrastructure_url_set
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.