2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/5dac6a566615/ Changeset: 5dac6a566615 User: jeremy goecks Date: 2014-02-28 22:18:05 Summary: Add header and line demarcation to tabular chunked data view. Affected #: 1 file diff -r edff37d76463a468753477080f65886d4a53619e -r 5dac6a566615bf747a8515f72ec21be15957647f static/scripts/mvc/data.js --- a/static/scripts/mvc/data.js +++ b/static/scripts/mvc/data.js @@ -115,23 +115,29 @@ */ var TabularDatasetChunkedView = Backbone.View.extend({ - initialize: function(options) - { + initialize: function(options) { + // Row count for rendering. + this.row_count = 0; + + // CSS colors used in table. + this.header_color = '#AAA'; + this.dark_row_color = '#DDD'; + // load trackster button new TabularButtonTracksterView(options); }, - render: function() - { + render: function() { // Add data table and header. var data_table = $('<table/>').attr({ id: 'content_table', cellpadding: 0 }); this.$el.append(data_table); - var column_names = this.model.get_metadata('column_names'); + var column_names = this.model.get_metadata('column_names'), + header_row = $('<tr/>').css('background-color', this.header_color).appendTo(data_table); if (column_names) { - data_table.append('<tr><th>' + column_names.join('</th><th>') + '</th></tr>'); + header_row.append('<th>' + column_names.join('</th><th>') + '</th>'); } // Add first chunk. @@ -199,6 +205,11 @@ var cells = line.split('\t'), row = $('<tr>'), num_columns = this.model.get_metadata('columns'); + + if (this.row_count % 2 !== 0) { + row.css('background-color', this.dark_row_color); + } + if (cells.length === num_columns) { _.each(cells, function(cell_contents, index) { row.append(this._renderCell(cell_contents, index)); @@ -222,6 +233,8 @@ // Comment line, just return the one cell. row.append(this._renderCell(line, 0, num_columns)); } + + this.row_count++; return row; }, https://bitbucket.org/galaxy/galaxy-central/commits/eafb4208db66/ Changeset: eafb4208db66 User: jeremy goecks Date: 2014-02-28 23:03:52 Summary: Automated merge Affected #: 2 files diff -r 5dac6a566615bf747a8515f72ec21be15957647f -r eafb4208db665dfeed7d8f3e6f0d2b61ce2f4fc8 test/unit/tools/test_select_parameters.py --- a/test/unit/tools/test_select_parameters.py +++ b/test/unit/tools/test_select_parameters.py @@ -48,6 +48,24 @@ self.options_xml = '''<options><filter type="data_meta" ref="input_bam" key="dbkey"/></options>''' assert self.param.need_late_validation( self.trans, { "series": [ { "my_name": "42", "input_bam": basic.RuntimeValue() } ] } ) + def test_filter_param_value( self ): + self.options_xml = '''<options from_data_table="test_table"><filter type="param_value" ref="input_bam" column="0" /></options>''' + assert ("testname1", "testpath1", False) in self.param.get_options( self.trans, { "input_bam": "testname1" } ) + assert ("testname2", "testpath2", False) in self.param.get_options( self.trans, { "input_bam": "testname2" } ) + assert len( self.param.get_options( self.trans, { "input_bam": "testname3" } ) ) == 0 + + def test_filter_param_value2( self ): + # Same test as above, but filtering on a different column. + self.options_xml = '''<options from_data_table="test_table"><filter type="param_value" ref="input_bam" column="1" /></options>''' + assert ("testname1", "testpath1", False) in self.param.get_options( self.trans, { "input_bam": "testpath1" } ) + assert ("testname2", "testpath2", False) in self.param.get_options( self.trans, { "input_bam": "testpath2" } ) + assert len( self.param.get_options( self.trans, { "input_bam": "testpath3" } ) ) == 0 + + def test_filter_nested( self ): + # Test filtering a parameter inside a conditional (not currently supported.) + self.options_xml = '''<options from_data_table="test_table"><filter type="param_value" ref="input_bam" column="1" /></options>''' + assert ("testname1", "testpath1", False) in self.param.get_options( self.trans, {"condtional1" : { "input_bam": "testpath1", "my_name": 42 } } ) + # TODO: Good deal of overlap here with DataToolParameterTestCase, # refactor. def setUp( self ): @@ -59,6 +77,7 @@ self.test_history = model.History() self.app.model.context.add( self.test_history ) self.app.model.context.flush() + self.app.tool_data_tables[ "test_table" ] = MockToolDataTable() self.trans = bunch.Bunch( app=self.app, get_history=lambda: self.test_history, @@ -91,3 +110,16 @@ self._param = basic.SelectToolParameter( self.mock_tool, self.param_xml ) return self._param + + +class MockToolDataTable( object ): + + def __init__( self ): + self.columns = dict( + name=0, + value=1, + ) + self.missing_index_file = None + + def get_fields( self ): + return [ [ "testname1", "testpath1" ], [ "testname2", "testpath2" ] ] diff -r 5dac6a566615bf747a8515f72ec21be15957647f -r eafb4208db665dfeed7d8f3e6f0d2b61ce2f4fc8 test/unit/tools_support.py --- a/test/unit/tools_support.py +++ b/test/unit/tools_support.py @@ -121,6 +121,7 @@ from galaxy.security import GalaxyRBACAgent self.job_queue = NoopQueue() self.security_agent = GalaxyRBACAgent( self.model ) + self.tool_data_tables = {} class MockContext(object): Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.