mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fixing test and small refactor
This commit is contained in:
parent
08ac2959a4
commit
2f0ab99ae5
@ -6,7 +6,6 @@ import { AngularComponent, getAngularLoader } from 'app/core/services/AngularLoa
|
||||
import appEvents from 'app/core/app_events';
|
||||
|
||||
// Components
|
||||
import { LoadingPlaceholder } from '@grafana/ui';
|
||||
import { EditorTabBody, EditorToolbarView } from '../dashboard/dashgrid/EditorTabBody';
|
||||
import EmptyListCTA from 'app/core/components/EmptyListCTA/EmptyListCTA';
|
||||
import StateHistory from './StateHistory';
|
||||
@ -113,7 +112,7 @@ export class AlertTab extends PureComponent<Props> {
|
||||
|
||||
renderTestRuleResult = () => {
|
||||
const { panel, dashboard } = this.props;
|
||||
return <TestRuleResult panelId={panel.id} dashboard={dashboard} LoadingPlaceholder={LoadingPlaceholder} />;
|
||||
return <TestRuleResult panelId={panel.id} dashboard={dashboard} />;
|
||||
};
|
||||
|
||||
testRule = (): EditorToolbarView => ({
|
||||
|
@ -13,7 +13,6 @@ const setup = (propOverrides?: object) => {
|
||||
const props: Props = {
|
||||
panelId: 1,
|
||||
dashboard: new DashboardModel({ panels: [{ id: 1 }] }),
|
||||
LoadingPlaceholder: {},
|
||||
};
|
||||
|
||||
Object.assign(props, propOverrides);
|
@ -2,11 +2,11 @@ import React, { PureComponent } from 'react';
|
||||
import { JSONFormatter } from 'app/core/components/JSONFormatter/JSONFormatter';
|
||||
import { getBackendSrv } from 'app/core/services/backend_srv';
|
||||
import { DashboardModel } from '../dashboard/dashboard_model';
|
||||
import { LoadingPlaceholder } from '@grafana/ui/src';
|
||||
|
||||
export interface Props {
|
||||
panelId: number;
|
||||
dashboard: DashboardModel;
|
||||
LoadingPlaceholder: any;
|
||||
}
|
||||
|
||||
interface State {
|
||||
@ -35,7 +35,6 @@ export class TestRuleResult extends PureComponent<Props, State> {
|
||||
|
||||
render() {
|
||||
const { testRuleResponse, isLoading } = this.state;
|
||||
const { LoadingPlaceholder } = this.props;
|
||||
|
||||
if (isLoading === true) {
|
||||
return <LoadingPlaceholder text="Evaluating rule" />;
|
||||
|
@ -1,13 +0,0 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Render should render component 1`] = `
|
||||
<JSONFormatter
|
||||
config={
|
||||
Object {
|
||||
"animateOpen": true,
|
||||
}
|
||||
}
|
||||
json={Object {}}
|
||||
open={3}
|
||||
/>
|
||||
`;
|
@ -0,0 +1,7 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Render should render component 1`] = `
|
||||
<Component
|
||||
text="Evaluating rule"
|
||||
/>
|
||||
`;
|
@ -10,7 +10,6 @@ import { QueryInspector } from './QueryInspector';
|
||||
import { QueryOptions } from './QueryOptions';
|
||||
import { AngularQueryComponentScope } from 'app/features/panel/metrics_tab';
|
||||
import { PanelOptionSection } from './PanelOptionSection';
|
||||
import { LoadingPlaceholder } from '@grafana/ui';
|
||||
|
||||
// Services
|
||||
import { getDatasourceSrv } from 'app/features/plugins/datasource_srv';
|
||||
@ -129,7 +128,7 @@ export class QueriesTab extends PureComponent<Props, State> {
|
||||
|
||||
renderQueryInspector = () => {
|
||||
const { panel } = this.props;
|
||||
return <QueryInspector panel={panel} LoadingPlaceholder={LoadingPlaceholder} />;
|
||||
return <QueryInspector panel={panel} />;
|
||||
};
|
||||
|
||||
renderHelp = () => {
|
||||
|
@ -2,6 +2,7 @@ import React, { PureComponent } from 'react';
|
||||
import { JSONFormatter } from 'app/core/components/JSONFormatter/JSONFormatter';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { CopyToClipboard } from 'app/core/components/CopyToClipboard/CopyToClipboard';
|
||||
import { LoadingPlaceholder } from '@grafana/ui';
|
||||
|
||||
interface DsQuery {
|
||||
isLoading: boolean;
|
||||
@ -10,7 +11,6 @@ interface DsQuery {
|
||||
|
||||
interface Props {
|
||||
panel: any;
|
||||
LoadingPlaceholder: any;
|
||||
}
|
||||
|
||||
interface State {
|
||||
@ -177,7 +177,6 @@ export class QueryInspector extends PureComponent<Props, State> {
|
||||
|
||||
render() {
|
||||
const { response, isLoading } = this.state.dsQuery;
|
||||
const { LoadingPlaceholder } = this.props;
|
||||
const { isMocking } = this.state;
|
||||
const openNodes = this.getNrOfOpenNodes();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user