mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Reorg packages (#20111)
Primarily- moving majority of the types and utils from @grafana/ui to @grafana/data * Move types from grafana-ui to grafana-data * Move valueFormats to grafana-data * Move utils from grafana-ui to grafana-data * Update imports in grafana-ui * revert data's tsconfig change * Update imports in grafana-runtime * Fix import paths in grafana-ui * Move rxjs to devDeps * Core import updates batch 1 * Import updates batch 2 * Imports fix batch 3 * Imports fixes batch i don't know * Fix imorts in grafana-toolkit * Fix imports after master merge
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
import angular, { IQService } from 'angular';
|
||||
import _ from 'lodash';
|
||||
import { dateMath, ScopedVars, toDataFrame, TimeRange } from '@grafana/data';
|
||||
import {
|
||||
dateMath,
|
||||
ScopedVars,
|
||||
toDataFrame,
|
||||
TimeRange,
|
||||
DataSourceApi,
|
||||
DataQueryRequest,
|
||||
DataSourceInstanceSettings,
|
||||
} from '@grafana/data';
|
||||
import kbn from 'app/core/utils/kbn';
|
||||
import { CloudWatchQuery } from './types';
|
||||
import { DataSourceApi, DataQueryRequest, DataSourceInstanceSettings } from '@grafana/ui';
|
||||
import { BackendSrv } from 'app/core/services/backend_srv';
|
||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
import { TimeSrv } from 'app/features/dashboard/services/TimeSrv';
|
||||
|
||||
@@ -5,7 +5,7 @@ import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
import { CustomVariable } from 'app/features/templating/all';
|
||||
import _ from 'lodash';
|
||||
import { CloudWatchQuery } from '../types';
|
||||
import { DataSourceInstanceSettings } from '@grafana/ui';
|
||||
import { DataSourceInstanceSettings } from '@grafana/data';
|
||||
import { BackendSrv } from 'app/core/services/backend_srv';
|
||||
import { TimeSrv } from 'app/features/dashboard/services/TimeSrv';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataQuery } from '@grafana/ui';
|
||||
import { DataQuery } from '@grafana/data';
|
||||
|
||||
export interface CloudWatchQuery extends DataQuery {
|
||||
id: string;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
|
||||
// Types
|
||||
import { Select, DataQuery, DataQueryError, PanelData } from '@grafana/ui';
|
||||
import { DataFrame, SelectableValue } from '@grafana/data';
|
||||
import { Select } from '@grafana/ui';
|
||||
import { DataQuery, DataQueryError, PanelData, DataFrame, SelectableValue } from '@grafana/data';
|
||||
import { DashboardQuery } from './types';
|
||||
import config from 'app/core/config';
|
||||
import { css } from 'emotion';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataSourceApi, DataQueryRequest, DataQueryResponse, DataSourceInstanceSettings } from '@grafana/ui';
|
||||
import { DataSourceApi, DataQueryRequest, DataQueryResponse, DataSourceInstanceSettings } from '@grafana/data';
|
||||
import { DashboardQuery } from './types';
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DashboardDatasource } from './datasource';
|
||||
import { DataSourcePlugin } from '@grafana/ui';
|
||||
import { DataSourcePlugin } from '@grafana/data';
|
||||
|
||||
export const plugin = new DataSourcePlugin(DashboardDatasource);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { isSharedDashboardQuery } from './runSharedRequest';
|
||||
import { DataSourceApi } from '@grafana/ui';
|
||||
import { DataSourceApi } from '@grafana/data';
|
||||
|
||||
describe('SharedQueryRunner', () => {
|
||||
it('should identify shared queries', () => {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { Observable } from 'rxjs';
|
||||
import { DataQuery, PanelData, DataSourceApi } from '@grafana/ui';
|
||||
import { QueryRunnerOptions } from 'app/features/dashboard/state/PanelQueryRunner';
|
||||
import { DashboardQuery, SHARED_DASHBODARD_QUERY } from './types';
|
||||
import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv';
|
||||
import { LoadingState, DefaultTimeRange } from '@grafana/data';
|
||||
import { LoadingState, DefaultTimeRange, DataQuery, PanelData, DataSourceApi } from '@grafana/data';
|
||||
|
||||
export function isSharedDashboardQuery(datasource: string | DataSourceApi) {
|
||||
if (!datasource) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataQuery } from '@grafana/ui/src/types';
|
||||
import { DataQuery } from '@grafana/data';
|
||||
|
||||
export const SHARED_DASHBODARD_QUERY = '-- Dashboard --';
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import _ from 'lodash';
|
||||
import React from 'react';
|
||||
|
||||
import { SlatePrism } from '@grafana/ui';
|
||||
|
||||
// dom also includes Element polyfills
|
||||
import { QueryField, ExploreQueryFieldProps } from '@grafana/ui';
|
||||
import { QueryField, SlatePrism } from '@grafana/ui';
|
||||
import { ExploreQueryFieldProps } from '@grafana/data';
|
||||
import { ElasticDatasource } from '../datasource';
|
||||
import { ElasticsearchOptions, ElasticsearchQuery } from '../types';
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import { DataSourceHttpSettings, DataSourcePluginOptionsEditorProps } from '@grafana/ui';
|
||||
import { DataSourceHttpSettings } from '@grafana/ui';
|
||||
import { DataSourcePluginOptionsEditorProps } from '@grafana/data';
|
||||
import { ElasticsearchOptions } from '../types';
|
||||
import { defaultMaxConcurrentShardRequests, ElasticDetails } from './ElasticDetails';
|
||||
import { LogsConfig } from './LogsConfig';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { DataSourceSettings, EventsWithValidation, FormField, Input, regexValidation, Select } from '@grafana/ui';
|
||||
import { EventsWithValidation, FormField, Input, regexValidation, Select } from '@grafana/ui';
|
||||
import { ElasticsearchOptions } from '../types';
|
||||
import { SelectableValue } from '@grafana/data';
|
||||
import { DataSourceSettings, SelectableValue } from '@grafana/data';
|
||||
|
||||
const indexPatternTypes = [
|
||||
{ label: 'No pattern', value: 'none' },
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataSourceSettings } from '@grafana/ui';
|
||||
import { DataSourceSettings } from '@grafana/data';
|
||||
import { ElasticsearchOptions } from '../types';
|
||||
import { createDatasourceSettings } from '../../../../features/datasources/mocks';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import angular, { IQService } from 'angular';
|
||||
import _ from 'lodash';
|
||||
import { DataSourceApi, DataSourceInstanceSettings, DataQueryRequest, DataQueryResponse } from '@grafana/ui';
|
||||
import { DataSourceApi, DataSourceInstanceSettings, DataQueryRequest, DataQueryResponse } from '@grafana/data';
|
||||
import { ElasticResponse } from './elastic_response';
|
||||
import { IndexPattern } from './index_pattern';
|
||||
import { ElasticQueryBuilder } from './query_builder';
|
||||
|
||||
@@ -2,8 +2,7 @@ import _ from 'lodash';
|
||||
import flatten from 'app/core/utils/flatten';
|
||||
import * as queryDef from './query_def';
|
||||
import TableModel from 'app/core/table_model';
|
||||
import { DataFrame, toDataFrame, FieldType, MutableDataFrame } from '@grafana/data';
|
||||
import { DataQueryResponse } from '@grafana/ui';
|
||||
import { DataQueryResponse, DataFrame, toDataFrame, FieldType, MutableDataFrame } from '@grafana/data';
|
||||
import { ElasticsearchAggregation } from './types';
|
||||
|
||||
export class ElasticResponse {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataSourcePlugin } from '@grafana/ui';
|
||||
import { DataSourcePlugin } from '@grafana/data';
|
||||
import { ElasticDatasource } from './datasource';
|
||||
import { ElasticQueryCtrl } from './query_ctrl';
|
||||
import ElasticsearchQueryField from './components/ElasticsearchQueryField';
|
||||
|
||||
@@ -6,7 +6,7 @@ import { toUtc, dateTime } from '@grafana/data';
|
||||
import { BackendSrv } from 'app/core/services/backend_srv';
|
||||
import { TimeSrv } from 'app/features/dashboard/services/TimeSrv';
|
||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
import { DataSourceInstanceSettings } from '@grafana/ui';
|
||||
import { DataSourceInstanceSettings } from '@grafana/data';
|
||||
import { ElasticsearchOptions } from '../types';
|
||||
|
||||
describe('ElasticDatasource', function(this: any) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataQuery, DataSourceJsonData } from '@grafana/ui';
|
||||
import { DataQuery, DataSourceJsonData } from '@grafana/data';
|
||||
|
||||
export interface ElasticsearchOptions extends DataSourceJsonData {
|
||||
timeField: string;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import { SelectableValue } from '@grafana/data';
|
||||
import { DataSourcePluginOptionsEditorProps } from '@grafana/ui';
|
||||
import { SelectableValue, DataSourcePluginOptionsEditorProps } from '@grafana/data';
|
||||
import { MonitorConfig } from './components/MonitorConfig';
|
||||
import { AnalyticsConfig } from './components/AnalyticsConfig';
|
||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { TimeSeries, toDataFrame } from '@grafana/data';
|
||||
import { DataQueryRequest, DataQueryResponseData, DataSourceInstanceSettings } from '@grafana/ui';
|
||||
import { DataQueryRequest, DataQueryResponseData, DataSourceInstanceSettings } from '@grafana/data';
|
||||
import { BackendSrv } from 'app/core/services/backend_srv';
|
||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
import _ from 'lodash';
|
||||
|
||||
@@ -2,7 +2,7 @@ import _ from 'lodash';
|
||||
import LogAnalyticsQuerystringBuilder from '../log_analytics/querystring_builder';
|
||||
import ResponseParser from './response_parser';
|
||||
import { AzureMonitorQuery, AzureDataSourceJsonData } from '../types';
|
||||
import { DataQueryRequest, DataSourceInstanceSettings } from '@grafana/ui';
|
||||
import { DataQueryRequest, DataSourceInstanceSettings } from '@grafana/data';
|
||||
import { BackendSrv } from 'app/core/services/backend_srv';
|
||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
AzureMonitorMetricDefinitionsResponse,
|
||||
AzureMonitorResourceGroupsResponse,
|
||||
} from '../types';
|
||||
import { DataQueryRequest, DataQueryResponseData, DataSourceInstanceSettings } from '@grafana/ui';
|
||||
import { DataQueryRequest, DataQueryResponseData, DataSourceInstanceSettings } from '@grafana/data';
|
||||
|
||||
import { TimeSeries, toDataFrame } from '@grafana/data';
|
||||
import { BackendSrv } from 'app/core/services/backend_srv';
|
||||
|
||||
@@ -3,7 +3,7 @@ import AzureMonitorDatasource from './azure_monitor/azure_monitor_datasource';
|
||||
import AppInsightsDatasource from './app_insights/app_insights_datasource';
|
||||
import AzureLogAnalyticsDatasource from './azure_log_analytics/azure_log_analytics_datasource';
|
||||
import { AzureMonitorQuery, AzureDataSourceJsonData } from './types';
|
||||
import { DataSourceApi, DataQueryRequest, DataSourceInstanceSettings } from '@grafana/ui';
|
||||
import { DataSourceApi, DataQueryRequest, DataSourceInstanceSettings } from '@grafana/data';
|
||||
import { BackendSrv } from 'app/core/services/backend_srv';
|
||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
import { IQService } from 'angular';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataSourcePlugin } from '@grafana/ui';
|
||||
import { DataSourcePlugin } from '@grafana/data';
|
||||
import { AzureMonitorQueryCtrl } from './query_ctrl';
|
||||
import Datasource from './datasource';
|
||||
import { ConfigEditor } from './ConfigEditor';
|
||||
|
||||
@@ -8,7 +8,7 @@ import kbn from 'app/core/utils/kbn';
|
||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
import { auto, IPromise } from 'angular';
|
||||
import { DataFrame } from '@grafana/data';
|
||||
import { PanelEvents } from '@grafana/ui';
|
||||
import { PanelEvents } from '@grafana/data';
|
||||
|
||||
export interface ResultFormat {
|
||||
text: string;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataQuery, DataSourceJsonData } from '@grafana/ui';
|
||||
import { DataQuery, DataSourceJsonData } from '@grafana/data';
|
||||
|
||||
export interface AzureMonitorQuery extends DataQuery {
|
||||
refId: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import _ from 'lodash';
|
||||
import { isVersionGtOrEq } from 'app/core/utils/version';
|
||||
import { InterpolateFunction } from '@grafana/ui';
|
||||
import { InterpolateFunction } from '@grafana/data';
|
||||
|
||||
const index: any = {};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataQuery } from '@grafana/ui';
|
||||
import { DataQuery } from '@grafana/data';
|
||||
|
||||
export interface GraphiteQuery extends DataQuery {
|
||||
target?: string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { ExploreQueryFieldProps } from '@grafana/ui';
|
||||
import { ExploreQueryFieldProps } from '@grafana/data';
|
||||
// @ts-ignore
|
||||
import Cascader from 'rc-cascader';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import { ExploreStartPageProps } from '@grafana/ui';
|
||||
import { ExploreStartPageProps } from '@grafana/data';
|
||||
import InfluxCheatSheet from './InfluxCheatSheet';
|
||||
|
||||
export default class InfluxStartPage extends PureComponent<ExploreStartPageProps> {
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import _ from 'lodash';
|
||||
|
||||
import { dateMath } from '@grafana/data';
|
||||
import { dateMath, DataSourceApi, DataSourceInstanceSettings } from '@grafana/data';
|
||||
import InfluxSeries from './influx_series';
|
||||
import InfluxQueryModel from './influx_query_model';
|
||||
import ResponseParser from './response_parser';
|
||||
import { InfluxQueryBuilder } from './query_builder';
|
||||
import { DataSourceApi, DataSourceInstanceSettings } from '@grafana/ui';
|
||||
import { InfluxQuery, InfluxOptions } from './types';
|
||||
import { BackendSrv } from 'app/core/services/backend_srv';
|
||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
createResetHandler,
|
||||
PasswordFieldEnum,
|
||||
} from '../../../features/datasources/utils/passwordHandlers';
|
||||
import { DataSourcePlugin } from '@grafana/ui';
|
||||
import { DataSourcePlugin } from '@grafana/data';
|
||||
|
||||
class InfluxConfigCtrl {
|
||||
static templateUrl = 'partials/config.html';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataQuery, DataSourceJsonData } from '@grafana/ui';
|
||||
import { DataQuery, DataSourceJsonData } from '@grafana/data';
|
||||
|
||||
export interface InfluxOptions extends DataSourceJsonData {
|
||||
timeInterval: string;
|
||||
|
||||
@@ -4,8 +4,8 @@ import React, { PureComponent } from 'react';
|
||||
// Types
|
||||
import { InputOptions } from './types';
|
||||
|
||||
import { DataSourcePluginOptionsEditorProps, TableInputCSV } from '@grafana/ui';
|
||||
import { DataFrame, MutableDataFrame } from '@grafana/data';
|
||||
import { TableInputCSV } from '@grafana/ui';
|
||||
import { DataSourcePluginOptionsEditorProps, DataFrame, MutableDataFrame } from '@grafana/data';
|
||||
import { dataFrameToCSV } from './utils';
|
||||
|
||||
interface Props extends DataSourcePluginOptionsEditorProps<InputOptions> {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import InputDatasource, { describeDataFrame } from './InputDatasource';
|
||||
import { InputQuery, InputOptions } from './types';
|
||||
import { readCSV, DataFrame, MutableDataFrame } from '@grafana/data';
|
||||
import { DataSourceInstanceSettings, PluginMeta } from '@grafana/ui';
|
||||
import { readCSV, DataFrame, MutableDataFrame, DataSourceInstanceSettings, PluginMeta } from '@grafana/data';
|
||||
|
||||
import { getQueryOptions } from 'test/helpers/getQueryOptions';
|
||||
|
||||
describe('InputDatasource', () => {
|
||||
|
||||
@@ -5,8 +5,10 @@ import {
|
||||
DataSourceApi,
|
||||
DataSourceInstanceSettings,
|
||||
MetricFindValue,
|
||||
} from '@grafana/ui';
|
||||
import { DataFrame, DataFrameDTO, toDataFrame } from '@grafana/data';
|
||||
DataFrame,
|
||||
DataFrameDTO,
|
||||
toDataFrame,
|
||||
} from '@grafana/data';
|
||||
|
||||
import { InputQuery, InputOptions } from './types';
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ import React, { PureComponent } from 'react';
|
||||
import { InputDatasource, describeDataFrame } from './InputDatasource';
|
||||
import { InputQuery, InputOptions } from './types';
|
||||
|
||||
import { FormLabel, Select, QueryEditorProps, TableInputCSV } from '@grafana/ui';
|
||||
import { DataFrame, toCSV, SelectableValue, MutableDataFrame } from '@grafana/data';
|
||||
import { FormLabel, Select, TableInputCSV } from '@grafana/ui';
|
||||
import { DataFrame, toCSV, SelectableValue, MutableDataFrame, QueryEditorProps } from '@grafana/data';
|
||||
|
||||
import { dataFrameToCSV } from './utils';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataSourcePlugin } from '@grafana/ui';
|
||||
import { DataSourcePlugin } from '@grafana/data';
|
||||
|
||||
import { InputDatasource } from './InputDatasource';
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { DataQuery, DataSourceJsonData } from '@grafana/ui';
|
||||
import { DataFrameDTO } from '@grafana/data';
|
||||
import { DataQuery, DataSourceJsonData, DataFrameDTO } from '@grafana/data';
|
||||
|
||||
export interface InputQuery extends DataQuery {
|
||||
// Data saved in the panel
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import React from 'react';
|
||||
import { DataSourceHttpSettings, DataSourcePluginOptionsEditorProps, DataSourceSettings, FormField } from '@grafana/ui';
|
||||
import { DataSourcePluginOptionsEditorProps, DataSourceSettings } from '@grafana/data';
|
||||
import { FormField, DataSourceHttpSettings } from '@grafana/ui';
|
||||
import { LokiOptions } from '../types';
|
||||
|
||||
export type Props = DataSourcePluginOptionsEditorProps<LokiOptions>;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import { shuffle } from 'lodash';
|
||||
import { ExploreStartPageProps, DataQuery } from '@grafana/ui';
|
||||
import { ExploreStartPageProps, DataQuery } from '@grafana/data';
|
||||
import LokiLanguageProvider from '../language_provider';
|
||||
|
||||
const DEFAULT_EXAMPLES = ['{job="default/prometheus"}'];
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
import React, { memo } from 'react';
|
||||
|
||||
// Types
|
||||
import { AbsoluteTimeRange } from '@grafana/data';
|
||||
import { QueryEditorProps } from '@grafana/ui';
|
||||
import { AbsoluteTimeRange, QueryEditorProps } from '@grafana/data';
|
||||
import { LokiDatasource } from '../datasource';
|
||||
import { LokiQuery } from '../types';
|
||||
import { LokiQueryField } from './LokiQueryField';
|
||||
|
||||
@@ -11,8 +11,8 @@ import { Plugin, Node } from 'slate';
|
||||
|
||||
// Types
|
||||
import { LokiQuery } from '../types';
|
||||
import { ExploreQueryFieldProps, DOMUtil } from '@grafana/ui';
|
||||
import { AbsoluteTimeRange } from '@grafana/data';
|
||||
import { DOMUtil } from '@grafana/ui';
|
||||
import { ExploreQueryFieldProps, AbsoluteTimeRange } from '@grafana/data';
|
||||
import { Grammar } from 'prismjs';
|
||||
import LokiLanguageProvider, { LokiHistoryItem } from '../language_provider';
|
||||
import LokiDatasource from '../datasource';
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import LokiDatasource from './datasource';
|
||||
import { LokiQuery } from './types';
|
||||
import { getQueryOptions } from 'test/helpers/getQueryOptions';
|
||||
import { AnnotationQueryRequest, DataSourceApi } from '@grafana/ui';
|
||||
import { DataFrame, dateTime } from '@grafana/data';
|
||||
import { AnnotationQueryRequest, DataSourceApi, DataFrame, dateTime } from '@grafana/data';
|
||||
import { BackendSrv } from 'app/core/services/backend_srv';
|
||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
|
||||
|
||||
@@ -9,13 +9,6 @@ import {
|
||||
AnnotationEvent,
|
||||
DataFrameView,
|
||||
LoadingState,
|
||||
} from '@grafana/data';
|
||||
import { addLabelToSelector } from 'app/plugins/datasource/prometheus/add_label_to_query';
|
||||
import LanguageProvider from './language_provider';
|
||||
import { logStreamToDataFrame } from './result_transformer';
|
||||
import { formatQuery, parseQuery, getHighlighterExpressionsFromQuery } from './query_utils';
|
||||
// Types
|
||||
import {
|
||||
PluginMeta,
|
||||
DataSourceApi,
|
||||
DataSourceInstanceSettings,
|
||||
@@ -23,7 +16,11 @@ import {
|
||||
DataQueryRequest,
|
||||
DataQueryResponse,
|
||||
AnnotationQueryRequest,
|
||||
} from '@grafana/ui';
|
||||
} from '@grafana/data';
|
||||
import { addLabelToSelector } from 'app/plugins/datasource/prometheus/add_label_to_query';
|
||||
import LanguageProvider from './language_provider';
|
||||
import { logStreamToDataFrame } from './result_transformer';
|
||||
import { formatQuery, parseQuery, getHighlighterExpressionsFromQuery } from './query_utils';
|
||||
|
||||
import { LokiQuery, LokiOptions, LokiLogsStream, LokiResponse } from './types';
|
||||
import { BackendSrv } from 'app/core/services/backend_srv';
|
||||
|
||||
@@ -7,11 +7,11 @@ import syntax from './syntax';
|
||||
|
||||
// Types
|
||||
import { LokiQuery } from './types';
|
||||
import { dateTime, AbsoluteTimeRange } from '@grafana/data';
|
||||
import { dateTime, AbsoluteTimeRange, LanguageProvider, HistoryItem } from '@grafana/data';
|
||||
import { PromQuery } from '../prometheus/types';
|
||||
|
||||
import LokiDatasource from './datasource';
|
||||
import { CompletionItem, TypeaheadInput, TypeaheadOutput, LanguageProvider, HistoryItem } from '@grafana/ui';
|
||||
import { CompletionItem, TypeaheadInput, TypeaheadOutput } from '@grafana/ui';
|
||||
|
||||
const DEFAULT_KEYS = ['job', 'namespace'];
|
||||
const EMPTY_SELECTOR = '{}';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import LokiDatasource from './datasource';
|
||||
import { DataSourceSettings } from '@grafana/ui';
|
||||
import { DataSourceSettings } from '@grafana/data';
|
||||
import { LokiOptions } from './types';
|
||||
import { createDatasourceSettings } from '../../../features/datasources/mocks';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataSourcePlugin } from '@grafana/ui';
|
||||
import { DataSourcePlugin } from '@grafana/data';
|
||||
import Datasource from './datasource';
|
||||
|
||||
import LokiCheatSheet from './components/LokiCheatSheet';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { DataQuery, DataSourceJsonData } from '@grafana/ui';
|
||||
import { Labels } from '@grafana/data';
|
||||
import { Labels, DataQuery, DataSourceJsonData } from '@grafana/data';
|
||||
|
||||
export interface LokiQuery extends DataQuery {
|
||||
expr: string;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { DatasourceSrvMock, MockDataSourceApi } from 'test/mocks/datasource_srv';
|
||||
import { getDataSourceSrv } from '@grafana/runtime';
|
||||
import { getQueryOptions } from 'test/helpers/getQueryOptions';
|
||||
import { DataSourceInstanceSettings } from '@grafana/ui';
|
||||
import { LoadingState } from '@grafana/data';
|
||||
import { LoadingState, DataSourceInstanceSettings } from '@grafana/data';
|
||||
import { MixedDatasource } from './module';
|
||||
import { from } from 'rxjs';
|
||||
|
||||
|
||||
@@ -3,8 +3,14 @@ import groupBy from 'lodash/groupBy';
|
||||
import { from, of, Observable, merge } from 'rxjs';
|
||||
import { tap } from 'rxjs/operators';
|
||||
|
||||
import { LoadingState } from '@grafana/data';
|
||||
import { DataSourceApi, DataQuery, DataQueryRequest, DataQueryResponse, DataSourceInstanceSettings } from '@grafana/ui';
|
||||
import {
|
||||
LoadingState,
|
||||
DataSourceApi,
|
||||
DataQuery,
|
||||
DataQueryRequest,
|
||||
DataQueryResponse,
|
||||
DataSourceInstanceSettings,
|
||||
} from '@grafana/data';
|
||||
import { getDataSourceSrv } from '@grafana/runtime';
|
||||
import { mergeMap, map } from 'rxjs/operators';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import _ from 'lodash';
|
||||
import { QueryCtrl } from 'app/plugins/sdk';
|
||||
import { auto } from 'angular';
|
||||
import { PanelEvents } from '@grafana/ui';
|
||||
import { PanelEvents } from '@grafana/data';
|
||||
|
||||
export interface MssqlQuery {
|
||||
refId: string;
|
||||
|
||||
@@ -8,7 +8,7 @@ import sqlPart from './sql_part';
|
||||
import { auto, IQService } from 'angular';
|
||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
import { CoreEvents } from 'app/types';
|
||||
import { PanelEvents } from '@grafana/ui';
|
||||
import { PanelEvents } from '@grafana/data';
|
||||
|
||||
export interface QueryMeta {
|
||||
sql: string;
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import angular, { IQService } from 'angular';
|
||||
import _ from 'lodash';
|
||||
import { dateMath } from '@grafana/data';
|
||||
import { dateMath, DataQueryRequest } from '@grafana/data';
|
||||
import { BackendSrv } from 'app/core/services/backend_srv';
|
||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
import { DataQueryRequest } from '@grafana/ui';
|
||||
|
||||
export default class OpenTsDatasource {
|
||||
type: any;
|
||||
|
||||
@@ -8,7 +8,7 @@ import sqlPart from './sql_part';
|
||||
import { auto, IQService } from 'angular';
|
||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
import { CoreEvents } from 'app/types';
|
||||
import { PanelEvents } from '@grafana/ui';
|
||||
import { PanelEvents } from '@grafana/data';
|
||||
|
||||
export interface QueryMeta {
|
||||
sql: string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { ExploreStartPageProps, DataQuery } from '@grafana/ui';
|
||||
import { ExploreStartPageProps, DataQuery } from '@grafana/data';
|
||||
|
||||
const CHEAT_SHEET_ITEMS = [
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ import React, { Component } from 'react';
|
||||
|
||||
import { PrometheusDatasource } from '../datasource';
|
||||
import { PromQuery } from '../types';
|
||||
import { DataQueryRequest, PanelData } from '@grafana/ui';
|
||||
import { DataQueryRequest, PanelData } from '@grafana/data';
|
||||
import { getDatasourceSrv } from 'app/features/plugins/datasource_srv';
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -2,8 +2,8 @@ import _ from 'lodash';
|
||||
import React, { PureComponent } from 'react';
|
||||
|
||||
// Types
|
||||
import { FormLabel, Select, Switch, QueryEditorProps } from '@grafana/ui';
|
||||
import { SelectableValue } from '@grafana/data';
|
||||
import { FormLabel, Select, Switch } from '@grafana/ui';
|
||||
import { SelectableValue, QueryEditorProps } from '@grafana/data';
|
||||
|
||||
import { PrometheusDatasource } from '../datasource';
|
||||
import { PromQuery, PromOptions } from '../types';
|
||||
|
||||
@@ -4,16 +4,15 @@ import React from 'react';
|
||||
import Cascader from 'rc-cascader';
|
||||
|
||||
import { Plugin } from 'slate';
|
||||
import { SlatePrism, TypeaheadInput, TypeaheadOutput, QueryField, BracesPlugin, HistoryItem } from '@grafana/ui';
|
||||
import { SlatePrism, TypeaheadInput, TypeaheadOutput, QueryField, BracesPlugin } from '@grafana/ui';
|
||||
|
||||
import Prism from 'prismjs';
|
||||
|
||||
// dom also includes Element polyfills
|
||||
import { PromQuery, PromContext, PromOptions } from '../types';
|
||||
import { CancelablePromise, makePromiseCancelable } from 'app/core/utils/CancelablePromise';
|
||||
import { ExploreQueryFieldProps, QueryHint, DOMUtil } from '@grafana/ui';
|
||||
import { isDataFrame, toLegacyResponseData } from '@grafana/data';
|
||||
import { SuggestionsState } from '@grafana/ui';
|
||||
import { ExploreQueryFieldProps, QueryHint, isDataFrame, toLegacyResponseData, HistoryItem } from '@grafana/data';
|
||||
import { DOMUtil, SuggestionsState } from '@grafana/ui';
|
||||
import { PrometheusDatasource } from '../datasource';
|
||||
import PromQlLanguageProvider from '../language_provider';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { PrometheusDatasource } from './datasource';
|
||||
import { DataSourceInstanceSettings } from '@grafana/ui';
|
||||
import { DataSourceInstanceSettings } from '@grafana/data';
|
||||
import { PromContext, PromOptions } from './types';
|
||||
import { dateTime, LoadingState } from '@grafana/data';
|
||||
|
||||
|
||||
@@ -3,7 +3,20 @@ import _ from 'lodash';
|
||||
import $ from 'jquery';
|
||||
// Services & Utils
|
||||
import kbn from 'app/core/utils/kbn';
|
||||
import { AnnotationEvent, dateMath, DateTime, LoadingState, TimeRange, TimeSeries } from '@grafana/data';
|
||||
import {
|
||||
AnnotationEvent,
|
||||
dateMath,
|
||||
DateTime,
|
||||
LoadingState,
|
||||
TimeRange,
|
||||
TimeSeries,
|
||||
DataQueryError,
|
||||
DataQueryRequest,
|
||||
DataQueryResponse,
|
||||
DataQueryResponseData,
|
||||
DataSourceApi,
|
||||
DataSourceInstanceSettings,
|
||||
} from '@grafana/data';
|
||||
import { from, merge, Observable, of, forkJoin } from 'rxjs';
|
||||
import { filter, map, tap } from 'rxjs/operators';
|
||||
|
||||
@@ -16,14 +29,6 @@ import { getQueryHints } from './query_hints';
|
||||
import { expandRecordingRules } from './language_utils';
|
||||
// Types
|
||||
import { PromContext, PromOptions, PromQuery, PromQueryRequest } from './types';
|
||||
import {
|
||||
DataQueryError,
|
||||
DataQueryRequest,
|
||||
DataQueryResponse,
|
||||
DataQueryResponseData,
|
||||
DataSourceApi,
|
||||
DataSourceInstanceSettings,
|
||||
} from '@grafana/ui';
|
||||
import { safeStringifyValue } from 'app/core/utils/explore';
|
||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
import { TimeSrv } from 'app/features/dashboard/services/TimeSrv';
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
import _ from 'lodash';
|
||||
|
||||
import { dateTime } from '@grafana/data';
|
||||
import {
|
||||
CompletionItem,
|
||||
TypeaheadInput,
|
||||
TypeaheadOutput,
|
||||
CompletionItemGroup,
|
||||
LanguageProvider,
|
||||
HistoryItem,
|
||||
} from '@grafana/ui';
|
||||
import { dateTime, LanguageProvider, HistoryItem } from '@grafana/data';
|
||||
import { CompletionItem, TypeaheadInput, TypeaheadOutput, CompletionItemGroup } from '@grafana/ui';
|
||||
|
||||
import { parseSelector, processLabels, processHistogramLabels } from './language_utils';
|
||||
import PromqlSyntax, { FUNCTIONS, RATE_RANGES } from './promql';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import _ from 'lodash';
|
||||
import { QueryHint, QueryFix } from '@grafana/ui';
|
||||
import { QueryHint, QueryFix } from '@grafana/data';
|
||||
|
||||
/**
|
||||
* Number of time series results needed before starting to suggest sum aggregation hints
|
||||
|
||||
@@ -8,8 +8,7 @@ import {
|
||||
prometheusRegularEscape,
|
||||
prometheusSpecialRegexEscape,
|
||||
} from '../datasource';
|
||||
import { dateTime } from '@grafana/data';
|
||||
import { DataSourceInstanceSettings, DataQueryResponseData, DataQueryRequest } from '@grafana/ui';
|
||||
import { DataSourceInstanceSettings, DataQueryResponseData, DataQueryRequest, dateTime } from '@grafana/data';
|
||||
import { PromOptions, PromQuery, PromContext } from '../types';
|
||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
import { TimeSrv } from 'app/features/dashboard/services/TimeSrv';
|
||||
|
||||
@@ -2,7 +2,7 @@ import Plain from 'slate-plain-serializer';
|
||||
import { Editor as SlateEditor } from 'slate';
|
||||
import LanguageProvider from '../language_provider';
|
||||
import { PrometheusDatasource } from '../datasource';
|
||||
import { HistoryItem } from '@grafana/ui';
|
||||
import { HistoryItem } from '@grafana/data';
|
||||
import { PromQuery } from '../types';
|
||||
|
||||
describe('Language completion provider', () => {
|
||||
|
||||
@@ -2,8 +2,7 @@ import { PrometheusDatasource } from '../datasource';
|
||||
import PrometheusMetricFindQuery from '../metric_find_query';
|
||||
//@ts-ignore
|
||||
import q from 'q';
|
||||
import { toUtc } from '@grafana/data';
|
||||
import { DataSourceInstanceSettings } from '@grafana/ui';
|
||||
import { toUtc, DataSourceInstanceSettings } from '@grafana/data';
|
||||
import { PromOptions } from '../types';
|
||||
|
||||
describe('PrometheusMetricFindQuery', () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ResultTransformer } from '../result_transformer';
|
||||
import { DataQueryResponseData } from '@grafana/ui';
|
||||
import { DataQueryResponseData } from '@grafana/data';
|
||||
|
||||
describe('Prometheus Result Transformer', () => {
|
||||
const ctx: any = {};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataQuery, DataSourceJsonData } from '@grafana/ui';
|
||||
import { DataQuery, DataSourceJsonData } from '@grafana/data';
|
||||
|
||||
export enum PromContext {
|
||||
Explore = 'explore',
|
||||
|
||||
@@ -14,7 +14,7 @@ import { StackdriverQuery, MetricDescriptor } from '../types';
|
||||
import { getAlignmentPickerData } from '../functions';
|
||||
import StackdriverDatasource from '../datasource';
|
||||
import { TimeSeries, SelectableValue } from '@grafana/data';
|
||||
import { PanelEvents } from '@grafana/ui';
|
||||
import { PanelEvents } from '@grafana/data';
|
||||
|
||||
export interface Props {
|
||||
onQueryChange: (target: StackdriverQuery) => void;
|
||||
|
||||
@@ -3,8 +3,7 @@ import appEvents from 'app/core/app_events';
|
||||
import _ from 'lodash';
|
||||
import StackdriverMetricFindQuery from './StackdriverMetricFindQuery';
|
||||
import { StackdriverQuery, MetricDescriptor, StackdriverOptions } from './types';
|
||||
import { DataSourceApi, DataQueryRequest, DataSourceInstanceSettings } from '@grafana/ui';
|
||||
import { ScopedVars } from '@grafana/data';
|
||||
import { DataSourceApi, DataQueryRequest, DataSourceInstanceSettings, ScopedVars } from '@grafana/data';
|
||||
import { BackendSrv } from 'app/core/services/backend_srv';
|
||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
import { TimeSrv } from 'app/features/dashboard/services/TimeSrv';
|
||||
|
||||
@@ -2,8 +2,7 @@ import StackdriverDataSource from '../datasource';
|
||||
import { metricDescriptors } from './testData';
|
||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
import { CustomVariable } from 'app/features/templating/all';
|
||||
import { toUtc } from '@grafana/data';
|
||||
import { DataSourceInstanceSettings } from '@grafana/ui';
|
||||
import { DataSourceInstanceSettings, toUtc } from '@grafana/data';
|
||||
import { StackdriverOptions } from '../types';
|
||||
import { BackendSrv } from 'app/core/services/backend_srv';
|
||||
import { TimeSrv } from 'app/features/dashboard/services/TimeSrv';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataQuery, DataSourceJsonData } from '@grafana/ui';
|
||||
import { DataQuery, DataSourceJsonData } from '@grafana/data';
|
||||
|
||||
export enum MetricFindQueryTypes {
|
||||
Services = 'services',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Libraries
|
||||
import React, { PureComponent } from 'react';
|
||||
|
||||
import { DataSourcePluginOptionsEditorProps } from '@grafana/ui';
|
||||
import { DataSourcePluginOptionsEditorProps } from '@grafana/data';
|
||||
|
||||
type Props = DataSourcePluginOptionsEditorProps<any>;
|
||||
|
||||
|
||||
@@ -7,10 +7,9 @@ import { getBackendSrv } from '@grafana/runtime';
|
||||
|
||||
// Components
|
||||
import { FormLabel, Select } from '@grafana/ui';
|
||||
import { SelectableValue } from '@grafana/data';
|
||||
import { QueryEditorProps, SelectableValue } from '@grafana/data';
|
||||
|
||||
// Types
|
||||
import { QueryEditorProps } from '@grafana/ui';
|
||||
import { TestDataDataSource } from './datasource';
|
||||
import { TestDataQuery, Scenario } from './types';
|
||||
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import defaults from 'lodash/defaults';
|
||||
import { DataQueryRequest, DataQueryResponse, DataQueryError, DataStreamObserver, DataStreamState } from '@grafana/ui';
|
||||
|
||||
import {
|
||||
DataQueryRequest,
|
||||
DataQueryResponse,
|
||||
DataQueryError,
|
||||
DataStreamObserver,
|
||||
DataStreamState,
|
||||
FieldType,
|
||||
Field,
|
||||
LoadingState,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
|
||||
// Types
|
||||
import { PluginConfigPageProps, DataSourcePlugin } from '@grafana/ui';
|
||||
import { PluginConfigPageProps, DataSourcePlugin } from '@grafana/data';
|
||||
import { TestDataDataSource } from './datasource';
|
||||
|
||||
interface Props extends PluginConfigPageProps<DataSourcePlugin<TestDataDataSource>> {}
|
||||
|
||||
@@ -4,8 +4,9 @@ import {
|
||||
DataSourceApi,
|
||||
DataSourceInstanceSettings,
|
||||
MetricFindValue,
|
||||
} from '@grafana/ui';
|
||||
import { TableData, TimeSeries } from '@grafana/data';
|
||||
TableData,
|
||||
TimeSeries,
|
||||
} from '@grafana/data';
|
||||
import { Scenario, TestDataQuery } from './types';
|
||||
import { getBackendSrv } from 'app/core/services/backend_srv';
|
||||
import { queryMetricTree } from './metricTree';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataSourcePlugin } from '@grafana/ui';
|
||||
import { DataSourcePlugin } from '@grafana/data';
|
||||
import { TestDataDataSource } from './datasource';
|
||||
import { TestDataQueryCtrl } from './query_ctrl';
|
||||
import { TestInfoTab } from './TestInfoTab';
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
import { defaults } from 'lodash';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { DataQueryRequest, DataQueryResponse } from '@grafana/ui';
|
||||
|
||||
import { FieldType, CircularDataFrame, CSVReader, Field, LoadingState } from '@grafana/data';
|
||||
import {
|
||||
DataQueryRequest,
|
||||
DataQueryResponse,
|
||||
FieldType,
|
||||
CircularDataFrame,
|
||||
CSVReader,
|
||||
Field,
|
||||
LoadingState,
|
||||
} from '@grafana/data';
|
||||
|
||||
import { TestDataQuery, StreamingQuery } from './types';
|
||||
import { getRandomLine } from './LogIpsum';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataQuery } from '@grafana/ui';
|
||||
import { DataQuery } from '@grafana/data';
|
||||
|
||||
export interface Scenario {
|
||||
id: string;
|
||||
|
||||
Reference in New Issue
Block a user