Chore: reduces circular dependencies for variables/utils.ts (#44087)

* Chore: move constants to own file

* Chore: moves safe* functions to grafana/data

* Chore: moves safe* functions to grafana/data

* Chore: adds VariableQueryEditorProps and deprecates VariableQueryProps

* Chore: remove getDefaultVariableAdapters function

* Chore: moves transaction status to types

* Chore: fix tests that do not initialise TemplateSrv

* Chore: change space when stringifying

* Chore: revert safe* func move

* Chore: remove circular dependency in Explore utils
This commit is contained in:
Hugo Häggmark
2022-01-17 12:48:26 +01:00
committed by GitHub
parent aa00af8f2d
commit 4b4afc7b2c
42 changed files with 136 additions and 142 deletions

View File

@@ -8,28 +8,28 @@ import {
DataQueryRequest,
DataSourceApi,
dateMath,
DateTime,
DefaultTimeZone,
ExploreUrlState,
HistoryItem,
IntervalValues,
isDateTime,
LogsDedupStrategy,
LogsSortOrder,
rangeUtil,
RawTimeRange,
TimeFragment,
TimeRange,
TimeZone,
toUtc,
urlUtil,
ExploreUrlState,
rangeUtil,
DateTime,
isDateTime,
} from '@grafana/data';
import store from 'app/core/store';
import { v4 as uuidv4 } from 'uuid';
import { getNextRefIdChar } from './query';
// Types
import { RefreshPicker } from '@grafana/ui';
import { ExploreId, QueryOptions, QueryTransaction } from 'app/types/explore';
import { EXPLORE_GRAPH_STYLES, ExploreGraphStyle, ExploreId, QueryOptions, QueryTransaction } from 'app/types/explore';
import { config } from '../config';
import { TimeSrv } from 'app/features/dashboard/services/TimeSrv';
import { DataSourceSrv } from '@grafana/runtime';
@@ -201,10 +201,6 @@ export const safeStringifyValue = (value: any, space?: number) => {
return '';
};
export const EXPLORE_GRAPH_STYLES = ['lines', 'bars', 'points', 'stacked_lines', 'stacked_bars'] as const;
export type ExploreGraphStyle = typeof EXPLORE_GRAPH_STYLES[number];
const DEFAULT_GRAPH_STYLE: ExploreGraphStyle = 'lines';
// we use this function to take any kind of data we loaded
// from an external source (URL, localStorage, whatever),