Always submit either history_id or new history name through run form

This commit is contained in:
guerler
2016-10-04 22:36:16 -04:00
parent 5a5d770455
commit b595cd3f47
4 changed files with 29 additions and 29 deletions
@@ -224,34 +224,31 @@ define([ 'utils/utils', 'utils/deferred', 'mvc/ui/ui-misc', 'mvc/form/form-view'
/** Render workflow parameters */
_renderHistory: function() {
this.history_form = null;
if ( !this.model.get( 'history_id' ) ) {
this.history_form = new Form({
cls : 'ui-portlet-narrow',
title : '<b>History Options</b>',
inputs : [{
type : 'conditional',
name : 'new_history',
test_param : {
name : 'check',
label : 'Send results to a new history',
type : 'boolean',
value : 'false',
help : ''
},
cases : [{
value : 'true',
inputs : [{
name : 'name',
label : 'History name',
type : 'text',
value : this.model.get( 'name' )
}]
this.history_form = new Form({
cls : 'ui-portlet-narrow',
title : '<b>History Options</b>',
inputs : [{
type : 'conditional',
name : 'new_history',
test_param : {
name : 'check',
label : 'Send results to a new history',
type : 'boolean',
value : 'false',
help : ''
},
cases : [{
value : 'true',
inputs : [{
name : 'name',
label : 'History name',
type : 'text',
value : this.model.get( 'name' )
}]
}]
});
this._append( this.$steps, this.history_form.$el );
}
}]
});
this._append( this.$steps, this.history_form.$el );
},
/** Render step */
@@ -355,8 +352,10 @@ define([ 'utils/utils', 'utils/deferred', 'mvc/ui/ui-misc', 'mvc/form/form-view'
/** Validate and submit workflow */
_submit: function() {
var self = this;
var history_form_data = this.history_form.data.create();
var job_def = {
new_history_name : this.history_form ? this.history_form.data.create()[ 'new_history|name' ] : {},
new_history_name : history_form_data[ 'new_history|name' ] ? history_form_data[ 'new_history|name' ] : null,
history_id : !history_form_data[ 'new_history|name' ] ? this.model.get( 'history_id' ) : null,
replacement_params : this.wp_form ? this.wp_form.data.create() : {},
parameters : {},
// Tool form will submit flat maps for each parameter
+1
View File
@@ -406,6 +406,7 @@ class WorkflowContentsManager(UsesAnnotations):
step_models.append( step_model )
return {
'id' : trans.app.security.encode_id( stored.id ),
'history_id' : trans.app.security.encode_id( trans.history.id ) if trans.history else None,
'name' : stored.name,
'steps' : step_models,
'step_version_changes' : step_version_changes,
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long