Skip to content

Commit

Permalink
Enable labels for all modules, used shared building process
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Feb 21, 2017
1 parent 0f742a6 commit 3a7e6b0
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 21 deletions.
@@ -1,12 +1,11 @@
/** This is the workflow tool form. */
define( [ 'utils/utils', 'mvc/tool/tool-form-base' ],
function( Utils, ToolFormBase ) {
var View = Backbone.View.extend({
define( [ 'utils/utils', 'mvc/form/form-view', 'mvc/tool/tool-form-base' ],
function( Utils, Form, ToolFormBase ) {
var Tool = Backbone.View.extend({
initialize: function( options ) {
var self = this;
this.workflow = options.workflow;
this.node = options.node;
this.setElement( '<div/>' );
if ( this.node ) {
this.post_job_actions = this.node.post_job_actions || {};
Utils.deepeach( options.inputs, function( input ) {
Expand Down Expand Up @@ -64,7 +63,6 @@ define( [ 'utils/utils', 'mvc/tool/tool-form-base' ],
});
},
}));
this.$el.append( this.form.$el );
} else {
Galaxy.emit.debug('tool-form-workflow::initialize()', 'Node not found in workflow.');
}
Expand Down Expand Up @@ -247,7 +245,14 @@ define( [ 'utils/utils', 'mvc/tool/tool-form-base' ],
}
});

var Default = Backbone.View.extend({
initialize: function( options ) {
this.form = new Form( options );
}
});

return {
View: View
Tool: Tool,
Default: Default
};
});
19 changes: 9 additions & 10 deletions client/galaxy/scripts/mvc/workflow/workflow-view.js
Expand Up @@ -6,13 +6,12 @@ define([
'mvc/workflow/workflow-canvas',
'mvc/workflow/workflow-node',
'mvc/workflow/workflow-icons',
'mvc/workflow/workflow-view-form',
'mvc/form/form-view',
'mvc/workflow/workflow-forms',
'mvc/ui/ui-misc',
'utils/async-save-text',
'libs/toastr',
'ui/editable-text'
], function( Utils, Globals, Workflow, WorkflowCanvas, Node, WorkflowIcons, ToolForm, Form, Ui, async_save_text, Toastr ){
], function( Utils, Globals, Workflow, WorkflowCanvas, Node, WorkflowIcons, FormWrappers, Ui, async_save_text, Toastr ){

// Reset tool search to start state.
function reset_tool_search( initValue ) {
Expand Down Expand Up @@ -661,7 +660,7 @@ define([
var $container = $( '#' + cls );
if ( content && $container.find( '#' + id ).length == 0 ) {
var $el = $( '<div id="' + id + '" class="' + cls + '"/>' );
var form = null;
var form_wrapper = null;
content.node = node;
content.workflow = this.workflow;
content.datatypes = this.datatypes;
Expand Down Expand Up @@ -690,10 +689,10 @@ define([
break;
}
}
var input_id = form.data.match( '__label' );
var input_element = form.element_list[ input_id ];
var input_id = form_wrapper.form.data.match( '__label' );
var input_element = form_wrapper.form.element_list[ input_id ];
input_element.model.set( 'error_text', duplicate && 'Duplicate label. Please fix this before saving the workflow.' );
form.trigger( 'change' );
form_wrapper.form.trigger( 'change' );
}
});
content.onchange = function() {
Expand All @@ -712,11 +711,11 @@ define([
});
};
if ( node.type == 'tool' ) {
form = new ToolForm.View( content );
form_wrapper = new FormWrappers.Tool( content );
} else {
form = new Form( content );
form_wrapper = new FormWrappers.Default( content );
}
$el.append( form.$el );
$el.append( form_wrapper.form.$el );
$container.append( $el );
}
$( '.' + cls ).hide();
Expand Down
1 change: 0 additions & 1 deletion static/maps/mvc/workflow/workflow-view-form.js.map

This file was deleted.

0 comments on commit 3a7e6b0

Please sign in to comment.