@ -63,8 +63,10 @@ interface Props<TQuery extends DataQuery> {
}
}
interface State < TQuery extends DataQuery > {
interface State < TQuery extends DataQuery > {
/** DatasourceUid or ds variable expression used to resolve current datasource */
loadedDataSourceIdentifier? : string | null ;
loadedDataSourceIdentifier? : string | null ;
datasource : DataSourceApi < TQuery > | null ;
datasource : DataSourceApi < TQuery > | null ;
datasourceUid? : string | null ;
hasTextEditMode : boolean ;
hasTextEditMode : boolean ;
data? : PanelData ;
data? : PanelData ;
isOpen? : boolean ;
isOpen? : boolean ;
@ -238,17 +240,17 @@ export class QueryEditorRow<TQuery extends DataQuery> extends PureComponent<Prop
}
}
}
}
waitingForDatasourceToLoad = ( ) : boolean = > {
isWaitingForDatasourceToLoad ( ) : boolean {
// if we not yet have loaded the datasource in state the
// if we not yet have loaded the datasource in state the
// ds in props and the ds in state will have different values.
// ds in props and the ds in state will have different values.
return this . props . dataSource . uid !== this . state . datasource ? . uid ;
return this . props . dataSource . uid !== this . state . loadedDataSourceIdentifier ;
} ;
}
renderPluginEditor = ( ) = > {
renderPluginEditor = ( ) = > {
const { query , onChange , queries , onRunQuery , onAddQuery , app = CoreApp . PanelEditor , history } = this . props ;
const { query , onChange , queries , onRunQuery , onAddQuery , app = CoreApp . PanelEditor , history } = this . props ;
const { datasource , data } = this . state ;
const { datasource , data } = this . state ;
if ( this . w aitingForDatasourceToLoad( ) ) {
if ( this . isW aitingForDatasourceToLoad( ) ) {
return null ;
return null ;
}
}