galaxy-commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
October 2014
- 2 participants
- 174 discussions
commit/galaxy-central: guerler: ToolForm: Fix optional parameters
by commits-noreply@bitbucket.org 09 Oct '14
by commits-noreply@bitbucket.org 09 Oct '14
09 Oct '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/34e643839cda/
Changeset: 34e643839cda
User: guerler
Date: 2014-10-10 03:48:59+00:00
Summary: ToolForm: Fix optional parameters
Affected #: 17 files
diff -r 46523237518bb9ec8ed9fa4cf30453c800580c24 -r 34e643839cdace531f6ebf1a7d08e5d735be51a6 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
@@ -1,10 +1,10 @@
/**
This is the main class of the tool form plugin. It is referenced as 'app' in all lower level modules.
*/
-define(['mvc/ui/ui-portlet', 'mvc/ui/ui-misc',
+define(['utils/utils', '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(Portlet, Ui, CitationModel, CitationView,
+ function(Utils, Portlet, Ui, CitationModel, CitationView,
Tools, ToolTemplate, ToolContent, ToolSection, ToolTree, ToolJobs) {
// create tool model
@@ -42,8 +42,7 @@
// load tool model
this.model = new Model({
- id : options.id,
- job_id : options.job_id
+ id : options.id
});
// creates a tree/json structure from the input form
@@ -102,6 +101,37 @@
// link this
var self = this;
+ // fetch model and render form
+ this.model.fetch({
+ error: function(response) {
+ console.debug('tools-form::_initializeToolForm() : Attempt to fetch tool model failed.');
+ },
+ success: function() {
+ // backup inputs
+ self.inputs = self.model.get('inputs');
+
+ // update inputs with job parameters
+ if (self.options.job_id) {
+ Utils.get({
+ url: galaxy_config.root + 'api/jobs/' + self.options.job_id,
+ success: function(parameters) {
+ // TODO: Update input parameters
+ //self._updateInputs(self.inputs, parameters);
+ self._buildForm();
+ }
+ });
+ } else {
+ self._buildForm();
+ }
+ }
+ });
+ },
+
+ // builds the tool form
+ _buildForm: function() {
+ // link this
+ var self = this;
+
// create question button
var button_question = new Ui.ButtonIcon({
icon : 'fa-question-circle',
@@ -152,79 +182,70 @@
});
}
- // fetch model and render form
- this.model.fetch({
- error: function(response) {
- console.debug('tools-form::_initializeToolForm() : Attempt to fetch tool model failed.');
- },
- success: function() {
- // create tool form section
- self.section = new ToolSection.View(self, {
- inputs : self.model.get('inputs'),
- cls : 'ui-table-plain'
- });
-
- // TEMPORARY SWITCH
- // switch to classic tool form mako if the form definition is incompatible
- if (self.incompatible) {
- self.$el.hide();
- $('#tool-form-classic').show();
- return;
- }
-
- // create portlet
- self.portlet = new Portlet.View({
- icon : 'fa-wrench',
- title: '<b>' + self.model.get('name') + '</b> ' + self.model.get('description'),
- operations: operations,
- buttons: {
- execute: new Ui.Button({
- icon : 'fa-check',
- tooltip : 'Execute the tool',
- title : 'Execute',
- cls : 'btn btn-primary',
- floating : 'clear',
- onclick : function() {
- self.job_handler.submit();
- }
- })
+ // create tool form section
+ this.section = new ToolSection.View(self, {
+ inputs : this.inputs,
+ cls : 'ui-table-plain'
+ });
+
+ // switch to classic tool form mako if the form definition is incompatible
+ if (this.incompatible) {
+ this.$el.hide();
+ $('#tool-form-classic').show();
+ return;
+ }
+
+ // create portlet
+ this.portlet = new Portlet.View({
+ icon : 'fa-wrench',
+ title: '<b>' + this.model.get('name') + '</b> ' + this.model.get('description'),
+ operations: operations,
+ buttons: {
+ execute: new Ui.Button({
+ icon : 'fa-check',
+ tooltip : 'Execute the tool',
+ title : 'Execute',
+ cls : 'btn btn-primary',
+ floating : 'clear',
+ onclick : function() {
+ self.job_handler.submit();
}
- });
-
- // configure button selection
- if(!self.options.biostar_url) {
- button_question.$el.hide();
- button_search.$el.hide();
- }
-
- // append form
- self.$el.append(self.portlet.$el);
-
- // append help
- if (self.options.help != '') {
- self.$el.append(ToolTemplate.help(self.options.help));
- }
-
- // append citations
- if (self.options.citations) {
- // append html
- self.$el.append(ToolTemplate.citations());
-
- // fetch citations
- var citations = new CitationModel.ToolCitationCollection();
- citations.tool_id = self.options.id;
- var citation_list_view = new CitationView.CitationListView({ collection: citations } );
- citation_list_view.render();
- citations.fetch();
- }
-
- // append tool section
- self.portlet.append(self.section.$el);
-
- // trigger refresh
- self.refresh();
+ })
}
});
+
+ // configure button selection
+ if(!this.options.biostar_url) {
+ button_question.$el.hide();
+ button_search.$el.hide();
+ }
+
+ // append form
+ this.$el.append(this.portlet.$el);
+
+ // append help
+ if (this.options.help != '') {
+ this.$el.append(ToolTemplate.help(this.options.help));
+ }
+
+ // append citations
+ if (this.options.citations) {
+ // append html
+ this.$el.append(ToolTemplate.citations());
+
+ // fetch citations
+ var citations = new CitationModel.ToolCitationCollection();
+ citations.tool_id = this.options.id;
+ var citation_list_view = new CitationView.CitationListView({ collection: citations } );
+ citation_list_view.render();
+ citations.fetch();
+ }
+
+ // append tool section
+ this.portlet.append(this.section.$el);
+
+ // trigger refresh
+ this.refresh();
}
});
diff -r 46523237518bb9ec8ed9fa4cf30453c800580c24 -r 34e643839cdace531f6ebf1a7d08e5d735be51a6 client/galaxy/scripts/mvc/tools/tools-jobs.js
--- a/client/galaxy/scripts/mvc/tools/tools-jobs.js
+++ b/client/galaxy/scripts/mvc/tools/tools-jobs.js
@@ -98,9 +98,9 @@
var input_id = this.app.tree.match(job_input_id);
var input_field = this.app.field_list[input_id];
var input_def = this.app.input_list[input_id];
-
+
// check basic field validation
- if (input_def && !input_def.optional && input_field && input_field.validate && !input_field.validate()) {
+ if (input_def && input_field && input_field.validate && !input_field.validate()) {
this._foundError(input_id);
return false;
}
diff -r 46523237518bb9ec8ed9fa4cf30453c800580c24 -r 34e643839cdace531f6ebf1a7d08e5d735be51a6 client/galaxy/scripts/mvc/tools/tools-section.js
--- a/client/galaxy/scripts/mvc/tools/tools-section.js
+++ b/client/galaxy/scripts/mvc/tools/tools-section.js
@@ -1,58 +1,8 @@
/**
This class creates a tool form section and populates it with input elements. It also handles repeat blocks and conditionals by recursively creating new sub sections. New input elements can be plugged in by adding cases to the switch block defined in the _addRow() function.
*/
-define(['utils/utils', 'mvc/ui/ui-table', 'mvc/ui/ui-misc', 'mvc/tools/tools-repeat', 'mvc/tools/tools-select-content'],
- function(Utils, Table, Ui, Repeat, SelectContent) {
-
- // input field element wrapper
- var InputElement = Backbone.View.extend({
- // initialize input wrapper
- initialize: function(options) {
- this.setElement(this._template(options));
- },
-
- /** Set error text
- */
- error: function(text) {
- // set text
- this.$el.find('.ui-table-form-error-text').html(text);
- this.$el.find('.ui-table-form-error').fadeIn();
- this.$el.addClass('ui-error');
- },
-
- /** Reset this view
- */
- reset: function() {
- this.$el.find('.ui-table-form-error').hide();
- this.$el.removeClass('ui-error');
- },
-
- /** Main Template
- */
- _template: function(options) {
- // create table element
- var $input = $('<div class="ui-table-element"/>');
-
- // add error
- $input.append('<div class="ui-table-form-error ui-error"><span class="fa fa-arrow-down"/><span class="ui-table-form-error-text"></div>');
-
- // add label
- if (options.label) {
- $input.append('<div class="ui-table-form-title-strong">' + options.label + '</div>');
- }
-
- // add input element
- $input.append(options.$el);
-
- // add help
- if (options.help) {
- $input.append('<div class="ui-table-form-info">' + options.help + '</div>');
- }
-
- // return input element
- return $input;
- }
- });
+define(['utils/utils', 'mvc/ui/ui-table', 'mvc/ui/ui-misc', 'mvc/tools/tools-repeat', 'mvc/tools/tools-select-content', 'mvc/tools/tools-input'],
+ function(Utils, Table, Ui, Repeat, SelectContent, InputElement) {
// create form view
var View = Backbone.View.extend({
@@ -234,7 +184,7 @@
var input_element = new InputElement({
label : input_def.title,
help : input_def.help,
- $el : repeat.$el
+ field : repeat
});
// displays as grouped subsection
@@ -337,9 +287,10 @@
// create input field wrapper
var input_element = new InputElement({
- label : input_def.label,
- help : input_def.help,
- $el : field.$el
+ label : input_def.label,
+ optional : input_def.optional,
+ help : input_def.help,
+ field : field
});
// add to element list
diff -r 46523237518bb9ec8ed9fa4cf30453c800580c24 -r 34e643839cdace531f6ebf1a7d08e5d735be51a6 client/galaxy/scripts/mvc/tools/tools-tree.js
--- a/client/galaxy/scripts/mvc/tools/tools-tree.js
+++ b/client/galaxy/scripts/mvc/tools/tools-tree.js
@@ -110,8 +110,13 @@
}
break;
default:
+ // get conditional value
+ var field = self.app.field_list[input.id];
+
// handle default value
- add (job_input_id, input.id, self.app.field_list[input.id].value());
+ if (!field.skip) {
+ add (job_input_id, input.id, field.value());
+ }
}
}
}
diff -r 46523237518bb9ec8ed9fa4cf30453c800580c24 -r 34e643839cdace531f6ebf1a7d08e5d735be51a6 lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -200,6 +200,7 @@
pass #HACK for assert trans.history, 'requires a history'
tool_dict[ 'model_class' ] = self.__class__.__name__
+ tool_dict[ 'optional' ] = self.optional
if hasattr( self, 'value' ):
tool_dict[ 'value' ] = self.value
return tool_dict
diff -r 46523237518bb9ec8ed9fa4cf30453c800580c24 -r 34e643839cdace531f6ebf1a7d08e5d735be51a6 static/scripts/mvc/tools/tools-form.js
--- a/static/scripts/mvc/tools/tools-form.js
+++ b/static/scripts/mvc/tools/tools-form.js
@@ -1,10 +1,10 @@
/**
This is the main class of the tool form plugin. It is referenced as 'app' in all lower level modules.
*/
-define(['mvc/ui/ui-portlet', 'mvc/ui/ui-misc',
+define(['utils/utils', '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(Portlet, Ui, CitationModel, CitationView,
+ function(Utils, Portlet, Ui, CitationModel, CitationView,
Tools, ToolTemplate, ToolContent, ToolSection, ToolTree, ToolJobs) {
// create tool model
@@ -42,8 +42,7 @@
// load tool model
this.model = new Model({
- id : options.id,
- job_id : options.job_id
+ id : options.id
});
// creates a tree/json structure from the input form
@@ -102,6 +101,37 @@
// link this
var self = this;
+ // fetch model and render form
+ this.model.fetch({
+ error: function(response) {
+ console.debug('tools-form::_initializeToolForm() : Attempt to fetch tool model failed.');
+ },
+ success: function() {
+ // backup inputs
+ self.inputs = self.model.get('inputs');
+
+ // update inputs with job parameters
+ if (self.options.job_id) {
+ Utils.get({
+ url: galaxy_config.root + 'api/jobs/' + self.options.job_id,
+ success: function(parameters) {
+ // TODO: Update input parameters
+ //self._updateInputs(self.inputs, parameters);
+ self._buildForm();
+ }
+ });
+ } else {
+ self._buildForm();
+ }
+ }
+ });
+ },
+
+ // builds the tool form
+ _buildForm: function() {
+ // link this
+ var self = this;
+
// create question button
var button_question = new Ui.ButtonIcon({
icon : 'fa-question-circle',
@@ -152,79 +182,70 @@
});
}
- // fetch model and render form
- this.model.fetch({
- error: function(response) {
- console.debug('tools-form::_initializeToolForm() : Attempt to fetch tool model failed.');
- },
- success: function() {
- // create tool form section
- self.section = new ToolSection.View(self, {
- inputs : self.model.get('inputs'),
- cls : 'ui-table-plain'
- });
-
- // TEMPORARY SWITCH
- // switch to classic tool form mako if the form definition is incompatible
- if (self.incompatible) {
- self.$el.hide();
- $('#tool-form-classic').show();
- return;
- }
-
- // create portlet
- self.portlet = new Portlet.View({
- icon : 'fa-wrench',
- title: '<b>' + self.model.get('name') + '</b> ' + self.model.get('description'),
- operations: operations,
- buttons: {
- execute: new Ui.Button({
- icon : 'fa-check',
- tooltip : 'Execute the tool',
- title : 'Execute',
- cls : 'btn btn-primary',
- floating : 'clear',
- onclick : function() {
- self.job_handler.submit();
- }
- })
+ // create tool form section
+ this.section = new ToolSection.View(self, {
+ inputs : this.inputs,
+ cls : 'ui-table-plain'
+ });
+
+ // switch to classic tool form mako if the form definition is incompatible
+ if (this.incompatible) {
+ this.$el.hide();
+ $('#tool-form-classic').show();
+ return;
+ }
+
+ // create portlet
+ this.portlet = new Portlet.View({
+ icon : 'fa-wrench',
+ title: '<b>' + this.model.get('name') + '</b> ' + this.model.get('description'),
+ operations: operations,
+ buttons: {
+ execute: new Ui.Button({
+ icon : 'fa-check',
+ tooltip : 'Execute the tool',
+ title : 'Execute',
+ cls : 'btn btn-primary',
+ floating : 'clear',
+ onclick : function() {
+ self.job_handler.submit();
}
- });
-
- // configure button selection
- if(!self.options.biostar_url) {
- button_question.$el.hide();
- button_search.$el.hide();
- }
-
- // append form
- self.$el.append(self.portlet.$el);
-
- // append help
- if (self.options.help != '') {
- self.$el.append(ToolTemplate.help(self.options.help));
- }
-
- // append citations
- if (self.options.citations) {
- // append html
- self.$el.append(ToolTemplate.citations());
-
- // fetch citations
- var citations = new CitationModel.ToolCitationCollection();
- citations.tool_id = self.options.id;
- var citation_list_view = new CitationView.CitationListView({ collection: citations } );
- citation_list_view.render();
- citations.fetch();
- }
-
- // append tool section
- self.portlet.append(self.section.$el);
-
- // trigger refresh
- self.refresh();
+ })
}
});
+
+ // configure button selection
+ if(!this.options.biostar_url) {
+ button_question.$el.hide();
+ button_search.$el.hide();
+ }
+
+ // append form
+ this.$el.append(this.portlet.$el);
+
+ // append help
+ if (this.options.help != '') {
+ this.$el.append(ToolTemplate.help(this.options.help));
+ }
+
+ // append citations
+ if (this.options.citations) {
+ // append html
+ this.$el.append(ToolTemplate.citations());
+
+ // fetch citations
+ var citations = new CitationModel.ToolCitationCollection();
+ citations.tool_id = this.options.id;
+ var citation_list_view = new CitationView.CitationListView({ collection: citations } );
+ citation_list_view.render();
+ citations.fetch();
+ }
+
+ // append tool section
+ this.portlet.append(this.section.$el);
+
+ // trigger refresh
+ this.refresh();
}
});
diff -r 46523237518bb9ec8ed9fa4cf30453c800580c24 -r 34e643839cdace531f6ebf1a7d08e5d735be51a6 static/scripts/mvc/tools/tools-input.js
--- /dev/null
+++ b/static/scripts/mvc/tools/tools-input.js
@@ -0,0 +1,108 @@
+/**
+ This class creates a tool form input element wrapper
+*/
+define([], function() {
+
+ // input field element wrapper
+ return Backbone.View.extend({
+ // initialize input wrapper
+ initialize: function(options) {
+ // link field
+ this.field = options.field;
+
+ // set element
+ this.setElement(this._template(options));
+
+ // link elements
+ this.$field = this.$el.find('.ui-table-form-field');
+ this.$title_optional = this.$el.find('.ui-table-form-title-optional');
+ this.$error_text = this.$el.find('.ui-table-form-error-text');
+ this.$error = this.$el.find('.ui-table-form-error');
+
+ // add field element
+ this.$field.prepend(this.field.$el);
+
+ // hide optional field on initialization
+ if (options.optional) {
+ this.field.skip = true;
+ } else {
+ this.field.skip = false;
+ }
+
+ // refresh view
+ this._refresh();
+
+ // add optional hide/show
+ var self = this;
+ this.$title_optional.on('click', function() {
+ // flip flag
+ self.field.skip = !self.field.skip;
+
+ // refresh view
+ self._refresh();
+ });
+ },
+
+ /** Set error text
+ */
+ error: function(text) {
+ this.$error_text.html(text);
+ this.$error.fadeIn();
+ this.$el.addClass('ui-error');
+ },
+
+ /** Reset this view
+ */
+ reset: function() {
+ this.$error.hide();
+ this.$el.removeClass('ui-error');
+ },
+
+ /** Refresh element
+ */
+ _refresh: function() {
+ // show/hide field element
+ if (!this.field.skip) {
+ this.$field.fadeIn('fast');
+ this.$title_optional.html('Disable');
+ } else {
+ this.$field.hide();
+ this.$title_optional.html('Enable');
+ }
+ },
+
+ /** Main Template
+ */
+ _template: function(options) {
+ // create table element
+ var tmp = '<div class="ui-table-form-element">' +
+ '<div class="ui-table-form-error ui-error">' +
+ '<span class="fa fa-arrow-down"/><span class="ui-table-form-error-text"/>' +
+ '</div>' +
+ '<div class="ui-table-form-title-strong">';
+
+ // is optional
+ if (options.optional) {
+ tmp += '*Optional: ' + options.label +
+ '<span> [<span class="ui-table-form-title-optional"/>]</span>';
+ } else {
+ tmp += options.label;
+ }
+
+ // finalize title
+ tmp += '</div>' +
+ '<div class="ui-table-form-field">';
+ // add help
+ if (options.help) {
+ tmp += '<div class="ui-table-form-info">' + options.help + '</div>';
+ }
+
+ // finalize
+ tmp += '</div>' +
+ '</div>';
+
+ // return input element
+ return tmp;
+ }
+ });
+});
diff -r 46523237518bb9ec8ed9fa4cf30453c800580c24 -r 34e643839cdace531f6ebf1a7d08e5d735be51a6 static/scripts/mvc/tools/tools-jobs.js
--- a/static/scripts/mvc/tools/tools-jobs.js
+++ b/static/scripts/mvc/tools/tools-jobs.js
@@ -98,9 +98,9 @@
var input_id = this.app.tree.match(job_input_id);
var input_field = this.app.field_list[input_id];
var input_def = this.app.input_list[input_id];
-
+
// check basic field validation
- if (input_def && !input_def.optional && input_field && input_field.validate && !input_field.validate()) {
+ if (input_def && input_field && input_field.validate && !input_field.validate()) {
this._foundError(input_id);
return false;
}
diff -r 46523237518bb9ec8ed9fa4cf30453c800580c24 -r 34e643839cdace531f6ebf1a7d08e5d735be51a6 static/scripts/mvc/tools/tools-section.js
--- a/static/scripts/mvc/tools/tools-section.js
+++ b/static/scripts/mvc/tools/tools-section.js
@@ -1,58 +1,8 @@
/**
This class creates a tool form section and populates it with input elements. It also handles repeat blocks and conditionals by recursively creating new sub sections. New input elements can be plugged in by adding cases to the switch block defined in the _addRow() function.
*/
-define(['utils/utils', 'mvc/ui/ui-table', 'mvc/ui/ui-misc', 'mvc/tools/tools-repeat', 'mvc/tools/tools-select-content'],
- function(Utils, Table, Ui, Repeat, SelectContent) {
-
- // input field element wrapper
- var InputElement = Backbone.View.extend({
- // initialize input wrapper
- initialize: function(options) {
- this.setElement(this._template(options));
- },
-
- /** Set error text
- */
- error: function(text) {
- // set text
- this.$el.find('.ui-table-form-error-text').html(text);
- this.$el.find('.ui-table-form-error').fadeIn();
- this.$el.addClass('ui-error');
- },
-
- /** Reset this view
- */
- reset: function() {
- this.$el.find('.ui-table-form-error').hide();
- this.$el.removeClass('ui-error');
- },
-
- /** Main Template
- */
- _template: function(options) {
- // create table element
- var $input = $('<div class="ui-table-element"/>');
-
- // add error
- $input.append('<div class="ui-table-form-error ui-error"><span class="fa fa-arrow-down"/><span class="ui-table-form-error-text"></div>');
-
- // add label
- if (options.label) {
- $input.append('<div class="ui-table-form-title-strong">' + options.label + '</div>');
- }
-
- // add input element
- $input.append(options.$el);
-
- // add help
- if (options.help) {
- $input.append('<div class="ui-table-form-info">' + options.help + '</div>');
- }
-
- // return input element
- return $input;
- }
- });
+define(['utils/utils', 'mvc/ui/ui-table', 'mvc/ui/ui-misc', 'mvc/tools/tools-repeat', 'mvc/tools/tools-select-content', 'mvc/tools/tools-input'],
+ function(Utils, Table, Ui, Repeat, SelectContent, InputElement) {
// create form view
var View = Backbone.View.extend({
@@ -234,7 +184,7 @@
var input_element = new InputElement({
label : input_def.title,
help : input_def.help,
- $el : repeat.$el
+ field : repeat
});
// displays as grouped subsection
@@ -337,9 +287,10 @@
// create input field wrapper
var input_element = new InputElement({
- label : input_def.label,
- help : input_def.help,
- $el : field.$el
+ label : input_def.label,
+ optional : input_def.optional,
+ help : input_def.help,
+ field : field
});
// add to element list
diff -r 46523237518bb9ec8ed9fa4cf30453c800580c24 -r 34e643839cdace531f6ebf1a7d08e5d735be51a6 static/scripts/mvc/tools/tools-tree.js
--- a/static/scripts/mvc/tools/tools-tree.js
+++ b/static/scripts/mvc/tools/tools-tree.js
@@ -110,8 +110,13 @@
}
break;
default:
+ // get conditional value
+ var field = self.app.field_list[input.id];
+
// handle default value
- add (job_input_id, input.id, self.app.field_list[input.id].value());
+ if (!field.skip) {
+ add (job_input_id, input.id, field.value());
+ }
}
}
}
diff -r 46523237518bb9ec8ed9fa4cf30453c800580c24 -r 34e643839cdace531f6ebf1a7d08e5d735be51a6 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(["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,l,j,a,f,d,g,k,c,h){var e=Backbone.Model.extend({initialize:function(m){this.url=galaxy_config.root+"api/tools/"+m.id+"?io_details=true"}});var b=Backbone.View.extend({container:"body",initialize:function(n){var m=this;if(parent.Galaxy&&parent.Galaxy.modal){this.modal=parent.Galaxy.modal}else{this.modal=new l.Modal.View()}this.options=n;this.setElement("<div/>");$(this.container).append(this.$el);this.model=new e({id:n.id,job_id:n.job_id});this.tree=new c(this);this.job_handler=new h(this);this.field_list={};this.input_list={};this.element_list={};this.content=new g({history_id:this.options.history_id,success:function(){m._initializeToolForm()}})},message:function(m){$(this.container).empty();$(this.container).append(m)},reset:function(){for(var m in this.element_list){this.element_list[m].reset()}},refresh:function(){this.tree.refresh();for(var m in this.field_list){this.field_list[m].trigger("change")}console.debug("tools-form::refresh() - Recreated data structure. Refresh.")},_initializeToolForm:function(){var n=this;var p=new l.ButtonIcon({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(n.options.biostar_url+"/p/new/post/")}});var q=new l.ButtonIcon({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(n.options.biostar_url+"/t/"+n.options.id+"/")}});var m=new l.ButtonIcon({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",galaxy_config.root+"root?tool_id="+n.options.id)}});var o={button_question:p,button_search:q,button_share:m};if(Galaxy.currUser.get("is_admin")){o.button_download=new l.ButtonIcon({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+n.options.id+"/download"}})}this.model.fetch({error:function(r){console.debug("tools-form::_initializeToolForm() : Attempt to fetch tool model failed.")},success:function(){n.section=new k.View(n,{inputs:n.model.get("inputs"),cls:"ui-table-plain"});if(n.incompatible){n.$el.hide();$("#tool-form-classic").show();return}n.portlet=new i.View({icon:"fa-wrench",title:"<b>"+n.model.get("name")+"</b> "+n.model.get("description"),operations:o,buttons:{execute:new l.Button({icon:"fa-check",tooltip:"Execute the tool",title:"Execute",cls:"btn btn-primary",floating:"clear",onclick:function(){n.job_handler.submit()}})}});if(!n.options.biostar_url){p.$el.hide();q.$el.hide()}n.$el.append(n.portlet.$el);if(n.options.help!=""){n.$el.append(d.help(n.options.help))}if(n.options.citations){n.$el.append(d.citations());var r=new j.ToolCitationCollection();r.tool_id=n.options.id;var s=new a.CitationListView({collection:r});s.render();r.fetch()}n.portlet.append(n.section.$el);n.refresh()}})}});return{View:b}});
\ No newline at end of file
+define(["utils/utils","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(j,i,m,k,a,f,d,g,l,c,h){var e=Backbone.Model.extend({initialize:function(n){this.url=galaxy_config.root+"api/tools/"+n.id+"?io_details=true"}});var b=Backbone.View.extend({container:"body",initialize:function(o){var n=this;if(parent.Galaxy&&parent.Galaxy.modal){this.modal=parent.Galaxy.modal}else{this.modal=new m.Modal.View()}this.options=o;this.setElement("<div/>");$(this.container).append(this.$el);this.model=new e({id:o.id});this.tree=new c(this);this.job_handler=new h(this);this.field_list={};this.input_list={};this.element_list={};this.content=new g({history_id:this.options.history_id,success:function(){n._initializeToolForm()}})},message:function(n){$(this.container).empty();$(this.container).append(n)},reset:function(){for(var n in this.element_list){this.element_list[n].reset()}},refresh:function(){this.tree.refresh();for(var n in this.field_list){this.field_list[n].trigger("change")}console.debug("tools-form::refresh() - Recreated data structure. Refresh.")},_initializeToolForm:function(){var n=this;this.model.fetch({error:function(o){console.debug("tools-form::_initializeToolForm() : Attempt to fetch tool model failed.")},success:function(){n.inputs=n.model.get("inputs");if(n.options.job_id){j.get({url:galaxy_config.root+"api/jobs/"+n.options.job_id,success:function(o){n._buildForm()}})}else{n._buildForm()}}})},_buildForm:function(){var p=this;var r=new m.ButtonIcon({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(p.options.biostar_url+"/p/new/post/")}});var s=new m.ButtonIcon({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(p.options.biostar_url+"/t/"+p.options.id+"/")}});var n=new m.ButtonIcon({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",galaxy_config.root+"root?tool_id="+p.options.id)}});var q={button_question:r,button_search:s,button_share:n};if(Galaxy.currUser.get("is_admin")){q.button_download=new m.ButtonIcon({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+p.options.id+"/download"}})}this.section=new l.View(p,{inputs:this.inputs,cls:"ui-table-plain"});if(this.incompatible){this.$el.hide();$("#tool-form-classic").show();return}this.portlet=new i.View({icon:"fa-wrench",title:"<b>"+this.model.get("name")+"</b> "+this.model.get("description"),operations:q,buttons:{execute:new m.Button({icon:"fa-check",tooltip:"Execute the tool",title:"Execute",cls:"btn btn-primary",floating:"clear",onclick:function(){p.job_handler.submit()}})}});if(!this.options.biostar_url){r.$el.hide();s.$el.hide()}this.$el.append(this.portlet.$el);if(this.options.help!=""){this.$el.append(d.help(this.options.help))}if(this.options.citations){this.$el.append(d.citations());var o=new k.ToolCitationCollection();o.tool_id=this.options.id;var t=new a.CitationListView({collection:o});t.render();o.fetch()}this.portlet.append(this.section.$el);this.refresh()}});return{View:b}});
\ No newline at end of file
diff -r 46523237518bb9ec8ed9fa4cf30453c800580c24 -r 34e643839cdace531f6ebf1a7d08e5d735be51a6 static/scripts/packed/mvc/tools/tools-input.js
--- /dev/null
+++ b/static/scripts/packed/mvc/tools/tools-input.js
@@ -0,0 +1,1 @@
+define([],function(){return Backbone.View.extend({initialize:function(b){this.field=b.field;this.setElement(this._template(b));this.$field=this.$el.find(".ui-table-form-field");this.$title_optional=this.$el.find(".ui-table-form-title-optional");this.$error_text=this.$el.find(".ui-table-form-error-text");this.$error=this.$el.find(".ui-table-form-error");this.$field.prepend(this.field.$el);if(b.optional){this.field.skip=true}else{this.field.skip=false}this._refresh();var a=this;this.$title_optional.on("click",function(){a.field.skip=!a.field.skip;a._refresh()})},error:function(a){this.$error_text.html(a);this.$error.fadeIn();this.$el.addClass("ui-error")},reset:function(){this.$error.hide();this.$el.removeClass("ui-error")},_refresh:function(){if(!this.field.skip){this.$field.fadeIn("fast");this.$title_optional.html("Disable")}else{this.$field.hide();this.$title_optional.html("Enable")}},_template:function(a){var b='<div class="ui-table-form-element"><div class="ui-table-form-error ui-error"><span class="fa fa-arrow-down"/><span class="ui-table-form-error-text"/></div><div class="ui-table-form-title-strong">';if(a.optional){b+="*Optional: "+a.label+'<span> [<span class="ui-table-form-title-optional"/>]</span>'}else{b+=a.label}b+='</div><div class="ui-table-form-field">';if(a.help){b+='<div class="ui-table-form-info">'+a.help+"</div>"}b+="</div></div>";return b}})});
\ No newline at end of file
diff -r 46523237518bb9ec8ed9fa4cf30453c800580c24 -r 34e643839cdace531f6ebf1a7d08e5d735be51a6 static/scripts/packed/mvc/tools/tools-jobs.js
--- a/static/scripts/packed/mvc/tools/tools-jobs.js
+++ b/static/scripts/packed/mvc/tools/tools-jobs.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/tools/tools-template"],function(b,a){return Backbone.Model.extend({initialize:function(d,c){this.app=d;this.options=b.merge(c,this.optionsDefault)},submit:function(){var c=this;var d={tool_id:this.app.options.id,inputs:this.app.tree.finalize()};this.app.reset();if(!this._validation(d)){console.debug("tools-jobs::submit - Submission canceled. Validation failed.");return}console.debug(d);this.app.modal.show({title:"Please wait...",body:"progress",buttons:{Close:function(){c.app.modal.hide()}}});b.request({type:"POST",url:galaxy_config.root+"api/tools",data:d,success:function(e){c.app.modal.hide();c.app.message(a.success(e));c._refreshHdas()},error:function(e,g){c.app.modal.hide();if(e&&e.message&&e.message.data){var h=c.app.tree.matchResponse(e.message.data);for(var f in h){c._foundError(f,h[f])}}else{console.debug(d);console.debug(e)}}})},_foundError:function(c,d){var e=this.app.element_list[c];e.error(d||"Please verify this parameter.");$(this.app.container).animate({scrollTop:e.$el.offset().top-20},500)},_validation:function(g){var c=g.inputs;var k=-1;for(var i in c){var e=c[i];var j=this.app.tree.match(i);var d=this.app.field_list[j];var h=this.app.input_list[j];if(h&&!h.optional&&d&&d.validate&&!d.validate()){this._foundError(j);return false}if(e.batch){var f=e.values.length;if(k===-1){k=f}else{if(k!==f){this._foundError(j,"Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>"+f+"</b> selection(s) while a previous field contains <b>"+k+"</b>.");return false}}}}return true},_refreshHdas:function(){if(parent.Galaxy&&parent.Galaxy.currHistoryPanel){parent.Galaxy.currHistoryPanel.refreshContents()}}})});
\ No newline at end of file
+define(["utils/utils","mvc/tools/tools-template"],function(b,a){return Backbone.Model.extend({initialize:function(d,c){this.app=d;this.options=b.merge(c,this.optionsDefault)},submit:function(){var c=this;var d={tool_id:this.app.options.id,inputs:this.app.tree.finalize()};this.app.reset();if(!this._validation(d)){console.debug("tools-jobs::submit - Submission canceled. Validation failed.");return}console.debug(d);this.app.modal.show({title:"Please wait...",body:"progress",buttons:{Close:function(){c.app.modal.hide()}}});b.request({type:"POST",url:galaxy_config.root+"api/tools",data:d,success:function(e){c.app.modal.hide();c.app.message(a.success(e));c._refreshHdas()},error:function(e,g){c.app.modal.hide();if(e&&e.message&&e.message.data){var h=c.app.tree.matchResponse(e.message.data);for(var f in h){c._foundError(f,h[f])}}else{console.debug(d);console.debug(e)}}})},_foundError:function(c,d){var e=this.app.element_list[c];e.error(d||"Please verify this parameter.");$(this.app.container).animate({scrollTop:e.$el.offset().top-20},500)},_validation:function(g){var c=g.inputs;var k=-1;for(var i in c){var e=c[i];var j=this.app.tree.match(i);var d=this.app.field_list[j];var h=this.app.input_list[j];if(h&&d&&d.validate&&!d.validate()){this._foundError(j);return false}if(e.batch){var f=e.values.length;if(k===-1){k=f}else{if(k!==f){this._foundError(j,"Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>"+f+"</b> selection(s) while a previous field contains <b>"+k+"</b>.");return false}}}}return true},_refreshHdas:function(){if(parent.Galaxy&&parent.Galaxy.currHistoryPanel){parent.Galaxy.currHistoryPanel.refreshContents()}}})});
\ No newline at end of file
diff -r 46523237518bb9ec8ed9fa4cf30453c800580c24 -r 34e643839cdace531f6ebf1a7d08e5d735be51a6 static/scripts/packed/mvc/tools/tools-section.js
--- a/static/scripts/packed/mvc/tools/tools-section.js
+++ b/static/scripts/packed/mvc/tools/tools-section.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/tools/tools-repeat","mvc/tools/tools-select-content"],function(d,b,g,c,a){var e=Backbone.View.extend({initialize:function(h){this.setElement(this._template(h))},error:function(h){this.$el.find(".ui-table-form-error-text").html(h);this.$el.find(".ui-table-form-error").fadeIn();this.$el.addClass("ui-error")},reset:function(){this.$el.find(".ui-table-form-error").hide();this.$el.removeClass("ui-error")},_template:function(h){var i=$('<div class="ui-table-element"/>');i.append('<div class="ui-table-form-error ui-error"><span class="fa fa-arrow-down"/><span class="ui-table-form-error-text"></div>');if(h.label){i.append('<div class="ui-table-form-title-strong">'+h.label+"</div>")}i.append(h.$el);if(h.help){i.append('<div class="ui-table-form-info">'+h.help+"</div>")}return i}});var f=Backbone.View.extend({initialize:function(i,h){this.app=i;this.inputs=h.inputs;h.cls_tr="section-row";this.table=new b.View(h);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var h in this.inputs){this._add(this.inputs[h])}},_add:function(j){var i=this;var h=jQuery.extend(true,{},j);h.id=d.uuid();this.app.input_list[h.id]=h;var k=h.type;switch(k){case"conditional":this._addConditional(h);break;case"repeat":this._addRepeat(h);break;default:this._addRow(k,h)}},_addConditional:function(h){h.label=h.test_param.label;h.value=h.test_param.value;var j=this._addRow("conditional",h);for(var l in h.cases){var k=h.id+"-section-"+l;var m=new f(this.app,{inputs:h.cases[l].inputs,cls:"ui-table-plain"});m.$el.addClass("ui-table-form-section");this.table.add(m.$el);this.table.append(k)}},_addRepeat:function(h){var j=this;var n=0;var m=new c.View({title_new:h.title,max:h.max,onnew:function(){var i=h.id+"-section-"+(n++);var q=new f(j.app,{inputs:h.inputs,cls:"ui-table-plain"});m.add({id:i,title:h.title,$el:q.$el,ondel:function(){m.del(i);m.retitle(h.title);j.app.refresh()}});m.retitle(h.title);j.app.refresh()}});for(var l=0;l<h.min;l++){var k=h.id+"-section-"+(n++);var p=new f(j.app,{inputs:h.inputs,cls:"ui-table-plain"});m.add({id:k,title:h.title,$el:p.$el})}m.retitle(h.title);var o=new e({label:h.title,help:h.help,$el:m.$el});o.$el.addClass("ui-table-form-section");this.table.add(o.$el);this.table.append(h.id)},_addRow:function(j,h){var l=h.id;var i=null;switch(j){case"text":i=this._fieldText(h);break;case"select":i=this._fieldSelect(h);break;case"data":i=this._fieldData(h);break;case"data_column":h.is_dynamic=false;i=this._fieldSelect(h);break;case"conditional":i=this._fieldConditional(h);break;case"hidden":i=this._fieldHidden(h);break;case"integer":i=this._fieldSlider(h);break;case"float":i=this._fieldSlider(h);break;case"boolean":i=this._fieldBoolean(h);break;case"genomebuild":i=this._fieldSelect(h);break;default:this.app.incompatible=true;if(h.options){i=this._fieldSelect(h)}else{i=this._fieldText(h)}console.debug("tools-form::_addRow() : Auto matched field type ("+j+").")}if(h.value!==undefined){i.value(h.value)}this.app.field_list[l]=i;var k=new e({label:h.label,help:h.help,$el:i.$el});this.app.element_list[l]=k;this.table.add(k.$el);this.table.append(l);return this.table.get(l)},_fieldConditional:function(h){var j=this;var k=[];for(var l in h.test_param.options){var m=h.test_param.options[l];k.push({label:m[0],value:m[1]})}return new g.Select.View({id:"field-"+h.id,data:k,onchange:function(u){for(var s in h.cases){var o=h.cases[s];var r=h.id+"-section-"+s;var n=j.table.get(r);var q=false;for(var p in o.inputs){var t=o.inputs[p].type;if(t&&t!=="hidden"){q=true;break}}if(o.value==u&&q){n.fadeIn("fast")}else{n.hide()}}}})},_fieldData:function(h){var i=this;var j=h.id;return new a.View(this.app,{id:"field-"+j,extensions:h.extensions,multiple:h.multiple,onchange:function(q){var o=q.values[0];var m=o.id;var p=o.src;var l=i.app.tree.references(j,"data_column");if(l.length<=0){console.debug("tool-form::field_data() - Data column parameters unavailable.");return}for(var n in l){var k=i.app.field_list[l[n]];k.wait&&k.wait()}i.app.content.getDetails({id:m,src:p,success:function(y){var B=null;if(y){console.debug("tool-form::field_data() - Selected content "+m+".");if(p=="hdca"&&y.elements&&y.elements.length>0){y=y.elements[0].object}B=y.metadata_column_types;if(!B){console.debug("tool-form::field_data() - FAILED: Could not find metadata for content "+m+".")}}else{console.debug("tool-form::field_data() - FAILED: Could not find content "+m+".")}for(var u in l){var w=i.app.input_list[l[u]];var x=i.app.field_list[l[u]];if(!w||!x){console.debug("tool-form::field_data() - FAILED: Column not found.")}var t=w.numerical;var s=[];for(var A in B){var z=B[A];var r=(parseInt(A)+1);var v="Text";if(z=="int"||z=="float"){v="Number"}if(z=="int"||z=="float"||!t){s.push({label:"Column: "+r+" ["+v+"]",value:r})}}if(x){x.update(s);if(!x.exists(x.value())){x.value(x.first())}x.show()}}}})}})},_fieldSelect:function(h){if(h.is_dynamic){this.app.incompatible=true}var j=[];for(var k in h.options){var l=h.options[k];j.push({label:l[0],value:l[1]})}var m=g.Select;switch(h.display){case"checkboxes":m=g.Checkbox;break;case"radio":m=g.Radio;break}return new m.View({id:"field-"+h.id,data:j,multiple:h.multiple})},_fieldText:function(h){return new g.Input({id:"field-"+h.id,area:h.area})},_fieldSlider:function(h){h.min=h.min||0;h.max=h.max||100000;var i=1;if(h.type=="float"){i=(h.max-h.min)/10000}return new g.Slider.View({id:"field-"+h.id,min:h.min,max:h.max,step:i})},_fieldHidden:function(h){return new g.Hidden({id:"field-"+h.id})},_fieldBoolean:function(h){return new g.RadioButton.View({id:"field-"+h.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]})}});return{View:f}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/tools/tools-repeat","mvc/tools/tools-select-content","mvc/tools/tools-input"],function(d,b,g,c,a,e){var f=Backbone.View.extend({initialize:function(i,h){this.app=i;this.inputs=h.inputs;h.cls_tr="section-row";this.table=new b.View(h);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var h in this.inputs){this._add(this.inputs[h])}},_add:function(j){var i=this;var h=jQuery.extend(true,{},j);h.id=d.uuid();this.app.input_list[h.id]=h;var k=h.type;switch(k){case"conditional":this._addConditional(h);break;case"repeat":this._addRepeat(h);break;default:this._addRow(k,h)}},_addConditional:function(h){h.label=h.test_param.label;h.value=h.test_param.value;var j=this._addRow("conditional",h);for(var l in h.cases){var k=h.id+"-section-"+l;var m=new f(this.app,{inputs:h.cases[l].inputs,cls:"ui-table-plain"});m.$el.addClass("ui-table-form-section");this.table.add(m.$el);this.table.append(k)}},_addRepeat:function(h){var j=this;var n=0;var m=new c.View({title_new:h.title,max:h.max,onnew:function(){var i=h.id+"-section-"+(n++);var q=new f(j.app,{inputs:h.inputs,cls:"ui-table-plain"});m.add({id:i,title:h.title,$el:q.$el,ondel:function(){m.del(i);m.retitle(h.title);j.app.refresh()}});m.retitle(h.title);j.app.refresh()}});for(var l=0;l<h.min;l++){var k=h.id+"-section-"+(n++);var p=new f(j.app,{inputs:h.inputs,cls:"ui-table-plain"});m.add({id:k,title:h.title,$el:p.$el})}m.retitle(h.title);var o=new e({label:h.title,help:h.help,field:m});o.$el.addClass("ui-table-form-section");this.table.add(o.$el);this.table.append(h.id)},_addRow:function(j,h){var l=h.id;var i=null;switch(j){case"text":i=this._fieldText(h);break;case"select":i=this._fieldSelect(h);break;case"data":i=this._fieldData(h);break;case"data_column":h.is_dynamic=false;i=this._fieldSelect(h);break;case"conditional":i=this._fieldConditional(h);break;case"hidden":i=this._fieldHidden(h);break;case"integer":i=this._fieldSlider(h);break;case"float":i=this._fieldSlider(h);break;case"boolean":i=this._fieldBoolean(h);break;case"genomebuild":i=this._fieldSelect(h);break;default:this.app.incompatible=true;if(h.options){i=this._fieldSelect(h)}else{i=this._fieldText(h)}console.debug("tools-form::_addRow() : Auto matched field type ("+j+").")}if(h.value!==undefined){i.value(h.value)}this.app.field_list[l]=i;var k=new e({label:h.label,optional:h.optional,help:h.help,field:i});this.app.element_list[l]=k;this.table.add(k.$el);this.table.append(l);return this.table.get(l)},_fieldConditional:function(h){var j=this;var k=[];for(var l in h.test_param.options){var m=h.test_param.options[l];k.push({label:m[0],value:m[1]})}return new g.Select.View({id:"field-"+h.id,data:k,onchange:function(u){for(var s in h.cases){var o=h.cases[s];var r=h.id+"-section-"+s;var n=j.table.get(r);var q=false;for(var p in o.inputs){var t=o.inputs[p].type;if(t&&t!=="hidden"){q=true;break}}if(o.value==u&&q){n.fadeIn("fast")}else{n.hide()}}}})},_fieldData:function(h){var i=this;var j=h.id;return new a.View(this.app,{id:"field-"+j,extensions:h.extensions,multiple:h.multiple,onchange:function(q){var o=q.values[0];var m=o.id;var p=o.src;var l=i.app.tree.references(j,"data_column");if(l.length<=0){console.debug("tool-form::field_data() - Data column parameters unavailable.");return}for(var n in l){var k=i.app.field_list[l[n]];k.wait&&k.wait()}i.app.content.getDetails({id:m,src:p,success:function(y){var B=null;if(y){console.debug("tool-form::field_data() - Selected content "+m+".");if(p=="hdca"&&y.elements&&y.elements.length>0){y=y.elements[0].object}B=y.metadata_column_types;if(!B){console.debug("tool-form::field_data() - FAILED: Could not find metadata for content "+m+".")}}else{console.debug("tool-form::field_data() - FAILED: Could not find content "+m+".")}for(var u in l){var w=i.app.input_list[l[u]];var x=i.app.field_list[l[u]];if(!w||!x){console.debug("tool-form::field_data() - FAILED: Column not found.")}var t=w.numerical;var s=[];for(var A in B){var z=B[A];var r=(parseInt(A)+1);var v="Text";if(z=="int"||z=="float"){v="Number"}if(z=="int"||z=="float"||!t){s.push({label:"Column: "+r+" ["+v+"]",value:r})}}if(x){x.update(s);if(!x.exists(x.value())){x.value(x.first())}x.show()}}}})}})},_fieldSelect:function(h){if(h.is_dynamic){this.app.incompatible=true}var j=[];for(var k in h.options){var l=h.options[k];j.push({label:l[0],value:l[1]})}var m=g.Select;switch(h.display){case"checkboxes":m=g.Checkbox;break;case"radio":m=g.Radio;break}return new m.View({id:"field-"+h.id,data:j,multiple:h.multiple})},_fieldText:function(h){return new g.Input({id:"field-"+h.id,area:h.area})},_fieldSlider:function(h){h.min=h.min||0;h.max=h.max||100000;var i=1;if(h.type=="float"){i=(h.max-h.min)/10000}return new g.Slider.View({id:"field-"+h.id,min:h.min,max:h.max,step:i})},_fieldHidden:function(h){return new g.Hidden({id:"field-"+h.id})},_fieldBoolean:function(h){return new g.RadioButton.View({id:"field-"+h.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]})}});return{View:f}});
\ No newline at end of file
diff -r 46523237518bb9ec8ed9fa4cf30453c800580c24 -r 34e643839cdace531f6ebf1a7d08e5d735be51a6 static/scripts/packed/mvc/tools/tools-tree.js
--- a/static/scripts/packed/mvc/tools/tools-tree.js
+++ b/static/scripts/packed/mvc/tools/tools-tree.js
@@ -1,1 +1,1 @@
-define([],function(){return Backbone.Model.extend({initialize:function(a){this.app=a},refresh:function(){this.dict={};this.xml=$("<div/>");if(!this.app.section){return{}}this._iterate(this.app.section.$el,this.dict,this.xml)},finalize:function(){var a=this;this.job_def={};this.job_ids={};function c(f,e,d){a.job_def[f]=d;a.job_ids[f]=e}function b(j,m){for(var g in m){var e=m[g];if(e.input){var n=e.input;var h=j;if(j!=""){h+="|"}h+=n.name;switch(n.type){case"repeat":var d="section-";var q=[];var l=null;for(var p in e){var k=p.indexOf(d);if(k!=-1){k+=d.length;q.push(parseInt(p.substr(k)));if(!l){l=p.substr(0,k)}}}q.sort(function(r,i){return r-i});var g=0;for(var f in q){b(h+"_"+g++,e[l+q[f]])}break;case"conditional":var o=a.app.field_list[n.id].value();c(h+"|"+n.test_param.name,n.id,o);for(var f in n.cases){if(n.cases[f].value==o){b(h,m[n.id+"-section-"+f]);break}}break;default:c(h,n.id,a.app.field_list[n.id].value())}}}}b("",this.dict);return this.job_def},match:function(a){return this.job_ids&&this.job_ids[a]},matchResponse:function(c){var a={};var b=this;function d(j,h){if(typeof h==="string"){var f=b.app.tree.job_ids[j];if(f){a[f]=h}}else{for(var g in h){var e=g;if(j!==""){e=j+"|"+e}d(e,h[g])}}}d("",c);return a},references:function(c,e){var g=[];var b=this;function d(h,j){var i=$(j).children();var l=[];var k=false;i.each(function(){var o=this;var n=$(o).attr("id");if(n!==c){var m=b.app.input_list[n];if(m){if(m.name==h){k=true;return false}if(m.data_ref==h&&m.type==e){l.push(n)}}}});if(!k){g=g.concat(l);i.each(function(){d(h,this)})}}var f=this.xml.find("#"+c);if(f.length>0){var a=this.app.input_list[c];if(a){d(a.name,f.parent())}}return g},_iterate:function(d,e,b){var a=this;var c=$(d).children();c.each(function(){var i=this;var h=$(i).attr("id");if($(i).hasClass("section-row")){e[h]={};var f=a.app.input_list[h];if(f){e[h]={input:f}}var g=$('<div id="'+h+'"/>');b.append(g);a._iterate(i,e[h],g)}else{a._iterate(i,e,b)}})}})});
\ No newline at end of file
+define([],function(){return Backbone.Model.extend({initialize:function(a){this.app=a},refresh:function(){this.dict={};this.xml=$("<div/>");if(!this.app.section){return{}}this._iterate(this.app.section.$el,this.dict,this.xml)},finalize:function(){var a=this;this.job_def={};this.job_ids={};function c(f,e,d){a.job_def[f]=d;a.job_ids[f]=e}function b(j,m){for(var g in m){var e=m[g];if(e.input){var o=e.input;var h=j;if(j!=""){h+="|"}h+=o.name;switch(o.type){case"repeat":var d="section-";var r=[];var l=null;for(var q in e){var k=q.indexOf(d);if(k!=-1){k+=d.length;r.push(parseInt(q.substr(k)));if(!l){l=q.substr(0,k)}}}r.sort(function(s,i){return s-i});var g=0;for(var f in r){b(h+"_"+g++,e[l+r[f]])}break;case"conditional":var p=a.app.field_list[o.id].value();c(h+"|"+o.test_param.name,o.id,p);for(var f in o.cases){if(o.cases[f].value==p){b(h,m[o.id+"-section-"+f]);break}}break;default:var n=a.app.field_list[o.id];if(!n.skip){c(h,o.id,n.value())}}}}}b("",this.dict);return this.job_def},match:function(a){return this.job_ids&&this.job_ids[a]},matchResponse:function(c){var a={};var b=this;function d(j,h){if(typeof h==="string"){var f=b.app.tree.job_ids[j];if(f){a[f]=h}}else{for(var g in h){var e=g;if(j!==""){e=j+"|"+e}d(e,h[g])}}}d("",c);return a},references:function(c,e){var g=[];var b=this;function d(h,j){var i=$(j).children();var l=[];var k=false;i.each(function(){var o=this;var n=$(o).attr("id");if(n!==c){var m=b.app.input_list[n];if(m){if(m.name==h){k=true;return false}if(m.data_ref==h&&m.type==e){l.push(n)}}}});if(!k){g=g.concat(l);i.each(function(){d(h,this)})}}var f=this.xml.find("#"+c);if(f.length>0){var a=this.app.input_list[c];if(a){d(a.name,f.parent())}}return g},_iterate:function(d,e,b){var a=this;var c=$(d).children();c.each(function(){var i=this;var h=$(i).attr("id");if($(i).hasClass("section-row")){e[h]={};var f=a.app.input_list[h];if(f){e[h]={input:f}}var g=$('<div id="'+h+'"/>');b.append(g);a._iterate(i,e[h],g)}else{a._iterate(i,e,b)}})}})});
\ No newline at end of file
diff -r 46523237518bb9ec8ed9fa4cf30453c800580c24 -r 34e643839cdace531f6ebf1a7d08e5d735be51a6 static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -1284,8 +1284,10 @@
.ui-table tbody{cursor:pointer}
.ui-table-plain tbody td{padding:5px 0px 5px 0px !important;border:none !important}
.ui-table-plain tbody{cursor:auto !important}
+.ui-table-form-element .ui-table-form-title-optional{font-weight:bold;text-decoration:underline;cursor:pointer}
+.ui-table-form-element .ui-table-form-field{margin-top:5px}
.ui-table-form-section{border-left:solid 3px #ebd9b2;border-radius:5px !important;padding-left:10px}
-.ui-table-form-title-strong{font-weight:bold;padding-bottom:5px}
+.ui-table-form-title-strong{font-weight:bold}
.ui-table-form-info{clear:both !important}
.ui-table-form-separator{font-weight:bold;font-size:0.9em}
.ui-label{font-weight:bold}
diff -r 46523237518bb9ec8ed9fa4cf30453c800580c24 -r 34e643839cdace531f6ebf1a7d08e5d735be51a6 static/style/src/less/ui.less
--- a/static/style/src/less/ui.less
+++ b/static/style/src/less/ui.less
@@ -44,6 +44,17 @@
}
}
+.ui-table-form-element {
+ .ui-table-form-title-optional {
+ font-weight: bold;
+ text-decoration: underline;
+ cursor: pointer;
+ }
+ .ui-table-form-field {
+ margin-top: 5px;
+ }
+}
+
.ui-table-form-section {
border-left: solid 3px @form-heading-bg;
border-radius: 5px !important;
@@ -52,7 +63,6 @@
.ui-table-form-title-strong {
font-weight: bold;
- padding-bottom: 5px;
}
.ui-table-form-info {
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
0
09 Oct '14
Branch: refs/heads/master
Home: https://github.com/galaxyproject/usegalaxy-playbook
Commit: 6f878bbac19e180d9417e8445695269edbebdc1c
https://github.com/galaxyproject/usegalaxy-playbook/commit/6f878bbac19e180d…
Author: Nate Coraor <nate(a)bx.psu.edu>
Date: 2014-10-09 (Thu, 09 Oct 2014)
Changed paths:
M files/galaxy/test.galaxyproject.org/config/job_resource_params_conf.xml
A files/galaxy/test.galaxyproject.org/dynamic_rules/multi_dynamic_walltime.py
M files/galaxy/test.galaxyproject.org/dynamic_rules/reserved.py
R files/galaxy/test.galaxyproject.org/dynamic_rules/roundup_multi_walltime.py
A files/galaxy/test.galaxyproject.org/dynamic_rules/stampede_select.py
M stage/group_vars/galaxyservers.yml
M templates/galaxy/test.galaxyproject.org/config/job_conf.xml.j2
Log Message:
-----------
Overhaul job running on Test.
1
0
commit/galaxy-central: jmchilton: More informative exceptions for startup failure due to job config XML errors.
by commits-noreply@bitbucket.org 09 Oct '14
by commits-noreply@bitbucket.org 09 Oct '14
09 Oct '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/46523237518b/
Changeset: 46523237518b
User: jmchilton
Date: 2014-10-09 19:04:38+00:00
Summary: More informative exceptions for startup failure due to job config XML errors.
Describe that this is an XML formatting issue that is causing the problem and include the full path of the file when to the user starting Galaxy.
Inspired by problems described here: https://biostar.usegalaxy.org/p/9245/.
Affected #: 1 file
diff -r dd0d4fa44feb1d620a288093cb72e1b83811ce0f -r 46523237518bb9ec8ed9fa4cf30453c800580c24 lib/galaxy/jobs/__init__.py
--- a/lib/galaxy/jobs/__init__.py
+++ b/lib/galaxy/jobs/__init__.py
@@ -91,6 +91,15 @@
return self.get( "resources", None )
+def config_exception(e, file):
+ abs_path = os.path.abspath(file)
+ message = 'Problem parsing the XML in file %s, ' % abs_path
+ message += 'please correct the indicated portion of the file and restart Galaxy.'
+ message += str(e)
+ log.exception(message)
+ return Exception(message)
+
+
class JobConfiguration( object ):
"""A parser and interface to advanced job management features.
@@ -118,12 +127,15 @@
self.__parse_resource_parameters()
# Initialize the config
+ job_config_file = self.app.config.job_config_file
try:
- tree = util.parse_xml(self.app.config.job_config_file)
+ tree = util.parse_xml(job_config_file)
self.__parse_job_conf_xml(tree)
except IOError:
log.warning( 'Job configuration "%s" does not exist, using legacy job configuration from Galaxy config file "%s" instead' % ( self.app.config.job_config_file, self.app.config.config_file ) )
self.__parse_job_conf_legacy()
+ except Exception as e:
+ raise config_exception(e, job_config_file)
def __parse_job_conf_xml(self, tree):
"""Loads the new-style job configuration from options in the job config file (by default, job_conf.xml).
@@ -358,7 +370,12 @@
if not os.path.exists( self.app.config.job_resource_params_file ):
return
- resource_definitions = util.parse_xml( self.app.config.job_resource_params_file )
+ resource_param_file = self.app.config.job_resource_params_file
+ try:
+ resource_definitions = util.parse_xml( resource_param_file )
+ except Exception as e:
+ raise config_exception(e, resource_param_file)
+
resource_definitions_root = resource_definitions.getroot()
# TODO: Also handling conditionals would be awesome!
for parameter_elem in resource_definitions_root.findall( "param" ):
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
0
[galaxyproject/usegalaxy-playbook] ec8b9e: Return to running jobs on rodeo now that slurm-drm...
by GitHub 09 Oct '14
by GitHub 09 Oct '14
09 Oct '14
Branch: refs/heads/master
Home: https://github.com/galaxyproject/usegalaxy-playbook
Commit: ec8b9e45188359bac081e151c2a4c8b5734d5c54
https://github.com/galaxyproject/usegalaxy-playbook/commit/ec8b9e45188359ba…
Author: Nate Coraor <nate(a)bx.psu.edu>
Date: 2014-10-09 (Thu, 09 Oct 2014)
Changed paths:
M files/galaxy/test.galaxyproject.org/dynamic_rules/reserved.py
M templates/galaxy/test.galaxyproject.org/config/job_conf.xml.j2
Log Message:
-----------
Return to running jobs on rodeo now that slurm-drmaa supports it.
1
0
commit/galaxy-central: davebgx: More flexibility for tool data table configuration in the install and test framework.
by commits-noreply@bitbucket.org 09 Oct '14
by commits-noreply@bitbucket.org 09 Oct '14
09 Oct '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/dd0d4fa44feb/
Changeset: dd0d4fa44feb
User: davebgx
Date: 2014-10-09 18:17:33+00:00
Summary: More flexibility for tool data table configuration in the install and test framework.
Affected #: 1 file
diff -r 1ae6886199e5277ff822cc14c52bf9215b3593d4 -r dd0d4fa44feb1d620a288093cb72e1b83811ce0f test/install_and_test_tool_shed_repositories/base/util.py
--- a/test/install_and_test_tool_shed_repositories/base/util.py
+++ b/test/install_and_test_tool_shed_repositories/base/util.py
@@ -115,13 +115,16 @@
additional_tool_data_tables = None
additional_tool_data_path = None
-# Set up default tool data tables.
-if os.path.exists( 'tool_data_table_conf.xml' ):
- tool_data_table_conf = 'tool_data_table_conf.xml'
-elif os.path.exists( 'tool_data_table_conf.xml.sample' ):
- tool_data_table_conf = 'tool_data_table_conf.xml.sample'
-else:
- tool_data_table_conf = None
+tool_data_table_conf = None
+# Set up default tool data tables. If a non-sample version is in config/, use that. Otherwise iterate through lower
+# priority versions.
+for conf in [ 'config/tool_data_table_conf.xml',
+ 'config/tool_data_table_conf.xml.sample',
+ 'tool_data_table_conf.xml',
+ 'tool_data_table_conf.xml.sample' ]:
+ if os.path.exists( conf ):
+ tool_data_table_conf = conf
+ break
# The GALAXY_INSTALL_TEST_TOOL_SHED_URL and GALAXY_INSTALL_TEST_TOOL_SHED_API_KEY environment variables must be
# set for this script to work correctly. If the value of GALAXY_INSTALL_TEST_TOOL_SHED_URL does not refer to one
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
0
commit/galaxy-central: guerler: ToolForm: Fix compatibility check
by commits-noreply@bitbucket.org 09 Oct '14
by commits-noreply@bitbucket.org 09 Oct '14
09 Oct '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/1ae6886199e5/
Changeset: 1ae6886199e5
User: guerler
Date: 2014-10-09 16:50:35+00:00
Summary: ToolForm: Fix compatibility check
Affected #: 4 files
diff -r d7fb2045f0c5e31cb18b45799ace9bc4cfd15efe -r 1ae6886199e5277ff822cc14c52bf9215b3593d4 client/galaxy/scripts/mvc/tools/tools-section.js
--- a/client/galaxy/scripts/mvc/tools/tools-section.js
+++ b/client/galaxy/scripts/mvc/tools/tools-section.js
@@ -275,6 +275,7 @@
// data column
case 'data_column':
+ input_def.is_dynamic = false;
field = this._fieldSelect(input_def);
break;
@@ -308,7 +309,7 @@
field = this._fieldSelect(input_def);
break;
- // flag as incompatible
+ // field not found
default:
// flag
this.app.incompatible = true;
@@ -525,6 +526,11 @@
/** Select/Checkbox/Radio options field
*/
_fieldSelect : function (input_def) {
+ // check compatibility
+ if (input_def.is_dynamic) {
+ this.app.incompatible = true;
+ }
+
// configure options fields
var options = [];
for (var i in input_def.options) {
diff -r d7fb2045f0c5e31cb18b45799ace9bc4cfd15efe -r 1ae6886199e5277ff822cc14c52bf9215b3593d4 lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -1007,6 +1007,7 @@
d['display'] = self.display
d['multiple'] = self.multiple
+ d['is_dynamic'] = self.is_dynamic
return d
diff -r d7fb2045f0c5e31cb18b45799ace9bc4cfd15efe -r 1ae6886199e5277ff822cc14c52bf9215b3593d4 static/scripts/mvc/tools/tools-section.js
--- a/static/scripts/mvc/tools/tools-section.js
+++ b/static/scripts/mvc/tools/tools-section.js
@@ -275,6 +275,7 @@
// data column
case 'data_column':
+ input_def.is_dynamic = false;
field = this._fieldSelect(input_def);
break;
@@ -308,7 +309,7 @@
field = this._fieldSelect(input_def);
break;
- // flag as incompatible
+ // field not found
default:
// flag
this.app.incompatible = true;
@@ -525,6 +526,11 @@
/** Select/Checkbox/Radio options field
*/
_fieldSelect : function (input_def) {
+ // check compatibility
+ if (input_def.is_dynamic) {
+ this.app.incompatible = true;
+ }
+
// configure options fields
var options = [];
for (var i in input_def.options) {
diff -r d7fb2045f0c5e31cb18b45799ace9bc4cfd15efe -r 1ae6886199e5277ff822cc14c52bf9215b3593d4 static/scripts/packed/mvc/tools/tools-section.js
--- a/static/scripts/packed/mvc/tools/tools-section.js
+++ b/static/scripts/packed/mvc/tools/tools-section.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/tools/tools-repeat","mvc/tools/tools-select-content"],function(d,b,g,c,a){var e=Backbone.View.extend({initialize:function(h){this.setElement(this._template(h))},error:function(h){this.$el.find(".ui-table-form-error-text").html(h);this.$el.find(".ui-table-form-error").fadeIn();this.$el.addClass("ui-error")},reset:function(){this.$el.find(".ui-table-form-error").hide();this.$el.removeClass("ui-error")},_template:function(h){var i=$('<div class="ui-table-element"/>');i.append('<div class="ui-table-form-error ui-error"><span class="fa fa-arrow-down"/><span class="ui-table-form-error-text"></div>');if(h.label){i.append('<div class="ui-table-form-title-strong">'+h.label+"</div>")}i.append(h.$el);if(h.help){i.append('<div class="ui-table-form-info">'+h.help+"</div>")}return i}});var f=Backbone.View.extend({initialize:function(i,h){this.app=i;this.inputs=h.inputs;h.cls_tr="section-row";this.table=new b.View(h);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var h in this.inputs){this._add(this.inputs[h])}},_add:function(j){var i=this;var h=jQuery.extend(true,{},j);h.id=d.uuid();this.app.input_list[h.id]=h;var k=h.type;switch(k){case"conditional":this._addConditional(h);break;case"repeat":this._addRepeat(h);break;default:this._addRow(k,h)}},_addConditional:function(h){h.label=h.test_param.label;h.value=h.test_param.value;var j=this._addRow("conditional",h);for(var l in h.cases){var k=h.id+"-section-"+l;var m=new f(this.app,{inputs:h.cases[l].inputs,cls:"ui-table-plain"});m.$el.addClass("ui-table-form-section");this.table.add(m.$el);this.table.append(k)}},_addRepeat:function(h){var j=this;var n=0;var m=new c.View({title_new:h.title,max:h.max,onnew:function(){var i=h.id+"-section-"+(n++);var q=new f(j.app,{inputs:h.inputs,cls:"ui-table-plain"});m.add({id:i,title:h.title,$el:q.$el,ondel:function(){m.del(i);m.retitle(h.title);j.app.refresh()}});m.retitle(h.title);j.app.refresh()}});for(var l=0;l<h.min;l++){var k=h.id+"-section-"+(n++);var p=new f(j.app,{inputs:h.inputs,cls:"ui-table-plain"});m.add({id:k,title:h.title,$el:p.$el})}m.retitle(h.title);var o=new e({label:h.title,help:h.help,$el:m.$el});o.$el.addClass("ui-table-form-section");this.table.add(o.$el);this.table.append(h.id)},_addRow:function(j,h){var l=h.id;var i=null;switch(j){case"text":i=this._fieldText(h);break;case"select":i=this._fieldSelect(h);break;case"data":i=this._fieldData(h);break;case"data_column":i=this._fieldSelect(h);break;case"conditional":i=this._fieldConditional(h);break;case"hidden":i=this._fieldHidden(h);break;case"integer":i=this._fieldSlider(h);break;case"float":i=this._fieldSlider(h);break;case"boolean":i=this._fieldBoolean(h);break;case"genomebuild":i=this._fieldSelect(h);break;default:this.app.incompatible=true;if(h.options){i=this._fieldSelect(h)}else{i=this._fieldText(h)}console.debug("tools-form::_addRow() : Auto matched field type ("+j+").")}if(h.value!==undefined){i.value(h.value)}this.app.field_list[l]=i;var k=new e({label:h.label,help:h.help,$el:i.$el});this.app.element_list[l]=k;this.table.add(k.$el);this.table.append(l);return this.table.get(l)},_fieldConditional:function(h){var j=this;var k=[];for(var l in h.test_param.options){var m=h.test_param.options[l];k.push({label:m[0],value:m[1]})}return new g.Select.View({id:"field-"+h.id,data:k,onchange:function(u){for(var s in h.cases){var o=h.cases[s];var r=h.id+"-section-"+s;var n=j.table.get(r);var q=false;for(var p in o.inputs){var t=o.inputs[p].type;if(t&&t!=="hidden"){q=true;break}}if(o.value==u&&q){n.fadeIn("fast")}else{n.hide()}}}})},_fieldData:function(h){var i=this;var j=h.id;return new a.View(this.app,{id:"field-"+j,extensions:h.extensions,multiple:h.multiple,onchange:function(q){var o=q.values[0];var m=o.id;var p=o.src;var l=i.app.tree.references(j,"data_column");if(l.length<=0){console.debug("tool-form::field_data() - Data column parameters unavailable.");return}for(var n in l){var k=i.app.field_list[l[n]];k.wait&&k.wait()}i.app.content.getDetails({id:m,src:p,success:function(y){var B=null;if(y){console.debug("tool-form::field_data() - Selected content "+m+".");if(p=="hdca"&&y.elements&&y.elements.length>0){y=y.elements[0].object}B=y.metadata_column_types;if(!B){console.debug("tool-form::field_data() - FAILED: Could not find metadata for content "+m+".")}}else{console.debug("tool-form::field_data() - FAILED: Could not find content "+m+".")}for(var u in l){var w=i.app.input_list[l[u]];var x=i.app.field_list[l[u]];if(!w||!x){console.debug("tool-form::field_data() - FAILED: Column not found.")}var t=w.numerical;var s=[];for(var A in B){var z=B[A];var r=(parseInt(A)+1);var v="Text";if(z=="int"||z=="float"){v="Number"}if(z=="int"||z=="float"||!t){s.push({label:"Column: "+r+" ["+v+"]",value:r})}}if(x){x.update(s);if(!x.exists(x.value())){x.value(x.first())}x.show()}}}})}})},_fieldSelect:function(h){var j=[];for(var k in h.options){var l=h.options[k];j.push({label:l[0],value:l[1]})}var m=g.Select;switch(h.display){case"checkboxes":m=g.Checkbox;break;case"radio":m=g.Radio;break}return new m.View({id:"field-"+h.id,data:j,multiple:h.multiple})},_fieldText:function(h){return new g.Input({id:"field-"+h.id,area:h.area})},_fieldSlider:function(h){h.min=h.min||0;h.max=h.max||100000;var i=1;if(h.type=="float"){i=(h.max-h.min)/10000}return new g.Slider.View({id:"field-"+h.id,min:h.min,max:h.max,step:i})},_fieldHidden:function(h){return new g.Hidden({id:"field-"+h.id})},_fieldBoolean:function(h){return new g.RadioButton.View({id:"field-"+h.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]})}});return{View:f}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/tools/tools-repeat","mvc/tools/tools-select-content"],function(d,b,g,c,a){var e=Backbone.View.extend({initialize:function(h){this.setElement(this._template(h))},error:function(h){this.$el.find(".ui-table-form-error-text").html(h);this.$el.find(".ui-table-form-error").fadeIn();this.$el.addClass("ui-error")},reset:function(){this.$el.find(".ui-table-form-error").hide();this.$el.removeClass("ui-error")},_template:function(h){var i=$('<div class="ui-table-element"/>');i.append('<div class="ui-table-form-error ui-error"><span class="fa fa-arrow-down"/><span class="ui-table-form-error-text"></div>');if(h.label){i.append('<div class="ui-table-form-title-strong">'+h.label+"</div>")}i.append(h.$el);if(h.help){i.append('<div class="ui-table-form-info">'+h.help+"</div>")}return i}});var f=Backbone.View.extend({initialize:function(i,h){this.app=i;this.inputs=h.inputs;h.cls_tr="section-row";this.table=new b.View(h);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var h in this.inputs){this._add(this.inputs[h])}},_add:function(j){var i=this;var h=jQuery.extend(true,{},j);h.id=d.uuid();this.app.input_list[h.id]=h;var k=h.type;switch(k){case"conditional":this._addConditional(h);break;case"repeat":this._addRepeat(h);break;default:this._addRow(k,h)}},_addConditional:function(h){h.label=h.test_param.label;h.value=h.test_param.value;var j=this._addRow("conditional",h);for(var l in h.cases){var k=h.id+"-section-"+l;var m=new f(this.app,{inputs:h.cases[l].inputs,cls:"ui-table-plain"});m.$el.addClass("ui-table-form-section");this.table.add(m.$el);this.table.append(k)}},_addRepeat:function(h){var j=this;var n=0;var m=new c.View({title_new:h.title,max:h.max,onnew:function(){var i=h.id+"-section-"+(n++);var q=new f(j.app,{inputs:h.inputs,cls:"ui-table-plain"});m.add({id:i,title:h.title,$el:q.$el,ondel:function(){m.del(i);m.retitle(h.title);j.app.refresh()}});m.retitle(h.title);j.app.refresh()}});for(var l=0;l<h.min;l++){var k=h.id+"-section-"+(n++);var p=new f(j.app,{inputs:h.inputs,cls:"ui-table-plain"});m.add({id:k,title:h.title,$el:p.$el})}m.retitle(h.title);var o=new e({label:h.title,help:h.help,$el:m.$el});o.$el.addClass("ui-table-form-section");this.table.add(o.$el);this.table.append(h.id)},_addRow:function(j,h){var l=h.id;var i=null;switch(j){case"text":i=this._fieldText(h);break;case"select":i=this._fieldSelect(h);break;case"data":i=this._fieldData(h);break;case"data_column":h.is_dynamic=false;i=this._fieldSelect(h);break;case"conditional":i=this._fieldConditional(h);break;case"hidden":i=this._fieldHidden(h);break;case"integer":i=this._fieldSlider(h);break;case"float":i=this._fieldSlider(h);break;case"boolean":i=this._fieldBoolean(h);break;case"genomebuild":i=this._fieldSelect(h);break;default:this.app.incompatible=true;if(h.options){i=this._fieldSelect(h)}else{i=this._fieldText(h)}console.debug("tools-form::_addRow() : Auto matched field type ("+j+").")}if(h.value!==undefined){i.value(h.value)}this.app.field_list[l]=i;var k=new e({label:h.label,help:h.help,$el:i.$el});this.app.element_list[l]=k;this.table.add(k.$el);this.table.append(l);return this.table.get(l)},_fieldConditional:function(h){var j=this;var k=[];for(var l in h.test_param.options){var m=h.test_param.options[l];k.push({label:m[0],value:m[1]})}return new g.Select.View({id:"field-"+h.id,data:k,onchange:function(u){for(var s in h.cases){var o=h.cases[s];var r=h.id+"-section-"+s;var n=j.table.get(r);var q=false;for(var p in o.inputs){var t=o.inputs[p].type;if(t&&t!=="hidden"){q=true;break}}if(o.value==u&&q){n.fadeIn("fast")}else{n.hide()}}}})},_fieldData:function(h){var i=this;var j=h.id;return new a.View(this.app,{id:"field-"+j,extensions:h.extensions,multiple:h.multiple,onchange:function(q){var o=q.values[0];var m=o.id;var p=o.src;var l=i.app.tree.references(j,"data_column");if(l.length<=0){console.debug("tool-form::field_data() - Data column parameters unavailable.");return}for(var n in l){var k=i.app.field_list[l[n]];k.wait&&k.wait()}i.app.content.getDetails({id:m,src:p,success:function(y){var B=null;if(y){console.debug("tool-form::field_data() - Selected content "+m+".");if(p=="hdca"&&y.elements&&y.elements.length>0){y=y.elements[0].object}B=y.metadata_column_types;if(!B){console.debug("tool-form::field_data() - FAILED: Could not find metadata for content "+m+".")}}else{console.debug("tool-form::field_data() - FAILED: Could not find content "+m+".")}for(var u in l){var w=i.app.input_list[l[u]];var x=i.app.field_list[l[u]];if(!w||!x){console.debug("tool-form::field_data() - FAILED: Column not found.")}var t=w.numerical;var s=[];for(var A in B){var z=B[A];var r=(parseInt(A)+1);var v="Text";if(z=="int"||z=="float"){v="Number"}if(z=="int"||z=="float"||!t){s.push({label:"Column: "+r+" ["+v+"]",value:r})}}if(x){x.update(s);if(!x.exists(x.value())){x.value(x.first())}x.show()}}}})}})},_fieldSelect:function(h){if(h.is_dynamic){this.app.incompatible=true}var j=[];for(var k in h.options){var l=h.options[k];j.push({label:l[0],value:l[1]})}var m=g.Select;switch(h.display){case"checkboxes":m=g.Checkbox;break;case"radio":m=g.Radio;break}return new m.View({id:"field-"+h.id,data:j,multiple:h.multiple})},_fieldText:function(h){return new g.Input({id:"field-"+h.id,area:h.area})},_fieldSlider:function(h){h.min=h.min||0;h.max=h.max||100000;var i=1;if(h.type=="float"){i=(h.max-h.min)/10000}return new g.Slider.View({id:"field-"+h.id,min:h.min,max:h.max,step:i})},_fieldHidden:function(h){return new g.Hidden({id:"field-"+h.id})},_fieldBoolean:function(h){return new g.RadioButton.View({id:"field-"+h.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]})}});return{View:f}});
\ 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.
1
0
commit/galaxy-central: jmchilton: Remove stray print statements.
by commits-noreply@bitbucket.org 09 Oct '14
by commits-noreply@bitbucket.org 09 Oct '14
09 Oct '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/d7fb2045f0c5/
Changeset: d7fb2045f0c5
User: jmchilton
Date: 2014-10-09 16:08:15+00:00
Summary: Remove stray print statements.
This should maybe be backported to -stable? If anyone feels strongly that it should I will open a PR.
Affected #: 1 file
diff -r bda732e549b775718e31423c175a2f415f18a7b7 -r d7fb2045f0c5e31cb18b45799ace9bc4cfd15efe lib/galaxy/tools/actions/__init__.py
--- a/lib/galaxy/tools/actions/__init__.py
+++ b/lib/galaxy/tools/actions/__init__.py
@@ -482,10 +482,8 @@
#process change_format tags
if output.change_format:
for change_elem in output.change_format:
- print change_elem
for when_elem in change_elem.findall( 'when' ):
check = when_elem.get( 'input', None )
- print check
if check is not None:
try:
if '$' not in check:
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
0
commit/galaxy-central: natefoo: Update tag latest_2014.10.06 for changeset bde1c35ef8e5
by commits-noreply@bitbucket.org 09 Oct '14
by commits-noreply@bitbucket.org 09 Oct '14
09 Oct '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/ff30da7a2873/
Changeset: ff30da7a2873
Branch: stable
User: natefoo
Date: 2014-10-09 13:00:13+00:00
Summary: Update tag latest_2014.10.06 for changeset bde1c35ef8e5
Affected #: 1 file
diff -r bde1c35ef8e53d0436507c48ed9b08b1dc5b06a3 -r ff30da7a2873416a332b7700eb15e26a1bf3c46e .hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -20,4 +20,4 @@
ca45b78adb4152fc6e7395514d46eba6b7d0b838 release_2014.08.11
548ab24667d6206780237bd807f7d857a484c461 latest_2014.08.11
2092948937ac30ef82f71463a235c66d34987088 release_2014.10.06
-2092948937ac30ef82f71463a235c66d34987088 latest_2014.10.06
+bde1c35ef8e53d0436507c48ed9b08b1dc5b06a3 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
0
commit/galaxy-central: guerler: ToolForm: Highlight first error only
by commits-noreply@bitbucket.org 08 Oct '14
by commits-noreply@bitbucket.org 08 Oct '14
08 Oct '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/bda732e549b7/
Changeset: bda732e549b7
User: guerler
Date: 2014-10-09 03:01:37+00:00
Summary: ToolForm: Highlight first error only
Affected #: 3 files
diff -r 386258341ae7da120bc5421bb62ece96e7c32624 -r bda732e549b775718e31423c175a2f415f18a7b7 client/galaxy/scripts/mvc/tools/tools-jobs.js
--- a/client/galaxy/scripts/mvc/tools/tools-jobs.js
+++ b/client/galaxy/scripts/mvc/tools/tools-jobs.js
@@ -73,17 +73,11 @@
// mark error
input_element.error(message || 'Please verify this parameter.');
-
- // set flag
- if (this.valid) {
- // scroll to first input element
- $(this.app.container).animate({
- scrollTop: input_element.$el.offset().top - 20
- }, 500);
-
- // set error flag
- this.valid = false;
- }
+
+ // scroll to first input element
+ $(this.app.container).animate({
+ scrollTop: input_element.$el.offset().top - 20
+ }, 500);
},
/** Validate job definition
@@ -92,9 +86,6 @@
// get input parameters
var job_inputs = job_def.inputs;
- // validation flag
- this.valid = true;
-
// counter for values declared in batch mode
var n_values = -1;
@@ -111,6 +102,7 @@
// check basic field validation
if (input_def && !input_def.optional && input_field && input_field.validate && !input_field.validate()) {
this._foundError(input_id);
+ return false;
}
// check if input field is in batch mode
@@ -121,6 +113,7 @@
} else {
if (n_values !== n) {
this._foundError(input_id, 'Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>' + n + '</b> selection(s) while a previous field contains <b>' + n_values + '</b>.');
+ return false;
}
}
}
@@ -128,7 +121,7 @@
}
// return validation result
- return this.valid;
+ return true;
},
/** Refreshes the history panel
diff -r 386258341ae7da120bc5421bb62ece96e7c32624 -r bda732e549b775718e31423c175a2f415f18a7b7 static/scripts/mvc/tools/tools-jobs.js
--- a/static/scripts/mvc/tools/tools-jobs.js
+++ b/static/scripts/mvc/tools/tools-jobs.js
@@ -73,17 +73,11 @@
// mark error
input_element.error(message || 'Please verify this parameter.');
-
- // set flag
- if (this.valid) {
- // scroll to first input element
- $(this.app.container).animate({
- scrollTop: input_element.$el.offset().top - 20
- }, 500);
-
- // set error flag
- this.valid = false;
- }
+
+ // scroll to first input element
+ $(this.app.container).animate({
+ scrollTop: input_element.$el.offset().top - 20
+ }, 500);
},
/** Validate job definition
@@ -92,9 +86,6 @@
// get input parameters
var job_inputs = job_def.inputs;
- // validation flag
- this.valid = true;
-
// counter for values declared in batch mode
var n_values = -1;
@@ -111,6 +102,7 @@
// check basic field validation
if (input_def && !input_def.optional && input_field && input_field.validate && !input_field.validate()) {
this._foundError(input_id);
+ return false;
}
// check if input field is in batch mode
@@ -121,6 +113,7 @@
} else {
if (n_values !== n) {
this._foundError(input_id, 'Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>' + n + '</b> selection(s) while a previous field contains <b>' + n_values + '</b>.');
+ return false;
}
}
}
@@ -128,7 +121,7 @@
}
// return validation result
- return this.valid;
+ return true;
},
/** Refreshes the history panel
diff -r 386258341ae7da120bc5421bb62ece96e7c32624 -r bda732e549b775718e31423c175a2f415f18a7b7 static/scripts/packed/mvc/tools/tools-jobs.js
--- a/static/scripts/packed/mvc/tools/tools-jobs.js
+++ b/static/scripts/packed/mvc/tools/tools-jobs.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/tools/tools-template"],function(b,a){return Backbone.Model.extend({initialize:function(d,c){this.app=d;this.options=b.merge(c,this.optionsDefault)},submit:function(){var c=this;var d={tool_id:this.app.options.id,inputs:this.app.tree.finalize()};this.app.reset();if(!this._validation(d)){console.debug("tools-jobs::submit - Submission canceled. Validation failed.");return}console.debug(d);this.app.modal.show({title:"Please wait...",body:"progress",buttons:{Close:function(){c.app.modal.hide()}}});b.request({type:"POST",url:galaxy_config.root+"api/tools",data:d,success:function(e){c.app.modal.hide();c.app.message(a.success(e));c._refreshHdas()},error:function(e,g){c.app.modal.hide();if(e&&e.message&&e.message.data){var h=c.app.tree.matchResponse(e.message.data);for(var f in h){c._foundError(f,h[f])}}else{console.debug(d);console.debug(e)}}})},_foundError:function(c,d){var e=this.app.element_list[c];e.error(d||"Please verify this parameter.");if(this.valid){$(this.app.container).animate({scrollTop:e.$el.offset().top-20},500);this.valid=false}},_validation:function(g){var c=g.inputs;this.valid=true;var k=-1;for(var i in c){var e=c[i];var j=this.app.tree.match(i);var d=this.app.field_list[j];var h=this.app.input_list[j];if(h&&!h.optional&&d&&d.validate&&!d.validate()){this._foundError(j)}if(e.batch){var f=e.values.length;if(k===-1){k=f}else{if(k!==f){this._foundError(j,"Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>"+f+"</b> selection(s) while a previous field contains <b>"+k+"</b>.")}}}}return this.valid},_refreshHdas:function(){if(parent.Galaxy&&parent.Galaxy.currHistoryPanel){parent.Galaxy.currHistoryPanel.refreshContents()}}})});
\ No newline at end of file
+define(["utils/utils","mvc/tools/tools-template"],function(b,a){return Backbone.Model.extend({initialize:function(d,c){this.app=d;this.options=b.merge(c,this.optionsDefault)},submit:function(){var c=this;var d={tool_id:this.app.options.id,inputs:this.app.tree.finalize()};this.app.reset();if(!this._validation(d)){console.debug("tools-jobs::submit - Submission canceled. Validation failed.");return}console.debug(d);this.app.modal.show({title:"Please wait...",body:"progress",buttons:{Close:function(){c.app.modal.hide()}}});b.request({type:"POST",url:galaxy_config.root+"api/tools",data:d,success:function(e){c.app.modal.hide();c.app.message(a.success(e));c._refreshHdas()},error:function(e,g){c.app.modal.hide();if(e&&e.message&&e.message.data){var h=c.app.tree.matchResponse(e.message.data);for(var f in h){c._foundError(f,h[f])}}else{console.debug(d);console.debug(e)}}})},_foundError:function(c,d){var e=this.app.element_list[c];e.error(d||"Please verify this parameter.");$(this.app.container).animate({scrollTop:e.$el.offset().top-20},500)},_validation:function(g){var c=g.inputs;var k=-1;for(var i in c){var e=c[i];var j=this.app.tree.match(i);var d=this.app.field_list[j];var h=this.app.input_list[j];if(h&&!h.optional&&d&&d.validate&&!d.validate()){this._foundError(j);return false}if(e.batch){var f=e.values.length;if(k===-1){k=f}else{if(k!==f){this._foundError(j,"Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>"+f+"</b> selection(s) while a previous field contains <b>"+k+"</b>.");return false}}}}return true},_refreshHdas:function(){if(parent.Galaxy&&parent.Galaxy.currHistoryPanel){parent.Galaxy.currHistoryPanel.refreshContents()}}})});
\ 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.
1
0
commit/galaxy-central: guerler: ToolForm: Fix execute button style
by commits-noreply@bitbucket.org 08 Oct '14
by commits-noreply@bitbucket.org 08 Oct '14
08 Oct '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/386258341ae7/
Changeset: 386258341ae7
User: guerler
Date: 2014-10-09 02:49:39+00:00
Summary: ToolForm: Fix execute button style
Affected #: 6 files
diff -r f08384fff7709c7edb3a3f8b6883bc398f3e78d8 -r 386258341ae7da120bc5421bb62ece96e7c32624 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
@@ -178,10 +178,11 @@
title: '<b>' + self.model.get('name') + '</b> ' + self.model.get('description'),
operations: operations,
buttons: {
- execute: new Ui.ButtonIcon({
+ execute: new Ui.Button({
icon : 'fa-check',
tooltip : 'Execute the tool',
title : 'Execute',
+ cls : 'btn btn-primary',
floating : 'clear',
onclick : function() {
self.job_handler.submit();
diff -r f08384fff7709c7edb3a3f8b6883bc398f3e78d8 -r 386258341ae7da120bc5421bb62ece96e7c32624 client/galaxy/scripts/mvc/ui/ui-misc.js
--- a/client/galaxy/scripts/mvc/ui/ui-misc.js
+++ b/client/galaxy/scripts/mvc/ui/ui-misc.js
@@ -102,7 +102,7 @@
id : null,
title : '',
floating : 'right',
- cls : 'btn btn-default',
+ cls : 'ui-button btn btn-default',
icon : ''
},
@@ -131,7 +131,7 @@
// element
_template: function(options) {
- var str = '<button id="' + options.id + '" type="submit" style="float: ' + options.floating + ';" type="button" class="ui-button ' + options.cls + '">';
+ var str = '<button id="' + options.id + '" type="submit" style="float: ' + options.floating + ';" type="button" class="' + options.cls + '">';
if (options.icon) {
str += '<i class="icon fa ' + options.icon + '"></i> ' ;
}
diff -r f08384fff7709c7edb3a3f8b6883bc398f3e78d8 -r 386258341ae7da120bc5421bb62ece96e7c32624 static/scripts/mvc/tools/tools-form.js
--- a/static/scripts/mvc/tools/tools-form.js
+++ b/static/scripts/mvc/tools/tools-form.js
@@ -178,10 +178,11 @@
title: '<b>' + self.model.get('name') + '</b> ' + self.model.get('description'),
operations: operations,
buttons: {
- execute: new Ui.ButtonIcon({
+ execute: new Ui.Button({
icon : 'fa-check',
tooltip : 'Execute the tool',
title : 'Execute',
+ cls : 'btn btn-primary',
floating : 'clear',
onclick : function() {
self.job_handler.submit();
diff -r f08384fff7709c7edb3a3f8b6883bc398f3e78d8 -r 386258341ae7da120bc5421bb62ece96e7c32624 static/scripts/mvc/ui/ui-misc.js
--- a/static/scripts/mvc/ui/ui-misc.js
+++ b/static/scripts/mvc/ui/ui-misc.js
@@ -102,7 +102,7 @@
id : null,
title : '',
floating : 'right',
- cls : 'btn btn-default',
+ cls : 'ui-button btn btn-default',
icon : ''
},
@@ -131,7 +131,7 @@
// element
_template: function(options) {
- var str = '<button id="' + options.id + '" type="submit" style="float: ' + options.floating + ';" type="button" class="ui-button ' + options.cls + '">';
+ var str = '<button id="' + options.id + '" type="submit" style="float: ' + options.floating + ';" type="button" class="' + options.cls + '">';
if (options.icon) {
str += '<i class="icon fa ' + options.icon + '"></i> ' ;
}
diff -r f08384fff7709c7edb3a3f8b6883bc398f3e78d8 -r 386258341ae7da120bc5421bb62ece96e7c32624 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(["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,l,j,a,f,d,g,k,c,h){var e=Backbone.Model.extend({initialize:function(m){this.url=galaxy_config.root+"api/tools/"+m.id+"?io_details=true"}});var b=Backbone.View.extend({container:"body",initialize:function(n){var m=this;if(parent.Galaxy&&parent.Galaxy.modal){this.modal=parent.Galaxy.modal}else{this.modal=new l.Modal.View()}this.options=n;this.setElement("<div/>");$(this.container).append(this.$el);this.model=new e({id:n.id,job_id:n.job_id});this.tree=new c(this);this.job_handler=new h(this);this.field_list={};this.input_list={};this.element_list={};this.content=new g({history_id:this.options.history_id,success:function(){m._initializeToolForm()}})},message:function(m){$(this.container).empty();$(this.container).append(m)},reset:function(){for(var m in this.element_list){this.element_list[m].reset()}},refresh:function(){this.tree.refresh();for(var m in this.field_list){this.field_list[m].trigger("change")}console.debug("tools-form::refresh() - Recreated data structure. Refresh.")},_initializeToolForm:function(){var n=this;var p=new l.ButtonIcon({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(n.options.biostar_url+"/p/new/post/")}});var q=new l.ButtonIcon({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(n.options.biostar_url+"/t/"+n.options.id+"/")}});var m=new l.ButtonIcon({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",galaxy_config.root+"root?tool_id="+n.options.id)}});var o={button_question:p,button_search:q,button_share:m};if(Galaxy.currUser.get("is_admin")){o.button_download=new l.ButtonIcon({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+n.options.id+"/download"}})}this.model.fetch({error:function(r){console.debug("tools-form::_initializeToolForm() : Attempt to fetch tool model failed.")},success:function(){n.section=new k.View(n,{inputs:n.model.get("inputs"),cls:"ui-table-plain"});if(n.incompatible){n.$el.hide();$("#tool-form-classic").show();return}n.portlet=new i.View({icon:"fa-wrench",title:"<b>"+n.model.get("name")+"</b> "+n.model.get("description"),operations:o,buttons:{execute:new l.ButtonIcon({icon:"fa-check",tooltip:"Execute the tool",title:"Execute",floating:"clear",onclick:function(){n.job_handler.submit()}})}});if(!n.options.biostar_url){p.$el.hide();q.$el.hide()}n.$el.append(n.portlet.$el);if(n.options.help!=""){n.$el.append(d.help(n.options.help))}if(n.options.citations){n.$el.append(d.citations());var r=new j.ToolCitationCollection();r.tool_id=n.options.id;var s=new a.CitationListView({collection:r});s.render();r.fetch()}n.portlet.append(n.section.$el);n.refresh()}})}});return{View:b}});
\ No newline at end of file
+define(["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,l,j,a,f,d,g,k,c,h){var e=Backbone.Model.extend({initialize:function(m){this.url=galaxy_config.root+"api/tools/"+m.id+"?io_details=true"}});var b=Backbone.View.extend({container:"body",initialize:function(n){var m=this;if(parent.Galaxy&&parent.Galaxy.modal){this.modal=parent.Galaxy.modal}else{this.modal=new l.Modal.View()}this.options=n;this.setElement("<div/>");$(this.container).append(this.$el);this.model=new e({id:n.id,job_id:n.job_id});this.tree=new c(this);this.job_handler=new h(this);this.field_list={};this.input_list={};this.element_list={};this.content=new g({history_id:this.options.history_id,success:function(){m._initializeToolForm()}})},message:function(m){$(this.container).empty();$(this.container).append(m)},reset:function(){for(var m in this.element_list){this.element_list[m].reset()}},refresh:function(){this.tree.refresh();for(var m in this.field_list){this.field_list[m].trigger("change")}console.debug("tools-form::refresh() - Recreated data structure. Refresh.")},_initializeToolForm:function(){var n=this;var p=new l.ButtonIcon({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(n.options.biostar_url+"/p/new/post/")}});var q=new l.ButtonIcon({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(n.options.biostar_url+"/t/"+n.options.id+"/")}});var m=new l.ButtonIcon({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",galaxy_config.root+"root?tool_id="+n.options.id)}});var o={button_question:p,button_search:q,button_share:m};if(Galaxy.currUser.get("is_admin")){o.button_download=new l.ButtonIcon({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+n.options.id+"/download"}})}this.model.fetch({error:function(r){console.debug("tools-form::_initializeToolForm() : Attempt to fetch tool model failed.")},success:function(){n.section=new k.View(n,{inputs:n.model.get("inputs"),cls:"ui-table-plain"});if(n.incompatible){n.$el.hide();$("#tool-form-classic").show();return}n.portlet=new i.View({icon:"fa-wrench",title:"<b>"+n.model.get("name")+"</b> "+n.model.get("description"),operations:o,buttons:{execute:new l.Button({icon:"fa-check",tooltip:"Execute the tool",title:"Execute",cls:"btn btn-primary",floating:"clear",onclick:function(){n.job_handler.submit()}})}});if(!n.options.biostar_url){p.$el.hide();q.$el.hide()}n.$el.append(n.portlet.$el);if(n.options.help!=""){n.$el.append(d.help(n.options.help))}if(n.options.citations){n.$el.append(d.citations());var r=new j.ToolCitationCollection();r.tool_id=n.options.id;var s=new a.CitationListView({collection:r});s.render();r.fetch()}n.portlet.append(n.section.$el);n.refresh()}})}});return{View:b}});
\ No newline at end of file
diff -r f08384fff7709c7edb3a3f8b6883bc398f3e78d8 -r 386258341ae7da120bc5421bb62ece96e7c32624 static/scripts/packed/mvc/ui/ui-misc.js
--- a/static/scripts/packed/mvc/ui/ui-misc.js
+++ b/static/scripts/packed/mvc/ui/ui-misc.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/ui/ui-select-default","mvc/ui/ui-slider","mvc/ui/ui-options","mvc/ui/ui-button-menu","mvc/ui/ui-modal"],function(k,b,e,n,p,l){var d=Backbone.View.extend({optionsDefault:{url:"",cls:""},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement(this._template(this.options))},_template:function(q){return'<img class="ui-image '+q.cls+'" src="'+q.url+'"/>'}});var j=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement(this._template(this.options))},title:function(q){this.$el.html(q)},_template:function(q){return'<label class="ui-label '+q.cls+'">'+q.title+"</label>"},value:function(){return options.title}});var c=Backbone.View.extend({optionsDefault:{floating:"right",icon:"",tooltip:"",placement:"bottom",title:"",cls:""},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).tooltip({title:q.tooltip,placement:"bottom"})},_template:function(q){return'<div><span class="fa '+q.icon+'" class="ui-icon"/> '+q.title+"</div>"}});var g=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"btn btn-default",icon:""},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",function(){$(".tooltip").hide();if(q.onclick){q.onclick()}});$(this.el).tooltip({title:q.tooltip,placement:"bottom"})},_template:function(q){var r='<button id="'+q.id+'" type="submit" style="float: '+q.floating+';" type="button" class="ui-button '+q.cls+'">';if(q.icon){r+='<i class="icon fa '+q.icon+'"></i> '}r+=q.title+"</button>";return r}});var h=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"ui-button-icon",icon:"",tooltip:"",onclick:null},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));this.$button=this.$el.find(".button");var q=this;$(this.el).on("click",function(){$(".tooltip").hide();if(r.onclick&&!q.disabled){r.onclick()}});$(this.el).tooltip({title:r.tooltip,placement:"bottom"})},disable:function(){this.$button.addClass("disabled");this.disabled=true},enable:function(){this.$button.removeClass("disabled");this.disabled=false},_template:function(q){var r="";if(q.title){r="width: auto;"}var s='<div id="'+q.id+'" style="float: '+q.floating+"; "+r+'" class="'+q.cls+'">';if(q.title){s+='<div class="button"><i class="icon fa '+q.icon+'"/> <span class="title">'+q.title+"</span></div>"}else{s+='<i class="icon fa '+q.icon+'"/>'}s+="</div>";return s}});var f=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",q.onclick)},_template:function(q){return'<div><a href="javascript:void(0)" class="ui-anchor '+q.cls+'">'+q.title+"</a></div>"}});var m=Backbone.View.extend({optionsDefault:{message:"",status:"info",persistent:false},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement("<div></div>")},update:function(r){this.options=k.merge(r,this.optionsDefault);if(r.message!=""){this.$el.html(this._template(this.options));this.$el.find(".alert").append(r.message);this.$el.fadeIn();if(!r.persistent){var q=this;window.setTimeout(function(){if(q.$el.is(":visible")){q.$el.fadeOut()}else{q.$el.hide()}},3000)}}else{this.$el.fadeOut()}},_template:function(q){return'<div class="ui-message alert alert-'+q.status+'"/>'}});var a=Backbone.View.extend({optionsDefault:{onclick:null,searchword:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));var q=this;if(this.options.onclick){this.$el.on("submit",function(t){var s=q.$el.find("#search");q.options.onclick(s.val())})}},_template:function(q){return'<div class="ui-search"><form onsubmit="return false;"><input id="search" class="form-control input-sm" type="text" name="search" placeholder="Search..." value="'+q.searchword+'"><button type="submit" class="btn search-btn"><i class="fa fa-search"></i></button></form></div>'}});var i=Backbone.View.extend({optionsDefault:{value:"",type:"text",placeholder:"",disabled:false,visible:true,cls:"",area:false},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));if(this.options.disabled){this.$el.prop("disabled",true)}if(!this.options.visible){this.$el.hide()}var q=this;this.$el.on("input",function(){if(q.options.onchange){q.options.onchange(q.$el.val())}})},value:function(q){if(q!==undefined){this.$el.val(q)}return this.$el.val()},_template:function(q){if(q.area){return'<textarea id="'+q.id+'" class="ui-textarea '+q.cls+'"></textarea>'}else{return'<input id="'+q.id+'" type="'+q.type+'" value="'+q.value+'" placeholder="'+q.placeholder+'" class="ui-input '+q.cls+'">'}}});var o=Backbone.View.extend({optionsDefault:{value:""},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement(this._template(this.options))},value:function(q){if(q!==undefined){this.$el.val(q)}return this.$el.val()},_template:function(q){return'<hidden id="'+q.id+'" value="'+q.value+'"/>'}});return{Anchor:f,Button:g,ButtonIcon:h,ButtonMenu:p,Icon:c,Image:d,Input:i,Label:j,Message:m,Modal:l,RadioButton:n.RadioButton,Checkbox:n.Checkbox,Radio:n.Radio,Searchbox:a,Select:b,Hidden:o,Slider:e}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-select-default","mvc/ui/ui-slider","mvc/ui/ui-options","mvc/ui/ui-button-menu","mvc/ui/ui-modal"],function(k,b,e,n,p,l){var d=Backbone.View.extend({optionsDefault:{url:"",cls:""},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement(this._template(this.options))},_template:function(q){return'<img class="ui-image '+q.cls+'" src="'+q.url+'"/>'}});var j=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement(this._template(this.options))},title:function(q){this.$el.html(q)},_template:function(q){return'<label class="ui-label '+q.cls+'">'+q.title+"</label>"},value:function(){return options.title}});var c=Backbone.View.extend({optionsDefault:{floating:"right",icon:"",tooltip:"",placement:"bottom",title:"",cls:""},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).tooltip({title:q.tooltip,placement:"bottom"})},_template:function(q){return'<div><span class="fa '+q.icon+'" class="ui-icon"/> '+q.title+"</div>"}});var g=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"ui-button btn btn-default",icon:""},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",function(){$(".tooltip").hide();if(q.onclick){q.onclick()}});$(this.el).tooltip({title:q.tooltip,placement:"bottom"})},_template:function(q){var r='<button id="'+q.id+'" type="submit" style="float: '+q.floating+';" type="button" class="'+q.cls+'">';if(q.icon){r+='<i class="icon fa '+q.icon+'"></i> '}r+=q.title+"</button>";return r}});var h=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"ui-button-icon",icon:"",tooltip:"",onclick:null},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));this.$button=this.$el.find(".button");var q=this;$(this.el).on("click",function(){$(".tooltip").hide();if(r.onclick&&!q.disabled){r.onclick()}});$(this.el).tooltip({title:r.tooltip,placement:"bottom"})},disable:function(){this.$button.addClass("disabled");this.disabled=true},enable:function(){this.$button.removeClass("disabled");this.disabled=false},_template:function(q){var r="";if(q.title){r="width: auto;"}var s='<div id="'+q.id+'" style="float: '+q.floating+"; "+r+'" class="'+q.cls+'">';if(q.title){s+='<div class="button"><i class="icon fa '+q.icon+'"/> <span class="title">'+q.title+"</span></div>"}else{s+='<i class="icon fa '+q.icon+'"/>'}s+="</div>";return s}});var f=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",q.onclick)},_template:function(q){return'<div><a href="javascript:void(0)" class="ui-anchor '+q.cls+'">'+q.title+"</a></div>"}});var m=Backbone.View.extend({optionsDefault:{message:"",status:"info",persistent:false},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement("<div></div>")},update:function(r){this.options=k.merge(r,this.optionsDefault);if(r.message!=""){this.$el.html(this._template(this.options));this.$el.find(".alert").append(r.message);this.$el.fadeIn();if(!r.persistent){var q=this;window.setTimeout(function(){if(q.$el.is(":visible")){q.$el.fadeOut()}else{q.$el.hide()}},3000)}}else{this.$el.fadeOut()}},_template:function(q){return'<div class="ui-message alert alert-'+q.status+'"/>'}});var a=Backbone.View.extend({optionsDefault:{onclick:null,searchword:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));var q=this;if(this.options.onclick){this.$el.on("submit",function(t){var s=q.$el.find("#search");q.options.onclick(s.val())})}},_template:function(q){return'<div class="ui-search"><form onsubmit="return false;"><input id="search" class="form-control input-sm" type="text" name="search" placeholder="Search..." value="'+q.searchword+'"><button type="submit" class="btn search-btn"><i class="fa fa-search"></i></button></form></div>'}});var i=Backbone.View.extend({optionsDefault:{value:"",type:"text",placeholder:"",disabled:false,visible:true,cls:"",area:false},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));if(this.options.disabled){this.$el.prop("disabled",true)}if(!this.options.visible){this.$el.hide()}var q=this;this.$el.on("input",function(){if(q.options.onchange){q.options.onchange(q.$el.val())}})},value:function(q){if(q!==undefined){this.$el.val(q)}return this.$el.val()},_template:function(q){if(q.area){return'<textarea id="'+q.id+'" class="ui-textarea '+q.cls+'"></textarea>'}else{return'<input id="'+q.id+'" type="'+q.type+'" value="'+q.value+'" placeholder="'+q.placeholder+'" class="ui-input '+q.cls+'">'}}});var o=Backbone.View.extend({optionsDefault:{value:""},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement(this._template(this.options))},value:function(q){if(q!==undefined){this.$el.val(q)}return this.$el.val()},_template:function(q){return'<hidden id="'+q.id+'" value="'+q.value+'"/>'}});return{Anchor:f,Button:g,ButtonIcon:h,ButtonMenu:p,Icon:c,Image:d,Input:i,Label:j,Message:m,Modal:l,RadioButton:n.RadioButton,Checkbox:n.Checkbox,Radio:n.Radio,Searchbox:a,Select:b,Hidden:o,Slider: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.
1
0