commit/galaxy-central: jmchilton: Merge stable.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/a1aa1dbc8cb6/ Changeset: a1aa1dbc8cb6 User: jmchilton Date: 2014-11-17 15:40:51+00:00 Summary: Merge stable. Affected #: 7 files diff -r a4f509eb288327415a231c83a79a7aa324d5fe4f -r a1aa1dbc8cb6249b4ca39f0e4cda500abcafae82 .hgtags --- a/.hgtags +++ b/.hgtags @@ -20,4 +20,4 @@ ca45b78adb4152fc6e7395514d46eba6b7d0b838 release_2014.08.11 548ab24667d6206780237bd807f7d857a484c461 latest_2014.08.11 2092948937ac30ef82f71463a235c66d34987088 release_2014.10.06 -a1dca14d5b1afbf2b5bde192e3e6b6763836eff8 latest_2014.10.06 +011c8b2118be778eaf1ba952730ff876d6447ba9 latest_2014.10.06 diff -r a4f509eb288327415a231c83a79a7aa324d5fe4f -r a1aa1dbc8cb6249b4ca39f0e4cda500abcafae82 client/galaxy/scripts/mvc/citation/citation-view.js --- a/client/galaxy/scripts/mvc/citation/citation-view.js +++ b/client/galaxy/scripts/mvc/citation/citation-view.js @@ -58,11 +58,11 @@ var doiUrl = ""; if( fields.doi ) { doiUrl = 'http://dx.doi.org/' + fields.doi; - ref += '[<a href="' + doiUrl + '">doi:' + fields.doi + "</a>]"; + ref += '[<a href="' + doiUrl + '" target="_blank">doi:' + fields.doi + "</a>]"; } var url = fields.url || doiUrl; if( url ) { - ref += '[<a href="' + url + '">Link</a>]'; + ref += '[<a href="' + url + '" target="_blank">Link</a>]'; } return ref; }, @@ -185,4 +185,4 @@ CitationListView : CitationListView }; -}); \ No newline at end of file +}); diff -r a4f509eb288327415a231c83a79a7aa324d5fe4f -r a1aa1dbc8cb6249b4ca39f0e4cda500abcafae82 lib/galaxy/tools/__init__.py --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -2615,14 +2615,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 a4f509eb288327415a231c83a79a7aa324d5fe4f -r a1aa1dbc8cb6249b4ca39f0e4cda500abcafae82 lib/galaxy/workflow/modules.py --- a/lib/galaxy/workflow/modules.py +++ b/lib/galaxy/workflow/modules.py @@ -727,7 +727,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 a4f509eb288327415a231c83a79a7aa324d5fe4f -r a1aa1dbc8cb6249b4ca39f0e4cda500abcafae82 lib/galaxy/workflow/run_request.py --- a/lib/galaxy/workflow/run_request.py +++ b/lib/galaxy/workflow/run_request.py @@ -117,7 +117,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 ): diff -r a4f509eb288327415a231c83a79a7aa324d5fe4f -r a1aa1dbc8cb6249b4ca39f0e4cda500abcafae82 static/scripts/mvc/citation/citation-view.js --- a/static/scripts/mvc/citation/citation-view.js +++ b/static/scripts/mvc/citation/citation-view.js @@ -58,11 +58,11 @@ var doiUrl = ""; if( fields.doi ) { doiUrl = 'http://dx.doi.org/' + fields.doi; - ref += '[<a href="' + doiUrl + '">doi:' + fields.doi + "</a>]"; + ref += '[<a href="' + doiUrl + '" target="_blank">doi:' + fields.doi + "</a>]"; } var url = fields.url || doiUrl; if( url ) { - ref += '[<a href="' + url + '">Link</a>]'; + ref += '[<a href="' + url + '" target="_blank">Link</a>]'; } return ref; }, @@ -185,4 +185,4 @@ CitationListView : CitationListView }; -}); \ No newline at end of file +}); diff -r a4f509eb288327415a231c83a79a7aa324d5fe4f -r a1aa1dbc8cb6249b4ca39f0e4cda500abcafae82 static/scripts/packed/mvc/citation/citation-view.js --- a/static/scripts/packed/mvc/citation/citation-view.js +++ b/static/scripts/packed/mvc/citation/citation-view.js @@ -1,1 +1,1 @@ -define(["mvc/base-mvc","mvc/citation/citation-model","utils/localization"],function(a,d,c){var b=Backbone.View.extend({tagName:"div",className:"citations",render:function(){this.$el.append("<p>"+this.formattedReference()+"</p>");return this},formattedReference:function(){var k=this.model;var i=k.entryType();var l=k.fields();var g="";var o=this._asSentence((l.author?l.author:"")+(l.year?(" ("+l.year+")"):""))+" ";var n=l.title||"";var h=l.pages?("pp. "+l.pages):"";var p=l.address;if(i=="article"){var j=(l.volume?l.volume:"")+(l.number?(" ("+l.number+")"):"")+(h?", "+h:"");g=o+this._asSentence(n)+(l.journal?("In <em>"+l.journal+", "):"")+this._asSentence(j)+this._asSentence(l.address)+"</em>"}else{if(i=="inproceedings"||i=="proceedings"){g=o+this._asSentence(n)+(l.booktitle?("In <em>"+l.booktitle+", "):"")+(h?h:"")+(p?", "+p:"")+".</em>"}else{if(i=="mastersthesis"||i=="phdthesis"){g=o+this._asSentence(n)+(l.howpublished?l.howpublished+". ":"")+(l.note?l.note+".":"")}else{if(i=="techreport"){g=o+this._asSentence(n)+this._asSentence(l.institution)+this._asSentence(l.number)+this._asSentence(l.type)}else{if(i=="book"||i=="inbook"||i=="incollection"){g=o+" "+this._formatBookInfo(l)}else{g=o+" "+this._asSentence(n)+this._asSentence(l.howpublished)+this._asSentence(l.note)}}}}}var m="";if(l.doi){m="http://dx.doi.org/"+l.doi;g+='[<a href="'+m+'">doi:'+l.doi+"</a>]"}var f=l.url||m;if(f){g+='[<a href="'+f+'">Link</a>]'}return g},_formatBookInfo:function(f){var g="";if(f.chapter){g+=f.chapter+" in "}if(f.title){g+="<em>"+f.title+"</em>"}if(f.editor){g+=", Edited by "+f.editor+", "}if(f.publisher){g+=", "+f.publisher}if(f.pages){g+=", pp. "+f.pages+""}if(f.series){g+=", <em>"+f.series+"</em>"}if(f.volume){g+=", Vol."+f.volume}if(f.issn){g+=", ISBN: "+f.issn}return g+"."},_asSentence:function(f){return(f&&f.trim())?f+". ":""}});var e=Backbone.View.extend({el:"#citations",initialize:function(){this.listenTo(this.collection,"add",this.renderCitation)},events:{"click .citations-to-bibtex":"showBibtex","click .citations-to-formatted":"showFormatted"},renderCitation:function(g){var f=new b({model:g});this.$(".citations-formatted").append(f.render().el);var h=this.$(".citations-bibtex-text");h.val(h.val()+"\n\r"+g.attributes.content)},render:function(){this.$el.html(this.citationsElement());this.collection.each(function(f){this.renderCitation(f)},this);this.showFormatted()},showBibtex:function(){this.$(".citations-to-formatted").show();this.$(".citations-to-bibtex").hide();this.$(".citations-bibtex").show();this.$(".citations-formatted").hide();this.$(".citations-bibtex-text").select()},showFormatted:function(){this.$(".citations-to-formatted").hide();this.$(".citations-to-bibtex").show();this.$(".citations-bibtex").hide();this.$(".citations-formatted").show()},partialWarningElement:function(){if(this.collection.partial){return['<div style="padding:5px 10px">',"<b>Warning: This is a experimental feature.</b> Most Galaxy tools will not annotate"," citations explicitly at this time. When writing up your analysis, please manually"," review your histories and find all references"," that should be cited in order to completely describe your work. Also, please remember to",' <a href="https://wiki.galaxyproject.org/CitingGalaxy">cite Galaxy</a>.',"</div>",].join("")}else{return""}},citationsElement:function(){return['<div class="toolForm">','<div class="toolFormTitle">',c("Citations"),' <i class="fa fa-pencil-square-o citations-to-bibtex" title="Select all as BibTeX."></i>',' <i class="fa fa-times citations-to-formatted" title="Return to formatted citation list."></i>',"</div>",'<div class="toolFormBody" style="padding:5px 10px">',this.partialWarningElement(),'<span class="citations-formatted"></span>',"</div>",'<div class="citations-bibtex toolFormBody" style="padding:5px 10px">','<textarea style="width: 100%; height: 500px;" class="citations-bibtex-text"></textarea>',"</div>","</div>"].join("")}});return{CitationView:b,CitationListView:e}}); \ No newline at end of file +define(["mvc/base-mvc","mvc/citation/citation-model","utils/localization"],function(a,d,c){var b=Backbone.View.extend({tagName:"div",className:"citations",render:function(){this.$el.append("<p>"+this.formattedReference()+"</p>");return this},formattedReference:function(){var k=this.model;var i=k.entryType();var l=k.fields();var g="";var o=this._asSentence((l.author?l.author:"")+(l.year?(" ("+l.year+")"):""))+" ";var n=l.title||"";var h=l.pages?("pp. "+l.pages):"";var p=l.address;if(i=="article"){var j=(l.volume?l.volume:"")+(l.number?(" ("+l.number+")"):"")+(h?", "+h:"");g=o+this._asSentence(n)+(l.journal?("In <em>"+l.journal+", "):"")+this._asSentence(j)+this._asSentence(l.address)+"</em>"}else{if(i=="inproceedings"||i=="proceedings"){g=o+this._asSentence(n)+(l.booktitle?("In <em>"+l.booktitle+", "):"")+(h?h:"")+(p?", "+p:"")+".</em>"}else{if(i=="mastersthesis"||i=="phdthesis"){g=o+this._asSentence(n)+(l.howpublished?l.howpublished+". ":"")+(l.note?l.note+".":"")}else{if(i=="techreport"){g=o+this._asSentence(n)+this._asSentence(l.institution)+this._asSentence(l.number)+this._asSentence(l.type)}else{if(i=="book"||i=="inbook"||i=="incollection"){g=o+" "+this._formatBookInfo(l)}else{g=o+" "+this._asSentence(n)+this._asSentence(l.howpublished)+this._asSentence(l.note)}}}}}var m="";if(l.doi){m="http://dx.doi.org/"+l.doi;g+='[<a href="'+m+'" target="_blank">doi:'+l.doi+"</a>]"}var f=l.url||m;if(f){g+='[<a href="'+f+'" target="_blank">Link</a>]'}return g},_formatBookInfo:function(f){var g="";if(f.chapter){g+=f.chapter+" in "}if(f.title){g+="<em>"+f.title+"</em>"}if(f.editor){g+=", Edited by "+f.editor+", "}if(f.publisher){g+=", "+f.publisher}if(f.pages){g+=", pp. "+f.pages+""}if(f.series){g+=", <em>"+f.series+"</em>"}if(f.volume){g+=", Vol."+f.volume}if(f.issn){g+=", ISBN: "+f.issn}return g+"."},_asSentence:function(f){return(f&&f.trim())?f+". ":""}});var e=Backbone.View.extend({el:"#citations",initialize:function(){this.listenTo(this.collection,"add",this.renderCitation)},events:{"click .citations-to-bibtex":"showBibtex","click .citations-to-formatted":"showFormatted"},renderCitation:function(g){var f=new b({model:g});this.$(".citations-formatted").append(f.render().el);var h=this.$(".citations-bibtex-text");h.val(h.val()+"\n\r"+g.attributes.content)},render:function(){this.$el.html(this.citationsElement());this.collection.each(function(f){this.renderCitation(f)},this);this.showFormatted()},showBibtex:function(){this.$(".citations-to-formatted").show();this.$(".citations-to-bibtex").hide();this.$(".citations-bibtex").show();this.$(".citations-formatted").hide();this.$(".citations-bibtex-text").select()},showFormatted:function(){this.$(".citations-to-formatted").hide();this.$(".citations-to-bibtex").show();this.$(".citations-bibtex").hide();this.$(".citations-formatted").show()},partialWarningElement:function(){if(this.collection.partial){return['<div style="padding:5px 10px">',"<b>Warning: This is a experimental feature.</b> Most Galaxy tools will not annotate"," citations explicitly at this time. When writing up your analysis, please manually"," review your histories and find all references"," that should be cited in order to completely describe your work. Also, please remember to",' <a href="https://wiki.galaxyproject.org/CitingGalaxy">cite Galaxy</a>.',"</div>",].join("")}else{return""}},citationsElement:function(){return['<div class="toolForm">','<div class="toolFormTitle">',c("Citations"),' <i class="fa fa-pencil-square-o citations-to-bibtex" title="Select all as BibTeX."></i>',' <i class="fa fa-times citations-to-formatted" title="Return to formatted citation list."></i>',"</div>",'<div class="toolFormBody" style="padding:5px 10px">',this.partialWarningElement(),'<span class="citations-formatted"></span>',"</div>",'<div class="citations-bibtex toolFormBody" style="padding:5px 10px">','<textarea style="width: 100%; height: 500px;" class="citations-bibtex-text"></textarea>',"</div>","</div>"].join("")}});return{CitationView:b,CitationListView:e}}); \ No newline at end of file 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.
participants (1)
-
commits-noreply@bitbucket.org