mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Variables: Adds loading state and indicators (#27917)
* Refactor: Replaces initLock with state machine * Refactor: removes some states for now * Refactor: adds loading state in OptionsPicker * Refactor: major refactor of load state * Refactor: fixes updating graph in parallell * Refactor: moves error handling to updateOptions * Refactor: fixes the last cases * Tests: disables variable e2e again * Chore: removes nova config * Refactor: small changes when going through the code again * Refactor: fixes typings * Refactor: changes after PR comments * Refactor: split up onTimeRangeUpdated and fixed some error handling * Tests: removes unused func * Tests: fixes typing
This commit is contained in:
@@ -6,7 +6,7 @@ import { DataSourceInstanceSettings } from '@grafana/data';
|
||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
import { MetricsQueryEditor, normalizeQuery, Props } from './MetricsQueryEditor';
|
||||
import { CloudWatchDatasource } from '../datasource';
|
||||
import { CustomVariableModel, VariableHide } from '../../../../features/variables/types';
|
||||
import { CustomVariableModel, initialVariableModelState } from '../../../../features/variables/types';
|
||||
|
||||
const setup = () => {
|
||||
const instanceSettings = {
|
||||
@@ -15,6 +15,7 @@ const setup = () => {
|
||||
|
||||
const templateSrv = new TemplateSrv();
|
||||
const variable: CustomVariableModel = {
|
||||
...initialVariableModelState,
|
||||
id: 'var3',
|
||||
index: 0,
|
||||
name: 'var3',
|
||||
@@ -27,11 +28,7 @@ const setup = () => {
|
||||
multi: true,
|
||||
includeAll: false,
|
||||
query: '',
|
||||
hide: VariableHide.dontHide,
|
||||
type: 'custom',
|
||||
label: null,
|
||||
skipUrlSync: false,
|
||||
global: false,
|
||||
};
|
||||
templateSrv.init([variable]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user