Skip to content

Commit cbc38c9

Browse files
committed
hides diagnostics and expression visualization. produces unavoidable error message..
1 parent 47d8fa4 commit cbc38c9

1 file changed

Lines changed: 32 additions & 4 deletions

File tree

gemma-web/src/main/webapp/scripts/api/entities/experiment/ExpressionExperimentPage.js

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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,19 @@ 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+
debugger
172+
if(hasData){
173+
// VISUALISATION TAB
174+
this.add( this.makeVisualisationTab( experimentDetails, isAdmin ) );
175+
176+
// DIAGNOSTICS TAB
177+
this.add( this.makeDiagnosticsTab( experimentDetails, isAdmin ) );
178+
}
179+
}.createDelegate(this))
180+
151181

152-
// VISUALISATION TAB
153-
this.add( this.makeVisualisationTab( experimentDetails, isAdmin ) );
154182

155-
// DIAGNOSTICS TAB
156-
this.add( this.makeDiagnosticsTab( experimentDetails, isAdmin ) );
157183

158184
this.adjustForIsAdmin( isAdmin, this.editable );
159185

@@ -208,6 +234,8 @@ Gemma.ExpressionExperimentPage = Ext.extend( Ext.TabPanel, {
208234
};
209235
},
210236

237+
238+
211239
makeVisualisationTab : function( experimentDetails, isAdmin ) {
212240
var eeId = this.eeId;
213241
var title = "Data for a 'random' sampling of probes";

0 commit comments

Comments
 (0)