Commit fcdc2974 by Ryan McKinley Committed by GitHub

@grafana/data: export dateMath and rangeUtil (#17971)

parent 3f151709
......@@ -10,5 +10,7 @@ export * from './object';
export * from './fieldCache';
export * from './moment_wrapper';
// Names are too general to export
// rangeutils, datemath
// Names are too general to export globally
import * as dateMath from './datemath';
import * as rangeUtil from './rangeutil';
export { dateMath, rangeUtil };
......@@ -9,7 +9,7 @@ import { ClickOutsideWrapper } from '../ClickOutsideWrapper/ClickOutsideWrapper'
// Utils & Services
import { isDateTime } from '@grafana/data';
import * as rangeUtil from '@grafana/data/src/utils/rangeutil';
import { rangeUtil } from '@grafana/data';
import { rawToTimeRange } from './time';
// Types
......
import { TimeRange, TIME_FORMAT, RawTimeRange, TimeZone } from '@grafana/data';
import { describeTimeRange } from '@grafana/data/src/utils/rangeutil';
import * as dateMath from '@grafana/data/src/utils/datemath';
import { dateMath } from '@grafana/data';
import { isDateTime, dateTime, DateTime, toUtc } from '@grafana/data';
export const rawToTimeRange = (raw: RawTimeRange, timeZone?: TimeZone): TimeRange => {
......
import coreModule from '../core_module';
import * as rangeUtil from '@grafana/data/src/utils/rangeutil';
import { rangeUtil } from '@grafana/data';
function ngModelOnBlur() {
return {
......
import * as rangeUtil from '@grafana/data/src/utils/rangeutil';
import { rangeUtil } from '@grafana/data';
import _ from 'lodash';
import { dateTime } from '@grafana/data';
......
......@@ -4,7 +4,7 @@ import { from } from 'rxjs';
import { isLive } from '@grafana/ui/src/components/RefreshPicker/RefreshPicker';
// Services & Utils
import * as dateMath from '@grafana/data/src/utils/datemath';
import { dateMath } from '@grafana/data';
import { renderUrl } from 'app/core/utils/url';
import kbn from 'app/core/utils/kbn';
import store from 'app/core/store';
......
......@@ -4,7 +4,7 @@ import moment from 'moment';
import _ from 'lodash';
import $ from 'jquery';
import kbn from 'app/core/utils/kbn';
import * as dateMath from '@grafana/data/src/utils/datemath';
import { dateMath } from '@grafana/data';
import impressionSrv from 'app/core/services/impression_srv';
export class DashboardLoaderSrv {
......
......@@ -4,7 +4,7 @@ import _ from 'lodash';
// Utils
import kbn from 'app/core/utils/kbn';
import coreModule from 'app/core/core_module';
import * as dateMath from '@grafana/data/src/utils/datemath';
import { dateMath } from '@grafana/data';
// Types
import { TimeRange, RawTimeRange, TimeZone } from '@grafana/data';
......
......@@ -4,7 +4,7 @@ import isEqual from 'lodash/isEqual';
// Utils & Services
import { getBackendSrv } from 'app/core/services/backend_srv';
import * as dateMath from '@grafana/data/src/utils/datemath';
import { dateMath } from '@grafana/data';
import {
guessFieldTypes,
LoadingState,
......
......@@ -8,8 +8,8 @@ import { TimeRange } from '@grafana/data';
// Utils
import { isString as _isString } from 'lodash';
import * as rangeUtil from '@grafana/data/src/utils/rangeutil';
import * as dateMath from '@grafana/data/src/utils/datemath';
import { rangeUtil } from '@grafana/data';
import { dateMath } from '@grafana/data';
import appEvents from 'app/core/app_events';
import config from 'app/core/config';
......
import _ from 'lodash';
import React, { PureComponent } from 'react';
import * as rangeUtil from '@grafana/data/src/utils/rangeutil';
import { rangeUtil } from '@grafana/data';
import { Switch } from '@grafana/ui';
import {
RawTimeRange,
......
......@@ -6,7 +6,7 @@ import { isLive } from '@grafana/ui/src/components/RefreshPicker/RefreshPicker';
import { DataStreamState, DataQueryResponse, DataQueryResponseData } from '@grafana/ui';
import { LoadingState, DataFrame, AbsoluteTimeRange } from '@grafana/data';
import * as dateMath from '@grafana/data/src/utils/datemath';
import { dateMath } from '@grafana/data';
import { ActionOf } from 'app/core/redux/actionCreatorFactory';
import { StoreState } from 'app/types/store';
......
......@@ -19,7 +19,7 @@ import TimeSeries from 'app/core/time_series2';
import TableModel from 'app/core/table_model';
import { coreModule, appEvents, contextSrv } from 'app/core/core';
import { DataSourcePlugin, AppPlugin, PanelPlugin, PluginMeta, DataSourcePluginMeta } from '@grafana/ui';
import * as dateMath from '@grafana/data/src/utils/datemath';
import { dateMath } from '@grafana/data';
import * as fileExport from 'app/core/utils/file_export';
import * as flatten from 'app/core/utils/flatten';
import * as ticks from 'app/core/utils/ticks';
......
import angular from 'angular';
import _ from 'lodash';
import * as dateMath from '@grafana/data/src/utils/datemath';
import { dateMath } from '@grafana/data';
import kbn from 'app/core/utils/kbn';
import { CloudWatchQuery } from './types';
import { DataSourceApi, DataQueryRequest, DataSourceInstanceSettings } from '@grafana/ui';
......
import '../datasource';
import CloudWatchDatasource from '../datasource';
import * as dateMath from '@grafana/data/src/utils/datemath';
import { dateMath } from '@grafana/data';
import { TemplateSrv } from 'app/features/templating/template_srv';
import { CustomVariable } from 'app/features/templating/all';
import _ from 'lodash';
......
import angular, { IQService } from 'angular';
import * as dateMath from '@grafana/data/src/utils/datemath';
import { dateMath } from '@grafana/data';
import _ from 'lodash';
import { ElasticDatasource, getMaxConcurrenShardRequestOrDefault } from '../datasource';
import { toUtc, dateTime } from '@grafana/data';
......
import _ from 'lodash';
import * as dateMath from '@grafana/data/src/utils/datemath';
import { dateMath } from '@grafana/data';
import { isVersionGtOrEq, SemVersion } from 'app/core/utils/version';
import gfunc from './gfunc';
import { IQService } from 'angular';
......
import _ from 'lodash';
import * as dateMath from '@grafana/data/src/utils/datemath';
import { dateMath } from '@grafana/data';
import InfluxSeries from './influx_series';
import InfluxQueryModel from './influx_query_model';
import ResponseParser from './response_parser';
......
......@@ -5,7 +5,7 @@ import { webSocket } from 'rxjs/webSocket';
import { catchError, map } from 'rxjs/operators';
// Services & Utils
import * as dateMath from '@grafana/data/src/utils/datemath';
import { dateMath } 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 angular, { IQService } from 'angular';
import _ from 'lodash';
import * as dateMath from '@grafana/data/src/utils/datemath';
import { dateMath } from '@grafana/data';
import { BackendSrv } from 'app/core/services/backend_srv';
import { TemplateSrv } from 'app/features/templating/template_srv';
import { DataQueryRequest } from '@grafana/ui';
......
......@@ -6,7 +6,7 @@ import { single, map, filter, catchError } from 'rxjs/operators';
// Services & Utils
import kbn from 'app/core/utils/kbn';
import * as dateMath from '@grafana/data/src/utils/datemath';
import { dateMath } from '@grafana/data';
import PrometheusMetricFindQuery from './metric_find_query';
import { ResultTransformer } from './result_transformer';
import PrometheusLanguageProvider from './language_provider';
......
......@@ -2,7 +2,7 @@ import _ from 'lodash';
import alertDef from '../../../features/alerting/state/alertDef';
import { PanelCtrl } from 'app/plugins/sdk';
import * as dateMath from '@grafana/data/src/utils/datemath';
import { dateMath } from '@grafana/data';
import { dateTime } from '@grafana/data';
import { auto } from 'angular';
import { BackendSrv } from '@grafana/runtime';
......
import _ from 'lodash';
import config from 'app/core/config';
import * as dateMath from '@grafana/data/src/utils/datemath';
import { dateMath } from '@grafana/data';
import { angularMocks, sinon } from '../lib/common';
import { PanelModel } from 'app/features/dashboard/state/PanelModel';
import { RawTimeRange } from '@grafana/data';
......
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