grafana/public/test/helpers/initTemplateSrv.ts
Dominik Prokop 683ce69347
Link suppliers: getLinks API update (#29757)
* ContextMenuPlugin WIP

* Remove Add annotations menu item from graph context menu

* ts ifx

* WIP

* Tests updates

* ts check fix

* Fix rebase

* Use replace function in angular graph data links
2020-12-15 13:29:37 +01:00

13 lines
494 B
TypeScript

import { TimeRange } from '@grafana/data';
import { convertToStoreState } from './convertToStoreState';
import { TemplateSrv } from '../../app/features/templating/template_srv';
import { getTemplateSrvDependencies } from './getTemplateSrvDependencies';
export function initTemplateSrv(variables: any[], timeRange?: TimeRange) {
const state = convertToStoreState(variables);
const srv = new TemplateSrv(getTemplateSrvDependencies(state));
srv.init(variables, timeRange);
return srv;
}