mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Variables: replaces homegrown variableAdapters with Registry (#22866)
* Refactor: intial commit * Tests: fixes tests * Refactor: adds stricter typings
This commit is contained in:
@@ -18,7 +18,7 @@ import { changeVariableEditorExtended } from '../editor/reducer';
|
||||
import { datasourceBuilder } from '../shared/testing/builders';
|
||||
|
||||
describe('data source actions', () => {
|
||||
variableAdapters.set('datasource', createDataSourceVariableAdapter());
|
||||
variableAdapters.setInit(() => [createDataSourceVariableAdapter()]);
|
||||
|
||||
describe('when updateDataSourceVariableOptions is dispatched', () => {
|
||||
describe('and there is no regex', () => {
|
||||
|
||||
@@ -11,8 +11,9 @@ import { updateDataSourceVariableOptions } from './actions';
|
||||
|
||||
export const createDataSourceVariableAdapter = (): VariableAdapter<DataSourceVariableModel> => {
|
||||
return {
|
||||
id: 'datasource',
|
||||
description: 'Enabled you to dynamically switch the datasource for multiple panels',
|
||||
label: 'Datasource',
|
||||
name: 'Datasource',
|
||||
initialState: initialDataSourceVariableModelState,
|
||||
reducer: dataSourceVariableReducer,
|
||||
picker: OptionsPicker,
|
||||
|
||||
Reference in New Issue
Block a user