Commit 17517703 by Hugo Häggmark Committed by GitHub

Fix: Fixes templateSrv is undefined for plugins that do not use @@ngInject (#20696)

Fixes #20662
parent 29d27fba
import _ from 'lodash'; import _ from 'lodash';
import { sanitize, escapeHtml } from 'app/core/utils/text'; import { escapeHtml, sanitize } from 'app/core/utils/text';
import config from 'app/core/config'; import config from 'app/core/config';
import { profiler } from 'app/core/core'; import { Emitter, profiler } from 'app/core/core';
import { Emitter } from 'app/core/core';
import getFactors from 'app/core/utils/factors'; import getFactors from 'app/core/utils/factors';
import { import {
duplicatePanel, calculateInnerPanelHeight,
removePanel,
copyPanel as copyPanelUtil, copyPanel as copyPanelUtil,
duplicatePanel,
editPanelJson as editPanelJsonUtil, editPanelJson as editPanelJsonUtil,
removePanel,
sharePanel as sharePanelUtil, sharePanel as sharePanelUtil,
calculateInnerPanelHeight,
} from 'app/features/dashboard/utils/panel'; } from 'app/features/dashboard/utils/panel';
import { GRID_COLUMN_COUNT } from 'app/core/constants'; import { GRID_COLUMN_COUNT } from 'app/core/constants';
import { auto } from 'angular'; import { auto } from 'angular';
import { TemplateSrv } from '../templating/template_srv'; import { TemplateSrv } from '../templating/template_srv';
import { getPanelLinksSupplier } from './panellinks/linkSuppliers'; import { getPanelLinksSupplier } from './panellinks/linkSuppliers';
import { renderMarkdown, AppEvent, PanelEvents, PanelPluginMeta } from '@grafana/data'; import { AppEvent, PanelEvents, PanelPluginMeta, renderMarkdown } from '@grafana/data';
import { getLocationSrv } from '@grafana/runtime'; import { getLocationSrv } from '@grafana/runtime';
export class PanelCtrl { export class PanelCtrl {
...@@ -39,7 +38,6 @@ export class PanelCtrl { ...@@ -39,7 +38,6 @@ export class PanelCtrl {
timing: any; timing: any;
maxPanelsPerRowOptions: number[]; maxPanelsPerRowOptions: number[];
/** @ngInject */
constructor($scope: any, $injector: auto.IInjectorService) { constructor($scope: any, $injector: auto.IInjectorService) {
this.$injector = $injector; this.$injector = $injector;
this.$location = $injector.get('$location'); this.$location = $injector.get('$location');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment