@@ -92,8 +92,9 @@ Ext4.define('LABKEY.targetedms.QCTrendPlotPanel', {
9292 if ( this . minAcquiredTime == null || this . maxAcquiredTime == null )
9393 Ext4 . get ( this . plotDivId ) . update ( "<span class='labkey-error'>Unable to render report. Missing min and max AcquiredTime from data query.</span>" ) ;
9494 else {
95+ Ext4 . get ( this . plotDivId ) . update ( "Loading..." ) ;
9596 // Load replicate annotations in the callback.
96- this . queryInitialQcMetrics ( this . queryContainerReplicateAnnotations , this ) ;
97+ LABKEY . targetedms . QCMetricConfigLoader . getMetrics ( this . queryContainerReplicateAnnotations , this ) ;
9798 }
9899 } ,
99100
@@ -111,7 +112,7 @@ Ext4.define('LABKEY.targetedms.QCTrendPlotPanel', {
111112 if ( value === "true" || value === "false" ) {
112113 value = value === "true" ;
113114 }
114- else if ( value != undefined && value . length > 0 && ! isNaN ( Number ( value ) ) ) {
115+ else if ( value !== undefined && value . length > 0 && ! isNaN ( Number ( value ) ) ) {
115116 value = + value ;
116117 }
117118 else if ( key === 'plotTypes' ) { // convert string to array
@@ -120,15 +121,15 @@ Ext4.define('LABKEY.targetedms.QCTrendPlotPanel', {
120121 value = value . split ( ',' ) ;
121122 }
122123 if ( key === 'selectedAnnotations' ) {
123- var annotations = { } ;
124+ const annotations = { } ;
124125
125- var a = value . split ( ',' ) ;
126- for ( var i = 0 ; i < a . length ; i ++ )
126+ const a = value . split ( ',' ) ;
127+ for ( let i = 0 ; i < a . length ; i ++ )
127128 {
128- var b = a [ i ] . split ( ":" ) ;
129- var name = b [ 0 ] ;
130- var val = b [ 1 ] ;
131- var selected = annotations [ name ] ;
129+ const b = a [ i ] . split ( ":" ) ;
130+ const name = b [ 0 ] ;
131+ const val = b [ 1 ] ;
132+ let selected = annotations [ name ] ;
132133 if ( ! selected )
133134 {
134135 selected = [ ] ;
@@ -154,7 +155,8 @@ Ext4.define('LABKEY.targetedms.QCTrendPlotPanel', {
154155 } ) ;
155156 } ,
156157
157- queryContainerReplicateAnnotations : function ( ) {
158+ queryContainerReplicateAnnotations : function ( metrics ) {
159+ this . metricPropArr = metrics ;
158160 LABKEY . Ajax . request ( {
159161 url : LABKEY . ActionURL . buildURL ( 'targetedms' , 'GetContainerReplicateAnnotations.api' ) ,
160162 method : 'GET' ,
@@ -211,6 +213,8 @@ Ext4.define('LABKEY.targetedms.QCTrendPlotPanel', {
211213 }
212214
213215 this . getExpRunRangeDetails ( ) ;
216+ // We just finished loading the previously set options so clear any dirty state
217+ this . havePlotOptionsChanged = false ;
214218 } ,
215219
216220 getExpRunRangeDetails : function ( ) {
@@ -286,7 +290,6 @@ Ext4.define('LABKEY.targetedms.QCTrendPlotPanel', {
286290
287291 getFirstPlotOptionsToolbar : function ( ) {
288292 if ( ! this . plotTypeOptionsToolbar ) {
289- let items = [ ] ;
290293 this . plotTypeOptionsToolbar = Ext4 . create ( 'Ext.toolbar.Toolbar' , {
291294 ui : 'footer' ,
292295 cls : 'levey-jennings-toolbar' ,
@@ -327,7 +330,7 @@ Ext4.define('LABKEY.targetedms.QCTrendPlotPanel', {
327330 minValue : 2 ,
328331 listeners : {
329332 scope : this ,
330- change : function ( cmp , newVal , oldVal ) {
333+ change : function ( cmp , newVal ) {
331334 this . trailingRuns = newVal ;
332335 this . havePlotOptionsChanged = true ;
333336 this . displayTrendPlot ( ) ;
@@ -370,7 +373,7 @@ Ext4.define('LABKEY.targetedms.QCTrendPlotPanel', {
370373 value : selectedPlotTypes ,
371374 listeners : {
372375 scope : this ,
373- change : function ( cmp , newVal , oldVal ) {
376+ change : function ( cmp , newVal ) {
374377 var newValues = newVal ;
375378 this . plotTypes = newValues ? Ext4 . isArray ( newValues ) ? newValues : [ newValues ] : [ ] ;
376379
@@ -418,7 +421,7 @@ Ext4.define('LABKEY.targetedms.QCTrendPlotPanel', {
418421
419422 toolbarItems . push ( this . getGroupedXCheckbox ( ) ) ;
420423 toolbarItems . push ( { xtype : 'tbspacer' } , { xtype : 'tbseparator' } , { xtype : 'tbspacer' } ) ;
421- var location = toolbarItems . push ( this . getSinglePlotCheckbox ( ) ) ;
424+ const location = toolbarItems . push ( this . getSinglePlotCheckbox ( ) ) ;
422425 toolbarItems . push ( { xtype : 'tbspacer' } , { xtype : 'tbseparator' } , { xtype : 'tbspacer' } ) ;
423426 toolbarItems . push ( this . getShowExcludedCheckbox ( ) ) ;
424427 toolbarItems . push ( { xtype : 'tbspacer' } , { xtype : 'tbseparator' } , { xtype : 'tbspacer' } ) ;
0 commit comments