mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Remove deprecated re-exported template variable types (#87459)
Chore: Remove deprecated re-exported template varible types
This commit is contained in:
@@ -3524,12 +3524,11 @@ exports[`better eslint`] = {
|
||||
],
|
||||
"public/app/features/variables/types.ts:5381": [
|
||||
[0, 0, 0, "Do not re-export imported variable (\`@grafana/data\`)", "0"],
|
||||
[0, 0, 0, "Do not re-export imported variable (\`VariableHide\`)", "1"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "4"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "5"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "6"]
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "5"]
|
||||
],
|
||||
"public/app/features/variables/utils.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { defaults, each, sortBy } from 'lodash';
|
||||
|
||||
import { DataSourceRef, PanelPluginMeta } from '@grafana/data';
|
||||
import { DataSourceRef, PanelPluginMeta, VariableOption, VariableRefresh } from '@grafana/data';
|
||||
import { getDataSourceSrv } from '@grafana/runtime';
|
||||
import config from 'app/core/config';
|
||||
import { PanelModel } from 'app/features/dashboard/state';
|
||||
@@ -10,7 +10,6 @@ import { variableRegex } from 'app/features/variables/utils';
|
||||
import { isPanelModelLibraryPanel } from '../../../library-panels/guard';
|
||||
import { LibraryElementKind } from '../../../library-panels/types';
|
||||
import { isConstant, isQuery } from '../../../variables/guard';
|
||||
import { VariableOption, VariableRefresh } from '../../../variables/types';
|
||||
import { DashboardModel } from '../../state/DashboardModel';
|
||||
import { GridPos } from '../../state/PanelModel';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
|
||||
import { isEmptyObject, SelectableValue } from '@grafana/data';
|
||||
import { isEmptyObject, SelectableValue, VariableRefresh } from '@grafana/data';
|
||||
import { getBackendSrv } from '@grafana/runtime';
|
||||
import { Button, ClipboardButton, Field, Input, LinkButton, Modal, Select, Spinner } from '@grafana/ui';
|
||||
import { t, Trans } from 'app/core/internationalization';
|
||||
@@ -8,7 +8,6 @@ import { getTimeSrv } from 'app/features/dashboard/services/TimeSrv';
|
||||
import { DashboardModel, PanelModel } from 'app/features/dashboard/state';
|
||||
import { DashboardInteractions } from 'app/features/dashboard-scene/utils/interactions';
|
||||
|
||||
import { VariableRefresh } from '../../../variables/types';
|
||||
import { getDashboardSnapshotSrv } from '../../services/SnapshotSrv';
|
||||
|
||||
import { ShareModalTabProps } from './types';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { each, map } from 'lodash';
|
||||
|
||||
import { DataLinkBuiltInVars, MappingType } from '@grafana/data';
|
||||
import { DataLinkBuiltInVars, MappingType, VariableHide } from '@grafana/data';
|
||||
import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks';
|
||||
import { setDataSourceSrv } from '@grafana/runtime';
|
||||
import { FieldConfigSource } from '@grafana/schema';
|
||||
@@ -9,7 +9,6 @@ import { GRID_CELL_HEIGHT, GRID_CELL_VMARGIN } from 'app/core/constants';
|
||||
import { mockDataSource, MockDataSourceSrv } from 'app/features/alerting/unified/mocks';
|
||||
import { MIXED_DATASOURCE_NAME } from 'app/plugins/datasource/mixed/MixedDataSource';
|
||||
|
||||
import { VariableHide } from '../../variables/types';
|
||||
import { DashboardModel } from '../state/DashboardModel';
|
||||
import { PanelModel } from '../state/PanelModel';
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import { each, find, findIndex, flattenDeep, isArray, isBoolean, isNumber, isStr
|
||||
|
||||
import {
|
||||
AnnotationQuery,
|
||||
ConstantVariableModel,
|
||||
DataLink,
|
||||
DataLinkBuiltInVars,
|
||||
DataQuery,
|
||||
@@ -19,10 +20,12 @@ import {
|
||||
SpecialValueMatch,
|
||||
standardEditorsRegistry,
|
||||
standardFieldConfigEditorRegistry,
|
||||
TextBoxVariableModel,
|
||||
ThresholdsConfig,
|
||||
urlUtil,
|
||||
ValueMap,
|
||||
ValueMapping,
|
||||
VariableHide,
|
||||
} from '@grafana/data';
|
||||
import { labelsToFieldsTransformer } from '@grafana/data/src/transformations/transformers/labelsToFields';
|
||||
import { mergeTransformer } from '@grafana/data/src/transformations/transformers/merge';
|
||||
@@ -59,7 +62,6 @@ import {
|
||||
migrateMultipleStatsAnnotationQuery,
|
||||
migrateMultipleStatsMetricsQuery,
|
||||
} from '../../../plugins/datasource/cloudwatch/migrations/dashboardMigrations';
|
||||
import { ConstantVariableModel, TextBoxVariableModel, VariableHide } from '../../variables/types';
|
||||
|
||||
import { DashboardModel } from './DashboardModel';
|
||||
import { PanelModel } from './PanelModel';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import { connect, ConnectedProps } from 'react-redux';
|
||||
|
||||
import { DataSourceInstanceSettings, getDataSourceRef } from '@grafana/data';
|
||||
import { AdHocVariableModel, DataSourceInstanceSettings, getDataSourceRef } from '@grafana/data';
|
||||
import { AdHocVariableForm } from 'app/features/dashboard-scene/settings/variables/components/AdHocVariableForm';
|
||||
import { StoreState } from 'app/types';
|
||||
|
||||
@@ -9,7 +9,6 @@ import { initialVariableEditorState } from '../editor/reducer';
|
||||
import { getAdhocVariableEditorState } from '../editor/selectors';
|
||||
import { VariableEditorProps } from '../editor/types';
|
||||
import { getVariablesState } from '../state/selectors';
|
||||
import { AdHocVariableModel } from '../types';
|
||||
import { toKeyedVariableIdentifier } from '../utils';
|
||||
|
||||
import { changeVariableDatasource } from './actions';
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { cloneDeep } from 'lodash';
|
||||
|
||||
import { DataSourceRef } from '@grafana/data';
|
||||
import { AdHocVariableFilter, AdHocVariableModel, DataSourceRef } from '@grafana/data';
|
||||
import { getDatasourceSrv } from 'app/features/plugins/datasource_srv';
|
||||
import { AdHocVariableFilter, AdHocVariableModel } from 'app/features/variables/types';
|
||||
import { StoreState, ThunkResult } from 'app/types';
|
||||
|
||||
import { changeVariableEditorExtended } from '../editor/reducer';
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { cloneDeep } from 'lodash';
|
||||
|
||||
import { AdHocVariableModel } from '@grafana/data';
|
||||
|
||||
import { dispatch } from '../../../store/store';
|
||||
import { VariableAdapter } from '../adapters';
|
||||
import { AdHocVariableModel } from '../types';
|
||||
import { toKeyedVariableIdentifier } from '../utils';
|
||||
|
||||
import { AdHocVariableEditor } from './AdHocVariableEditor';
|
||||
|
||||
@@ -3,10 +3,9 @@ import userEvent from '@testing-library/user-event';
|
||||
import React from 'react';
|
||||
import selectEvent from 'react-select-event';
|
||||
|
||||
import { AdHocVariableFilter } from '@grafana/data';
|
||||
import { DataSourceSrv, setDataSourceSrv } from '@grafana/runtime';
|
||||
|
||||
import { AdHocVariableFilter } from '../../types';
|
||||
|
||||
import { AdHocFilter } from './AdHocFilter';
|
||||
|
||||
describe('AdHocFilter', () => {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import React, { PureComponent, ReactNode } from 'react';
|
||||
|
||||
import { DataSourceRef, SelectableValue } from '@grafana/data';
|
||||
import { AdHocVariableFilter, DataSourceRef, SelectableValue } from '@grafana/data';
|
||||
import { Segment } from '@grafana/ui';
|
||||
import { AdHocVariableFilter } from 'app/features/variables/types';
|
||||
|
||||
import { AdHocFilterBuilder } from './AdHocFilterBuilder';
|
||||
import { REMOVE_FILTER_KEY } from './AdHocFilterKey';
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import React, { useCallback, useState } from 'react';
|
||||
|
||||
import { DataSourceRef, SelectableValue } from '@grafana/data';
|
||||
import { AdHocVariableFilter, DataSourceRef, SelectableValue } from '@grafana/data';
|
||||
import { t } from 'app/core/internationalization';
|
||||
import { AdHocVariableFilter } from 'app/features/variables/types';
|
||||
|
||||
import { AdHocFilterKey, REMOVE_FILTER_KEY } from './AdHocFilterKey';
|
||||
import { AdHocFilterRenderer } from './AdHocFilterRenderer';
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import React from 'react';
|
||||
|
||||
import { DataSourceRef, SelectableValue } from '@grafana/data';
|
||||
import { AdHocVariableFilter } from 'app/features/variables/types';
|
||||
import { AdHocVariableFilter, DataSourceRef, SelectableValue } from '@grafana/data';
|
||||
|
||||
import { AdHocFilterKey } from './AdHocFilterKey';
|
||||
import { AdHocFilterValue } from './AdHocFilterValue';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import { connect, ConnectedProps } from 'react-redux';
|
||||
|
||||
import { AdHocVariableFilter, AdHocVariableModel } from 'app/features/variables/types';
|
||||
import { AdHocVariableFilter, AdHocVariableModel } from '@grafana/data';
|
||||
|
||||
import { VariablePickerProps } from '../../pickers/types';
|
||||
import { toKeyedVariableIdentifier } from '../../utils';
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { cloneDeep } from 'lodash';
|
||||
|
||||
import { AdHocVariableFilter, AdHocVariableModel } from '@grafana/data';
|
||||
|
||||
import { reducerTester } from '../../../../test/core/redux/reducerTester';
|
||||
import { getVariableTestContext } from '../state/helpers';
|
||||
import { VariablesState } from '../state/types';
|
||||
import { AdHocVariableFilter, AdHocVariableModel } from '../types';
|
||||
import { toVariablePayload } from '../utils';
|
||||
|
||||
import { createAdHocVariableAdapter } from './adapter';
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
||||
|
||||
import { AdHocVariableFilter, AdHocVariableModel, initialVariableModelState } from 'app/features/variables/types';
|
||||
import { AdHocVariableFilter, AdHocVariableModel } from '@grafana/data';
|
||||
import { initialVariableModelState } from 'app/features/variables/types';
|
||||
|
||||
import { getInstanceState } from '../state/selectors';
|
||||
import { initialVariablesState, VariablePayload, VariablesState } from '../state/types';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { UrlQueryValue } from '@grafana/data';
|
||||
import { AdHocVariableFilter } from 'app/features/variables/types';
|
||||
import { AdHocVariableFilter, UrlQueryValue } from '@grafana/data';
|
||||
|
||||
import { toFilters, toUrl } from './urlParser';
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { isArray, isString } from 'lodash';
|
||||
|
||||
import { UrlQueryValue } from '@grafana/data';
|
||||
import { AdHocVariableFilter } from 'app/features/variables/types';
|
||||
import { AdHocVariableFilter, UrlQueryValue } from '@grafana/data';
|
||||
|
||||
export const toUrl = (filters: AdHocVariableFilter[]): string[] => {
|
||||
return filters.map((filter) => toArray(filter).map(escapeDelimiter).join('|'));
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import React, { FormEvent, PureComponent } from 'react';
|
||||
|
||||
import { ConstantVariableModel } from '@grafana/data';
|
||||
import { ConstantVariableForm } from 'app/features/dashboard-scene/settings/variables/components/ConstantVariableForm';
|
||||
|
||||
import { VariableEditorProps } from '../editor/types';
|
||||
import { ConstantVariableModel } from '../types';
|
||||
|
||||
export interface Props extends VariableEditorProps<ConstantVariableModel> {}
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { ConstantVariableModel, VariableOption } from '@grafana/data';
|
||||
|
||||
import { reduxTester } from '../../../../test/core/redux/reduxTester';
|
||||
import { variableAdapters } from '../adapters';
|
||||
import { getRootReducer, RootReducerType } from '../state/helpers';
|
||||
import { toKeyedAction } from '../state/keyedVariablesReducer';
|
||||
import { addVariable, setCurrentVariableValue } from '../state/sharedReducer';
|
||||
import { ConstantVariableModel, initialVariableModelState, VariableOption } from '../types';
|
||||
import { initialVariableModelState } from '../types';
|
||||
import { toKeyedVariableIdentifier, toVariablePayload } from '../utils';
|
||||
|
||||
import { updateConstantVariableOptions } from './actions';
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { cloneDeep } from 'lodash';
|
||||
|
||||
import { ConstantVariableModel } from '@grafana/data';
|
||||
|
||||
import { dispatch } from '../../../store/store';
|
||||
import { VariableAdapter } from '../adapters';
|
||||
import { optionPickerFactory } from '../pickers';
|
||||
import { setOptionAsCurrent, setOptionFromUrl } from '../state/actions';
|
||||
import { ConstantVariableModel } from '../types';
|
||||
import { toKeyedVariableIdentifier } from '../utils';
|
||||
|
||||
import { ConstantVariableEditor } from './ConstantVariableEditor';
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { cloneDeep } from 'lodash';
|
||||
|
||||
import { ConstantVariableModel } from '@grafana/data';
|
||||
|
||||
import { reducerTester } from '../../../../test/core/redux/reducerTester';
|
||||
import { getVariableTestContext } from '../state/helpers';
|
||||
import { VariablesState } from '../state/types';
|
||||
import { ConstantVariableModel } from '../types';
|
||||
import { toVariablePayload } from '../utils';
|
||||
|
||||
import { createConstantVariableAdapter } from './adapter';
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
||||
|
||||
import { ConstantVariableModel, VariableHide, VariableOption } from '@grafana/data';
|
||||
|
||||
import { getInstanceState } from '../state/selectors';
|
||||
import { initialVariablesState, VariablePayload, VariablesState } from '../state/types';
|
||||
import { ConstantVariableModel, initialVariableModelState, VariableHide, VariableOption } from '../types';
|
||||
import { initialVariableModelState } from '../types';
|
||||
|
||||
export const initialConstantVariableModelState: ConstantVariableModel = {
|
||||
...initialVariableModelState,
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import React, { FormEvent, PureComponent } from 'react';
|
||||
import { MapDispatchToProps, MapStateToProps } from 'react-redux';
|
||||
|
||||
import { CustomVariableModel, VariableWithMultiSupport } from '@grafana/data';
|
||||
import { connectWithStore } from 'app/core/utils/connectWithReduxStore';
|
||||
import { CustomVariableForm } from 'app/features/dashboard-scene/settings/variables/components/CustomVariableForm';
|
||||
import { StoreState } from 'app/types';
|
||||
|
||||
import { OnPropChangeArguments, VariableEditorProps } from '../editor/types';
|
||||
import { changeVariableMultiValue } from '../state/actions';
|
||||
import { CustomVariableModel, VariableWithMultiSupport } from '../types';
|
||||
|
||||
interface OwnProps extends VariableEditorProps<CustomVariableModel> {}
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { CustomVariableModel, VariableOption } from '@grafana/data';
|
||||
|
||||
import { reduxTester } from '../../../../test/core/redux/reduxTester';
|
||||
import { variableAdapters } from '../adapters';
|
||||
import { getRootReducer, RootReducerType } from '../state/helpers';
|
||||
import { toKeyedAction } from '../state/keyedVariablesReducer';
|
||||
import { addVariable, setCurrentVariableValue } from '../state/sharedReducer';
|
||||
import { CustomVariableModel, initialVariableModelState, VariableOption } from '../types';
|
||||
import { initialVariableModelState } from '../types';
|
||||
import { toKeyedVariableIdentifier, toVariablePayload } from '../utils';
|
||||
|
||||
import { updateCustomVariableOptions } from './actions';
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { cloneDeep } from 'lodash';
|
||||
|
||||
import { CustomVariableModel } from '@grafana/data';
|
||||
|
||||
import { dispatch } from '../../../store/store';
|
||||
import { VariableAdapter } from '../adapters';
|
||||
import { ALL_VARIABLE_TEXT } from '../constants';
|
||||
import { optionPickerFactory } from '../pickers';
|
||||
import { setOptionAsCurrent, setOptionFromUrl } from '../state/actions';
|
||||
import { CustomVariableModel } from '../types';
|
||||
import { containsVariable, isAllVariable, toKeyedVariableIdentifier } from '../utils';
|
||||
|
||||
import { CustomVariableEditor } from './CustomVariableEditor';
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { cloneDeep } from 'lodash';
|
||||
|
||||
import { CustomVariableModel } from '@grafana/data';
|
||||
|
||||
import { reducerTester } from '../../../../test/core/redux/reducerTester';
|
||||
import { ALL_VARIABLE_TEXT, ALL_VARIABLE_VALUE } from '../constants';
|
||||
import { getVariableTestContext } from '../state/helpers';
|
||||
import { VariablesState } from '../state/types';
|
||||
import { CustomVariableModel } from '../types';
|
||||
import { toVariablePayload } from '../utils';
|
||||
|
||||
import { createCustomVariableAdapter } from './adapter';
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
||||
|
||||
import { CustomVariableModel, VariableOption } from '@grafana/data';
|
||||
|
||||
import { ALL_VARIABLE_TEXT, ALL_VARIABLE_VALUE } from '../constants';
|
||||
import { getInstanceState } from '../state/selectors';
|
||||
import { initialVariablesState, VariablePayload, VariablesState } from '../state/types';
|
||||
import { CustomVariableModel, initialVariableModelState, VariableOption } from '../types';
|
||||
import { initialVariableModelState } from '../types';
|
||||
|
||||
export const initialCustomVariableModelState: CustomVariableModel = {
|
||||
...initialVariableModelState,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { FormEvent, PureComponent } from 'react';
|
||||
import { connect, ConnectedProps } from 'react-redux';
|
||||
|
||||
import { SelectableValue } from '@grafana/data';
|
||||
import { DataSourceVariableModel, SelectableValue, VariableWithMultiSupport } from '@grafana/data';
|
||||
import { DataSourceVariableForm } from 'app/features/dashboard-scene/settings/variables/components/DataSourceVariableForm';
|
||||
|
||||
import { StoreState } from '../../../types';
|
||||
@@ -10,7 +10,6 @@ import { getDatasourceVariableEditorState } from '../editor/selectors';
|
||||
import { OnPropChangeArguments, VariableEditorProps } from '../editor/types';
|
||||
import { changeVariableMultiValue } from '../state/actions';
|
||||
import { getVariablesState } from '../state/selectors';
|
||||
import { DataSourceVariableModel, VariableWithMultiSupport } from '../types';
|
||||
import { toKeyedVariableIdentifier } from '../utils';
|
||||
|
||||
import { initDataSourceVariableEditor } from './actions';
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { cloneDeep } from 'lodash';
|
||||
|
||||
import { DataSourceVariableModel } from '@grafana/data';
|
||||
|
||||
import { dispatch } from '../../../store/store';
|
||||
import { VariableAdapter } from '../adapters';
|
||||
import { ALL_VARIABLE_TEXT } from '../constants';
|
||||
import { optionPickerFactory } from '../pickers';
|
||||
import { setOptionAsCurrent, setOptionFromUrl } from '../state/actions';
|
||||
import { DataSourceVariableModel } from '../types';
|
||||
import { containsVariable, isAllVariable, toKeyedVariableIdentifier } from '../utils';
|
||||
|
||||
import { DataSourceVariableEditor } from './DataSourceVariableEditor';
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import { cloneDeep } from 'lodash';
|
||||
|
||||
import { DataSourceInstanceSettings } from '@grafana/data';
|
||||
import { DataSourceInstanceSettings, DataSourceVariableModel } from '@grafana/data';
|
||||
import { getMockPlugins } from '@grafana/data/test/__mocks__/pluginMocks';
|
||||
|
||||
import { reducerTester } from '../../../../test/core/redux/reducerTester';
|
||||
import { getDataSourceInstanceSetting } from '../shared/testing/helpers';
|
||||
import { getVariableTestContext } from '../state/helpers';
|
||||
import { VariablesState } from '../state/types';
|
||||
import { DataSourceVariableModel } from '../types';
|
||||
import { toVariablePayload } from '../utils';
|
||||
|
||||
import { createDataSourceVariableAdapter } from './adapter';
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
||||
|
||||
import { DataSourceInstanceSettings, matchPluginId } from '@grafana/data';
|
||||
import {
|
||||
DataSourceInstanceSettings,
|
||||
DataSourceVariableModel,
|
||||
matchPluginId,
|
||||
VariableOption,
|
||||
VariableRefresh,
|
||||
} from '@grafana/data';
|
||||
|
||||
import { ALL_VARIABLE_TEXT, ALL_VARIABLE_VALUE } from '../constants';
|
||||
import { getInstanceState } from '../state/selectors';
|
||||
import { initialVariablesState, VariablePayload, VariablesState } from '../state/types';
|
||||
import { DataSourceVariableModel, initialVariableModelState, VariableOption, VariableRefresh } from '../types';
|
||||
import { initialVariableModelState } from '../types';
|
||||
|
||||
export const initialDataSourceVariableModelState: DataSourceVariableModel = {
|
||||
...initialVariableModelState,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import React, { ChangeEvent, FormEvent, useCallback } from 'react';
|
||||
|
||||
import { VariableWithMultiSupport } from '@grafana/data';
|
||||
import { SelectionOptionsForm } from 'app/features/dashboard-scene/settings/variables/components/SelectionOptionsForm';
|
||||
|
||||
import { KeyedVariableIdentifier } from '../state/types';
|
||||
import { VariableWithMultiSupport } from '../types';
|
||||
import { toKeyedVariableIdentifier } from '../utils';
|
||||
|
||||
import { VariableEditorProps } from './types';
|
||||
|
||||
@@ -2,7 +2,7 @@ import React, { FormEvent, PureComponent } from 'react';
|
||||
import { connect, ConnectedProps } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
|
||||
import { LoadingState, SelectableValue, VariableType } from '@grafana/data';
|
||||
import { LoadingState, SelectableValue, VariableHide, VariableType } from '@grafana/data';
|
||||
import { selectors } from '@grafana/e2e-selectors';
|
||||
import { locationService } from '@grafana/runtime';
|
||||
import { Button, HorizontalGroup, Icon } from '@grafana/ui';
|
||||
@@ -20,7 +20,6 @@ import { toKeyedAction } from '../state/keyedVariablesReducer';
|
||||
import { getVariable, getVariablesState } from '../state/selectors';
|
||||
import { changeVariableProp, changeVariableType, removeVariable } from '../state/sharedReducer';
|
||||
import { KeyedVariableIdentifier } from '../state/types';
|
||||
import { VariableHide } from '../types';
|
||||
import { toKeyedVariableIdentifier, toVariablePayload } from '../utils';
|
||||
|
||||
import { ConfirmDeleteModal } from './ConfirmDeleteModal';
|
||||
|
||||
@@ -2,6 +2,8 @@ import { ComponentType } from 'react';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import {
|
||||
AdHocVariableModel,
|
||||
ConstantVariableModel,
|
||||
DataQuery,
|
||||
DataQueryRequest,
|
||||
DataQueryResponse,
|
||||
@@ -9,21 +11,16 @@ import {
|
||||
DataSourceJsonData,
|
||||
DataSourceRef,
|
||||
MetricFindValue,
|
||||
QueryVariableModel,
|
||||
StandardVariableQuery,
|
||||
VariableModel,
|
||||
VariableSupportType,
|
||||
VariableWithMultiSupport,
|
||||
VariableWithOptions,
|
||||
} from '@grafana/data';
|
||||
|
||||
import { LEGACY_VARIABLE_QUERY_EDITOR_NAME } from './editor/LegacyVariableQueryEditor';
|
||||
import {
|
||||
AdHocVariableModel,
|
||||
ConstantVariableModel,
|
||||
QueryVariableModel,
|
||||
VariableQueryEditorType,
|
||||
VariableQueryEditorProps,
|
||||
VariableWithMultiSupport,
|
||||
VariableWithOptions,
|
||||
} from './types';
|
||||
import { VariableQueryEditorType, VariableQueryEditorProps } from './types';
|
||||
|
||||
/** @deprecated use a if (model.type === "query") type narrowing check instead */
|
||||
export const isQuery = (model: VariableModel): model is QueryVariableModel => {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { cloneDeep } from 'lodash';
|
||||
|
||||
import { IntervalVariableModel } from '@grafana/data';
|
||||
|
||||
import { dispatch } from '../../../store/store';
|
||||
import { VariableAdapter } from '../adapters';
|
||||
import { optionPickerFactory } from '../pickers';
|
||||
import { setOptionAsCurrent, setOptionFromUrl } from '../state/actions';
|
||||
import { IntervalVariableModel } from '../types';
|
||||
import { toKeyedVariableIdentifier } from '../utils';
|
||||
|
||||
import { IntervalVariableEditor } from './IntervalVariableEditor';
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { cloneDeep } from 'lodash';
|
||||
|
||||
import { IntervalVariableModel } from '@grafana/data';
|
||||
|
||||
import { reducerTester } from '../../../../test/core/redux/reducerTester';
|
||||
import { getVariableTestContext } from '../state/helpers';
|
||||
import { VariablesState } from '../state/types';
|
||||
import { IntervalVariableModel } from '../types';
|
||||
import { toVariablePayload } from '../utils';
|
||||
|
||||
import { createIntervalVariableAdapter } from './adapter';
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
||||
import { map } from 'lodash';
|
||||
|
||||
import { IntervalVariableModel, VariableRefresh, VariableOption } from '@grafana/data';
|
||||
|
||||
import { getInstanceState } from '../state/selectors';
|
||||
import { initialVariablesState, VariablePayload, VariablesState } from '../state/types';
|
||||
import { initialVariableModelState, IntervalVariableModel, VariableOption, VariableRefresh } from '../types';
|
||||
import { initialVariableModelState } from '../types';
|
||||
|
||||
export const initialIntervalVariableModelState: IntervalVariableModel = {
|
||||
...initialVariableModelState,
|
||||
|
||||
@@ -4,12 +4,11 @@ import React from 'react';
|
||||
import { Provider } from 'react-redux';
|
||||
import { Store } from 'redux';
|
||||
|
||||
import { LoadingState } from '@grafana/data';
|
||||
import { LoadingState, QueryVariableModel, VariableWithMultiSupport, VariableWithOptions } from '@grafana/data';
|
||||
import { selectors } from '@grafana/e2e-selectors';
|
||||
|
||||
import { queryBuilder } from '../../shared/testing/builders';
|
||||
import { getPreloadedState } from '../../state/helpers';
|
||||
import { QueryVariableModel, VariableWithMultiSupport, VariableWithOptions } from '../../types';
|
||||
import { VariablePickerProps } from '../types';
|
||||
|
||||
import { optionPickerFactory } from './OptionsPicker';
|
||||
|
||||
@@ -2,7 +2,7 @@ import React, { ComponentType, PureComponent } from 'react';
|
||||
import { connect, ConnectedProps } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
|
||||
import { LoadingState } from '@grafana/data';
|
||||
import { LoadingState, VariableOption, VariableWithMultiSupport, VariableWithOptions } from '@grafana/data';
|
||||
import { ClickOutsideWrapper } from '@grafana/ui';
|
||||
import { StoreState, ThunkDispatch } from 'app/types';
|
||||
|
||||
@@ -13,7 +13,6 @@ import { formatVariableLabel } from '../../shared/formatVariable';
|
||||
import { toKeyedAction } from '../../state/keyedVariablesReducer';
|
||||
import { getVariablesState } from '../../state/selectors';
|
||||
import { KeyedVariableIdentifier } from '../../state/types';
|
||||
import { VariableOption, VariableWithMultiSupport, VariableWithOptions } from '../../types';
|
||||
import { toKeyedVariableIdentifier } from '../../utils';
|
||||
import { VariableInput } from '../shared/VariableInput';
|
||||
import { VariableLink } from '../shared/VariableLink';
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { QueryVariableModel, VariableSort, VariableRefresh } from '@grafana/data';
|
||||
import { locationService } from '@grafana/runtime';
|
||||
|
||||
import { reduxTester } from '../../../../../test/core/redux/reduxTester';
|
||||
@@ -7,7 +8,7 @@ import { queryBuilder } from '../../shared/testing/builders';
|
||||
import { getPreloadedState, getRootReducer, RootReducerType } from '../../state/helpers';
|
||||
import { toKeyedAction } from '../../state/keyedVariablesReducer';
|
||||
import { addVariable, changeVariableProp, setCurrentVariableValue } from '../../state/sharedReducer';
|
||||
import { initialVariableModelState, QueryVariableModel, VariableRefresh, VariableSort } from '../../types';
|
||||
import { initialVariableModelState } from '../../types';
|
||||
import { toKeyedVariableIdentifier, toVariablePayload } from '../../utils';
|
||||
import { NavigationKey } from '../types';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { debounce, trim } from 'lodash';
|
||||
|
||||
import { isEmptyObject, containsSearchFilter } from '@grafana/data';
|
||||
import { isEmptyObject, containsSearchFilter, VariableWithOptions, VariableOption } from '@grafana/data';
|
||||
import { StoreState, ThunkDispatch, ThunkResult } from 'app/types';
|
||||
|
||||
import { variableAdapters } from '../../adapters';
|
||||
@@ -9,7 +9,6 @@ import { toKeyedAction } from '../../state/keyedVariablesReducer';
|
||||
import { getVariable, getVariablesState } from '../../state/selectors';
|
||||
import { changeVariableProp, setCurrentVariableValue } from '../../state/sharedReducer';
|
||||
import { KeyedVariableIdentifier } from '../../state/types';
|
||||
import { VariableOption, VariableWithOptions } from '../../types';
|
||||
import { getCurrentValue, toVariablePayload } from '../../utils';
|
||||
import { NavigationKey } from '../types';
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { cloneDeep } from 'lodash';
|
||||
|
||||
import { QueryVariableModel, VariableOption } from '@grafana/data';
|
||||
|
||||
import { reducerTester } from '../../../../../test/core/redux/reducerTester';
|
||||
import { ALL_VARIABLE_TEXT, ALL_VARIABLE_VALUE } from '../../constants';
|
||||
import { QueryVariableModel, VariableOption } from '../../types';
|
||||
|
||||
import {
|
||||
cleanPickerState,
|
||||
|
||||
@@ -2,12 +2,11 @@ import uFuzzy from '@leeoniya/ufuzzy';
|
||||
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
||||
import { cloneDeep, isString } from 'lodash';
|
||||
|
||||
import { containsSearchFilter } from '@grafana/data';
|
||||
import { containsSearchFilter, VariableOption, VariableWithOptions } from '@grafana/data';
|
||||
|
||||
import { applyStateChanges } from '../../../../core/utils/applyStateChanges';
|
||||
import { ALL_VARIABLE_VALUE } from '../../constants';
|
||||
import { isMulti, isQuery } from '../../guard';
|
||||
import { VariableOption, VariableWithOptions } from '../../types';
|
||||
|
||||
export interface ToggleOption {
|
||||
option?: VariableOption;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import { css, cx } from '@emotion/css';
|
||||
import React, { PureComponent } from 'react';
|
||||
|
||||
import { GrafanaTheme2 } from '@grafana/data';
|
||||
import { GrafanaTheme2, VariableOption } from '@grafana/data';
|
||||
import { selectors } from '@grafana/e2e-selectors';
|
||||
import { Tooltip, Themeable2, withTheme2, clearButtonStyles, stylesFactory } from '@grafana/ui';
|
||||
import { Trans, t } from 'app/core/internationalization';
|
||||
|
||||
import { ALL_VARIABLE_VALUE } from '../../constants';
|
||||
import { VariableOption } from '../../types';
|
||||
|
||||
export interface Props extends React.HTMLProps<HTMLUListElement>, Themeable2 {
|
||||
multi: boolean;
|
||||
|
||||
@@ -3,7 +3,7 @@ import userEvent from '@testing-library/user-event';
|
||||
import React from 'react';
|
||||
import { MockDataSourceApi } from 'test/mocks/datasource_srv';
|
||||
|
||||
import { VariableSupportType } from '@grafana/data';
|
||||
import { QueryVariableModel, VariableSupportType } from '@grafana/data';
|
||||
import { selectors } from '@grafana/e2e-selectors';
|
||||
import { mockDataSource } from 'app/features/alerting/unified/mocks';
|
||||
import { DataSourceType } from 'app/features/alerting/unified/utils/datasource';
|
||||
@@ -11,7 +11,6 @@ import { DataSourceType } from 'app/features/alerting/unified/utils/datasource';
|
||||
import { NEW_VARIABLE_ID } from '../constants';
|
||||
import { LegacyVariableQueryEditor } from '../editor/LegacyVariableQueryEditor';
|
||||
import { KeyedVariableIdentifier } from '../state/types';
|
||||
import { QueryVariableModel } from '../types';
|
||||
|
||||
import { Props, QueryVariableEditorUnConnected } from './QueryVariableEditor';
|
||||
import { initialQueryVariableModelState } from './reducer';
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
import React, { FormEvent, PureComponent } from 'react';
|
||||
import { connect, ConnectedProps } from 'react-redux';
|
||||
|
||||
import { DataSourceInstanceSettings, getDataSourceRef, SelectableValue } from '@grafana/data';
|
||||
import {
|
||||
DataSourceInstanceSettings,
|
||||
getDataSourceRef,
|
||||
QueryVariableModel,
|
||||
SelectableValue,
|
||||
VariableRefresh,
|
||||
VariableSort,
|
||||
} from '@grafana/data';
|
||||
import { QueryVariableEditorForm } from 'app/features/dashboard-scene/settings/variables/components/QueryVariableForm';
|
||||
|
||||
import { StoreState } from '../../../types';
|
||||
@@ -11,7 +18,6 @@ import { getQueryVariableEditorState } from '../editor/selectors';
|
||||
import { VariableEditorProps } from '../editor/types';
|
||||
import { changeVariableMultiValue } from '../state/actions';
|
||||
import { getVariablesState } from '../state/selectors';
|
||||
import { QueryVariableModel, VariableRefresh, VariableSort } from '../types';
|
||||
import { toKeyedVariableIdentifier } from '../utils';
|
||||
|
||||
import { changeQueryVariableDataSource, changeQueryVariableQuery, initQueryVariableEditor } from './actions';
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import React, { PropsWithChildren, useMemo } from 'react';
|
||||
|
||||
import { SelectableValue } from '@grafana/data';
|
||||
import { SelectableValue, VariableSort } from '@grafana/data';
|
||||
|
||||
import { VariableSelectField } from '../../dashboard-scene/settings/variables/components/VariableSelectField';
|
||||
import { VariableSort } from '../types';
|
||||
|
||||
interface Props {
|
||||
onChange: (option: SelectableValue<VariableSort>) => void;
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { delay } from 'rxjs/operators';
|
||||
|
||||
import { DataSourceApi, getDefaultTimeRange, LoadingState, VariableSupportType } from '@grafana/data';
|
||||
import {
|
||||
DataSourceApi,
|
||||
getDefaultTimeRange,
|
||||
LoadingState,
|
||||
QueryVariableModel,
|
||||
VariableSupportType,
|
||||
} from '@grafana/data';
|
||||
|
||||
import { queryBuilder } from '../shared/testing/builders';
|
||||
import { getPreloadedState } from '../state/helpers';
|
||||
import { toKeyedAction } from '../state/keyedVariablesReducer';
|
||||
import { initialTransactionState } from '../state/transactionReducer';
|
||||
import { KeyedVariableIdentifier } from '../state/types';
|
||||
import { QueryVariableModel } from '../types';
|
||||
import { toKeyedVariableIdentifier } from '../utils';
|
||||
|
||||
import { UpdateOptionsResults, VariableQueryRunner } from './VariableQueryRunner';
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
DataSourceApi,
|
||||
LoadingState,
|
||||
PanelData,
|
||||
QueryVariableModel,
|
||||
ScopedVars,
|
||||
} from '@grafana/data';
|
||||
|
||||
@@ -18,7 +19,6 @@ import { getTimeSrv } from '../../dashboard/services/TimeSrv';
|
||||
import { runRequest } from '../../query/state/runRequest';
|
||||
import { getLastKey, getVariable } from '../state/selectors';
|
||||
import { KeyedVariableIdentifier } from '../state/types';
|
||||
import { QueryVariableModel } from '../types';
|
||||
import { getTemplatedRegex } from '../utils';
|
||||
|
||||
import { toMetricFindValuesOperator, updateOptionsState, validateVariableSelection } from './operators';
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
import React from 'react';
|
||||
|
||||
import { DataSourceApi, DataSourceRef, getDefaultTimeRange, LoadingState } from '@grafana/data';
|
||||
import {
|
||||
DataSourceApi,
|
||||
DataSourceRef,
|
||||
getDefaultTimeRange,
|
||||
LoadingState,
|
||||
QueryVariableModel,
|
||||
VariableHide,
|
||||
VariableRefresh,
|
||||
VariableSort,
|
||||
} from '@grafana/data';
|
||||
import { DataSourceSrv, setDataSourceSrv } from '@grafana/runtime';
|
||||
|
||||
import { reduxTester } from '../../../../test/core/redux/reduxTester';
|
||||
@@ -29,7 +38,7 @@ import {
|
||||
variableStateFetching,
|
||||
} from '../state/sharedReducer';
|
||||
import { variablesInitTransaction } from '../state/transactionReducer';
|
||||
import { QueryVariableModel, VariableHide, VariableQueryEditorProps, VariableRefresh, VariableSort } from '../types';
|
||||
import { VariableQueryEditorProps } from '../types';
|
||||
import { toKeyedVariableIdentifier, toVariablePayload } from '../utils';
|
||||
|
||||
import { setVariableQueryRunner, VariableQueryRunner } from './VariableQueryRunner';
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { cloneDeep } from 'lodash';
|
||||
|
||||
import { QueryVariableModel, VariableRefresh } from '@grafana/data';
|
||||
|
||||
import { dispatch } from '../../../store/store';
|
||||
import { VariableAdapter } from '../adapters';
|
||||
import { ALL_VARIABLE_TEXT } from '../constants';
|
||||
import { optionPickerFactory } from '../pickers';
|
||||
import { setOptionAsCurrent, setOptionFromUrl } from '../state/actions';
|
||||
import { QueryVariableModel, VariableRefresh } from '../types';
|
||||
import { containsVariable, isAllVariable, toKeyedVariableIdentifier } from '../utils';
|
||||
|
||||
import { QueryVariableEditor } from './QueryVariableEditor';
|
||||
|
||||
@@ -8,12 +8,12 @@ import {
|
||||
isDataFrame,
|
||||
MetricFindValue,
|
||||
PanelData,
|
||||
QueryVariableModel,
|
||||
} from '@grafana/data';
|
||||
|
||||
import { ThunkDispatch } from '../../../types';
|
||||
import { validateVariableSelectionState } from '../state/actions';
|
||||
import { toKeyedAction } from '../state/keyedVariablesReducer';
|
||||
import { QueryVariableModel } from '../types';
|
||||
import { getTemplatedRegex, toKeyedVariableIdentifier, toVariablePayload } from '../utils';
|
||||
|
||||
import { updateVariableOptions } from './reducer';
|
||||
|
||||
@@ -5,11 +5,10 @@ import {
|
||||
DataSourceApi,
|
||||
getDefaultTimeRange,
|
||||
QueryVariableModel,
|
||||
VariableRefresh,
|
||||
VariableSupportType,
|
||||
} from '@grafana/data';
|
||||
|
||||
import { VariableRefresh } from '../types';
|
||||
|
||||
import { QueryRunners, RunnerArgs, variableDummyRefId } from './queryRunners';
|
||||
|
||||
describe('QueryRunners', () => {
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
getDefaultTimeRange,
|
||||
LoadingState,
|
||||
PanelData,
|
||||
QueryVariableModel,
|
||||
VariableSupportType,
|
||||
} from '@grafana/data';
|
||||
|
||||
@@ -18,7 +19,6 @@ import {
|
||||
hasLegacyVariableSupport,
|
||||
hasStandardVariableSupport,
|
||||
} from '../guard';
|
||||
import { QueryVariableModel } from '../types';
|
||||
import { getLegacyQueryOptions } from '../utils';
|
||||
|
||||
export interface RunnerArgs {
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { cloneDeep } from 'lodash';
|
||||
|
||||
import { MetricFindValue } from '@grafana/data';
|
||||
import { MetricFindValue, QueryVariableModel, VariableSort } from '@grafana/data';
|
||||
|
||||
import { reducerTester } from '../../../../test/core/redux/reducerTester';
|
||||
import { getVariableTestContext } from '../state/helpers';
|
||||
import { VariablesState } from '../state/types';
|
||||
import { QueryVariableModel, VariableSort } from '../types';
|
||||
import { toVariablePayload } from '../utils';
|
||||
|
||||
import { createQueryVariableAdapter } from './adapter';
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
||||
import { isNumber, sortBy, toLower, uniqBy } from 'lodash';
|
||||
|
||||
import { MetricFindValue, stringToJsRegex } from '@grafana/data';
|
||||
import {
|
||||
MetricFindValue,
|
||||
QueryVariableModel,
|
||||
stringToJsRegex,
|
||||
VariableOption,
|
||||
VariableRefresh,
|
||||
VariableSort,
|
||||
} from '@grafana/data';
|
||||
|
||||
import { ALL_VARIABLE_TEXT, ALL_VARIABLE_VALUE, NONE_VARIABLE_TEXT, NONE_VARIABLE_VALUE } from '../constants';
|
||||
import { getInstanceState } from '../state/selectors';
|
||||
import { initialVariablesState, VariablePayload, VariablesState } from '../state/types';
|
||||
import { initialVariableModelState, QueryVariableModel, VariableOption, VariableRefresh, VariableSort } from '../types';
|
||||
import { initialVariableModelState } from '../types';
|
||||
|
||||
interface VariableOptionsUpdate {
|
||||
templatedRegex: string;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { VariableOption } from 'app/features/variables/types';
|
||||
import { VariableOption } from '@grafana/data';
|
||||
|
||||
import { alignCurrentWithMulti } from './multiOptions';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { VariableOption } from 'app/features/variables/types';
|
||||
import { VariableOption } from '@grafana/data';
|
||||
|
||||
export const alignCurrentWithMulti = (current: VariableOption, value: boolean): VariableOption => {
|
||||
if (!current) {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { DataSourceRef } from '@grafana/data';
|
||||
import { AdHocVariableFilter, AdHocVariableModel } from 'app/features/variables/types';
|
||||
import { AdHocVariableFilter, AdHocVariableModel, DataSourceRef } from '@grafana/data';
|
||||
|
||||
import { VariableBuilder } from './variableBuilder';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataSourceVariableModel, QueryVariableModel, VariableRefresh } from 'app/features/variables/types';
|
||||
import { DataSourceVariableModel, QueryVariableModel, VariableRefresh } from '@grafana/data';
|
||||
|
||||
import { MultiVariableBuilder } from './multiVariableBuilder';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IntervalVariableModel, VariableRefresh } from 'app/features/variables/types';
|
||||
import { IntervalVariableModel, VariableRefresh } from '@grafana/data';
|
||||
|
||||
import { OptionsVariableBuilder } from './optionsVariableBuilder';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { VariableWithMultiSupport } from 'app/features/variables/types';
|
||||
import { VariableWithMultiSupport } from '@grafana/data';
|
||||
|
||||
import { OptionsVariableBuilder } from './optionsVariableBuilder';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { VariableOption, VariableWithOptions } from 'app/features/variables/types';
|
||||
import { VariableOption, VariableWithOptions } from '@grafana/data';
|
||||
|
||||
import { VariableBuilder } from './variableBuilder';
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { DataSourceRef } from '@grafana/data';
|
||||
import { QueryVariableModel } from 'app/features/variables/types';
|
||||
import { DataSourceRef, QueryVariableModel } from '@grafana/data';
|
||||
|
||||
import { DatasourceVariableBuilder } from './datasourceVariableBuilder';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { TextBoxVariableModel } from 'app/features/variables/types';
|
||||
import { TextBoxVariableModel } from '@grafana/data';
|
||||
|
||||
import { OptionsVariableBuilder } from './optionsVariableBuilder';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { AnyAction } from 'redux';
|
||||
|
||||
import { LoadingState } from '@grafana/data';
|
||||
import { ConstantVariableModel, LoadingState, VariableRefresh } from '@grafana/data';
|
||||
import * as runtime from '@grafana/runtime';
|
||||
import { DataSourceSrv, LocationService } from '@grafana/runtime';
|
||||
import { BackendSrv } from 'app/core/services/backend_srv';
|
||||
@@ -27,7 +27,6 @@ import {
|
||||
textboxBuilder,
|
||||
} from '../shared/testing/builders';
|
||||
import { createTextBoxVariableAdapter } from '../textbox/adapter';
|
||||
import { ConstantVariableModel, VariableRefresh } from '../types';
|
||||
import { toKeyedVariableIdentifier, toVariablePayload } from '../utils';
|
||||
|
||||
import {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { dateTime, TimeRange } from '@grafana/data';
|
||||
import { dateTime, TimeRange, VariableRefresh } from '@grafana/data';
|
||||
import { config, DataSourceSrv } from '@grafana/runtime';
|
||||
import * as runtime from '@grafana/runtime';
|
||||
|
||||
@@ -17,7 +17,6 @@ import { createIntervalVariableAdapter } from '../interval/adapter';
|
||||
import { createIntervalOptions } from '../interval/reducer';
|
||||
import { createQueryVariableAdapter } from '../query/adapter';
|
||||
import { constantBuilder, intervalBuilder, queryBuilder, datasourceBuilder } from '../shared/testing/builders';
|
||||
import { VariableRefresh } from '../types';
|
||||
import { toKeyedVariableIdentifier, toVariablePayload } from '../utils';
|
||||
|
||||
import { onTimeRangeUpdated, OnTimeRangeUpdatedDependencies, setOptionAsCurrent } from './actions';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { UrlQueryMap } from '@grafana/data';
|
||||
import { UrlQueryMap, VariableRefresh } from '@grafana/data';
|
||||
import { setDataSourceSrv } from '@grafana/runtime';
|
||||
import { DashboardModel } from 'app/features/dashboard/state';
|
||||
import { DatasourceSrv } from 'app/features/plugins/datasource_srv';
|
||||
@@ -11,7 +11,6 @@ import { setVariableQueryRunner, VariableQueryRunner } from '../query/VariableQu
|
||||
import { createQueryVariableAdapter } from '../query/adapter';
|
||||
import { updateVariableOptions } from '../query/reducer';
|
||||
import { customBuilder, queryBuilder } from '../shared/testing/builders';
|
||||
import { VariableRefresh } from '../types';
|
||||
import { toKeyedVariableIdentifier, toVariablePayload } from '../utils';
|
||||
|
||||
import { initDashboardTemplating, processVariable } from './actions';
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import { createAction } from '@reduxjs/toolkit';
|
||||
import { ComponentType } from 'react';
|
||||
|
||||
import { VariableType } from '@grafana/data';
|
||||
import { QueryVariableModel, VariableType } from '@grafana/data';
|
||||
|
||||
import { reducerTester } from '../../../../test/core/redux/reducerTester';
|
||||
import { VariableAdapter, variableAdapters } from '../adapters';
|
||||
import { VariableEditorProps } from '../editor/types';
|
||||
import { VariablePickerProps } from '../pickers/types';
|
||||
import { QueryVariableModel } from '../types';
|
||||
import { toVariablePayload } from '../utils';
|
||||
|
||||
import { createQueryVariable } from './__tests__/fixtures';
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
import { cloneDeep } from 'lodash';
|
||||
|
||||
import { BaseVariableModel, LoadingState, VariableType } from '@grafana/data';
|
||||
import {
|
||||
BaseVariableModel,
|
||||
ConstantVariableModel,
|
||||
LoadingState,
|
||||
QueryVariableModel,
|
||||
VariableOption,
|
||||
VariableType,
|
||||
} from '@grafana/data';
|
||||
|
||||
import { reducerTester } from '../../../../test/core/redux/reducerTester';
|
||||
import { variableAdapters } from '../adapters';
|
||||
@@ -10,7 +17,6 @@ import { ALL_VARIABLE_TEXT, ALL_VARIABLE_VALUE } from '../constants';
|
||||
import { changeVariableNameSucceeded } from '../editor/reducer';
|
||||
import { createQueryVariableAdapter } from '../query/adapter';
|
||||
import { initialQueryVariableModelState } from '../query/reducer';
|
||||
import { ConstantVariableModel, QueryVariableModel, VariableOption } from '../types';
|
||||
import { toVariablePayload } from '../utils';
|
||||
|
||||
import { createConstantVariable } from './__tests__/fixtures';
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { ComponentType } from 'react';
|
||||
|
||||
import { LoadingState } from '@grafana/data';
|
||||
import { LoadingState, SystemVariable, VariableHide } from '@grafana/data';
|
||||
|
||||
import { VariableAdapter } from '../adapters';
|
||||
import { VariableEditorProps } from '../editor/types';
|
||||
import { VariablePickerProps } from '../pickers/types';
|
||||
import { initialVariableModelState, SystemVariable, VariableHide } from '../types';
|
||||
import { initialVariableModelState } from '../types';
|
||||
|
||||
export const createSystemVariableAdapter = (): VariableAdapter<SystemVariable<any>> => {
|
||||
return {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import React, { FormEvent, ReactElement, useCallback } from 'react';
|
||||
|
||||
import { TextBoxVariableModel } from '@grafana/data';
|
||||
import { selectors } from '@grafana/e2e-selectors';
|
||||
|
||||
import { VariableLegend } from '../../dashboard-scene/settings/variables/components/VariableLegend';
|
||||
import { VariableTextField } from '../../dashboard-scene/settings/variables/components/VariableTextField';
|
||||
import { VariableEditorProps } from '../editor/types';
|
||||
import { TextBoxVariableModel } from '../types';
|
||||
|
||||
export interface Props extends VariableEditorProps<TextBoxVariableModel> {}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { ChangeEvent, FocusEvent, KeyboardEvent, ReactElement, useCallback, useEffect, useState } from 'react';
|
||||
|
||||
import { isEmptyObject } from '@grafana/data';
|
||||
import { TextBoxVariableModel, isEmptyObject } from '@grafana/data';
|
||||
import { Input } from '@grafana/ui';
|
||||
import { t } from 'app/core/internationalization';
|
||||
import { useDispatch } from 'app/types';
|
||||
@@ -10,7 +10,6 @@ import { VARIABLE_PREFIX } from '../constants';
|
||||
import { VariablePickerProps } from '../pickers/types';
|
||||
import { toKeyedAction } from '../state/keyedVariablesReducer';
|
||||
import { changeVariableProp } from '../state/sharedReducer';
|
||||
import { TextBoxVariableModel } from '../types';
|
||||
import { toVariablePayload } from '../utils';
|
||||
|
||||
export interface Props extends VariablePickerProps<TextBoxVariableModel> {}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { VariableOption } from '@grafana/data';
|
||||
import { locationService } from '@grafana/runtime';
|
||||
|
||||
import { reduxTester } from '../../../../test/core/redux/reduxTester';
|
||||
@@ -6,7 +7,6 @@ import { textboxBuilder } from '../shared/testing/builders';
|
||||
import { getRootReducer, RootReducerType } from '../state/helpers';
|
||||
import { toKeyedAction } from '../state/keyedVariablesReducer';
|
||||
import { addVariable, changeVariableProp, setCurrentVariableValue } from '../state/sharedReducer';
|
||||
import { VariableOption } from '../types';
|
||||
import { toKeyedVariableIdentifier, toVariablePayload } from '../utils';
|
||||
|
||||
import { setTextBoxVariableOptionsFromUrl, updateTextBoxVariableOptions } from './actions';
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { VariableHide } from '@grafana/data';
|
||||
|
||||
import { variableAdapters } from '../adapters';
|
||||
import { textboxBuilder } from '../shared/testing/builders';
|
||||
import { VariableHide } from '../types';
|
||||
|
||||
import { createTextBoxVariableAdapter } from './adapter';
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { cloneDeep } from 'lodash';
|
||||
|
||||
import { TextBoxVariableModel } from '@grafana/data';
|
||||
|
||||
import { dispatch } from '../../../store/store';
|
||||
import { VariableAdapter } from '../adapters';
|
||||
import { setOptionAsCurrent } from '../state/actions';
|
||||
import { TextBoxVariableModel } from '../types';
|
||||
import { toKeyedVariableIdentifier } from '../utils';
|
||||
|
||||
import { TextBoxVariableEditor } from './TextBoxVariableEditor';
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { cloneDeep } from 'lodash';
|
||||
|
||||
import { TextBoxVariableModel } from '@grafana/data';
|
||||
|
||||
import { reducerTester } from '../../../../test/core/redux/reducerTester';
|
||||
import { getVariableTestContext } from '../state/helpers';
|
||||
import { VariablesState } from '../state/types';
|
||||
import { TextBoxVariableModel } from '../types';
|
||||
import { toVariablePayload } from '../utils';
|
||||
|
||||
import { createTextBoxVariableAdapter } from './adapter';
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
||||
|
||||
import { TextBoxVariableModel } from '@grafana/data';
|
||||
|
||||
import { getInstanceState } from '../state/selectors';
|
||||
import { initialVariablesState, VariablePayload, VariablesState } from '../state/types';
|
||||
import { initialVariableModelState, TextBoxVariableModel } from '../types';
|
||||
import { initialVariableModelState } from '../types';
|
||||
|
||||
export const initialTextBoxVariableModelState: TextBoxVariableModel = {
|
||||
...initialVariableModelState,
|
||||
|
||||
@@ -10,52 +10,7 @@ import {
|
||||
VariableHide,
|
||||
TypedVariableModel,
|
||||
} from '@grafana/data';
|
||||
export {
|
||||
/** @deprecated Import from @grafana/data instead */
|
||||
VariableRefresh,
|
||||
/** @deprecated Import from @grafana/data instead */
|
||||
VariableSort,
|
||||
/** @deprecated Import from @grafana/data instead */
|
||||
VariableHide,
|
||||
/** @deprecated Import from @grafana/data instead */
|
||||
AdHocVariableFilter,
|
||||
/** @deprecated Import from @grafana/data instead */
|
||||
AdHocVariableModel,
|
||||
/** @deprecated Import from @grafana/data instead */
|
||||
VariableOption,
|
||||
/** @deprecated Import from @grafana/data instead */
|
||||
IntervalVariableModel,
|
||||
/** @deprecated Import from @grafana/data instead */
|
||||
CustomVariableModel,
|
||||
/** @deprecated Import from @grafana/data instead */
|
||||
DataSourceVariableModel,
|
||||
/** @deprecated Import from @grafana/data instead */
|
||||
QueryVariableModel,
|
||||
/** @deprecated Import from @grafana/data instead */
|
||||
TextBoxVariableModel,
|
||||
/** @deprecated Import from @grafana/data instead */
|
||||
ConstantVariableModel,
|
||||
/** @deprecated Import from @grafana/data instead */
|
||||
VariableWithMultiSupport,
|
||||
/** @deprecated Import from @grafana/data instead */
|
||||
VariableWithOptions,
|
||||
/** @deprecated Import from @grafana/data instead */
|
||||
DashboardProps,
|
||||
/** @deprecated Import from @grafana/data instead */
|
||||
DashboardVariableModel,
|
||||
/** @deprecated Import from @grafana/data instead */
|
||||
OrgProps,
|
||||
/** @deprecated Import from @grafana/data instead */
|
||||
OrgVariableModel,
|
||||
/** @deprecated Import from @grafana/data instead */
|
||||
UserProps,
|
||||
/** @deprecated Import from @grafana/data instead */
|
||||
UserVariableModel,
|
||||
/** @deprecated Import from @grafana/data instead */
|
||||
SystemVariable,
|
||||
/** @deprecated Import from @grafana/data instead */
|
||||
BaseVariableModel as VariableModel,
|
||||
} from '@grafana/data';
|
||||
export { BaseVariableModel as VariableModel } from '@grafana/data';
|
||||
import { TemplateSrv } from '@grafana/runtime';
|
||||
|
||||
import { NEW_VARIABLE_ID } from './constants';
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { UrlQueryMap } from '@grafana/data';
|
||||
import { UrlQueryMap, VariableRefresh } from '@grafana/data';
|
||||
import { locationService } from '@grafana/runtime';
|
||||
|
||||
import { VariableRefresh } from './types';
|
||||
import {
|
||||
containsVariable,
|
||||
ensureStringValues,
|
||||
|
||||
Reference in New Issue
Block a user