[hotfix] fixing the build

This commit is contained in:
Maxime Beauchemin
2017-04-13 15:58:04 -07:00
parent 6c68a21e4f
commit c43a9fd554
4 changed files with 24 additions and 36 deletions

View File

@@ -263,8 +263,8 @@ class ChartContainer extends React.PureComponent {
<div className="pull-right">
{this.props.chartStatus === 'success' &&
this.props.queryResponse &&
this.props.queryResponse.is_cached &&
this.props.queryResponse &&
this.props.queryResponse.is_cached &&
<TooltipWrapper
tooltip="Loaded from cache. Click to force refresh"
label="cache-desc"
@@ -275,7 +275,7 @@ class ChartContainer extends React.PureComponent {
>
cached
</Label>
</TooltipWrapper>
</TooltipWrapper>
}
<Timer
startTime={this.props.chartUpdateStartTime}

View File

@@ -28,26 +28,6 @@ export default class DisplayQueryButton extends React.PureComponent {
this.beforeOpen = this.beforeOpen.bind(this);
this.fetchQuery = this.fetchQuery.bind(this);
}
fetchQuery() {
this.setState({ isLoading: true });
$.ajax({
type: 'GET',
url: this.props.queryEndpoint,
success: data => {
this.setState({
language: data.language,
query: data.query,
isLoading: false,
});
},
error: data => {
this.setState({
error: data.error,
isLoading: false,
});
},
});
}
setStateFromQueryResponse() {
const qr = this.props.queryResponse;
this.setState({
@@ -56,6 +36,26 @@ export default class DisplayQueryButton extends React.PureComponent {
isLoading: false,
});
}
fetchQuery() {
this.setState({ isLoading: true });
$.ajax({
type: 'GET',
url: this.props.queryEndpoint,
success: (data) => {
this.setState({
language: data.language,
query: data.query,
isLoading: false,
});
},
error: (data) => {
this.setState({
error: data.error,
isLoading: false,
});
},
});
}
beforeOpen() {
if (this.props.chartStatus === 'loading' || this.props.chartStatus === null) {
this.fetchQuery();