@@ -48,6 +48,25 @@ Gemma.ExpressionExperimentPage = Ext.extend( Ext.TabPanel, {
4848 }
4949 } ,
5050
51+ checkData : function ( eeId , geneList , callback ) {
52+ // checks to see if a dataset has expression data to prevent the relevant tabs from
53+ // being shown
54+ var store = new Gemma . VisualizationStore ( )
55+ store . on ( 'exception' , function ( e , type , action , options , response , arg ) {
56+ Ext . callback ( callback , this , [ false ] )
57+ } )
58+
59+ store . load ( {
60+ params : [ [ eeId ] , geneList || [ ] ] ,
61+ callback : function ( records , options , success ) {
62+ var hasData = ! ! ( success && records && records . length > 0 ) ;
63+ callback ( hasData ) ;
64+ } ,
65+ scope : this
66+ } ) ;
67+
68+ } ,
69+
5170 /**
5271 * @memberOf Gemma.ExpressionExperimentPage
5372 */
@@ -148,12 +167,18 @@ Gemma.ExpressionExperimentPage = Ext.extend( Ext.TabPanel, {
148167
149168 // EXPERIMENT DESIGN TAB
150169 this . add ( this . makeDesignTab ( experimentDetails ) ) ;
170+ this . checkData ( experimentDetails . id , [ ] , function ( hasData ) {
171+ if ( hasData ) {
172+ // VISUALISATION TAB
173+ this . add ( this . makeVisualisationTab ( experimentDetails , isAdmin ) ) ;
174+
175+ // DIAGNOSTICS TAB
176+ this . add ( this . makeDiagnosticsTab ( experimentDetails , isAdmin ) ) ;
177+ }
178+ } . createDelegate ( this ) )
179+
151180
152- // VISUALISATION TAB
153- this . add ( this . makeVisualisationTab ( experimentDetails , isAdmin ) ) ;
154181
155- // DIAGNOSTICS TAB
156- this . add ( this . makeDiagnosticsTab ( experimentDetails , isAdmin ) ) ;
157182
158183 this . adjustForIsAdmin ( isAdmin , this . editable ) ;
159184
@@ -208,6 +233,8 @@ Gemma.ExpressionExperimentPage = Ext.extend( Ext.TabPanel, {
208233 } ;
209234 } ,
210235
236+
237+
211238 makeVisualisationTab : function ( experimentDetails , isAdmin ) {
212239 var eeId = this . eeId ;
213240 var title = "Data for a 'random' sampling of probes" ;
0 commit comments