mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Prometheus: Fixed Prometheus query editor error (plus new ErrorBoundaryAlert component) (#18838)
* ErrorHandling: Fixed Prometheus query editor error and added error boundary * Update public/app/core/components/ErrorBoundary/ErrorBoundary.tsx Co-Authored-By: kay delaney <45561153+kaydelaney@users.noreply.github.com> * Fixed ts error
This commit is contained in:
@@ -154,7 +154,8 @@ class PromQueryField extends React.PureComponent<PromQueryFieldProps, PromQueryF
|
||||
|
||||
componentDidUpdate(prevProps: PromQueryFieldProps) {
|
||||
const { queryResponse } = this.props;
|
||||
if (prevProps.queryResponse && prevProps.queryResponse.series !== queryResponse.series) {
|
||||
|
||||
if (queryResponse && prevProps.queryResponse && prevProps.queryResponse.series !== queryResponse.series) {
|
||||
this.refreshHint();
|
||||
}
|
||||
|
||||
@@ -177,7 +178,7 @@ class PromQueryField extends React.PureComponent<PromQueryFieldProps, PromQueryF
|
||||
refreshHint = () => {
|
||||
const { datasource, query, queryResponse } = this.props;
|
||||
|
||||
if (!queryResponse.series || queryResponse.series.length === 0) {
|
||||
if (!queryResponse || queryResponse.series.length === 0) {
|
||||
this.setState({ hint: null });
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user