Commit 076defdc by Dominik Prokop

Post merge updates

parent 1e7f3f28
// Library // Library
import React, { Component } from 'react'; import React, { Component } from 'react';
import Tooltip from 'app/core/components/Tooltip/Tooltip'; import { Tooltip } from '@grafana/ui';
import { Themes } from '@grafana/ui/src/components/Tooltip/Popper';
import ErrorBoundary from 'app/core/components/ErrorBoundary/ErrorBoundary'; import ErrorBoundary from 'app/core/components/ErrorBoundary/ErrorBoundary';
// Services // Services
...@@ -12,7 +14,6 @@ import kbn from 'app/core/utils/kbn'; ...@@ -12,7 +14,6 @@ import kbn from 'app/core/utils/kbn';
// Types // Types
import { DataQueryOptions, DataQueryResponse } from 'app/types'; import { DataQueryOptions, DataQueryResponse } from 'app/types';
import { TimeRange, TimeSeries, LoadingState } from '@grafana/ui'; import { TimeRange, TimeSeries, LoadingState } from '@grafana/ui';
import { Themes } from 'app/core/components/Tooltip/Popper';
const DEFAULT_PLUGIN_ERROR = 'Error in plugin'; const DEFAULT_PLUGIN_ERROR = 'Error in plugin';
...@@ -144,10 +145,10 @@ export class DataPanel extends Component<Props, State> { ...@@ -144,10 +145,10 @@ export class DataPanel extends Component<Props, State> {
this.setState({ this.setState({
loading: LoadingState.Error, loading: LoadingState.Error,
isFirstLoad: false, isFirstLoad: false,
errorMessage: errorMessage errorMessage: errorMessage,
}); });
} }
} };
render() { render() {
const { queries } = this.props; const { queries } = this.props;
...@@ -171,7 +172,7 @@ export class DataPanel extends Component<Props, State> { ...@@ -171,7 +172,7 @@ export class DataPanel extends Component<Props, State> {
<> <>
{this.renderLoadingStates()} {this.renderLoadingStates()}
<ErrorBoundary> <ErrorBoundary>
{({error, errorInfo}) => { {({ error, errorInfo }) => {
if (errorInfo) { if (errorInfo) {
this.onError(error.message || DEFAULT_PLUGIN_ERROR); this.onError(error.message || DEFAULT_PLUGIN_ERROR);
return null; return null;
...@@ -200,15 +201,11 @@ export class DataPanel extends Component<Props, State> { ...@@ -200,15 +201,11 @@ export class DataPanel extends Component<Props, State> {
); );
} else if (loading === LoadingState.Error) { } else if (loading === LoadingState.Error) {
return ( return (
<Tooltip <Tooltip content={errorMessage} placement="bottom-start" theme={Themes.Error}>
content={errorMessage} <div className="panel-info-corner panel-info-corner--error">
className="popper__manager--block" <i className="fa" />
refClassName={`panel-info-corner panel-info-corner--error`} <span className="panel-info-corner-inner" />
placement="bottom-start" </div>
theme={Themes.Error}
>
<i className="fa" />
<span className="panel-info-corner-inner" />
</Tooltip> </Tooltip>
); );
} }
......
...@@ -78,7 +78,7 @@ export class PanelHeaderCorner extends Component<Props> { ...@@ -78,7 +78,7 @@ export class PanelHeaderCorner extends Component<Props> {
{infoMode === InfoModes.Info || infoMode === InfoModes.Links ? ( {infoMode === InfoModes.Info || infoMode === InfoModes.Links ? (
<Tooltip <Tooltip
content={this.getInfoContent} content={this.getInfoContent}
placement="bottom-start" placement="bottom-start"
> >
<div <div
className={`panel-info-corner panel-info-corner--${infoMode.toLowerCase()}`} className={`panel-info-corner panel-info-corner--${infoMode.toLowerCase()}`}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment