diff --git a/public/app/plugins/datasource/stackdriver/angular_wrappers.ts b/public/app/plugins/datasource/stackdriver/angular_wrappers.ts index 6549135790c..537b03f9c99 100644 --- a/public/app/plugins/datasource/stackdriver/angular_wrappers.ts +++ b/public/app/plugins/datasource/stackdriver/angular_wrappers.ts @@ -6,6 +6,7 @@ export function registerAngularDirectives() { 'target', 'onQueryChange', 'onExecuteQuery', + ['events', { watchDepth: 'reference' }], ['uiSegmentSrv', { watchDepth: 'reference' }], ['datasource', { watchDepth: 'reference' }], ['templateSrv', { watchDepth: 'reference' }], diff --git a/public/app/plugins/datasource/stackdriver/components/Help.tsx b/public/app/plugins/datasource/stackdriver/components/Help.tsx index 9cc02acffa0..bf9cb2b182d 100644 --- a/public/app/plugins/datasource/stackdriver/components/Help.tsx +++ b/public/app/plugins/datasource/stackdriver/components/Help.tsx @@ -3,6 +3,7 @@ import { Project } from './Project'; export interface Props { datasource: any; + rawQuery: string; } interface State { @@ -21,39 +22,87 @@ export class Help extends React.Component { } handleRawQueryClicked() { - this.setState({ displayHelp: !this.state.displayHelp }); + this.setState({ displaRawQuery: !this.state.displaRawQuery }); + } + + shouldComponentUpdate(nextProps) { + return nextProps.metricDescriptor !== null; } render() { const { displayHelp, displaRawQuery } = this.state; - const { datasource } = this.props; + const { datasource, rawQuery } = this.props; return ( -
- - {/* {displayHelp && ( */} -
- -
- {/* )} */} - - {displaRawQuery && ( -
-