mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 03:13:49 +08:00
Templating: removes old Angular variable system and featureToggle (#24779)
* Chore: initial commit * Tests: fixes MetricsQueryEditor.test.tsx * Tests: fixes cloudwatch/specs/datasource.test.ts * Tests: fixes stackdriver/specs/datasource.test.ts * Tests: remove refrences to CustomVariable * Refactor: moves DefaultVariableQueryEditor * Refactor: moves utils * Refactor: moves types * Refactor: removes variableSrv * Refactor: removes feature toggle newVariables * Refactor: removes valueSelectDropDown * Chore: removes GeneralTabCtrl * Chore: migrates RowOptions * Refactor: adds RowOptionsButton * Refactor: makes the interface more explicit * Refactor: small changes * Refactor: changed type as it can be any variable type * Tests: fixes broken test * Refactor: changes after PR comments * Refactor: adds loading state and call to onChange in componentDidMount
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { TextBoxVariableModel } from '../../templating/types';
|
||||
import { TextBoxVariableModel } from '../types';
|
||||
import { ThunkResult } from '../../../types';
|
||||
import { getVariable } from '../state/selectors';
|
||||
import { variableAdapters } from '../adapters';
|
||||
@ -12,7 +12,7 @@ export const updateTextBoxVariableOptions = (identifier: VariableIdentifier): Th
|
||||
return async (dispatch, getState) => {
|
||||
await dispatch(createTextBoxOptions(toVariablePayload(identifier)));
|
||||
|
||||
const variableInState = getVariable<TextBoxVariableModel>(identifier.id!, getState());
|
||||
const variableInState = getVariable<TextBoxVariableModel>(identifier.id, getState());
|
||||
await variableAdapters.get(identifier.type).setValue(variableInState, variableInState.options[0], true);
|
||||
};
|
||||
};
|
||||
@ -21,7 +21,7 @@ export const setTextBoxVariableOptionsFromUrl = (
|
||||
identifier: VariableIdentifier,
|
||||
urlValue: UrlQueryValue
|
||||
): ThunkResult<void> => async (dispatch, getState) => {
|
||||
const variableInState = getVariable<TextBoxVariableModel>(identifier.id!, getState());
|
||||
const variableInState = getVariable<TextBoxVariableModel>(identifier.id, getState());
|
||||
|
||||
dispatch(changeVariableProp(toVariablePayload(variableInState, { propName: 'query', propValue: urlValue })));
|
||||
|
||||
|
Reference in New Issue
Block a user