mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
CloudWatch: Remove core imports from app/features/variables/types (#79361)
* CloudWatch: Remove core imports from app/features/variables/types * fix import * lint
This commit is contained in:
parent
147c1b8d8f
commit
9501d06edf
@ -10,8 +10,8 @@ import {
|
||||
} from '@grafana/data';
|
||||
import { getBackendSrv, setBackendSrv, DataSourceWithBackend } from '@grafana/runtime';
|
||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
import { initialCustomVariableModelState } from 'app/features/variables/custom/reducer';
|
||||
|
||||
import { initialCustomVariableModelState } from '../__mocks__/variables';
|
||||
import { CloudWatchDatasource } from '../datasource';
|
||||
import { CloudWatchJsonData } from '../types';
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { CustomVariableModel } from '@grafana/data';
|
||||
import { getBackendSrv, setBackendSrv } from '@grafana/runtime';
|
||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
import { CustomVariableModel } from 'app/features/variables/types';
|
||||
|
||||
import { ResourcesAPI } from '../resources/ResourcesAPI';
|
||||
|
||||
|
@ -0,0 +1,26 @@
|
||||
import { BaseVariableModel, CustomVariableModel, LoadingState, VariableHide, VariableOption } from '@grafana/data';
|
||||
|
||||
export const initialVariableModelState: BaseVariableModel = {
|
||||
id: '00000000-0000-0000-0000-000000000000',
|
||||
rootStateKey: null,
|
||||
name: '',
|
||||
type: 'query',
|
||||
global: false,
|
||||
index: -1,
|
||||
hide: VariableHide.dontHide,
|
||||
skipUrlSync: false,
|
||||
state: LoadingState.NotStarted,
|
||||
error: null,
|
||||
description: null,
|
||||
};
|
||||
|
||||
export const initialCustomVariableModelState: CustomVariableModel = {
|
||||
...initialVariableModelState,
|
||||
type: 'custom',
|
||||
multi: false,
|
||||
includeAll: false,
|
||||
allValue: null,
|
||||
query: '',
|
||||
options: [],
|
||||
current: {} as VariableOption,
|
||||
};
|
@ -2,11 +2,11 @@ import { render, screen } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import selectEvent from 'react-select-event';
|
||||
|
||||
import { DataSourceInstanceSettings } from '@grafana/data';
|
||||
import { CustomVariableModel, DataSourceInstanceSettings } from '@grafana/data';
|
||||
import * as ui from '@grafana/ui';
|
||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
|
||||
import { CustomVariableModel, initialVariableModelState } from '../../../../../../features/variables/types';
|
||||
import { initialVariableModelState } from '../../../__mocks__/variables';
|
||||
import { CloudWatchDatasource } from '../../../datasource';
|
||||
import { CloudWatchJsonData, MetricEditorMode, MetricQueryType } from '../../../types';
|
||||
|
||||
|
@ -3,7 +3,6 @@ import { of } from 'rxjs';
|
||||
import { CustomVariableModel, getFrameDisplayName, VariableHide } from '@grafana/data';
|
||||
import { dateTime } from '@grafana/data/src/datetime/moment_wrapper';
|
||||
import { BackendDataSourceResponse } from '@grafana/runtime';
|
||||
import { initialVariableModelState } from 'app/features/variables/types';
|
||||
import * as redux from 'app/store/store';
|
||||
|
||||
import {
|
||||
@ -17,6 +16,7 @@ import {
|
||||
} from '../__mocks__/CloudWatchDataSource';
|
||||
import { setupMockedMetricsQueryRunner } from '../__mocks__/MetricsQueryRunner';
|
||||
import { validMetricSearchBuilderQuery, validMetricSearchCodeQuery } from '../__mocks__/queries';
|
||||
import { initialVariableModelState } from '../__mocks__/variables';
|
||||
import { MetricQueryType, MetricEditorMode, CloudWatchMetricsQuery, DataQueryError } from '../types';
|
||||
|
||||
describe('CloudWatchMetricsQueryRunner', () => {
|
||||
|
Loading…
Reference in New Issue
Block a user