Remove former populate_state

This commit is contained in:
guerler
2016-02-18 17:41:38 -05:00
parent 580895af1d
commit 7ea4668ff7
19 changed files with 231 additions and 481 deletions
@@ -7,7 +7,7 @@ define(['utils/utils',
'mvc/ui/ui-select-library',
'mvc/ui/ui-select-ftp',
'mvc/ui/ui-color-picker'],
function(Utils, Ui, SelectContent, SelectLibrary, SelectFtp, ColorPicker) {
function( Utils, Ui, SelectContent, SelectLibrary, SelectFtp, ColorPicker ) {
// create form view
return Backbone.Model.extend({
@@ -31,50 +31,30 @@ define(['utils/utils',
'ftpfile' : '_fieldFtp'
},
// initialize
initialize: function(app, options) {
initialize: function( app, options ) {
this.app = app;
},
/** Returns an input field for a given field type
*/
create: function(input_def) {
// add regular/default value if missing
if (input_def.value === undefined) {
input_def.value = null;
}
if (input_def.default_value === undefined) {
input_def.default_value = input_def.value;
}
// create field wrapper
var field = null;
var fieldClass = this.types[input_def.type];
if (fieldClass && typeof(this[fieldClass]) === 'function') {
field = this[fieldClass].call(this, input_def);
}
// match unavailable field types
if (!field) {
create: function( input_def ) {
var fieldClass = this.types[ input_def.type ];
var field = typeof( this[ fieldClass ] ) === 'function' ? this[ fieldClass ].call( this, input_def ) : null;
if ( !field ) {
this.app.incompatible = true;
if (input_def.options) {
field = this._fieldSelect(input_def);
} else {
field = this._fieldText(input_def);
}
field = input_def.options ? this._fieldSelect( input_def ) : this._fieldText( input_def );
Galaxy.emit.debug('form-parameters::_addRow()', 'Auto matched field type (' + input_def.type + ').');
}
// set initial field value
input_def.value !== undefined && ( field.value( input_def.value ) );
input_def.value === undefined && ( input_def.value = null );
field.value( input_def.value );
return field;
},
/** Data input field
*/
_fieldData: function(input_def) {
_fieldData: function( input_def ) {
var self = this;
return new SelectContent.View(this.app, {
return new SelectContent.View( this.app, {
id : 'field-' + input_def.id,
extensions : input_def.extensions,
optional : input_def.optional,
@@ -82,37 +62,33 @@ define(['utils/utils',
type : input_def.type,
data : input_def.options,
onchange : function() {
self.app.trigger('change');
self.app.trigger( 'change' );
}
});
},
/** Select/Checkbox/Radio options field
*/
_fieldSelect: function (input_def) {
_fieldSelect: function ( input_def ) {
// show text field e.g. in workflow editor
if( input_def.is_workflow ) {
return this._fieldText( input_def );
}
// customize properties
if (input_def.type == 'data_column') {
if ( input_def.type == 'data_column' ) {
input_def.error_text = 'Missing columns in referenced dataset.'
}
// configure options fields
var options = [];
for (var i in input_def.options) {
var option = input_def.options[i];
options.push({
label: option[0],
value: option[1]
});
}
_.each( input_def.options, function( option ) {
options.push( { label: option[ 0 ], value: option[ 1 ] } );
});
// identify display type
var SelectClass = Ui.Select;
switch (input_def.display) {
switch ( input_def.display ) {
case 'checkboxes':
SelectClass = Ui.Checkbox;
break;
@@ -127,19 +103,18 @@ define(['utils/utils',
id : 'field-' + input_def.id,
data : options,
error_text : input_def.error_text || 'No options available',
optional : input_def.optional && input_def.default_value === null,
multiple : input_def.multiple,
optional : input_def.optional,
searchable : input_def.searchable,
onchange : function() {
self.app.trigger('change');
self.app.trigger( 'change' );
}
});
},
/** Drill down options field
*/
_fieldDrilldown: function (input_def) {
_fieldDrilldown: function ( input_def ) {
// show text field e.g. in workflow editor
if( input_def.is_workflow ) {
return this._fieldText( input_def );
@@ -152,25 +127,25 @@ define(['utils/utils',
data : input_def.options,
display : input_def.display,
onchange : function() {
self.app.trigger('change');
self.app.trigger( 'change' );
}
});
},
/** Text input field
*/
_fieldText: function(input_def) {
_fieldText: function( input_def ) {
// field replaces e.g. a select field
if (input_def.options) {
if ( input_def.options ) {
input_def.area = input_def.multiple;
if (!Utils.validate(input_def.value)) {
if ( !Utils.validate( input_def.value ) ) {
input_def.value = null;
} else {
if ($.isArray(input_def.value)) {
if ( $.isArray( input_def.value ) ) {
var str_value = '';
for (var i in input_def.value) {
str_value += String(input_def.value[i]);
if (!input_def.multiple) {
for ( var i in input_def.value ) {
str_value += String( input_def.value[ i ] );
if ( !input_def.multiple ) {
break;
}
str_value += '\n';
@@ -192,7 +167,7 @@ define(['utils/utils',
/** Slider field
*/
_fieldSlider: function(input_def) {
_fieldSlider: function( input_def ) {
var self = this;
return new Ui.Slider.View({
id : 'field-' + input_def.id,
@@ -201,14 +176,14 @@ define(['utils/utils',
min : input_def.min,
max : input_def.max,
onchange : function() {
self.app.trigger('change');
self.app.trigger( 'change' );
}
});
},
/** Hidden field
*/
_fieldHidden: function(input_def) {
_fieldHidden: function( input_def ) {
return new Ui.Hidden({
id : 'field-' + input_def.id,
info : input_def.info
@@ -217,54 +192,54 @@ define(['utils/utils',
/** Boolean field
*/
_fieldBoolean: function(input_def) {
_fieldBoolean: function( input_def ) {
var self = this;
return new Ui.RadioButton.View({
id : 'field-' + input_def.id,
data : [ { label : 'Yes', value : 'true' },
{ label : 'No', value : 'false' }],
onchange : function() {
self.app.trigger('change');
self.app.trigger( 'change' );
}
});
},
/** Color picker field
*/
_fieldColor: function(input_def) {
_fieldColor: function( input_def ) {
var self = this;
return new ColorPicker({
id : 'field-' + input_def.id,
onchange : function() {
self.app.trigger('change');
self.app.trigger( 'change' );
}
});
},
/** Library dataset field
*/
_fieldLibrary: function(input_def) {
_fieldLibrary: function( input_def ) {
var self = this;
return new SelectLibrary.View({
id : 'field-' + input_def.id,
optional : input_def.optional,
multiple : input_def.multiple,
onchange : function() {
self.app.trigger('change');
self.app.trigger( 'change' );
}
});
},
/** FTP file field
*/
_fieldFtp: function(input_def) {
_fieldFtp: function( input_def ) {
var self = this;
return new SelectFtp.View({
id : 'field-' + input_def.id,
optional : input_def.optional,
multiple : input_def.multiple,
onchange : function() {
self.app.trigger('change');
self.app.trigger( 'change' );
}
});
}
@@ -231,7 +231,6 @@ define(['utils/utils',
name : input_def.name,
label : input_def.label || input_def.name,
value : input_def.value,
default_value : input_def.default_value,
text_value : input_def.text_value || input_def.value,
collapsible_value : input_def.collapsible_value,
collapsible_preview : input_def.collapsible_preview,
+5 -8
View File
@@ -48,15 +48,12 @@ function sanitize(content) {
* usually used for selectable options
* @param{String} value - Value or list to be validated
*/
function validate (value) {
if (!(value instanceof Array)) {
value = [value];
function validate ( value ) {
if ( !( value instanceof Array ) ) {
value = [ value ];
}
if (value.length === 0) {
return false;
}
for (var i in value) {
if (['__null__', '__undefined__', null, undefined].indexOf(value[i]) > -1) {
for( var i in value ) {
if ( [ '__null__', '__undefined__', null, undefined ].indexOf( value[ i ] ) > -1 ) {
return false;
}
}
+138 -344
View File
@@ -1108,7 +1108,7 @@ class Tool( object, Dictifiable ):
else:
input.visit_inputs( "", value[input.name], callback )
def handle_input( self, trans, incoming, history=None, source='html' ):
def handle_input( self, trans, incoming, history=None ):
"""
Process incoming parameters for this tool from the dict `incoming`,
update the tool state (or create if none existed), and either return
@@ -1135,32 +1135,31 @@ class Tool( object, Dictifiable ):
if rerun_remap_job_id and len( expanded_incomings ) > 1:
raise exceptions.MessageException( 'Failure executing tool (cannot create multiple jobs when remapping existing job).' )
# Process incoming data
validation_timer = ExecutionTimer()
all_errors = []
all_params = []
validate_input = self.get_hook( 'validate_input' )
for expanded_incoming in expanded_incomings:
expanded_state = self.new_state( request_context )
# Process incoming data
params = {}
errors = {}
if not self.check_values:
# If `self.check_values` is false we don't do any checking or
# processing on input This is used to pass raw values
# through to/from external sites.
errors = {}
params = expanded_incoming
state_inputs = expanded_incoming
else:
# Update state for all inputs on the current page taking new
# values from `incoming`.
errors = self.populate_state( request_context, self.inputs, expanded_state.inputs, expanded_incoming, source=source )
self._populate_state( request_context, self.inputs, expanded_incoming, params, errors )
# If the tool provides a `validate_input` hook, call it.
validate_input = self.get_hook( 'validate_input' )
if validate_input:
validate_input( trans, errors, expanded_state.inputs, self.inputs )
params = expanded_state.inputs
validate_input( request_context, errors, params, self.inputs )
all_errors.append( errors )
all_params.append( params )
log.debug("Validated and populated state for tool request %s" % validation_timer)
# If there were errors, we stay on the same page and display
# error messages
log.debug( 'Validated and populated state for tool request %s' % validation_timer )
# If there were errors, we stay on the same page and display them
if any( all_errors ):
raise exceptions.MessageException( err_data=all_errors[ 0 ] )
else:
@@ -1175,6 +1174,7 @@ class Tool( object, Dictifiable ):
else:
raise exceptions.MessageException( execution_tracker.execution_errors[ 0 ] )
def handle_single_execution( self, trans, rerun_remap_job_id, params, history, mapping_over_collection, execution_cache=None ):
"""
Return a pair with whether execution is successful as well as either
@@ -1199,6 +1199,7 @@ class Tool( object, Dictifiable ):
message = 'Failure executing tool (invalid data returned from tool execution)'
return False, message
def find_fieldstorage( self, x ):
if isinstance( x, FieldStorage ):
raise InterruptedUpload( None )
@@ -1207,145 +1208,6 @@ class Tool( object, Dictifiable ):
elif isinstance(x, list):
[ self.find_fieldstorage( y ) for y in x ]
def populate_state( self, trans, inputs, state, incoming, source="html", prefix="", context=None ):
errors = dict()
# Push this level onto the context stack
context = ExpressionContext( state, context )
for input in inputs.itervalues():
key = prefix + input.name
if isinstance( input, Repeat ):
group_state = state[input.name]
# Create list of empty errors for each previously existing state
group_errors = [ ]
any_group_errors = False
rep_index = 0
del group_state[:] # Clear prepopulated defaults if repeat.min set.
while True:
rep_name = "%s_%d" % ( key, rep_index )
if not any( [ incoming_key.startswith(rep_name) for incoming_key in incoming.keys() ] ):
break
if rep_index < input.max:
new_state = {}
new_state['__index__'] = rep_index
self.fill_in_new_state( trans, input.inputs, new_state, context )
group_state.append( new_state )
group_errors.append( {} )
rep_errors = self.populate_state( trans,
input.inputs,
new_state,
incoming,
source,
prefix=rep_name + "|",
context=context )
if rep_errors:
any_group_errors = True
group_errors[rep_index].update( rep_errors )
else:
group_errors[-1] = { '__index__': 'Cannot add repeat (max size=%i).' % input.max }
any_group_errors = True
rep_index += 1
if any_group_errors:
errors[ input.name ] = group_errors
elif isinstance( input, Conditional ):
group_state = state[input.name]
group_prefix = "%s|" % ( key )
# Deal with the 'test' element and see if its value changed
if input.value_ref and not input.value_ref_in_group:
# We are referencing an existent parameter, which is not
# part of this group
test_param_key = prefix + input.test_param.name
else:
test_param_key = group_prefix + input.test_param.name
# Get value of test param and determine current case
value, test_param_error = check_param_from_incoming( trans,
group_state,
input.test_param,
incoming,
test_param_key,
context,
source )
if test_param_error:
errors[ input.name ] = [ test_param_error ]
# Store the value of the test element
group_state[ input.test_param.name ] = value
else:
current_case = input.get_current_case( value, trans )
# Current case has changed, throw away old state
group_state = state[input.name] = {}
# TODO: we should try to preserve values if we can
self.fill_in_new_state( trans, input.cases[current_case].inputs, group_state, context )
group_errors = self.populate_state( trans,
input.cases[current_case].inputs,
group_state,
incoming,
source,
prefix=group_prefix,
context=context)
if group_errors:
errors[ input.name ] = group_errors
# Store the current case in a special value
group_state['__current_case__'] = current_case
# Store the value of the test element
group_state[ input.test_param.name ] = value
elif isinstance( input, Section ):
group_state = state[input.name]
group_prefix = "%s|" % ( key )
self.fill_in_new_state( trans, input.inputs, group_state, context )
group_errors = self.populate_state( trans,
input.inputs,
group_state,
incoming,
source,
prefix=group_prefix,
context=context )
if group_errors:
errors[ input.name ] = group_errors
elif isinstance( input, UploadDataset ):
group_state = state[input.name]
group_errors = []
any_group_errors = False
d_type = input.get_datatype( trans, context )
writable_files = d_type.writable_files
# remove extra files
while len( group_state ) > len( writable_files ):
del group_state[-1]
# Add new fileupload as needed
while len( writable_files ) > len( group_state ):
new_state = {}
new_state['__index__'] = len( group_state )
self.fill_in_new_state( trans, input.inputs, new_state, context )
group_state.append( new_state )
if any_group_errors:
group_errors.append( {} )
# Update state
for i, rep_state in enumerate( group_state ):
rep_index = rep_state['__index__']
rep_prefix = "%s_%d|" % ( key, rep_index )
rep_errors = self.populate_state( trans,
input.inputs,
rep_state,
incoming,
source,
prefix=rep_prefix,
context=context)
if rep_errors:
any_group_errors = True
group_errors.append( rep_errors )
else:
group_errors.append( {} )
# Were there *any* errors for any repetition?
if any_group_errors:
errors[input.name] = group_errors
else:
value, error = check_param_from_incoming( trans, state, input, incoming, key, context, source )
if error:
errors[ input.name ] = error
state[ input.name ] = value
return errors
def update_state( self, trans, inputs, state, incoming, source='html', prefix="", context=None,
update_only=False, old_errors={}, item_callback=None ):
@@ -1663,7 +1525,7 @@ class Tool( object, Dictifiable ):
if input.min:
messages[ input.name ] = []
for i in range( input.min ):
rep_prefix = prefix + "%s %d > " % ( input.title, i + 1 )
rep_prefix = prefix + '%s %d > ' % ( input.title, i + 1 )
rep_dict = dict()
messages[ input.name ].append( rep_dict )
self.check_and_update_param_values_helper( input.inputs, {}, trans, rep_dict, context, rep_prefix, update_values=update_values )
@@ -1677,13 +1539,13 @@ class Tool( object, Dictifiable ):
else:
if isinstance( input, Repeat ):
for i, d in enumerate( values[ input.name ] ):
rep_prefix = prefix + "%s %d > " % ( input.title, i + 1 )
rep_prefix = prefix + '%s %d > ' % ( input.title, i + 1 )
self.check_and_update_param_values_helper( input.inputs, d, trans, messages, context, rep_prefix, update_values=update_values )
elif isinstance( input, Conditional ):
group_values = values[ input.name ]
use_initial_value = False
if '__current_case__' in group_values:
if int( group_values['__current_case__'] ) >= len( input.cases ):
if int( group_values[ '__current_case__' ] ) >= len( input.cases ):
use_initial_value = True
else:
use_initial_value = True
@@ -1691,11 +1553,11 @@ class Tool( object, Dictifiable ):
# No test param invalidates the whole conditional
values[ input.name ] = group_values = input.get_initial_value( trans, context )
messages[ input.test_param.name ] = "No value found for '%s%s', using default" % ( prefix, input.test_param.label )
current_case = group_values['__current_case__']
current_case = group_values[ '__current_case__' ]
for child_input in input.cases[current_case].inputs.itervalues():
messages[ child_input.name ] = "Value no longer valid for '%s%s', replacing with default" % ( prefix, child_input.label )
else:
current = group_values["__current_case__"]
current = group_values[ '__current_case__' ]
self.check_and_update_param_values_helper( input.cases[current].inputs, group_values, trans, messages, context, prefix, update_values=update_values )
elif isinstance( input, Section ):
messages[ input.name ] = {}
@@ -1710,14 +1572,14 @@ class Tool( object, Dictifiable ):
else:
# skip check if is workflow parameters
ck_param = True
search = input.type in ["text"]
search = input.type in [ 'text' ]
if trans.workflow_building_mode and contains_workflow_parameter( values[ input.name ], search=search ):
ck_param = False
# this will fail when a parameter's type has changed to a non-compatible one: e.g. conditional group changed to dataset input
if ck_param:
input.value_from_basic( input.value_to_basic( value, self.app ), self.app, ignore_errors=False )
except:
log.info("Parameter validation failed.", exc_info=True)
log.info( "Parameter validation failed.", exc_info=True )
messages[ input.name ] = "Value no longer valid for '%s%s', replacing with default" % ( prefix, input.label )
if update_values:
values[ input.name ] = input.get_initial_value( trans, context )
@@ -2018,7 +1880,7 @@ class Tool( object, Dictifiable ):
# If an admin user, expose the path to the actual tool config XML file.
if trans.user_is_admin():
tool_dict['config_file'] = os.path.abspath(self.config_file)
tool_dict[ 'config_file' ] = os.path.abspath( self.config_file )
# Add link details.
if link_details:
@@ -2042,11 +1904,11 @@ class Tool( object, Dictifiable ):
return tool_dict
def to_json(self, trans, kwd={}, job=None, workflow_mode=False):
def to_json( self, trans, kwd={}, job=None, workflow_mode=False ):
"""
Recursively creates a tool dictionary containing repeats, dynamic options and updated states.
"""
history_id = kwd.get('history_id', None)
history_id = kwd.get( 'history_id', None )
history = None
try:
if history_id is not None:
@@ -2070,7 +1932,7 @@ class Tool( object, Dictifiable ):
self._map_source_to_history( request_context, self.inputs, job_params )
tool_message = self._compare_tool_version( job )
params_to_incoming( kwd, self.inputs, job_params, self.app )
except Exception, e:
except Exception as e:
raise exceptions.MessageException( str( e ) )
# create parameter object
@@ -2116,7 +1978,7 @@ class Tool( object, Dictifiable ):
return None
# ensures that input dictionary is jsonifiable
def sanitize(dict, key='value'):
def sanitize( dict, key='value' ):
# get current value
value = dict[key] if key in dict else None
@@ -2138,142 +2000,52 @@ class Tool( object, Dictifiable ):
# update and return
dict[key] = value
# check the current state of a value and update it if necessary
def check_state( input, value, context ):
error = 'State validation failed.'
if isinstance( value, galaxy.tools.parameters.basic.DummyDataset ):
return [ None, None ]
elif isinstance( value, galaxy.tools.parameters.basic.RuntimeValue ):
return [ { '__class__' : 'RuntimeValue' }, None ]
elif isinstance( value, dict ):
if value.get( '__class__' ) == 'RuntimeValue':
return [ value, None ]
try:
value, error = check_param( request_context, input, value, context, boolean_fix=True )
except Exception, err:
log.error( 'Checking parameter %s failed. %s', input.name, str( err ) )
pass
return [ value, error ]
# populates state with incoming url parameters
def populate_state( inputs, state, errors, incoming, prefix="", context=None ):
context = ExpressionContext(state, context)
for input in inputs.itervalues():
state[input.name] = input.get_initial_value( request_context, context )
key = prefix + input.name
if input.type == 'repeat':
group_state = state[input.name]
rep_index = 0
del group_state[:]
while True:
rep_name = "%s_%d" % (key, rep_index)
if not any([incoming_key.startswith(rep_name) for incoming_key in incoming.keys()]) and rep_index >= input.min:
break
if rep_index < input.max:
new_state = {}
new_state['__index__'] = rep_index
group_state.append(new_state)
populate_state( input.inputs, new_state, errors, incoming, prefix=rep_name + "|", context=context )
rep_index += 1
elif input.type == 'conditional':
group_state = state[input.name]
group_prefix = "%s|" % ( key )
test_param_key = group_prefix + input.test_param.name
default_value = incoming.get(test_param_key, group_state.get(input.test_param.name, None))
value, error = check_state( input.test_param, default_value, context )
if error:
errors[test_param_key] = error
else:
try:
current_case = input.get_current_case( value, request_context )
group_state = state[input.name] = {}
populate_state( input.cases[current_case].inputs, group_state, errors, incoming, prefix=group_prefix, context=context )
group_state['__current_case__'] = current_case
except Exception:
errors[test_param_key] = 'The selected case is unavailable/invalid.'
pass
group_state[input.test_param.name] = value
elif input.type == 'section':
group_state = state[input.name]
group_prefix = "%s|" % ( key )
populate_state( input.inputs, group_state, errors, incoming, prefix=group_prefix, context=context )
else:
default_value = incoming.get(key, state.get(input.name, None))
value, error = check_state( input, default_value, context )
if error:
errors[key] = error
state[input.name] = value
# builds tool model including all attributes
def iterate( group_inputs, inputs, state_inputs, other_values=None ):
# populates model from state
def populate_model( inputs, state_inputs, group_inputs, other_values=None ):
other_values = ExpressionContext( state_inputs, other_values )
for input_index, input in enumerate( inputs.itervalues() ):
tool_dict = None
group_state = state_inputs.get(input.name, {})
group_state = state_inputs.get( input.name, {} )
if input.type == 'repeat':
tool_dict = input.to_dict( request_context )
group_cache = tool_dict['cache'] = {}
group_cache = tool_dict[ 'cache' ] = {}
for i in range( len( group_state ) ):
group_cache[i] = {}
iterate( group_cache[i], input.inputs, group_state[i], other_values )
group_cache[ i ] = {}
populate_model( input.inputs, group_state[ i ], group_cache[ i ], other_values )
elif input.type == 'conditional':
tool_dict = input.to_dict( request_context )
if 'test_param' in tool_dict:
test_param = tool_dict['test_param']
test_param['default_value'] = jsonify( input.test_param.get_initial_value( request_context, other_values ) )
test_param['value'] = jsonify(group_state.get(test_param['name'], test_param['default_value']))
test_param['text_value'] = input.test_param.value_to_display_text(test_param['value'], self.app)
for i in range(len( tool_dict['cases'] ) ):
test_param = tool_dict[ 'test_param' ]
test_param[ 'value' ] = jsonify( group_state.get( test_param[ 'name' ], input.test_param.get_initial_value( request_context, other_values ) ) )
test_param[ 'text_value' ] = input.test_param.value_to_display_text( test_param[ 'value' ], self.app )
for i in range( len( tool_dict['cases'] ) ):
current_state = {}
if i == group_state.get('__current_case__', None):
if i == group_state.get( '__current_case__' ):
current_state = group_state
iterate( tool_dict['cases'][i]['inputs'], input.cases[i].inputs, current_state, other_values )
populate_model( input.cases[ i ].inputs, current_state, tool_dict[ 'cases' ][ i ][ 'inputs' ], other_values )
elif input.type == 'section':
tool_dict = input.to_dict( request_context )
iterate( tool_dict['inputs'], input.inputs, group_state, other_values )
populate_model( tool_dict[ 'inputs' ], input.inputs, group_state, other_values )
else:
# expand input dictionary, resolve dynamic parameters
try:
tool_dict = input.to_dict( request_context, other_values=other_values )
except Exception:
tool_dict = input.to_dict( request_context )
log.exception('tools::to_json() - Skipping parameter expansion for %s.' % input.name)
pass
# backup default value
try:
tool_dict['default_value'] = input.get_initial_value( request_context, other_values )
except Exception:
tool_dict['default_value'] = None
log.exception('tools::to_json() - Getting initial value failed %s.' % input.name)
pass
# update input value from tool state
tool_dict['value'] = state_inputs.get(input.name, tool_dict['default_value'])
# add text value
tool_dict = input.to_dict( request_context, other_values=other_values )
tool_dict[ 'value' ] = state_inputs.get( input.name, input.get_initial_value( request_context, other_values ) )
tool_dict[ 'text_value' ] = input.value_to_display_text( tool_dict[ 'value' ], self.app )
sanitize( tool_dict, 'value' )
group_inputs[ input_index ] = tool_dict
# sanitize values
sanitize(tool_dict, 'value')
sanitize(tool_dict, 'default_value')
# backup final input dictionary
group_inputs[input_index] = tool_dict
# sanatization for the final tool state
def sanitize_state(state):
# sanatizes tool state
def sanitize_state( state ):
keys = None
if isinstance(state, dict):
if isinstance( state, dict ):
keys = state
elif isinstance(state, list):
keys = range( len(state) )
elif isinstance( state, list ):
keys = range( len( state ) )
if keys:
for k in keys:
if isinstance(state[k], dict) or isinstance(state[k], list):
sanitize_state(state[k])
if isinstance( state[ k ], dict ) or isinstance( state[ k ], list ):
sanitize_state( state[ k ] )
else:
state[k] = jsonify(state[k])
state[ k ] = jsonify( state[ k ] )
# expand incoming parameters (parameters might trigger multiple tool executions,
# here we select the first execution only in order to resolve dynamic parameters)
@@ -2284,75 +2056,110 @@ class Tool( object, Dictifiable ):
if self.input_translator:
self.input_translator.translate( params )
# initialize and populate tool state
# create tool state
state_inputs = {}
state_errors = {}
populate_state( self.inputs, state_inputs, state_errors, params.__dict__ )
self._populate_state( request_context, self.inputs, params.__dict__, state_inputs, state_errors )
# create basic tool model
# create tool model
tool_model = self.to_dict( request_context )
tool_model['inputs'] = {}
# build tool model and tool state
iterate( tool_model['inputs'], self.inputs, state_inputs, '' )
tool_model[ 'inputs' ] = {}
populate_model( self.inputs, state_inputs, tool_model[ 'inputs' ] )
# sanitize tool state
sanitize_state(state_inputs)
sanitize_state( state_inputs )
# load tool help
# create tool help
tool_help = ''
if self.help:
tool_help = self.help
tool_help = tool_help.render( static_path=url_for( '/static' ), host_url=url_for('/', qualified=True) )
tool_help = self.help.render( static_path=url_for( '/static' ), host_url=url_for( '/', qualified=True ) )
if type( tool_help ) is not unicode:
tool_help = unicode( tool_help, 'utf-8')
tool_help = unicode( tool_help, 'utf-8' )
# check if citations exist
tool_citations = False
if self.citations:
tool_citations = True
# get tool versions
# create tool versions
tool_versions = []
tools = self.app.toolbox.get_loaded_tools_by_lineage(self.id)
tools = self.app.toolbox.get_loaded_tools_by_lineage( self.id )
for t in tools:
if t.version not in tool_versions:
tool_versions.append(t.version)
tool_versions.append( t.version )
# add information with underlying requirements and their versions
tool_requirements = []
if self.requirements:
for requirement in self.requirements:
tool_requirements.append({
'name' : requirement.name,
'version' : requirement.version
})
# add toolshed url
sharable_url = None
if self.tool_shed_repository:
sharable_url = self.tool_shed_repository.get_sharable_url( self.app )
# add additional properties
# update tool model
tool_model.update({
'id' : self.id,
'help' : tool_help,
'citations' : tool_citations,
'citations' : bool( self.citations ),
'biostar_url' : self.app.config.biostar_url,
'sharable_url' : sharable_url,
'sharable_url' : self.tool_shed_repository.get_sharable_url( self.app ) if self.tool_shed_repository else None,
'message' : tool_message,
'versions' : tool_versions,
'requirements' : tool_requirements,
'requirements' : [ { 'name' : r.name, 'version' : r.version } for r in self.requirements ],
'errors' : state_errors,
'state_inputs' : state_inputs,
'job_id' : trans.security.encode_id( job.id ) if job else None,
'job_remap' : self._get_job_remap( job ),
'history_id' : trans.security.encode_id( history.id )
})
# return enriched tool model
return tool_model
# populates state from incoming parameters
def _populate_state( self, request_context, inputs, incoming, state, errors, prefix='', context=None ):
context = ExpressionContext( state, context )
for input in inputs.itervalues():
state[ input.name ] = input.get_initial_value( request_context, context )
key = prefix + input.name
group_state = state[ input.name ]
group_prefix = '%s|' % ( key )
if input.type == 'repeat':
rep_index = 0
del group_state[:]
while True:
rep_prefix = '%s_%d' % ( key, rep_index )
if not any( [ incoming_key.startswith( rep_prefix ) for incoming_key in incoming.keys() ] ) and rep_index >= input.min:
break
if rep_index < input.max:
new_state = { '__index__' : rep_index }
group_state.append( new_state )
self._populate_state( request_context, input.inputs, incoming, new_state, errors, prefix=rep_prefix + '|', context=context )
rep_index += 1
elif input.type == 'conditional':
test_param_key = group_prefix + input.test_param.name
test_param_value = incoming.get( test_param_key, group_state.get( input.test_param.name ) )
value, error = check_param( request_context, input.test_param, test_param_value, context )
if error:
errors[ test_param_key ] = error
else:
try:
current_case = input.get_current_case( value, request_context )
group_state = state[ input.name ] = {}
self._populate_state( request_context, input.cases[ current_case ].inputs, incoming, group_state, errors, prefix=group_prefix, context=context )
group_state[ '__current_case__' ] = current_case
except Exception:
errors[ test_param_key ] = 'The selected case is unavailable/invalid.'
pass
group_state[ input.test_param.name ] = value
elif input.type == 'section':
self._populate_state( request_context, input.inputs, incoming, group_state, errors, prefix=group_prefix, context=context )
elif input.type == 'upload_dataset':
d_type = input.get_datatype( request_context, context=context )
writable_files = d_type.writable_files
while len( group_state ) > len( writable_files ):
del group_state[ -1 ]
while len( writable_files ) > len( group_state ):
new_state = { '__index__' : len( group_state ) }
for upload_item in input.inputs.itervalues():
new_state[ upload_item.name ] = upload_item.get_initial_value( request_context, context )
group_state.append( new_state )
for i, rep_state in enumerate( group_state ):
rep_index = rep_state[ '__index__' ]
rep_prefix = '%s_%d|' % ( key, rep_index )
self._populate_state( request_context, input.inputs, incoming, rep_state, errors, prefix=rep_prefix, context=context )
else:
param_value = incoming.get( key, state.get( input.name ) )
value, error = check_param( request_context, input, param_value, context )
if error:
errors[ key ] = error
state[ input.name ] = value
def _get_job_remap( self, job):
if job:
if job.state == job.states.ERROR:
@@ -2373,28 +2180,28 @@ class Tool( object, Dictifiable ):
# Create index for hdas.
hda_source_dict = {}
for hda in history.datasets:
key = '%s_%s' % (hda.hid, hda.dataset.id)
key = '%s_%s' % ( hda.hid, hda.dataset.id )
hda_source_dict[ hda.dataset.id ] = hda_source_dict[ key ] = hda
# Ditto for dataset collections.
hdca_source_dict = {}
for hdca in history.dataset_collections:
key = '%s_%s' % (hdca.hid, hdca.collection.id)
key = '%s_%s' % ( hdca.hid, hdca.collection.id )
hdca_source_dict[ hdca.collection.id ] = hdca_source_dict[ key ] = hdca
# Map dataset or collection to current history
def map_to_history(value):
def map_to_history( value ):
id = None
source = None
if isinstance(value, self.app.model.HistoryDatasetAssociation):
if isinstance( value, self.app.model.HistoryDatasetAssociation ):
id = value.dataset.id
source = hda_source_dict
elif isinstance(value, self.app.model.HistoryDatasetCollectionAssociation):
elif isinstance( value, self.app.model.HistoryDatasetCollectionAssociation ):
id = value.collection.id
source = hdca_source_dict
else:
return None
key = '%s_%s' % (value.hid, id)
key = '%s_%s' % ( value.hid, id )
if key in source:
return source[ key ]
elif id in source:
@@ -2442,16 +2249,15 @@ class Tool( object, Dictifiable ):
else:
message += 'You can re-run the job with this tool version, which is a different version of the original tool.'
else:
new_tool_shed_url = tool.tool_shed_repository.get_sharable_url( tool.app ) + '/%s/' % tool.tool_shed_repository.changeset_revision
old_tool_shed = tool_id.split( "/repos/" )[0]
old_tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry( self.app, old_tool_shed )
old_tool_shed_url = old_tool_shed_url + "/view/%s/%s/" % (tool.repository_owner, tool.repository_name)
message = 'This job was run with <a href=\"%s\" target=\"_blank\">tool id \"%s\"</a>, version "%s", which is not available. ' % (old_tool_shed_url, tool_id, tool_version)
new_tool_shed_url = '%s/%s/' % ( tool.tool_shed_repository.get_sharable_url( tool.app ), tool.tool_shed_repository.changeset_revision )
old_tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry( self.app, tool_id.split( '/repos/' )[ 0 ] )
old_tool_shed_url = '%s/view/%s/%s/' % ( old_tool_shed_url, tool.repository_owner, tool.repository_name )
message = 'This job was run with <a href=\"%s\" target=\"_blank\">tool id \"%s\"</a>, version "%s", which is not available. ' % ( old_tool_shed_url, tool_id, tool_version )
if len( tools ) > 1:
message += 'You can re-run the job with the selected <a href=\"%s\" target=\"_blank\">tool id \"%s\"</a> or choose another derivation of the tool.' % (new_tool_shed_url, self.id)
message += 'You can re-run the job with the selected <a href=\"%s\" target=\"_blank\">tool id \"%s\"</a> or choose another derivation of the tool.' % ( new_tool_shed_url, self.id )
else:
message += 'You can re-run the job with <a href=\"%s\" target=\"_blank\">tool id \"%s\"</a>, which is a derivation of the original tool.' % (new_tool_shed_url, self.id)
except Exception, e:
message += 'You can re-run the job with <a href=\"%s\" target=\"_blank\">tool id \"%s\"</a>, which is a derivation of the original tool.' % ( new_tool_shed_url, self.id )
except Exception as e:
raise exceptions.MessageException( str( e ) )
return message
@@ -2787,18 +2593,6 @@ def json_fix( val ):
return val
def check_param_from_incoming( trans, state, input, incoming, key, context, source ):
"""
Unlike "update" state, this preserves default if no incoming value found.
This lets API user specify just a subset of params and allow defaults to be
used when available.
"""
default_input_value = state.get( input.name, None )
incoming_value = get_incoming_value( incoming, key, default_input_value )
value, error = check_param( trans, input, incoming_value, context, source=source )
return value, error
def get_incoming_value( incoming, key, default ):
"""
Fetch value from incoming dict directly or check special nginx upload
+26 -34
View File
@@ -19,47 +19,43 @@ def visit_input_values( inputs, input_values, callback, name_prefix="", label_pr
and a display label.
If the callback returns a value, it will be replace the old value.
FIXME: There is redundancy between this and the visit_inputs methods of
Repeat and Group. This tracks labels and those do not. It would
be nice to unify all the places that recursively visit inputs.
"""
context = ExpressionContext( input_values, context )
for input in inputs.itervalues():
if isinstance( input, Repeat ) or isinstance( input, UploadDataset ):
for i, d in enumerate( input_values[ input.name ] ):
index = d['__index__']
new_name_prefix = name_prefix + "%s_%d|" % ( input.name, index )
new_label_prefix = label_prefix + "%s %d > " % ( input.title, i + 1 )
new_name_prefix = name_prefix + '%s_%d|' % ( input.name, index )
new_label_prefix = label_prefix + '%s %d > ' % ( input.title, i + 1 )
visit_input_values( input.inputs, d, callback, new_name_prefix, new_label_prefix, no_replacement_value=no_replacement_value, context=context, details=details )
elif isinstance( input, Conditional ):
values = input_values[ input.name ]
current = values["__current_case__"]
new_name_prefix = name_prefix + input.name + "|"
current = values[ '__current_case__' ]
new_name_prefix = name_prefix + input.name + '|'
visit_input_values( input.cases[current].inputs, values, callback, new_name_prefix, label_prefix, no_replacement_value=no_replacement_value, context=context, details=details )
elif isinstance( input, Section ):
values = input_values[ input.name ]
new_name_prefix = name_prefix + input.name + "|"
new_name_prefix = name_prefix + input.name + '|'
visit_input_values( input.inputs, values, callback, new_name_prefix, label_prefix, no_replacement_value=no_replacement_value, context=context, details=details )
else:
args = {
'input' : input,
'value' : input_values.get( input.name ),
'prefixed_name' : "%s%s" % ( name_prefix, input.name ),
'prefixed_label' : "%s%s" % ( label_prefix, input.label )
'prefixed_name' : '%s%s' % ( name_prefix, input.name ),
'prefixed_label' : '%s%s' % ( label_prefix, input.label )
}
if details:
args[ 'context' ] = context
new_value = callback( **args )
if no_replacement_value is REPLACE_ON_TRUTHY:
replace = bool(new_value)
replace = bool( new_value )
else:
replace = new_value != no_replacement_value
if replace:
input_values[input.name] = new_value
input_values[ input.name ] = new_value
def check_param( trans, param, incoming_value, param_values, source='html', boolean_fix=False ):
def check_param( trans, param, incoming_value, param_values ):
"""
Check the value of a single parameter `param`. The value in
`incoming_value` is converted from its HTML encoding and validated.
@@ -70,20 +66,16 @@ def check_param( trans, param, incoming_value, param_values, source='html', bool
value = incoming_value
error = None
try:
# resolves the inconsistent definition of boolean parameters (see base.py) without modifying shared code
if boolean_fix and param.type == 'boolean' and isinstance( value, basestring ):
return [ string_as_bool( value ), None ]
if value is not None or isinstance( param, DataToolParameter ) or isinstance( param, DataCollectionToolParameter ):
# Convert value from HTML representation
if source == 'html':
value = param.from_html( value, trans, param_values )
else:
value = param.from_json( value, trans, param_values )
# Then do any further validation on the value
param.validate( value, trans )
elif value is None and isinstance( param, SelectToolParameter ):
# An empty select list or column list
param.validate( value, trans )
if trans.workflow_building_mode:
if isinstance( value, galaxy.tools.parameters.basic.DummyDataset ):
return [ None, None ]
if isinstance( value, galaxy.tools.parameters.basic.RuntimeValue ):
return [ { '__class__' : 'RuntimeValue' }, None ]
if isinstance( value, dict ):
if value.get( '__class__' ) == 'RuntimeValue':
return [ value, None ]
value = param.from_html( value, trans, param_values )
param.validate( value, trans )
except ValueError, e:
error = str( e )
return value, error
@@ -116,7 +108,7 @@ def params_from_strings( params, param_values, app, ignore_errors=False ):
for key, value in param_values.iteritems():
value = json_fix( loads( value ) )
if key in params:
value = params[key].value_from_basic( value, app, ignore_errors )
value = params[ key ].value_from_basic( value, app, ignore_errors )
rval[ key ] = value
return rval
@@ -131,18 +123,18 @@ def params_to_incoming( incoming, inputs, input_values, app, name_prefix="" ):
for input in inputs.itervalues():
if isinstance( input, Repeat ) or isinstance( input, UploadDataset ):
for d in input_values[ input.name ]:
index = d['__index__']
new_name_prefix = name_prefix + "%s_%d|" % ( input.name, index )
index = d[ '__index__' ]
new_name_prefix = name_prefix + '%s_%d|' % ( input.name, index )
params_to_incoming( incoming, input.inputs, d, app, new_name_prefix )
elif isinstance( input, Conditional ):
values = input_values[ input.name ]
current = values["__current_case__"]
new_name_prefix = name_prefix + input.name + "|"
current = values[ '__current_case__' ]
new_name_prefix = name_prefix + input.name + '|'
incoming[ new_name_prefix + input.test_param.name ] = values[ input.test_param.name ]
params_to_incoming( incoming, input.cases[current].inputs, values, app, new_name_prefix )
elif isinstance( input, Section ):
values = input_values[ input.name ]
new_name_prefix = name_prefix + input.name + "|"
new_name_prefix = name_prefix + input.name + '|'
params_to_incoming( incoming, input.inputs, values, app, new_name_prefix )
else:
value = input_values.get( input.name )
-6
View File
@@ -111,9 +111,6 @@ class ToolParameter( object, Dictifiable ):
"""
return value
def from_json( self, value, trans=None, other_values={} ):
return self.from_html( value, trans, other_values )
def get_initial_value( self, trans, other_values ):
"""
Return the starting value of the parameter
@@ -481,9 +478,6 @@ class BooleanToolParameter( ToolParameter ):
return form_builder.CheckboxField( self.name, checked, refresh_on_change=self.refresh_on_change )
def from_html( self, value, trans=None, other_values={} ):
return form_builder.CheckboxField.is_checked( value )
def from_json( self, value, trans=None, other_values={} ):
return string_as_bool( value )
def to_python( self, value, app ):
+1 -1
View File
@@ -255,7 +255,7 @@ class ToolsController( BaseAPIController, UsesVisualizationMixin ):
# TODO: handle dbkeys
params = util.Params( inputs, sanitize=False )
incoming = params.__dict__
vars = tool.handle_input( trans, incoming, history=target_history, source='json' )
vars = tool.handle_input( trans, incoming, history=target_history )
# TODO: check for errors and ensure that output dataset(s) are available.
output_datasets = vars.get( 'out_data', [] )
+8 -8
View File
@@ -163,7 +163,7 @@ class WorkflowModule( object ):
"""
raise TypeError( "Abstract method" )
def compute_runtime_state( self, trans, step_updates=None, source="html" ):
def compute_runtime_state( self, trans, step_updates=None ):
""" Determine the runtime state (potentially different from self.state
which describes configuration state). This (again unlike self.state) is
currently always a `DefaultToolState` object.
@@ -278,7 +278,7 @@ class SimpleWorkflowModule( WorkflowModule ):
errors[ name ] = error
return errors
def compute_runtime_state( self, trans, step_updates=None, source="html" ):
def compute_runtime_state( self, trans, step_updates=None ):
if step_updates and "tool_state" in step_updates:
# Fix this for multiple inputs
state = self.decode_runtime_state( trans, step_updates.pop( "tool_state" ) )
@@ -441,7 +441,7 @@ class SubWorkflowModule( WorkflowModule ):
errors[ name ] = error
return errors
def compute_runtime_state( self, trans, step_updates=None, source="html" ):
def compute_runtime_state( self, trans, step_updates=None ):
state = self.get_runtime_state()
step_errors = {}
return state, step_errors
@@ -1084,7 +1084,7 @@ class ToolModule( WorkflowModule ):
inputs = self.state.inputs
return self.tool.check_and_update_param_values( inputs, self.trans, workflow_building_mode=True )
def compute_runtime_state( self, trans, step_updates=None, source="html" ):
def compute_runtime_state( self, trans, step_updates=None ):
# Warning: This method destructively modifies existing step state.
step_errors = None
state = self.state
@@ -1097,7 +1097,7 @@ class ToolModule( WorkflowModule ):
# Update the state
self.runtime_post_job_actions = step_updates.get(RUNTIME_POST_JOB_ACTIONS_KEY, {})
step_errors = tool.update_state( trans, tool.inputs, state.inputs, step_updates,
update_only=True, old_errors=old_errors, source=source )
update_only=True, old_errors=old_errors )
step_metadata_runtime_state = self.__step_meta_runtime_state()
if step_metadata_runtime_state:
state.inputs[ RUNTIME_STEP_META_STATE_KEY ] = step_metadata_runtime_state
@@ -1385,7 +1385,7 @@ class WorkflowModuleInjector(object):
self.trans = trans
self.allow_tool_state_corrections = allow_tool_state_corrections
def inject( self, step, step_args=None, source="html" ):
def inject( self, step, step_args=None ):
""" Pre-condition: `step` is an ORM object coming from the database, if
supplied `step_args` is the representation of the inputs for that step
supplied via web form.
@@ -1421,7 +1421,7 @@ class WorkflowModuleInjector(object):
# are not persisted so we need to do it every time)
module.add_dummy_datasets( connections=step.input_connections )
state, step_errors = module.compute_runtime_state( trans, step_args, source=source )
state, step_errors = module.compute_runtime_state( trans, step_args )
step.state = state
@@ -1440,7 +1440,7 @@ def populate_module_and_state( trans, workflow, param_map, allow_tool_state_corr
module_injector = WorkflowModuleInjector( trans, allow_tool_state_corrections )
for step in workflow.steps:
step_args = param_map.get( step.id, {} )
step_errors = module_injector.inject( step, step_args=step_args, source="json" )
step_errors = module_injector.inject( step, step_args=step_args )
if step.type == 'tool' or step.type is None:
if step_errors:
message = "Workflow cannot be run because of validation errors in some steps: %s" % step_errors
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"form-parameters.js","sources":["../../../src/mvc/form/form-parameters.js"],"names":["define","Utils","Ui","SelectContent","SelectLibrary","SelectFtp","ColorPicker","Backbone","Model","extend","types","text","select","data_column","genomebuild","data","data_collection","integer","float","boolean","drill_down","color","hidden","hidden_data","baseurl","library_data","ftpfile","initialize","app","this","create","input_def","undefined","value","default_value","field","fieldClass","type","call","incompatible","options","_fieldSelect","_fieldText","Galaxy","emit","debug","_fieldData","self","View","id","extensions","optional","multiple","onchange","trigger","is_workflow","error_text","i","option","push","label","SelectClass","Select","display","Checkbox","Radio","searchable","_fieldDrilldown","Drilldown","area","validate","$","isArray","str_value","String","Input","new_value","_fieldSlider","Slider","precise","min","max","_fieldHidden","Hidden","info","_fieldBoolean","RadioButton","_fieldColor","_fieldLibrary","_fieldFtp"],"mappings":"AAGAA,QAAQ,cACA,iBACA,+BACA,2BACA,uBACA,0BACJ,SAASC,EAAOC,EAAIC,EAAeC,EAAeC,EAAWC,GAG7D,MAAOC,UAASC,MAAMC,QAElBC,OACIC,KAAsB,aACtBC,OAAsB,eACtBC,YAAsB,eACtBC,YAAsB,eACtBC,KAAsB,aACtBC,gBAAsB,aACtBC,QAAsB,eACtBC,QAAsB,eACtBC,UAAsB,gB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AAO,IAAI3B,GAAG4E,OAAO9B,MACjBC,GAAc,SAAWlB,EAAUkB,GACnC8B,QAAgC,SAAlBhD,EAAUM,KACxBkB,YAAcxB,EAAUwB,YACxByB,IAAcjD,EAAUiD,IACxBC,IAAclD,EAAUkD,IACxB5B,SAAc,WACVN,EAAKnB,IAAI0B,QAAQ,cAO7B4B,aAAc,SAASnD,GACnB,MAAO,IAAI7B,GAAGiF,QACVlC,GAAc,SAAWlB,EAAUkB,GACnCmC,KAAcrD,EAAUqD,QAMhCC,cAAe,SAAStD,GACpB,GAAIgB,GAAOlB,IACX,OAAO,IAAI3B,GAAGoF,YAAYtC,MACtBC,GAAc,SAAWlB,EAAUkB,GACnClC,OAAkB6C,MAAQ,MAAO3B,MAAQ,SACvB2B,MAAQ,KAAO3B,MAAQ,UACzCoB,SAAc,WACVN,EAAKnB,IAAI0B,QAAQ,cAO7BiC,YAAa,SAASxD,GAClB,GAAIgB,GAAOlB,IACX,OAAO,IAAIvB,IACP2C,GAAc,SAAWlB,EAAUkB,GACnCI,SAAc,WACVN,EAAKnB,IAAI0B,QAAQ,cAO7BkC,cAAe,SAASzD,GACpB,GAAIgB,GAAOlB,IACX,OAAO,IAAIzB,GAAc4C,MACrBC,GAAc,SAAWlB,EAAUkB,GACnCE,SAAcpB,EAAUoB,SACxBC,SAAcrB,EAAUqB,SACxBC,SAAc,WACVN,EAAKnB,IAAI0B,QAAQ,cAO7BmC,UAAW,SAAS1D,GAChB,GAAIgB,GAAOlB,IACX,OAAO,IAAIxB,GAAU2C,MACjBC,GAAc,SAAWlB,EAAUkB,GACnCE,SAAcpB,EAAUoB,SACxBC,SAAcrB,EAAUqB,SACxBC,SAAc,WACVN,EAAKnB,IAAI0B,QAAQ"}
{"version":3,"file":"form-parameters.js","sources":["../../../src/mvc/form/form-parameters.js"],"names":["define","Utils","Ui","SelectContent","SelectLibrary","SelectFtp","ColorPicker","Backbone","Model","extend","types","text","select","data_column","genomebuild","data","data_collection","integer","float","boolean","drill_down","color","hidden","hidden_data","baseurl","library_data","ftpfile","initialize","app","this","create","input_def","fieldClass","type","field","call","incompatible","options","_fieldSelect","_fieldText","Galaxy","emit","debug","undefined","value","_fieldData","self","View","id","extensions","optional","multiple","onchange","trigger","is_workflow","error_text","_","each","option","push","label","SelectClass","Select","display","Checkbox","Radio","searchable","_fieldDrilldown","Drilldown","area","validate","$","isArray","str_value","i","String","Input","new_value","_fieldSlider","Slider","precise","min","max","_fieldHidden","Hidden","info","_fieldBoolean","RadioButton","_fieldColor","_fieldLibrary","_fieldFtp"],"mappings":"AAGAA,QAAQ,cACA,iBACA,+BACA,2BACA,uBACA,0BACJ,SAAUC,EAAOC,EAAIC,EAAeC,EAAeC,EAAWC,GAG9D,MAAOC,UAASC,MAAMC,QAElBC,OACIC,KAAsB,aACtBC,OAAsB,eACtBC,YAAsB,eACtBC,YAAsB,eACtBC,KAAsB,aACtBC,gBAAsB,aACtBC,QAAsB,eACtBC,QAAsB,eACtBC,UAAsB,gBACtBC,WAAsB,kBACtBC,MAAsB,cACtBC,OAAsB,eACtBC,YAAsB,eACtBC,QAAsB,eACtBC,aAAsB,gBACtBC,QAAsB,aAG1BC,WAAY,SAAUC,GAClBC,KAAKD,IAAMA,GAKfE,OAAQ,SAAUC,GACd,GAAIC,GAAaH,KAAKnB,MAAOqB,EAAUE,MACnCC,EAAyC,kBAAzBL,MAAMG,GAAgCH,KAAMG,GAAaG,KAAMN,KAAME,GAAc,IAQvG,OAPMG,KACFL,KAAKD,IAAIQ,cAAe,EACxBF,EAAQH,EAAUM,QAAUR,KAAKS,aAAcP,GAAcF,KAAKU,WAAYR,GAC9ES,OAAOC,KAAKC,MAAM,6BAA8B,4BAA8BX,EAAUE,KAAO,OAE/EU,SAApBZ,EAAUa,QAAyBb,EAAUa,MAAQ,MACrDV,EAAMU,MAAOb,EAAUa,OAChBV,GAKXW,WAAY,SAAUd,GAClB,GAAIe,GAAOjB,IACX,OAAO,IAAI1B,GAAc4C,KAAMlB,KAAKD,K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mB,SACxBC,SAAcpB,EAAUoB,SACxBC,SAAc,WACVN,EAAKlB,IAAIyB,QAAS,cAO9BqC,UAAW,SAAU3D,GACjB,GAAIe,GAAOjB,IACX,OAAO,IAAIxB,GAAU0C,MACjBC,GAAc,SAAWjB,EAAUiB,GACnCE,SAAcnB,EAAUmB,SACxBC,SAAcpB,EAAUoB,SACxBC,SAAc,WACVN,EAAKlB,IAAIyB,QAAS"}
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"form-section.js","sources":["../../../src/mvc/form/form-section.js"],"names":["define","Utils","Table","Ui","Portlet","Repeat","InputElement","Parameters","View","Backbone","extend","initialize","app","options","this","inputs","cls","cls_tr","table","parameters","setElement","$el","render","delAll","i","add","input","input_def","jQuery","id","uid","input_list","type","_addConditional","_addRepeat","_addSection","_addRow","self","test_param","sustain_conditionals","disabled","field","onchange","value","selectedCase","data","matchCase","cases","case_def","section_id","section_row","get","nonhidden","j","hidden","fadeIn","hide","trigger","sub_section_id","sub_section","addClass","append","create","block_index","repeat","ondel","del","title","title_new","min","max","onnew","n_cache","_","size","cache","Math","default","sustain_repeats","hideOptions","input_element","label","name","help","button_visible","ButtonIcon","icon","tooltip","portlet","collapsible","collapsed","operations","$","html","setOperation","expand","collapse","on","setIcon","input_id","length","expanded","field_list","default_value","text_value","collapsible_value","collapsible_preview","argument","element_list"],"mappings":"AAGAA,QAAQ,cACA,kBACA,iBACA,oBACA,uBACA,sBACA,4BACJ,SAASC,EAAOC,EAAOC,EAAIC,EAASC,EAAQC,EAAcC,GAC1D,GAAIC,GAAOC,SAASD,KAAKE,QACrBC,WAAY,SAASC,EAAKC,GACtBC,KAAKF,IAAMA,EACXE,KAAKC,OAASF,EAAQE,OAGtBF,EAAQG,IAAM,iBAIdH,EAAQI,OAAS,cAGjBH,KAAKI,MAAQ,GAAIhB,GAAMM,KAAKK,GAC5BC,KAAKK,WAAa,GAAIZ,GAAWK,EAAKC,GACtCC,KAAKM,WAAWN,KAAKI,MAAMG,KAC3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3B,MAAKF,IAAIgG,aAAa/E,GAAMmD,EAC5BlE,KAAKI,MAAMO,IAAIuD,EAAc3D,KAC7BP,KAAKI,MAAM2C,OAAOhC,GAClBF,EAAU2B,QAAUxC,KAAKI,MAAMiC,IAAItB,GAAI2B,OAChCf,IAIf,QACIjC,KAAMA"}
{"version":3,"file":"form-section.js","sources":["../../../src/mvc/form/form-section.js"],"names":["define","Utils","Table","Ui","Portlet","Repeat","InputElement","Parameters","View","Backbone","extend","initialize","app","options","this","inputs","cls","cls_tr","table","parameters","setElement","$el","render","delAll","i","add","input","input_def","jQuery","id","uid","input_list","type","_addConditional","_addRepeat","_addSection","_addRow","self","test_param","sustain_conditionals","disabled","field","onchange","value","selectedCase","data","matchCase","cases","case_def","section_id","section_row","get","nonhidden","j","hidden","fadeIn","hide","trigger","sub_section_id","sub_section","addClass","append","create","block_index","repeat","ondel","del","title","title_new","min","max","onnew","n_cache","_","size","cache","Math","default","sustain_repeats","hideOptions","input_element","label","name","help","button_visible","ButtonIcon","icon","tooltip","portlet","collapsible","collapsed","operations","$","html","setOperation","expand","collapse","on","setIcon","input_id","length","expanded","field_list","text_value","collapsible_value","collapsible_preview","argument","element_list"],"mappings":"AAGAA,QAAQ,cACA,kBACA,iBACA,oBACA,uBACA,sBACA,4BACJ,SAASC,EAAOC,EAAOC,EAAIC,EAASC,EAAQC,EAAcC,GAC1D,GAAIC,GAAOC,SAASD,KAAKE,QACrBC,WAAY,SAASC,EAAKC,GACtBC,KAAKF,IAAMA,EACXE,KAAKC,OAASF,EAAQE,OAGtBF,EAAQG,IAAM,iBAIdH,EAAQI,OAAS,cAGjBH,KAAKI,MAAQ,GAAIhB,GAAMM,KAAKK,GAC5BC,KAAKK,WAAa,GAAIZ,GAAWK,EAAKC,GACtCC,KAAKM,WAAWN,KAAKI,MAAMG,KAC3BP,KAAKQ,UAKTA,OAAQ,WACJR,KAAKI,MAAMK,QACX,KAAK,GAAIC,KAAKV,MAAKC,OACfD,KAAKW,IAAIX,K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AUxC,KAAKI,MAAMiC,IAAItB,GAAI2B,OAChCf,IAIf,QACIjC,KAAMA"}
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"utils.js","sources":["../../src/utils/utils.js"],"names":["define","iframe","src","deepeach","dict","callback","i","d","_","isObject","new_dict","isJSON","text","test","replace","sanitize","content","$","html","validate","value","Array","length","undefined","indexOf","textify","lst","toString","pos","lastIndexOf","substr","get","options","top","__utils__get__","cache","url","success","console","debug","request","data","response","error","ajaxConfig","contentType","type","isEmptyObject","param","dataType","JSON","stringify","ajax","done","jQuery","parseJSON","e","fail","response_text","responseText","always","complete","cssGetAttribute","classname","name","el","appendTo","css","remove","cssLoadFile","Galaxy","root","merge","optionsDefault","defaults","roundToDecimalPlaces","number","numPlaces","placesMultiplier","Math","round","bytesToString","size","normal_font","numberPlaces","unit","tb","gb","mb","kb","rounded","uid","__utils__uid__","time","Date","hours","getHours","minutes","getMinutes","datetime","getDate","getMonth","getFullYear"],"mappings":"AAMAA,UAAW,WAIX,QAASC,GAAQC,GACb,MAAO,gBAAkBA,EAAM,yDAKnC,QAASC,GAAUC,EAAMC,GACrB,IAAK,GAAIC,KAAKF,GAAO,CACjB,GAAIG,GAAIH,EAAME,EACd,IAAIE,EAAEC,SAAUF,GAAM,CAClB,GAAIG,GAAWL,EAAUE,EACzBG,KAAcN,EAAME,GAAMI,GAC1BP,EAAUI,EAAGF,KASzB,QAASM,GAAOC,GACZ,MAAO,gBAAgBC,KAAKD,EAAKE,QAAQ,mBAAoB,KACzDA,QAAQ,mEAAoE,KAC5EA,QAAQ,uBAAwB,KAOxC,QAASC,GAASC,GACd,MAAOC,GAAE,UAAUL,KAAKI,GAASE,OAQrC,QAASC,GAAUC,GAIf,GAHMA,YAAiBC,SACnBD,GAASA,IAEQ,IAAjBA,EAAME,OACN,OAAO,CAEX,KAAK,GAAIhB,KAAKc,GACV,IAAK,WAAY,gBAAiB,KAAMG,QAAWC,QAAQJ,EAAMd,IAAM,GACnE,OAAO,CAGf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,WAAaK,EAAU,aAAeL,EAOrD,QAASM,KAEL,MADA1D,KAAI2D,eAAiB3D,IAAI2D,gBAAkB,EACpC,OAAS3D,IAAI2D,iBAMxB,QAASC,KACL,GAAItF,GAAI,GAAIuF,MACRC,GAASxF,EAAEyF,WAAa,GAAK,IAAM,IAAMzF,EAAEyF,WAC3CC,GAAW1F,EAAE2F,aAAe,GAAK,IAAM,IAAM3F,EAAE2F,YACnD,OAAOC,UAAW5F,EAAE6F,UAAY,KACjB7F,EAAE8F,WAAa,GAAM,IACtB9F,EAAE+F,cAAgB,KAClBP,EAAQ,IACRE,EA/ClB,GAAIR,GAAK,KACLD,EAAKC,EAAKA,EACVF,EAAKC,EAAKC,EACVH,EAAKC,EAAKE,CA+Cd,QACIpB,YAAaA,EACbP,gBAAiBA,EACjB/B,IAAKA,EACLyC,MAAOA,EACPvE,OAAQA,EACRgF,cAAeA,EACfU,IAAKA,EACLE,KAAMA,EACNrD,QAASA,EACTzB,SAAUA,EACVU,QAASA,EACTN,SAAUA,EACVhB,SAAUA,EACVQ,OAAQA"}
{"version":3,"file":"utils.js","sources":["../../src/utils/utils.js"],"names":["define","iframe","src","deepeach","dict","callback","i","d","_","isObject","new_dict","isJSON","text","test","replace","sanitize","content","$","html","validate","value","Array","undefined","indexOf","textify","lst","toString","pos","lastIndexOf","substr","get","options","top","__utils__get__","cache","url","success","console","debug","request","data","response","error","ajaxConfig","contentType","type","isEmptyObject","param","dataType","JSON","stringify","ajax","done","jQuery","parseJSON","e","fail","response_text","responseText","always","complete","cssGetAttribute","classname","name","el","appendTo","css","remove","cssLoadFile","length","Galaxy","root","merge","optionsDefault","defaults","roundToDecimalPlaces","number","numPlaces","placesMultiplier","Math","round","bytesToString","size","normal_font","numberPlaces","unit","tb","gb","mb","kb","rounded","uid","__utils__uid__","time","Date","hours","getHours","minutes","getMinutes","datetime","getDate","getMonth","getFullYear"],"mappings":"AAMAA,UAAW,WAIX,QAASC,GAAQC,GACb,MAAO,gBAAkBA,EA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AKuE,EAAFvE,EAAaA,IACvBwE,GAAoB,EAExB,OAAOC,MAAKC,MAAOJ,EAASE,GAAqBA,EAarD,QAASG,GAAeC,EAAMC,EAAaC,GACvCA,EAAgC9D,SAAjB8D,EAA4BA,EAAc,CAEzD,IAAIC,GAAO,EACX,IAAIH,GAAQI,EAAKJ,GAAcI,EAAID,EAAO,SAC1C,IAAIH,GAAQK,EAAKL,GAAcK,EAAIF,EAAO,SAC1C,IAAIH,GAAQM,EAAKN,GAAcM,EAAIH,EAAO,SAC1C,IAAIH,GAAQO,EAAKP,GAAcO,EAAIJ,EAAO,SAC1C,CAAA,KAAIH,EAAQ,GACL,MAAOC,GAAa,MAAO,oBADlBE,GAAO,IAGvB,GAAIK,GAAkB,KAARL,EAAaH,EAAMP,EAAsBO,EAAME,EAC7D,OAAID,GACOO,EAAU,IAAML,EAEhB,WAAaK,EAAU,aAAeL,EAOrD,QAASM,KAEL,MADA3D,KAAI4D,eAAiB5D,IAAI4D,gBAAkB,EACpC,OAAS5D,IAAI4D,iBAMxB,QAASC,KACL,GAAItF,GAAI,GAAIuF,MACRC,GAASxF,EAAEyF,WAAa,GAAK,IAAM,IAAMzF,EAAEyF,WAC3CC,GAAW1F,EAAE2F,aAAe,GAAK,IAAM,IAAM3F,EAAE2F,YACnD,OAAOC,UAAW5F,EAAE6F,UAAY,KACjB7F,EAAE8F,WAAa,GAAM,IACtB9F,EAAE+F,cAAgB,KAClBP,EAAQ,IACRE,EA/ClB,GAAIR,GAAK,KACLD,EAAKC,EAAKA,EACVF,EAAKC,EAAKC,EACVH,EAAKC,EAAKE,CA+Cd,QACIrB,YAAaA,EACbP,gBAAiBA,EACjB/B,IAAKA,EACL0C,MAAOA,EACPvE,OAAQA,EACRgF,cAAeA,EACfU,IAAKA,EACLE,KAAMA,EACNtD,QAASA,EACTxB,SAAUA,EACVS,QAASA,EACTL,SAAUA,EACVhB,SAAUA,EACVQ,OAAQA"}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
define(["utils/utils","mvc/ui/ui-misc","mvc/form/form-select-content","mvc/ui/ui-select-library","mvc/ui/ui-select-ftp","mvc/ui/ui-color-picker"],function(a,b,c,d,e,f){return Backbone.Model.extend({types:{text:"_fieldText",select:"_fieldSelect",data_column:"_fieldSelect",genomebuild:"_fieldSelect",data:"_fieldData",data_collection:"_fieldData",integer:"_fieldSlider","float":"_fieldSlider","boolean":"_fieldBoolean",drill_down:"_fieldDrilldown",color:"_fieldColor",hidden:"_fieldHidden",hidden_data:"_fieldHidden",baseurl:"_fieldHidden",library_data:"_fieldLibrary",ftpfile:"_fieldFtp"},initialize:function(a){this.app=a},create:function(a){void 0===a.value&&(a.value=null),void 0===a.default_value&&(a.default_value=a.value);var b=null,c=this.types[a.type];return c&&"function"==typeof this[c]&&(b=this[c].call(this,a)),b||(this.app.incompatible=!0,b=a.options?this._fieldSelect(a):this._fieldText(a),Galaxy.emit.debug("form-parameters::_addRow()","Auto matched field type ("+a.type+").")),void 0!==a.value&&b.value(a.value),b},_fieldData:function(a){var b=this;return new c.View(this.app,{id:"field-"+a.id,extensions:a.extensions,optional:a.optional,multiple:a.multiple,type:a.type,data:a.options,onchange:function(){b.app.trigger("change")}})},_fieldSelect:function(a){if(a.is_workflow)return this._fieldText(a);"data_column"==a.type&&(a.error_text="Missing columns in referenced dataset.");var c=[];for(var d in a.options){var e=a.options[d];c.push({label:e[0],value:e[1]})}var f=b.Select;switch(a.display){case"checkboxes":f=b.Checkbox;break;case"radio":f=b.Radio}var g=this;return new f.View({id:"field-"+a.id,data:c,error_text:a.error_text||"No options available",optional:a.optional&&null===a.default_value,multiple:a.multiple,optional:a.optional,searchable:a.searchable,onchange:function(){g.app.trigger("change")}})},_fieldDrilldown:function(a){if(a.is_workflow)return this._fieldText(a);var c=this;return new b.Drilldown.View({id:"field-"+a.id,data:a.options,display:a.display,onchange:function(){c.app.trigger("change")}})},_fieldText:function(c){if(c.options)if(c.area=c.multiple,a.validate(c.value)){if($.isArray(c.value)){var d="";for(var e in c.value){if(d+=String(c.value[e]),!c.multiple)break;d+="\n"}c.value=d}}else c.value=null;var f=this;return new b.Input({id:"field-"+c.id,area:c.area,onchange:function(a){c.onchange?c.onchange(a):f.app.trigger("change")}})},_fieldSlider:function(a){var c=this;return new b.Slider.View({id:"field-"+a.id,precise:"float"==a.type,is_workflow:a.is_workflow,min:a.min,max:a.max,onchange:function(){c.app.trigger("change")}})},_fieldHidden:function(a){return new b.Hidden({id:"field-"+a.id,info:a.info})},_fieldBoolean:function(a){var c=this;return new b.RadioButton.View({id:"field-"+a.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:function(){c.app.trigger("change")}})},_fieldColor:function(a){var b=this;return new f({id:"field-"+a.id,onchange:function(){b.app.trigger("change")}})},_fieldLibrary:function(a){var b=this;return new d.View({id:"field-"+a.id,optional:a.optional,multiple:a.multiple,onchange:function(){b.app.trigger("change")}})},_fieldFtp:function(a){var b=this;return new e.View({id:"field-"+a.id,optional:a.optional,multiple:a.multiple,onchange:function(){b.app.trigger("change")}})}})});
define(["utils/utils","mvc/ui/ui-misc","mvc/form/form-select-content","mvc/ui/ui-select-library","mvc/ui/ui-select-ftp","mvc/ui/ui-color-picker"],function(a,b,c,d,e,f){return Backbone.Model.extend({types:{text:"_fieldText",select:"_fieldSelect",data_column:"_fieldSelect",genomebuild:"_fieldSelect",data:"_fieldData",data_collection:"_fieldData",integer:"_fieldSlider","float":"_fieldSlider","boolean":"_fieldBoolean",drill_down:"_fieldDrilldown",color:"_fieldColor",hidden:"_fieldHidden",hidden_data:"_fieldHidden",baseurl:"_fieldHidden",library_data:"_fieldLibrary",ftpfile:"_fieldFtp"},initialize:function(a){this.app=a},create:function(a){var b=this.types[a.type],c="function"==typeof this[b]?this[b].call(this,a):null;return c||(this.app.incompatible=!0,c=a.options?this._fieldSelect(a):this._fieldText(a),Galaxy.emit.debug("form-parameters::_addRow()","Auto matched field type ("+a.type+").")),void 0===a.value&&(a.value=null),c.value(a.value),c},_fieldData:function(a){var b=this;return new c.View(this.app,{id:"field-"+a.id,extensions:a.extensions,optional:a.optional,multiple:a.multiple,type:a.type,data:a.options,onchange:function(){b.app.trigger("change")}})},_fieldSelect:function(a){if(a.is_workflow)return this._fieldText(a);"data_column"==a.type&&(a.error_text="Missing columns in referenced dataset.");var c=[];_.each(a.options,function(a){c.push({label:a[0],value:a[1]})});var d=b.Select;switch(a.display){case"checkboxes":d=b.Checkbox;break;case"radio":d=b.Radio}var e=this;return new d.View({id:"field-"+a.id,data:c,error_text:a.error_text||"No options available",multiple:a.multiple,optional:a.optional,searchable:a.searchable,onchange:function(){e.app.trigger("change")}})},_fieldDrilldown:function(a){if(a.is_workflow)return this._fieldText(a);var c=this;return new b.Drilldown.View({id:"field-"+a.id,data:a.options,display:a.display,onchange:function(){c.app.trigger("change")}})},_fieldText:function(c){if(c.options)if(c.area=c.multiple,a.validate(c.value)){if($.isArray(c.value)){var d="";for(var e in c.value){if(d+=String(c.value[e]),!c.multiple)break;d+="\n"}c.value=d}}else c.value=null;var f=this;return new b.Input({id:"field-"+c.id,area:c.area,onchange:function(a){c.onchange?c.onchange(a):f.app.trigger("change")}})},_fieldSlider:function(a){var c=this;return new b.Slider.View({id:"field-"+a.id,precise:"float"==a.type,is_workflow:a.is_workflow,min:a.min,max:a.max,onchange:function(){c.app.trigger("change")}})},_fieldHidden:function(a){return new b.Hidden({id:"field-"+a.id,info:a.info})},_fieldBoolean:function(a){var c=this;return new b.RadioButton.View({id:"field-"+a.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:function(){c.app.trigger("change")}})},_fieldColor:function(a){var b=this;return new f({id:"field-"+a.id,onchange:function(){b.app.trigger("change")}})},_fieldLibrary:function(a){var b=this;return new d.View({id:"field-"+a.id,optional:a.optional,multiple:a.multiple,onchange:function(){b.app.trigger("change")}})},_fieldFtp:function(a){var b=this;return new e.View({id:"field-"+a.id,optional:a.optional,multiple:a.multiple,onchange:function(){b.app.trigger("change")}})}})});
//# sourceMappingURL=../../../maps/mvc/form/form-parameters.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/ui/ui-portlet","mvc/form/form-repeat","mvc/form/form-input","mvc/form/form-parameters"],function(a,b,c,d,e,f,g){var h=Backbone.View.extend({initialize:function(a,c){this.app=a,this.inputs=c.inputs,c.cls="ui-table-plain",c.cls_tr="section-row",this.table=new b.View(c),this.parameters=new g(a,c),this.setElement(this.table.$el),this.render()},render:function(){this.table.delAll();for(var a in this.inputs)this.add(this.inputs[a])},add:function(b){var c=jQuery.extend(!0,{},b);c.id=b.id=a.uid(),this.app.input_list[c.id]=c;var d=c.type;switch(d){case"conditional":this._addConditional(c);break;case"repeat":this._addRepeat(c);break;case"section":this._addSection(c);break;default:this._addRow(c)}},_addConditional:function(a){var b=this;a.test_param.id=a.id,this.app.options.sustain_conditionals&&(a.test_param.disabled=!0);var c=this._addRow(a.test_param);c.options.onchange=function(c){var d=b.app.data.matchCase(a,c);for(var e in a.cases){var f=a.cases[e],g=a.id+"-section-"+e,h=b.table.get(g),i=!1;for(var j in f.inputs)if(!f.inputs[j].hidden){i=!0;break}e==d&&i?h.fadeIn("fast"):h.hide()}b.app.trigger("change")};for(var d in a.cases){var e=a.id+"-section-"+d,f=new h(this.app,{inputs:a.cases[d].inputs});f.$el.addClass("ui-table-section"),this.table.add(f.$el),this.table.append(e)}c.trigger("change")},_addRepeat:function(a){function b(b){var e=a.id+"-section-"+d++,f=new h(c.app,{inputs:b});g.add({id:e,$el:f.$el,ondel:function(){g.del(e),c.app.trigger("change")}})}for(var c=this,d=0,g=new e.View({title:a.title||"Repeat",title_new:a.title||"",min:a.min,max:a.max,onnew:function(){b(a.inputs),c.app.trigger("change")}}),i=_.size(a.cache),j=0;j<Math.max(Math.max(i,a.min),a.default);j++)b(i>j?a.cache[j]:a.inputs);this.app.options.sustain_repeats&&g.hideOptions();var k=new f(this.app,{label:a.title||a.name,help:a.help,field:g});this.table.add(k.$el),this.table.append(a.id)},_addSection:function(a){var b=this,e=new h(b.app,{inputs:a.inputs}),f=new c.ButtonIcon({icon:"fa-eye-slash",tooltip:"Show/hide section",cls:"ui-button-icon-plain"}),g=new d.View({title:a.title||a.name,cls:"ui-portlet-section",collapsible:!0,collapsed:!0,operations:{button_visible:f}});g.append(e.$el),g.append($("<div/>").addClass("ui-form-info").html(a.help)),g.setOperation("button_visible",function(){g.collapsed?g.expand():g.collapse()}),g.on("expanded",function(){f.setIcon("fa-eye")}),g.on("collapsed",function(){f.setIcon("fa-eye-slash")}),this.app.on("expand",function(a){g.$("#"+a).length>0&&g.expand()}),a.expanded&&g.expand(),this.table.add(g.$el),this.table.append(a.id)},_addRow:function(a){var b=a.id,c=this.parameters.create(a);this.app.field_list[b]=c;var d=new f(this.app,{name:a.name,label:a.label||a.name,value:a.value,default_value:a.default_value,text_value:a.text_value||a.value,collapsible_value:a.collapsible_value,collapsible_preview:a.collapsible_preview,help:a.help,argument:a.argument,disabled:a.disabled,field:c});return this.app.element_list[b]=d,this.table.add(d.$el),this.table.append(b),a.hidden&&this.table.get(b).hide(),c}});return{View:h}});
define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/ui/ui-portlet","mvc/form/form-repeat","mvc/form/form-input","mvc/form/form-parameters"],function(a,b,c,d,e,f,g){var h=Backbone.View.extend({initialize:function(a,c){this.app=a,this.inputs=c.inputs,c.cls="ui-table-plain",c.cls_tr="section-row",this.table=new b.View(c),this.parameters=new g(a,c),this.setElement(this.table.$el),this.render()},render:function(){this.table.delAll();for(var a in this.inputs)this.add(this.inputs[a])},add:function(b){var c=jQuery.extend(!0,{},b);c.id=b.id=a.uid(),this.app.input_list[c.id]=c;var d=c.type;switch(d){case"conditional":this._addConditional(c);break;case"repeat":this._addRepeat(c);break;case"section":this._addSection(c);break;default:this._addRow(c)}},_addConditional:function(a){var b=this;a.test_param.id=a.id,this.app.options.sustain_conditionals&&(a.test_param.disabled=!0);var c=this._addRow(a.test_param);c.options.onchange=function(c){var d=b.app.data.matchCase(a,c);for(var e in a.cases){var f=a.cases[e],g=a.id+"-section-"+e,h=b.table.get(g),i=!1;for(var j in f.inputs)if(!f.inputs[j].hidden){i=!0;break}e==d&&i?h.fadeIn("fast"):h.hide()}b.app.trigger("change")};for(var d in a.cases){var e=a.id+"-section-"+d,f=new h(this.app,{inputs:a.cases[d].inputs});f.$el.addClass("ui-table-section"),this.table.add(f.$el),this.table.append(e)}c.trigger("change")},_addRepeat:function(a){function b(b){var e=a.id+"-section-"+d++,f=new h(c.app,{inputs:b});g.add({id:e,$el:f.$el,ondel:function(){g.del(e),c.app.trigger("change")}})}for(var c=this,d=0,g=new e.View({title:a.title||"Repeat",title_new:a.title||"",min:a.min,max:a.max,onnew:function(){b(a.inputs),c.app.trigger("change")}}),i=_.size(a.cache),j=0;j<Math.max(Math.max(i,a.min),a.default);j++)b(i>j?a.cache[j]:a.inputs);this.app.options.sustain_repeats&&g.hideOptions();var k=new f(this.app,{label:a.title||a.name,help:a.help,field:g});this.table.add(k.$el),this.table.append(a.id)},_addSection:function(a){var b=this,e=new h(b.app,{inputs:a.inputs}),f=new c.ButtonIcon({icon:"fa-eye-slash",tooltip:"Show/hide section",cls:"ui-button-icon-plain"}),g=new d.View({title:a.title||a.name,cls:"ui-portlet-section",collapsible:!0,collapsed:!0,operations:{button_visible:f}});g.append(e.$el),g.append($("<div/>").addClass("ui-form-info").html(a.help)),g.setOperation("button_visible",function(){g.collapsed?g.expand():g.collapse()}),g.on("expanded",function(){f.setIcon("fa-eye")}),g.on("collapsed",function(){f.setIcon("fa-eye-slash")}),this.app.on("expand",function(a){g.$("#"+a).length>0&&g.expand()}),a.expanded&&g.expand(),this.table.add(g.$el),this.table.append(a.id)},_addRow:function(a){var b=a.id,c=this.parameters.create(a);this.app.field_list[b]=c;var d=new f(this.app,{name:a.name,label:a.label||a.name,value:a.value,text_value:a.text_value||a.value,collapsible_value:a.collapsible_value,collapsible_preview:a.collapsible_preview,help:a.help,argument:a.argument,disabled:a.disabled,field:c});return this.app.element_list[b]=d,this.table.add(d.$el),this.table.append(b),a.hidden&&this.table.get(b).hide(),c}});return{View:h}});
//# sourceMappingURL=../../../maps/mvc/form/form-section.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
define([],function(){function a(a){return'<iframe src="'+a+'" frameborder="0" style="width: 100%; height: 100%;"/>'}function b(a,c){for(var d in a){var e=a[d];if(_.isObject(e)){var f=c(e);f&&(a[d]=f),b(e,c)}}}function c(a){return/^[\],:{}\s]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))}function d(a){return $("<div/>").text(a).html()}function e(a){if(a instanceof Array||(a=[a]),0===a.length)return!1;for(var b in a)if(["__null__","__undefined__",null,void 0].indexOf(a[b])>-1)return!1;return!0}function f(a){var a=a.toString();if(a){a=a.replace(/,/g,", ");var b=a.lastIndexOf(", ");return-1!=b&&(a=a.substr(0,b)+" or "+a.substr(b+1)),a}return""}function g(a){top.__utils__get__=top.__utils__get__||{},a.cache&&top.__utils__get__[a.url]?(a.success&&a.success(top.__utils__get__[a.url]),console.debug("utils.js::get() - Fetching from cache ["+a.url+"].")):h({url:a.url,data:a.data,success:function(b){top.__utils__get__[a.url]=b,a.success&&a.success(b)},error:function(b){a.error&&a.error(b)}})}function h(a){var b={contentType:"application/json",type:a.type||"GET",data:a.data||{},url:a.url};"GET"==b.type||"DELETE"==b.type?($.isEmptyObject(b.data)||(b.url+=-1==b.url.indexOf("?")?"?":"&",b.url+=$.param(b.data,!0)),b.data=null):(b.dataType="json",b.url=b.url,b.data=JSON.stringify(b.data)),$.ajax(b).done(function(b){if("string"==typeof b)try{b=b.replace("Infinity,",'"Infinity",'),b=jQuery.parseJSON(b)}catch(c){console.debug(c)}a.success&&a.success(b)}).fail(function(b){var c=null;try{c=jQuery.parseJSON(b.responseText)}catch(d){c=b.responseText}a.error&&a.error(c,b)}).always(function(){a.complete&&a.complete()})}function i(a,b){var c=$('<div class="'+a+'"></div>');c.appendTo(":eq(0)");var d=c.css(b);return c.remove(),d}function j(a){$('link[href^="'+a+'"]').length||$('<link href="'+Galaxy.root+a+'" rel="stylesheet">').appendTo("head")}function k(a,b){return a?_.defaults(a,b):b}function l(a,b){for(var c=1,d=0;b>d;d++)c*=10;return Math.round(a*c)/c}function m(a,b,c){c=void 0!==c?c:1;var d="";if(a>=s)a/=s,d="TB";else if(a>=r)a/=r,d="GB";else if(a>=q)a/=q,d="MB";else if(a>=p)a/=p,d="KB";else{if(!(a>0))return b?"0 b":"<strong>-</strong>";d="b"}var e="b"==d?a:l(a,c);return b?e+" "+d:"<strong>"+e+"</strong> "+d}function n(){return top.__utils__uid__=top.__utils__uid__||0,"uid-"+top.__utils__uid__++}function o(){var a=new Date,b=(a.getHours()<10?"0":"")+a.getHours(),c=(a.getMinutes()<10?"0":"")+a.getMinutes();return datetime=a.getDate()+"/"+(a.getMonth()+1)+"/"+a.getFullYear()+", "+b+":"+c}var p=1024,q=p*p,r=q*p,s=r*p;return{cssLoadFile:j,cssGetAttribute:i,get:g,merge:k,iframe:a,bytesToString:m,uid:n,time:o,request:h,sanitize:d,textify:f,validate:e,deepeach:b,isJSON:c}});
define([],function(){function a(a){return'<iframe src="'+a+'" frameborder="0" style="width: 100%; height: 100%;"/>'}function b(a,c){for(var d in a){var e=a[d];if(_.isObject(e)){var f=c(e);f&&(a[d]=f),b(e,c)}}}function c(a){return/^[\],:{}\s]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))}function d(a){return $("<div/>").text(a).html()}function e(a){a instanceof Array||(a=[a]);for(var b in a)if(["__null__","__undefined__",null,void 0].indexOf(a[b])>-1)return!1;return!0}function f(a){var a=a.toString();if(a){a=a.replace(/,/g,", ");var b=a.lastIndexOf(", ");return-1!=b&&(a=a.substr(0,b)+" or "+a.substr(b+1)),a}return""}function g(a){top.__utils__get__=top.__utils__get__||{},a.cache&&top.__utils__get__[a.url]?(a.success&&a.success(top.__utils__get__[a.url]),console.debug("utils.js::get() - Fetching from cache ["+a.url+"].")):h({url:a.url,data:a.data,success:function(b){top.__utils__get__[a.url]=b,a.success&&a.success(b)},error:function(b){a.error&&a.error(b)}})}function h(a){var b={contentType:"application/json",type:a.type||"GET",data:a.data||{},url:a.url};"GET"==b.type||"DELETE"==b.type?($.isEmptyObject(b.data)||(b.url+=-1==b.url.indexOf("?")?"?":"&",b.url+=$.param(b.data,!0)),b.data=null):(b.dataType="json",b.url=b.url,b.data=JSON.stringify(b.data)),$.ajax(b).done(function(b){if("string"==typeof b)try{b=b.replace("Infinity,",'"Infinity",'),b=jQuery.parseJSON(b)}catch(c){console.debug(c)}a.success&&a.success(b)}).fail(function(b){var c=null;try{c=jQuery.parseJSON(b.responseText)}catch(d){c=b.responseText}a.error&&a.error(c,b)}).always(function(){a.complete&&a.complete()})}function i(a,b){var c=$('<div class="'+a+'"></div>');c.appendTo(":eq(0)");var d=c.css(b);return c.remove(),d}function j(a){$('link[href^="'+a+'"]').length||$('<link href="'+Galaxy.root+a+'" rel="stylesheet">').appendTo("head")}function k(a,b){return a?_.defaults(a,b):b}function l(a,b){for(var c=1,d=0;b>d;d++)c*=10;return Math.round(a*c)/c}function m(a,b,c){c=void 0!==c?c:1;var d="";if(a>=s)a/=s,d="TB";else if(a>=r)a/=r,d="GB";else if(a>=q)a/=q,d="MB";else if(a>=p)a/=p,d="KB";else{if(!(a>0))return b?"0 b":"<strong>-</strong>";d="b"}var e="b"==d?a:l(a,c);return b?e+" "+d:"<strong>"+e+"</strong> "+d}function n(){return top.__utils__uid__=top.__utils__uid__||0,"uid-"+top.__utils__uid__++}function o(){var a=new Date,b=(a.getHours()<10?"0":"")+a.getHours(),c=(a.getMinutes()<10?"0":"")+a.getMinutes();return datetime=a.getDate()+"/"+(a.getMonth()+1)+"/"+a.getFullYear()+", "+b+":"+c}var p=1024,q=p*p,r=q*p,s=r*p;return{cssLoadFile:j,cssGetAttribute:i,get:g,merge:k,iframe:a,bytesToString:m,uid:n,time:o,request:h,sanitize:d,textify:f,validate:e,deepeach:b,isJSON:c}});
//# sourceMappingURL=../../maps/utils/utils.js.map
-1
View File
@@ -110,7 +110,6 @@ define([ "test-app", "layout/masthead"
ok( $menu.css( 'display', 'none' ), 'Menu manually hidden' );
tab.set( 'show_menu', true );
ok( $menu.css( 'display', 'block' ), 'Menu manually shown, again' );
var tab = this.masthead.collection.findWhere( { id: 'enable-scratchbook' } );
var $tab = $( '#enable-scratchbook' ).find( '.dropdown' );
ok( tab && $tab.length == 1, 'Found tab to enable scratchbook' );