mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-24 12:13:33 +08:00
ToolForm: Rename public function
This commit is contained in:
@@ -497,14 +497,14 @@ define(['utils/utils', 'utils/deferred', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc',
|
||||
this.tree.finalize();
|
||||
var error_messages = this.tree.matchResponse(options.errors);
|
||||
for (var input_id in error_messages) {
|
||||
this._foundError(input_id, error_messages[input_id], true);
|
||||
this.foundError(input_id, error_messages[input_id], true);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/** Highlight and scroll to error
|
||||
*/
|
||||
_foundError: function (input_id, message, silent) {
|
||||
foundError: function (input_id, message, silent) {
|
||||
// get input field
|
||||
var input_element = this.element_list[input_id];
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ return Backbone.Model.extend({
|
||||
if (response && response.message && response.message.data) {
|
||||
var error_messages = self.app.tree.matchResponse(response.message.data);
|
||||
for (var input_id in error_messages) {
|
||||
self.app._foundError(input_id, error_messages[input_id]);
|
||||
self.app.foundError(input_id, error_messages[input_id]);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
@@ -99,7 +99,7 @@ return Backbone.Model.extend({
|
||||
|
||||
// validate non-optional fields
|
||||
if (!input_def.optional && input_field.validate && !input_field.validate()) {
|
||||
this.app._foundError(input_id);
|
||||
this.app.foundError(input_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ return Backbone.Model.extend({
|
||||
batch_src = src;
|
||||
} else {
|
||||
if (batch_src !== src) {
|
||||
this.app._foundError(input_id, 'Please select either dataset or dataset list fields for all batch mode fields.');
|
||||
this.app.foundError(input_id, 'Please select either dataset or dataset list fields for all batch mode fields.');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -131,7 +131,7 @@ return Backbone.Model.extend({
|
||||
batch_n = n;
|
||||
} else {
|
||||
if (batch_n !== n) {
|
||||
this.app._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>' + batch_n + '</b>.');
|
||||
this.app.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>' + batch_n + '</b>.');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -497,14 +497,14 @@ define(['utils/utils', 'utils/deferred', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc',
|
||||
this.tree.finalize();
|
||||
var error_messages = this.tree.matchResponse(options.errors);
|
||||
for (var input_id in error_messages) {
|
||||
this._foundError(input_id, error_messages[input_id], true);
|
||||
this.foundError(input_id, error_messages[input_id], true);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/** Highlight and scroll to error
|
||||
*/
|
||||
_foundError: function (input_id, message, silent) {
|
||||
foundError: function (input_id, message, silent) {
|
||||
// get input field
|
||||
var input_element = this.element_list[input_id];
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ return Backbone.Model.extend({
|
||||
if (response && response.message && response.message.data) {
|
||||
var error_messages = self.app.tree.matchResponse(response.message.data);
|
||||
for (var input_id in error_messages) {
|
||||
self.app._foundError(input_id, error_messages[input_id]);
|
||||
self.app.foundError(input_id, error_messages[input_id]);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
@@ -99,7 +99,7 @@ return Backbone.Model.extend({
|
||||
|
||||
// validate non-optional fields
|
||||
if (!input_def.optional && input_field.validate && !input_field.validate()) {
|
||||
this.app._foundError(input_id);
|
||||
this.app.foundError(input_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ return Backbone.Model.extend({
|
||||
batch_src = src;
|
||||
} else {
|
||||
if (batch_src !== src) {
|
||||
this.app._foundError(input_id, 'Please select either dataset or dataset list fields for all batch mode fields.');
|
||||
this.app.foundError(input_id, 'Please select either dataset or dataset list fields for all batch mode fields.');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -131,7 +131,7 @@ return Backbone.Model.extend({
|
||||
batch_n = n;
|
||||
} else {
|
||||
if (batch_n !== n) {
|
||||
this.app._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>' + batch_n + '</b>.');
|
||||
this.app.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>' + batch_n + '</b>.');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
define(["utils/utils","mvc/tools/tools-template"],function(b,a){return Backbone.Model.extend({initialize:function(c){this.app=c},submit:function(){var c=this;var d={tool_id:this.app.options.id,tool_version:this.app.options.version,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",closing_events:true,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.reciept(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.app._foundError(f,h[f]);break}}else{console.debug(e);c.app.modal.show({title:"Job submission failed",body:a.error(d),buttons:{Close:function(){c.app.modal.hide()}}})}}})},_validation:function(h){var d=h.inputs;var m=-1;var i=null;for(var k in d){var f=d[k];var l=this.app.tree.match(k);var e=this.app.field_list[l];var j=this.app.input_list[l];if(!l||!j||!e){console.debug("tools-jobs::_validation - Retrieving input objects failed.");continue}if(!j.optional&&e.validate&&!e.validate()){this.app._foundError(l);return false}if(f&&f.batch){var g=f.values.length;var c=null;if(g>0){c=f.values[0]&&f.values[0].src}if(c){if(i===null){i=c}else{if(i!==c){this.app._foundError(l,"Please select either dataset or dataset list fields for all batch mode fields.");return false}}}if(m===-1){m=g}else{if(m!==g){this.app._foundError(l,"Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>"+g+"</b> selection(s) while a previous field contains <b>"+m+"</b>.");return false}}}}return true},_refreshHdas:function(){if(parent.Galaxy&&parent.Galaxy.currHistoryPanel){parent.Galaxy.currHistoryPanel.refreshContents()}}})});
|
||||
define(["utils/utils","mvc/tools/tools-template"],function(b,a){return Backbone.Model.extend({initialize:function(c){this.app=c},submit:function(){var c=this;var d={tool_id:this.app.options.id,tool_version:this.app.options.version,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",closing_events:true,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.reciept(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.app.foundError(f,h[f]);break}}else{console.debug(e);c.app.modal.show({title:"Job submission failed",body:a.error(d),buttons:{Close:function(){c.app.modal.hide()}}})}}})},_validation:function(h){var d=h.inputs;var m=-1;var i=null;for(var k in d){var f=d[k];var l=this.app.tree.match(k);var e=this.app.field_list[l];var j=this.app.input_list[l];if(!l||!j||!e){console.debug("tools-jobs::_validation - Retrieving input objects failed.");continue}if(!j.optional&&e.validate&&!e.validate()){this.app.foundError(l);return false}if(f&&f.batch){var g=f.values.length;var c=null;if(g>0){c=f.values[0]&&f.values[0].src}if(c){if(i===null){i=c}else{if(i!==c){this.app.foundError(l,"Please select either dataset or dataset list fields for all batch mode fields.");return false}}}if(m===-1){m=g}else{if(m!==g){this.app.foundError(l,"Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>"+g+"</b> selection(s) while a previous field contains <b>"+m+"</b>.");return false}}}}return true},_refreshHdas:function(){if(parent.Galaxy&&parent.Galaxy.currHistoryPanel){parent.Galaxy.currHistoryPanel.refreshContents()}}})});
|
||||
Reference in New Issue
Block a user