Commit b8d9722b by Torkel Ödegaard

tech: removing unused variables from typescript files, and making tslint rules more strict

parent adda84d1
import * as React from 'react'; import * as React from 'react';
import * as ReactDOM from 'react-dom'; // import from 'react-dom';
import coreModule from '../core_module'; import coreModule from '../core_module';
export interface IProps { export interface IProps {
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import config from 'app/core/config';
import _ from 'lodash';
import $ from 'jquery';
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
var template = ` var template = `
...@@ -37,7 +34,7 @@ export class ColorPickerCtrl { ...@@ -37,7 +34,7 @@ export class ColorPickerCtrl {
showAxisControls: boolean; showAxisControls: boolean;
/** @ngInject */ /** @ngInject */
constructor(private $scope, private $rootScope) { constructor(private $scope, $rootScope) {
this.colors = $rootScope.colors; this.colors = $rootScope.colors;
this.autoClose = $scope.autoClose; this.autoClose = $scope.autoClose;
this.series = $scope.series; this.series = $scope.series;
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import config from 'app/core/config';
import _ from 'lodash';
import $ from 'jquery';
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
var template = ` var template = `
......
///<reference path="../../../headers/common.d.ts" /> ///<reference path="../../../headers/common.d.ts" />
import config from 'app/core/config';
import _ from 'lodash'; import _ from 'lodash';
import $ from 'jquery'; import $ from 'jquery';
import coreModule from '../../core_module'; import coreModule from '../../core_module';
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import config from 'app/core/config'; import config from 'app/core/config';
import store from 'app/core/store';
import _ from 'lodash'; import _ from 'lodash';
import angular from 'angular';
import $ from 'jquery'; import $ from 'jquery';
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
......
...@@ -8,7 +8,7 @@ export class HelpCtrl { ...@@ -8,7 +8,7 @@ export class HelpCtrl {
shortcuts: any; shortcuts: any;
/** @ngInject */ /** @ngInject */
constructor(private $scope, $sce) { constructor() {
this.tabIndex = 0; this.tabIndex = 0;
this.shortcuts = { this.shortcuts = {
'Global': [ 'Global': [
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import _ from 'lodash'; import _ from 'lodash';
import $ from 'jquery';
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
import Drop from 'tether-drop'; import Drop from 'tether-drop';
......
...@@ -6,7 +6,6 @@ import { ...@@ -6,7 +6,6 @@ import {
getObjectName, getObjectName,
getType, getType,
getValuePreview, getValuePreview,
getPreview,
cssClass, cssClass,
createElement createElement
} from './helpers'; } from './helpers';
......
///<reference path="../../../headers/common.d.ts" /> ///<reference path="../../../headers/common.d.ts" />
import config from 'app/core/config';
import store from 'app/core/store'; import store from 'app/core/store';
import _ from 'lodash';
import $ from 'jquery';
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
var template = ` var template = `
......
<div class="navbar-inner"> <div class="navbar-inner">
<a class="navbar-brand-btn pointer" ng-click="ctrl.contextSrv.toggleSideMenu()"> <a class="navbar-brand-btn pointer" ng-click="ctrl.toggleSideMenu()">
<span class="navbar-brand-btn-background"> <span class="navbar-brand-btn-background">
<img src="public/img/grafana_icon.svg"></img> <img src="public/img/grafana_icon.svg"></img>
</span> </span>
......
///<reference path="../../../headers/common.d.ts" /> ///<reference path="../../../headers/common.d.ts" />
import config from 'app/core/config';
import _ from 'lodash';
import $ from 'jquery';
import coreModule from '../../core_module'; import coreModule from '../../core_module';
import {NavModel, NavModelItem} from '../../nav_model_srv'; import {NavModel, NavModelItem} from '../../nav_model_srv';
...@@ -12,7 +9,7 @@ export class NavbarCtrl { ...@@ -12,7 +9,7 @@ export class NavbarCtrl {
hasMenu: boolean; hasMenu: boolean;
/** @ngInject */ /** @ngInject */
constructor(private $scope, private $rootScope, private contextSrv) { constructor(private $rootScope, private contextSrv) {
this.section = this.model.section; this.section = this.model.section;
this.hasMenu = this.model.menu.length > 0; this.hasMenu = this.model.menu.length > 0;
} }
...@@ -21,6 +18,10 @@ export class NavbarCtrl { ...@@ -21,6 +18,10 @@ export class NavbarCtrl {
this.$rootScope.appEvent('show-dash-search'); this.$rootScope.appEvent('show-dash-search');
} }
toggleSideMenu() {
this.contextSrv.toggleSideMenu();
}
navItemClicked(navItem, evt) { navItemClicked(navItem, evt) {
if (navItem.clickHandler) { if (navItem.clickHandler) {
navItem.clickHandler(); navItem.clickHandler();
......
///<reference path="../../../headers/common.d.ts" /> ///<reference path="../../../headers/common.d.ts" />
import angular from 'angular';
import config from 'app/core/config'; import config from 'app/core/config';
import _ from 'lodash'; import _ from 'lodash';
import $ from 'jquery';
import coreModule from '../../core_module'; import coreModule from '../../core_module';
import appEvents from 'app/core/app_events';
export class SearchCtrl { export class SearchCtrl {
isOpen: boolean; isOpen: boolean;
...@@ -22,7 +19,7 @@ export class SearchCtrl { ...@@ -22,7 +19,7 @@ export class SearchCtrl {
openCompleted: boolean; openCompleted: boolean;
/** @ngInject */ /** @ngInject */
constructor(private $scope, private $location, private $timeout, private backendSrv, private contextSrv, private $rootScope) { constructor($scope, private $location, private $timeout, private backendSrv, public contextSrv, $rootScope) {
$rootScope.onAppEvent('show-dash-search', this.openSearch.bind(this), $scope); $rootScope.onAppEvent('show-dash-search', this.openSearch.bind(this), $scope);
$rootScope.onAppEvent('hide-dash-search', this.closeSearch.bind(this), $scope); $rootScope.onAppEvent('hide-dash-search', this.closeSearch.bind(this), $scope);
} }
......
///<reference path="../../../headers/common.d.ts" /> ///<reference path="../../../headers/common.d.ts" />
import config from 'app/core/config'; import config from 'app/core/config';
import _ from 'lodash';
import $ from 'jquery'; import $ from 'jquery';
import coreModule from '../../core_module'; import coreModule from '../../core_module';
...@@ -19,7 +18,7 @@ export class SideMenuCtrl { ...@@ -19,7 +18,7 @@ export class SideMenuCtrl {
maxShownOrgs: number; maxShownOrgs: number;
/** @ngInject */ /** @ngInject */
constructor(private $scope, private $location, private contextSrv, private backendSrv, private $element) { constructor(private $scope, private $location, private contextSrv, private backendSrv) {
this.isSignedIn = contextSrv.isSignedIn; this.isSignedIn = contextSrv.isSignedIn;
this.user = contextSrv.user; this.user = contextSrv.user;
this.appSubUrl = config.appSubUrl; this.appSubUrl = config.appSubUrl;
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import config from 'app/core/config';
import _ from 'lodash';
import $ from 'jquery';
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
import Drop from 'tether-drop';
var template = ` var template = `
<label for="check-{{ctrl.id}}" class="gf-form-label {{ctrl.labelClass}} pointer" ng-show="ctrl.label"> <label for="check-{{ctrl.id}}" class="gf-form-label {{ctrl.labelClass}} pointer" ng-show="ctrl.label">
......
...@@ -8,9 +8,9 @@ export class SignUpCtrl { ...@@ -8,9 +8,9 @@ export class SignUpCtrl {
/** @ngInject */ /** @ngInject */
constructor( constructor(
private $scope: any, private $scope: any,
private $location: any, private backendSrv: any,
private contextSrv: any, $location: any,
private backendSrv: any) { contextSrv: any) {
contextSrv.sidemenu = false; contextSrv.sidemenu = false;
$scope.ctrl = this; $scope.ctrl = this;
......
...@@ -7,7 +7,7 @@ export class DeltaCtrl { ...@@ -7,7 +7,7 @@ export class DeltaCtrl {
observer: any; observer: any;
/** @ngInject */ /** @ngInject */
constructor(private $rootScope) { constructor($rootScope) {
const waitForCompile = function(mutations) { const waitForCompile = function(mutations) {
if (mutations.length === 1) { if (mutations.length === 1) {
this.$rootScope.appEvent('json-diff-ready'); this.$rootScope.appEvent('json-diff-ready');
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import angular from 'angular';
import _ from 'lodash';
import $ from 'jquery'; import $ from 'jquery';
import coreModule from '../core_module'; import coreModule from '../core_module';
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
import _ from 'lodash'; import _ from 'lodash';
import config from 'app/core/config'; import config from 'app/core/config';
import coreModule from 'app/core/core_module';
import {Observable} from 'vendor/npm/rxjs/Observable'; import {Observable} from 'vendor/npm/rxjs/Observable';
......
///<reference path="../headers/common.d.ts" /> ///<reference path="../headers/common.d.ts" />
import $ from 'jquery'; import $ from 'jquery';
import _ from 'lodash';
import angular from 'angular'; import angular from 'angular';
export class Profiler { export class Profiler {
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
import './dashboard_loaders'; import './dashboard_loaders';
import angular from 'angular';
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
import {BundleLoader} from './bundle_loader'; import {BundleLoader} from './bundle_loader';
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
import angular from 'angular'; import angular from 'angular';
import _ from 'lodash'; import _ from 'lodash';
import $ from 'jquery';
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
import appEvents from 'app/core/app_events'; import appEvents from 'app/core/app_events';
...@@ -10,7 +9,7 @@ export class AlertSrv { ...@@ -10,7 +9,7 @@ export class AlertSrv {
list: any[]; list: any[];
/** @ngInject */ /** @ngInject */
constructor(private $timeout, private $sce, private $rootScope, private $modal) { constructor(private $timeout, private $rootScope, private $modal) {
this.list = []; this.list = [];
} }
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import angular from 'angular';
import _ from 'lodash'; import _ from 'lodash';
import config from 'app/core/config';
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
import appEvents from 'app/core/app_events'; import appEvents from 'app/core/app_events';
...@@ -12,7 +10,7 @@ export class BackendSrv { ...@@ -12,7 +10,7 @@ export class BackendSrv {
private noBackendCache: boolean; private noBackendCache: boolean;
/** @ngInject */ /** @ngInject */
constructor(private $http, private alertSrv, private $rootScope, private $q, private $timeout, private contextSrv) { constructor(private $http, private alertSrv, private $q, private $timeout, private contextSrv) {
} }
get(url, params?) { get(url, params?) {
......
...@@ -6,7 +6,7 @@ import coreModule from '../core_module'; ...@@ -6,7 +6,7 @@ import coreModule from '../core_module';
class DynamicDirectiveSrv { class DynamicDirectiveSrv {
/** @ngInject */ /** @ngInject */
constructor(private $compile, private $parse, private $rootScope) {} constructor(private $compile, private $rootScope) {}
addDirective(element, name, scope) { addDirective(element, name, scope) {
var child = angular.element(document.createElement(name)); var child = angular.element(document.createElement(name));
......
...@@ -14,10 +14,7 @@ export class KeybindingSrv { ...@@ -14,10 +14,7 @@ export class KeybindingSrv {
/** @ngInject */ /** @ngInject */
constructor( constructor(
private $rootScope, private $rootScope,
private $modal, private $location) {
private $location,
private contextSrv,
private $timeout) {
// clear out all shortcuts on route change // clear out all shortcuts on route change
$rootScope.$on('$routeChangeSuccess', () => { $rootScope.$on('$routeChangeSuccess', () => {
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import config from 'app/core/config';
import _ from 'lodash'; import _ from 'lodash';
import $ from 'jquery';
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
import Drop from 'tether-drop'; import Drop from 'tether-drop';
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import config from 'app/core/config';
import _ from 'lodash';
import $ from 'jquery';
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
import appEvents from 'app/core/app_events'; import appEvents from 'app/core/app_events';
......
...@@ -2,12 +2,6 @@ ...@@ -2,12 +2,6 @@
import EventEmitter from 'eventemitter3'; import EventEmitter from 'eventemitter3';
var hasOwnProp = {}.hasOwnProperty;
function createName(name) {
return '$' + name;
}
export class Emitter { export class Emitter {
emitter: any; emitter: any;
......
...@@ -11,7 +11,7 @@ export default class AdminListUsersCtrl { ...@@ -11,7 +11,7 @@ export default class AdminListUsersCtrl {
navModel: any; navModel: any;
/** @ngInject */ /** @ngInject */
constructor(private $scope, private backendSrv, private navModelSrv) { constructor(private $scope, private backendSrv, navModelSrv) {
this.navModel = navModelSrv.getAdminNav(); this.navModel = navModelSrv.getAdminNav();
this.query = ''; this.query = '';
this.getUsers(); this.getUsers();
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import angular from 'angular';
import _ from 'lodash'; import _ from 'lodash';
import moment from 'moment'; import moment from 'moment';
...@@ -22,7 +21,7 @@ export class AlertListCtrl { ...@@ -22,7 +21,7 @@ export class AlertListCtrl {
navModel: any; navModel: any;
/** @ngInject */ /** @ngInject */
constructor(private backendSrv, private $location, private $scope, navModelSrv) { constructor(private backendSrv, private $location, navModelSrv) {
this.navModel = navModelSrv.getAlertingNav(0); this.navModel = navModelSrv.getAlertingNav(0);
var params = $location.search(); var params = $location.search();
......
///<reference path="../../headers/common.d.ts" />
import _ from 'lodash';
import {QueryPart} from 'app/core/components/query_part/query_part';
import alertDef from './alert_def';
export class AlertModel {
constructor() {
}
}
...@@ -5,7 +5,6 @@ import {ThresholdMapper} from './threshold_mapper'; ...@@ -5,7 +5,6 @@ import {ThresholdMapper} from './threshold_mapper';
import {QueryPart} from 'app/core/components/query_part/query_part'; import {QueryPart} from 'app/core/components/query_part/query_part';
import alertDef from './alert_def'; import alertDef from './alert_def';
import config from 'app/core/config'; import config from 'app/core/config';
import moment from 'moment';
import appEvents from 'app/core/app_events'; import appEvents from 'app/core/app_events';
export class AlertTabCtrl { export class AlertTabCtrl {
...@@ -30,13 +29,11 @@ export class AlertTabCtrl { ...@@ -30,13 +29,11 @@ export class AlertTabCtrl {
/** @ngInject */ /** @ngInject */
constructor(private $scope, constructor(private $scope,
private $timeout,
private backendSrv, private backendSrv,
private dashboardSrv, private dashboardSrv,
private uiSegmentSrv, private uiSegmentSrv,
private $q, private $q,
private datasourceSrv, private datasourceSrv) {
private templateSrv) {
this.panelCtrl = $scope.ctrl; this.panelCtrl = $scope.ctrl;
this.panel = this.panelCtrl.panel; this.panel = this.panelCtrl.panel;
this.$scope.ctrl = this; this.$scope.ctrl = this;
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import angular from 'angular';
import _ from 'lodash'; import _ from 'lodash';
import config from 'app/core/config';
import {appEvents, coreModule} from 'app/core/core'; import {appEvents, coreModule} from 'app/core/core';
export class AlertNotificationEditCtrl { export class AlertNotificationEditCtrl {
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import angular from 'angular';
import _ from 'lodash';
import config from 'app/core/config';
import {coreModule} from 'app/core/core'; import {coreModule} from 'app/core/core';
export class AlertNotificationsListCtrl { export class AlertNotificationsListCtrl {
notifications: any; notifications: any;
navModel: any; navModel: any;
/** @ngInject */ /** @ngInject */
constructor(private backendSrv, private $scope, navModelSrv) { constructor(private backendSrv, navModelSrv) {
this.loadNotifications(); this.loadNotifications();
this.navModel = navModelSrv.getAlertingNav(1); this.navModel = navModelSrv.getAlertingNav(1);
} }
......
import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common'; import {describe, it, expect} from 'test/lib/common';
import {AlertTabCtrl} from '../alert_tab_ctrl'; import {AlertTabCtrl} from '../alert_tab_ctrl';
import helpers from '../../../../test/specs/helpers';
describe('AlertTabCtrl', () => { describe('AlertTabCtrl', () => {
var $scope = { var $scope = {
...@@ -10,7 +9,7 @@ describe('AlertTabCtrl', () => { ...@@ -10,7 +9,7 @@ describe('AlertTabCtrl', () => {
describe('with null parameters', () => { describe('with null parameters', () => {
it('can be created', () => { it('can be created', () => {
var alertTab = new AlertTabCtrl($scope, null, null, null, null, null, null, null); var alertTab = new AlertTabCtrl($scope, null, null, null, null, null);
expect(alertTab).to.not.be(null); expect(alertTab).to.not.be(null);
}); });
......
import {describe, beforeEach, it, sinon, expect} from 'test/lib/common'; import {describe, it, expect} from 'test/lib/common';
import {ThresholdMapper} from '../threshold_mapper'; import {ThresholdMapper} from '../threshold_mapper';
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
export class ThresholdMapper { export class ThresholdMapper {
static alertToGraphThresholds(panel) { static alertToGraphThresholds(panel) {
var alert = panel.alert;
if (panel.type !== 'graph') { if (panel.type !== 'graph') {
return false; return false;
} }
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import angular from 'angular';
import _ from 'lodash'; import _ from 'lodash';
import $ from 'jquery'; import $ from 'jquery';
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
......
...@@ -4,7 +4,6 @@ import './editor_ctrl'; ...@@ -4,7 +4,6 @@ import './editor_ctrl';
import angular from 'angular'; import angular from 'angular';
import _ from 'lodash'; import _ from 'lodash';
import $ from 'jquery';
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
export class AnnotationsSrv { export class AnnotationsSrv {
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import _ from 'lodash'; import _ from 'lodash';
import moment from 'moment';
import {coreModule} from 'app/core/core'; import {coreModule} from 'app/core/core';
import {MetricsPanelCtrl} from 'app/plugins/sdk'; import {MetricsPanelCtrl} from 'app/plugins/sdk';
import {AnnotationEvent} from './event'; import {AnnotationEvent} from './event';
......
...@@ -10,7 +10,7 @@ export class AdHocFiltersCtrl { ...@@ -10,7 +10,7 @@ export class AdHocFiltersCtrl {
removeTagFilterSegment: any; removeTagFilterSegment: any;
/** @ngInject */ /** @ngInject */
constructor(private uiSegmentSrv, private datasourceSrv, private $q, private variableSrv, private $scope, private $rootScope) { constructor(private uiSegmentSrv, private datasourceSrv, private $q, private variableSrv, $scope, private $rootScope) {
this.removeTagFilterSegment = uiSegmentSrv.newSegment({fake: true, value: '-- remove filter --'}); this.removeTagFilterSegment = uiSegmentSrv.newSegment({fake: true, value: '-- remove filter --'});
this.buildSegmentModel(); this.buildSegmentModel();
this.$rootScope.onAppEvent('template-variable-value-updated', this.buildSegmentModel.bind(this), $scope); this.$rootScope.onAppEvent('template-variable-value-updated', this.buildSegmentModel.bind(this), $scope);
...@@ -107,7 +107,6 @@ export class AdHocFiltersCtrl { ...@@ -107,7 +107,6 @@ export class AdHocFiltersCtrl {
updateVariableModel() { updateVariableModel() {
var filters = []; var filters = [];
var filterIndex = -1; var filterIndex = -1;
var operator = "";
var hasFakes = false; var hasFakes = false;
this.segments.forEach(segment => { this.segments.forEach(segment => {
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import config from 'app/core/config';
import angular from 'angular';
import moment from 'moment';
import _ from 'lodash';
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
export class AlertingSrv { export class AlertingSrv {
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
import config from 'app/core/config'; import config from 'app/core/config';
import angular from 'angular'; import angular from 'angular';
import moment from 'moment';
import _ from 'lodash';
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
...@@ -12,7 +10,7 @@ export class DashboardCtrl { ...@@ -12,7 +10,7 @@ export class DashboardCtrl {
/** @ngInject */ /** @ngInject */
constructor( constructor(
private $scope, private $scope,
private $rootScope, $rootScope,
keybindingSrv, keybindingSrv,
timeSrv, timeSrv,
variableSrv, variableSrv,
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import _ from 'lodash';
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
import {DashboardModel} from './model'; import {DashboardModel} from './model';
......
...@@ -5,7 +5,6 @@ import moment from 'moment'; ...@@ -5,7 +5,6 @@ import moment from 'moment';
import angular from 'angular'; import angular from 'angular';
import {appEvents, NavModel} from 'app/core/core'; import {appEvents, NavModel} from 'app/core/core';
import {DashboardModel} from '../model'; import {DashboardModel} from '../model';
import {DashboardExporter} from '../export/exporter';
export class DashNavCtrl { export class DashNavCtrl {
dashboard: DashboardModel; dashboard: DashboardModel;
...@@ -18,12 +17,9 @@ export class DashNavCtrl { ...@@ -18,12 +17,9 @@ export class DashNavCtrl {
private $rootScope, private $rootScope,
private dashboardSrv, private dashboardSrv,
private $location, private $location,
private playlistSrv,
private backendSrv, private backendSrv,
private $timeout, private contextSrv,
private datasourceSrv, navModelSrv) {
private navModelSrv,
private contextSrv) {
this.navModel = navModelSrv.getDashboardNav(this.dashboard, this); this.navModel = navModelSrv.getDashboardNav(this.dashboard, this);
appEvents.on('save-dashboard', this.saveDashboard.bind(this), $scope); appEvents.on('save-dashboard', this.saveDashboard.bind(this), $scope);
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import config from 'app/core/config';
import angular from 'angular'; import angular from 'angular';
import _ from 'lodash'; import _ from 'lodash';
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<button type="button" class="btn gf-form-btn width-10 btn-secondary" ng-click="ctrl.saveJson()"> <button type="button" class="btn gf-form-btn width-10 btn-secondary" ng-click="ctrl.saveJson()">
<i class="fa fa-file-text-o"></i> View JSON <i class="fa fa-file-text-o"></i> View JSON
</button> </button>
<a class="btn btn-link" ng-click="dismiss()">Cancel</a> <a class="btn btn-link" ng-click="ctrl.dismiss()">Cancel</a>
</div> </div>
</div> </div>
......
///<reference path="../../../headers/common.d.ts" /> ///<reference path="../../../headers/common.d.ts" />
import kbn from 'app/core/utils/kbn';
import angular from 'angular'; import angular from 'angular';
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
import appEvents from 'app/core/app_events';
import config from 'app/core/config';
import _ from 'lodash';
import {DashboardExporter} from './exporter'; import {DashboardExporter} from './exporter';
...@@ -15,7 +11,7 @@ export class DashExportCtrl { ...@@ -15,7 +11,7 @@ export class DashExportCtrl {
dismiss: () => void; dismiss: () => void;
/** @ngInject */ /** @ngInject */
constructor(private backendSrv, private dashboardSrv, datasourceSrv, private $scope) { constructor(private dashboardSrv, datasourceSrv, private $scope) {
this.exporter = new DashboardExporter(datasourceSrv); this.exporter = new DashboardExporter(datasourceSrv);
this.exporter.makeExportable(this.dashboardSrv.getCurrent()).then(dash => { this.exporter.makeExportable(this.dashboardSrv.getCurrent()).then(dash => {
......
///<reference path="../../../headers/common.d.ts" /> ///<reference path="../../../headers/common.d.ts" />
import config from 'app/core/config'; import config from 'app/core/config';
import angular from 'angular';
import _ from 'lodash'; import _ from 'lodash';
import {DynamicDashboardSrv} from '../dynamic_dashboard_srv'; import {DynamicDashboardSrv} from '../dynamic_dashboard_srv';
export class DashboardExporter { export class DashboardExporter {
......
...@@ -10,8 +10,6 @@ export class ExportDataModalCtrl { ...@@ -10,8 +10,6 @@ export class ExportDataModalCtrl {
asRows: Boolean = true; asRows: Boolean = true;
dateTimeFormat: String = 'YYYY-MM-DDTHH:mm:ssZ'; dateTimeFormat: String = 'YYYY-MM-DDTHH:mm:ssZ';
excel: false; excel: false;
/** @ngInject */
constructor(private $scope) { }
export() { export() {
if (this.panel === 'table') { if (this.panel === 'table') {
......
...@@ -26,14 +26,12 @@ export class HistoryListCtrl { ...@@ -26,14 +26,12 @@ export class HistoryListCtrl {
isNewLatest: boolean; isNewLatest: boolean;
/** @ngInject */ /** @ngInject */
constructor(private $scope, constructor(private $route,
private $route,
private $rootScope, private $rootScope,
private $location, private $location,
private $window,
private $timeout,
private $q, private $q,
private historySrv: HistorySrv) { private historySrv: HistorySrv,
public $scope) {
this.appending = false; this.appending = false;
this.diff = 'basic'; this.diff = 'basic';
......
///<reference path="../../../headers/common.d.ts" /> ///<reference path="../../../headers/common.d.ts" />
import kbn from 'app/core/utils/kbn';
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
import appEvents from 'app/core/app_events';
import config from 'app/core/config'; import config from 'app/core/config';
import _ from 'lodash'; import _ from 'lodash';
...@@ -19,7 +17,7 @@ export class DashImportCtrl { ...@@ -19,7 +17,7 @@ export class DashImportCtrl {
gnetInfo: any; gnetInfo: any;
/** @ngInject */ /** @ngInject */
constructor(private backendSrv, private $location, private $scope, private $routeParams) { constructor(private backendSrv, private $location, private $scope, $routeParams) {
this.step = 1; this.step = 1;
this.nameExists = false; this.nameExists = false;
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import config from 'app/core/config';
import angular from 'angular'; import angular from 'angular';
import moment from 'moment'; import moment from 'moment';
import _ from 'lodash'; import _ from 'lodash';
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import _ from 'lodash'; import _ from 'lodash';
import config from 'app/core/config'; import config from 'app/core/config';
import {coreModule, appEvents} from 'app/core/core'; import {coreModule} from 'app/core/core';
export class AddPanelCtrl { export class AddPanelCtrl {
row: any; row: any;
...@@ -15,7 +15,7 @@ export class AddPanelCtrl { ...@@ -15,7 +15,7 @@ export class AddPanelCtrl {
panelSearch: any; panelSearch: any;
/** @ngInject */ /** @ngInject */
constructor(private $scope, private $timeout, private $rootScope) { constructor(private $timeout, private $rootScope) {
this.row = this.rowCtrl.row; this.row = this.rowCtrl.row;
this.dashboard = this.rowCtrl.dashboard; this.dashboard = this.rowCtrl.dashboard;
this.activeIndex = 0; this.activeIndex = 0;
......
///<reference path="../../../headers/common.d.ts" /> ///<reference path="../../../headers/common.d.ts" />
import _ from 'lodash';
import config from 'app/core/config';
import {coreModule} from 'app/core/core'; import {coreModule} from 'app/core/core';
// import VirtualScroll from 'virtual-scroll'; // import VirtualScroll from 'virtual-scroll';
// console.log(VirtualScroll); // console.log(VirtualScroll);
...@@ -14,7 +11,7 @@ export class RowOptionsCtrl { ...@@ -14,7 +11,7 @@ export class RowOptionsCtrl {
fontSizes = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']; fontSizes = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
/** @ngInject */ /** @ngInject */
constructor(private $scope, private $timeout, private $rootScope) { constructor() {
this.row = this.rowCtrl.row; this.row = this.rowCtrl.row;
this.dashboard = this.rowCtrl.dashboard; this.dashboard = this.rowCtrl.dashboard;
this.row.titleSize = this.row.titleSize || 'h6'; this.row.titleSize = this.row.titleSize || 'h6';
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import _ from 'lodash'; import _ from 'lodash';
import config from 'app/core/config'; import config from 'app/core/config';
import {coreModule, appEvents} from 'app/core/core'; import {coreModule} from 'app/core/core';
import './options'; import './options';
import './add_panel'; import './add_panel';
...@@ -186,7 +186,6 @@ coreModule.directive('panelWidth', function($rootScope) { ...@@ -186,7 +186,6 @@ coreModule.directive('panelWidth', function($rootScope) {
coreModule.directive('panelDropZone', function($timeout) { coreModule.directive('panelDropZone', function($timeout) {
return function(scope, element) { return function(scope, element) {
var row = scope.ctrl.row; var row = scope.ctrl.row;
var dashboard = scope.ctrl.dashboard;
var indrag = false; var indrag = false;
var textEl = element.find('.panel-drop-zone-text'); var textEl = element.find('.panel-drop-zone-text');
......
///<reference path="../../../headers/common.d.ts" /> ///<reference path="../../../headers/common.d.ts" />
import _ from 'lodash'; import _ from 'lodash';
import {Emitter, contextSrv, appEvents, assignModelProperties} from 'app/core/core'; import {Emitter, appEvents, assignModelProperties} from 'app/core/core';
export class DashboardRow { export class DashboardRow {
panels: any; panels: any;
......
...@@ -36,7 +36,7 @@ export class SaveDashboardAsModalCtrl { ...@@ -36,7 +36,7 @@ export class SaveDashboardAsModalCtrl {
dismiss: () => void; dismiss: () => void;
/** @ngInject */ /** @ngInject */
constructor(private $scope, private dashboardSrv) { constructor(private dashboardSrv) {
var dashboard = this.dashboardSrv.getCurrent(); var dashboard = this.dashboardSrv.getCurrent();
this.clone = dashboard.getSaveModelClone(); this.clone = dashboard.getSaveModelClone();
this.clone.id = null; this.clone.id = null;
......
...@@ -55,7 +55,7 @@ export class SaveDashboardModalCtrl { ...@@ -55,7 +55,7 @@ export class SaveDashboardModalCtrl {
dismiss: () => void; dismiss: () => void;
/** @ngInject */ /** @ngInject */
constructor(private $scope, private dashboardSrv) { constructor(private dashboardSrv) {
this.message = ''; this.message = '';
this.max = 64; this.max = 64;
} }
......
import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common'; import {describe, beforeEach, it, expect} from 'test/lib/common';
import _ from 'lodash'; import _ from 'lodash';
import {DashboardModel} from '../model'; import {DashboardModel} from '../model';
......
import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common'; import {describe, beforeEach} from 'test/lib/common';
import {DashboardSrv} from '../dashboard_srv'; import {DashboardSrv} from '../dashboard_srv';
......
import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common'; import {describe, beforeEach, it, expect, angularMocks} from 'test/lib/common';
import {DashboardSrv} from '../dashboard_srv'; import '../dashboard_srv';
import {DynamicDashboardSrv} from '../dynamic_dashboard_srv'; import {DynamicDashboardSrv} from '../dynamic_dashboard_srv';
function dynamicDashScenario(desc, func) { function dynamicDashScenario(desc, func) {
......
import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common'; import {describe, beforeEach, it, sinon, expect} from 'test/lib/common';
import _ from 'lodash'; import _ from 'lodash';
import config from 'app/core/config'; import config from 'app/core/config';
......
...@@ -3,14 +3,14 @@ import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/co ...@@ -3,14 +3,14 @@ import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/co
import _ from 'lodash'; import _ from 'lodash';
import {HistoryListCtrl} from 'app/features/dashboard/history/history'; import {HistoryListCtrl} from 'app/features/dashboard/history/history';
import { versions, compare, restore } from 'test/mocks/history-mocks'; import { versions, compare, restore } from 'test/mocks/history-mocks';
import config from 'app/core/config';
describe('HistoryListCtrl', function() { describe('HistoryListCtrl', function() {
var RESTORE_ID = 4; var RESTORE_ID = 4;
var ctx: any = {}; var ctx: any = {};
var versionsResponse: any = versions(); var versionsResponse: any = versions();
var restoreResponse: any = restore(7, RESTORE_ID);
restore(7, RESTORE_ID);
beforeEach(angularMocks.module('grafana.core')); beforeEach(angularMocks.module('grafana.core'));
beforeEach(angularMocks.module('grafana.services')); beforeEach(angularMocks.module('grafana.services'));
...@@ -65,7 +65,7 @@ describe('HistoryListCtrl', function() { ...@@ -65,7 +65,7 @@ describe('HistoryListCtrl', function() {
expect(ctx.ctrl.mode).to.be('list'); expect(ctx.ctrl.mode).to.be('list');
expect(ctx.ctrl.delta).to.eql({ basic: '', json: '' }); expect(ctx.ctrl.delta).to.eql({ basic: '', json: '' });
expect(ctx.ctrl.canCompare).to.be(false); expect(ctx.ctrl.canCompare).to.be(false);
expect(_.find(ctx.ctrl.revisions, rev => rev.checked)).to.be.undefined; expect(_.find(ctx.ctrl.revisions, rev => rev.checked)).to.be(undefined);
}); });
it('should indicate loading has finished', function() { it('should indicate loading has finished', function() {
...@@ -103,7 +103,7 @@ describe('HistoryListCtrl', function() { ...@@ -103,7 +103,7 @@ describe('HistoryListCtrl', function() {
it('should reset the controller\'s state', function() { it('should reset the controller\'s state', function() {
expect(ctx.ctrl.mode).to.be('list'); expect(ctx.ctrl.mode).to.be('list');
expect(ctx.ctrl.delta).to.eql({ basic: '', json: '' }); expect(ctx.ctrl.delta).to.eql({ basic: '', json: '' });
expect(_.find(ctx.ctrl.revisions, rev => rev.checked)).to.be.undefined; expect(_.find(ctx.ctrl.revisions, rev => rev.checked)).to.be(undefined);
}); });
it('should indicate loading has finished', function() { it('should indicate loading has finished', function() {
......
import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common'; import {describe, beforeEach, it, expect, angularMocks} from 'test/lib/common';
import helpers from 'test/specs/helpers'; import helpers from 'test/specs/helpers';
import HistorySrv from '../history/history_srv'; import '../history/history_srv';
import { versions, compare, restore } from 'test/mocks/history-mocks'; import {versions, restore} from 'test/mocks/history-mocks';
describe('historySrv', function() { describe('historySrv', function() {
var ctx = new helpers.ServiceTestContext(); var ctx = new helpers.ServiceTestContext();
......
import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common';
import _ from 'lodash';
import {DashboardRow} from '../row/row_model';
describe('DashboardRow', function() {
});
import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common'; import {describe, beforeEach, it, expect, angularMocks} from 'test/lib/common';
import helpers from 'test/specs/helpers'; import helpers from 'test/specs/helpers';
import _ from 'lodash'; import '../time_srv';
import TimeSrv from '../time_srv';
import moment from 'moment'; import moment from 'moment';
describe('timeSrv', function() { describe('timeSrv', function() {
......
...@@ -11,7 +11,6 @@ export class SubmenuCtrl { ...@@ -11,7 +11,6 @@ export class SubmenuCtrl {
/** @ngInject */ /** @ngInject */
constructor(private $rootScope, constructor(private $rootScope,
private variableSrv, private variableSrv,
private templateSrv,
private $location) { private $location) {
this.annotations = this.dashboard.templating.list; this.annotations = this.dashboard.templating.list;
this.variables = this.variableSrv.variables; this.variables = this.variableSrv.variables;
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import config from 'app/core/config';
import angular from 'angular';
import moment from 'moment'; import moment from 'moment';
import _ from 'lodash'; import _ from 'lodash';
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
......
...@@ -35,7 +35,7 @@ export class UnsavedChangesModalCtrl { ...@@ -35,7 +35,7 @@ export class UnsavedChangesModalCtrl {
dismiss: () => void; dismiss: () => void;
/** @ngInject */ /** @ngInject */
constructor(private $rootScope, private unsavedChangesSrv) { constructor(private unsavedChangesSrv) {
} }
discard() { discard() {
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import kbn from 'app/core/utils/kbn';
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
var template = ` var template = `
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import config from 'app/core/config'; import config from 'app/core/config';
import _ from 'lodash';
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
import Remarkable from 'remarkable'; import Remarkable from 'remarkable';
...@@ -18,7 +17,7 @@ export class OrgUsersCtrl { ...@@ -18,7 +17,7 @@ export class OrgUsersCtrl {
addUsersBtnName: string; addUsersBtnName: string;
/** @ngInject */ /** @ngInject */
constructor(private $scope, private $http, private backendSrv, navModelSrv, $sce) { constructor(private $scope, private backendSrv, navModelSrv, $sce) {
this.user = { this.user = {
loginOrEmail: '', loginOrEmail: '',
role: 'Viewer', role: 'Viewer',
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import config from 'app/core/config'; import config from 'app/core/config';
import _ from 'lodash';
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
export class PrefsControlCtrl { export class PrefsControlCtrl {
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
import config from 'app/core/config'; import config from 'app/core/config';
import {coreModule} from 'app/core/core'; import {coreModule} from 'app/core/core';
import _ from 'lodash';
export class ProfileCtrl { export class ProfileCtrl {
user: any; user: any;
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import angular from 'angular';
import config from 'app/core/config'; import config from 'app/core/config';
import $ from 'jquery'; import $ from 'jquery';
import _ from 'lodash'; import _ from 'lodash';
...@@ -10,7 +9,6 @@ import {PanelCtrl} from './panel_ctrl'; ...@@ -10,7 +9,6 @@ import {PanelCtrl} from './panel_ctrl';
import * as rangeUtil from 'app/core/utils/rangeutil'; import * as rangeUtil from 'app/core/utils/rangeutil';
import * as dateMath from 'app/core/utils/datemath'; import * as dateMath from 'app/core/utils/datemath';
import {Subject} from 'vendor/npm/rxjs/Subject';
import {metricsTabDirective} from './metrics_tab'; import {metricsTabDirective} from './metrics_tab';
class MetricsPanelCtrl extends PanelCtrl { class MetricsPanelCtrl extends PanelCtrl {
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import _ from 'lodash';
import {DashboardModel} from '../dashboard/model'; import {DashboardModel} from '../dashboard/model';
import Remarkable from 'remarkable'; import Remarkable from 'remarkable';
...@@ -22,7 +21,7 @@ export class MetricsTabCtrl { ...@@ -22,7 +21,7 @@ export class MetricsTabCtrl {
queryOptions: any; queryOptions: any;
/** @ngInject */ /** @ngInject */
constructor($scope, private $sce, private datasourceSrv, private backendSrv, private $timeout) { constructor($scope, private $sce, datasourceSrv, private backendSrv) {
this.panelCtrl = $scope.ctrl; this.panelCtrl = $scope.ctrl;
$scope.ctrl = this; $scope.ctrl = this;
...@@ -74,7 +73,6 @@ export class MetricsTabCtrl { ...@@ -74,7 +73,6 @@ export class MetricsTabCtrl {
return; return;
} }
var target: any = {isNew: true};
this.panelCtrl.addQuery({isNew: true, datasource: option.datasource.name}); this.panelCtrl.addQuery({isNew: true, datasource: option.datasource.name});
this.addQueryDropdown = {text: 'Add Query', value: null, fake: true}; this.addQueryDropdown = {text: 'Add Query', value: null, fake: true};
} }
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
import config from 'app/core/config'; import config from 'app/core/config';
import _ from 'lodash'; import _ from 'lodash';
import angular from 'angular';
import $ from 'jquery'; import $ from 'jquery';
import {profiler} from 'app/core/profiler'; import {profiler} from 'app/core/profiler';
import Remarkable from 'remarkable'; import Remarkable from 'remarkable';
...@@ -213,7 +212,6 @@ export class PanelCtrl { ...@@ -213,7 +212,6 @@ export class PanelCtrl {
} }
replacePanel(newPanel, oldPanel) { replacePanel(newPanel, oldPanel) {
var row = this.row;
var index = _.indexOf(this.row.panels, oldPanel); var index = _.indexOf(this.row.panels, oldPanel);
this.row.panels.splice(index, 1); this.row.panels.splice(index, 1);
......
...@@ -2,9 +2,7 @@ ...@@ -2,9 +2,7 @@
import angular from 'angular'; import angular from 'angular';
import $ from 'jquery'; import $ from 'jquery';
import _ from 'lodash';
import Drop from 'tether-drop'; import Drop from 'tether-drop';
import {appEvents} from 'app/core/core';
var module = angular.module('grafana.directives'); var module = angular.module('grafana.directives');
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import angular from 'angular'; import angular from 'angular';
import config from 'app/core/config';
var directiveModule = angular.module('grafana.directives'); var directiveModule = angular.module('grafana.directives');
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import angular from 'angular';
import _ from 'lodash'; import _ from 'lodash';
export class QueryCtrl { export class QueryCtrl {
...@@ -12,7 +11,7 @@ export class QueryCtrl { ...@@ -12,7 +11,7 @@ export class QueryCtrl {
error: string; error: string;
isLastQuery: boolean; isLastQuery: boolean;
constructor(public $scope, private $injector) { constructor(public $scope, public $injector) {
this.panel = this.panelCtrl.panel; this.panel = this.panelCtrl.panel;
this.isLastQuery = _.indexOf(this.panel.targets, this.target) === (this.panel.targets.length - 1); this.isLastQuery = _.indexOf(this.panel.targets, this.target) === (this.panel.targets.length - 1);
} }
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import angular from 'angular'; import angular from 'angular';
import _ from 'lodash';
var module = angular.module('grafana.directives'); var module = angular.module('grafana.directives');
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import angular from 'angular';
import _ from 'lodash'; import _ from 'lodash';
import coreModule from '../../core/core_module'; import coreModule from '../../core/core_module';
import config from 'app/core/config';
export class PlaylistEditCtrl { export class PlaylistEditCtrl {
filteredDashboards: any = []; filteredDashboards: any = [];
...@@ -21,11 +19,10 @@ export class PlaylistEditCtrl { ...@@ -21,11 +19,10 @@ export class PlaylistEditCtrl {
/** @ngInject */ /** @ngInject */
constructor( constructor(
private $scope, private $scope,
private playlistSrv,
private backendSrv, private backendSrv,
private $location, private $location,
private $route, $route,
private navModelSrv navModelSrv
) { ) {
this.navModel = navModelSrv.getPlaylistsNav(0); this.navModel = navModelSrv.getPlaylistsNav(0);
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import angular from 'angular';
import config from 'app/core/config';
import _ from 'lodash';
import $ from 'jquery';
import coreModule from '../../core/core_module'; import coreModule from '../../core/core_module';
export class PlaylistSearchCtrl { export class PlaylistSearchCtrl {
...@@ -13,7 +9,7 @@ export class PlaylistSearchCtrl { ...@@ -13,7 +9,7 @@ export class PlaylistSearchCtrl {
searchStarted: any; searchStarted: any;
/** @ngInject */ /** @ngInject */
constructor(private $scope, private $location, private $timeout, private backendSrv, private contextSrv) { constructor($timeout, private backendSrv) {
this.query = {query: '', tag: [], starred: false, limit: 30}; this.query = {query: '', tag: [], starred: false, limit: 30};
$timeout(() => { $timeout(() => {
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import angular from 'angular';
import coreModule from '../../core/core_module'; import coreModule from '../../core/core_module';
import kbn from 'app/core/utils/kbn'; import kbn from 'app/core/utils/kbn';
import appEvents from 'app/core/app_events'; import appEvents from 'app/core/app_events';
...@@ -16,7 +15,6 @@ class PlaylistSrv { ...@@ -16,7 +15,6 @@ class PlaylistSrv {
/** @ngInject */ /** @ngInject */
constructor( constructor(
private $rootScope: any,
private $location: any, private $location: any,
private $timeout: any, private $timeout: any,
private backendSrv: any, private backendSrv: any,
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import angular from 'angular';
import _ from 'lodash'; import _ from 'lodash';
import coreModule from '../../core/core_module'; import coreModule from '../../core/core_module';
...@@ -9,7 +8,7 @@ export class PlaylistsCtrl { ...@@ -9,7 +8,7 @@ export class PlaylistsCtrl {
navModel: any; navModel: any;
/** @ngInject */ /** @ngInject */
constructor(private $scope, private $location, private backendSrv, private navModelSrv) { constructor(private $scope, private backendSrv, navModelSrv) {
this.navModel = navModelSrv.getPlaylistsNav(0); this.navModel = navModelSrv.getPlaylistsNav(0);
backendSrv.get('/api/playlists').then(result => { backendSrv.get('/api/playlists').then(result => {
......
...@@ -9,7 +9,7 @@ describe('PlaylistEditCtrl', () => { ...@@ -9,7 +9,7 @@ describe('PlaylistEditCtrl', () => {
getPlaylistsNav: page => {}, getPlaylistsNav: page => {},
}; };
ctx = new PlaylistEditCtrl(null, null, null, null, { current: { params: {} } }, navModelSrv); ctx = new PlaylistEditCtrl(null, null, null, { current: { params: {} } }, navModelSrv);
ctx.dashboardresult = [ ctx.dashboardresult = [
{ id: 2, title: 'dashboard: 2' }, { id: 2, title: 'dashboard: 2' },
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import angular from 'angular';
import _ from 'lodash'; import _ from 'lodash';
import config from 'app/core/config'; import config from 'app/core/config';
...@@ -34,7 +33,6 @@ export class DataSourceEditCtrl { ...@@ -34,7 +33,6 @@ export class DataSourceEditCtrl {
/** @ngInject */ /** @ngInject */
constructor( constructor(
private $scope,
private $q, private $q,
private backendSrv, private backendSrv,
private $routeParams, private $routeParams,
...@@ -43,7 +41,7 @@ export class DataSourceEditCtrl { ...@@ -43,7 +41,7 @@ export class DataSourceEditCtrl {
private navModelSrv, private navModelSrv,
) { ) {
this.navModel = navModelSrv.getDatasourceNav(0); this.navModel = this.navModelSrv.getDatasourceNav(0);
this.isNew = true; this.isNew = true;
this.datasources = []; this.datasources = [];
this.tabIndex = 0; this.tabIndex = 0;
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import angular from 'angular';
import _ from 'lodash';
import coreModule from '../../core/core_module'; import coreModule from '../../core/core_module';
export class DataSourcesCtrl { export class DataSourcesCtrl {
...@@ -11,8 +9,6 @@ export class DataSourcesCtrl { ...@@ -11,8 +9,6 @@ export class DataSourcesCtrl {
/** @ngInject */ /** @ngInject */
constructor( constructor(
private $scope, private $scope,
private $location,
private $http,
private backendSrv, private backendSrv,
private datasourceSrv, private datasourceSrv,
private navModelSrv private navModelSrv
......
///<reference path="../../../headers/common.d.ts" /> ///<reference path="../../../headers/common.d.ts" />
import angular from 'angular';
import _ from 'lodash'; import _ from 'lodash';
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
import appEvents from 'app/core/app_events'; import appEvents from 'app/core/app_events';
...@@ -11,7 +10,7 @@ export class DashImportListCtrl { ...@@ -11,7 +10,7 @@ export class DashImportListCtrl {
datasource: any; datasource: any;
/** @ngInject */ /** @ngInject */
constructor($scope, private $http, private backendSrv, private $rootScope) { constructor($scope, private backendSrv, private $rootScope) {
this.dashboards = []; this.dashboards = [];
backendSrv.get(`/api/plugins/${this.plugin.id}/dashboards`).then(dashboards => { backendSrv.get(`/api/plugins/${this.plugin.id}/dashboards`).then(dashboards => {
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
import angular from 'angular'; import angular from 'angular';
import _ from 'lodash'; import _ from 'lodash';
import appEvents from 'app/core/app_events';
import Remarkable from 'remarkable'; import Remarkable from 'remarkable';
export class PluginEditCtrl { export class PluginEditCtrl {
...@@ -24,10 +23,9 @@ export class PluginEditCtrl { ...@@ -24,10 +23,9 @@ export class PluginEditCtrl {
private $scope, private $scope,
private $rootScope, private $rootScope,
private backendSrv, private backendSrv,
private $routeParams,
private $sce, private $sce,
private $http, $routeParams,
private navModelSrv, navModelSrv,
) { ) {
this.navModel = navModelSrv.getPluginsNav(); this.navModel = navModelSrv.getPluginsNav();
this.model = {}; this.model = {};
......
...@@ -15,7 +15,7 @@ class StyleGuideCtrl { ...@@ -15,7 +15,7 @@ class StyleGuideCtrl {
navModel: any; navModel: any;
/** @ngInject **/ /** @ngInject **/
constructor(private $http, private $routeParams, private $location, private backendSrv, navModelSrv) { constructor(private $http, private $routeParams, private backendSrv, navModelSrv) {
this.navModel = navModelSrv.getAdminNav(); this.navModel = navModelSrv.getAdminNav();
this.theme = config.bootData.user.lightTheme ? 'light': 'dark'; this.theme = config.bootData.user.lightTheme ? 'light': 'dark';
this.page = {}; this.page = {};
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import _ from 'lodash'; import _ from 'lodash';
import kbn from 'app/core/utils/kbn';
import {Variable, assignModelProperties, variableTypes} from './variable'; import {Variable, assignModelProperties, variableTypes} from './variable';
import {VariableSrv} from './variable_srv';
export class AdhocVariable implements Variable { export class AdhocVariable implements Variable {
filters: any[]; filters: any[];
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import _ from 'lodash';
import {Variable, assignModelProperties, variableTypes} from './variable'; import {Variable, assignModelProperties, variableTypes} from './variable';
import {VariableSrv} from './variable_srv';
export class ConstantVariable implements Variable { export class ConstantVariable implements Variable {
query: string; query: string;
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import _ from 'lodash'; import _ from 'lodash';
import kbn from 'app/core/utils/kbn';
import {Variable, assignModelProperties, variableTypes} from './variable'; import {Variable, assignModelProperties, variableTypes} from './variable';
import {VariableSrv} from './variable_srv';
export class CustomVariable implements Variable { export class CustomVariable implements Variable {
query: string; query: string;
...@@ -26,7 +24,7 @@ export class CustomVariable implements Variable { ...@@ -26,7 +24,7 @@ export class CustomVariable implements Variable {
}; };
/** @ngInject **/ /** @ngInject **/
constructor(private model, private timeSrv, private templateSrv, private variableSrv) { constructor(private model, private variableSrv) {
assignModelProperties(this, model, this.defaults); assignModelProperties(this, model, this.defaults);
} }
......
///<reference path="../../headers/common.d.ts" /> ///<reference path="../../headers/common.d.ts" />
import _ from 'lodash';
import kbn from 'app/core/utils/kbn'; import kbn from 'app/core/utils/kbn';
import {Variable, containsVariable, assignModelProperties, variableTypes} from './variable'; import {Variable, containsVariable, assignModelProperties, variableTypes} from './variable';
import {VariableSrv} from './variable_srv';
export class DatasourceVariable implements Variable { export class DatasourceVariable implements Variable {
regex: any; regex: any;
......
...@@ -7,7 +7,7 @@ import {variableTypes} from './variable'; ...@@ -7,7 +7,7 @@ import {variableTypes} from './variable';
export class VariableEditorCtrl { export class VariableEditorCtrl {
/** @ngInject **/ /** @ngInject **/
constructor(private $scope, private datasourceSrv, private variableSrv, templateSrv) { constructor($scope, datasourceSrv, variableSrv, templateSrv) {
$scope.variableTypes = variableTypes; $scope.variableTypes = variableTypes;
$scope.ctrl = {}; $scope.ctrl = {};
$scope.namePattern = /^(?!__).*$/; $scope.namePattern = /^(?!__).*$/;
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
import _ from 'lodash'; import _ from 'lodash';
import kbn from 'app/core/utils/kbn'; import kbn from 'app/core/utils/kbn';
import {Variable, assignModelProperties, variableTypes} from './variable'; import {Variable, assignModelProperties, variableTypes} from './variable';
import {VariableSrv} from './variable_srv';
export class IntervalVariable implements Variable { export class IntervalVariable implements Variable {
auto_count: number; auto_count: number;
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
import _ from 'lodash'; import _ from 'lodash';
import kbn from 'app/core/utils/kbn'; import kbn from 'app/core/utils/kbn';
import {Variable, containsVariable, assignModelProperties, variableTypes} from './variable'; import {Variable, containsVariable, assignModelProperties, variableTypes} from './variable';
import {VariableSrv} from './variable_srv';
function getNoneOption() { function getNoneOption() {
return { text: 'None', value: '', isNone: true }; return { text: 'None', value: '', isNone: true };
...@@ -48,7 +47,7 @@ export class QueryVariable implements Variable { ...@@ -48,7 +47,7 @@ export class QueryVariable implements Variable {
}; };
/** @ngInject **/ /** @ngInject **/
constructor(private model, private datasourceSrv, private templateSrv, private variableSrv, private $q, private timeSrv) { constructor(private model, private datasourceSrv, private templateSrv, private variableSrv, private timeSrv) {
// copy model properties to this instance // copy model properties to this instance
assignModelProperties(this, model, this.defaults); assignModelProperties(this, model, this.defaults);
} }
......
import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common'; import {describe, it, expect} from 'test/lib/common';
import {AdhocVariable} from '../adhoc_variable'; import {AdhocVariable} from '../adhoc_variable';
......
import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common'; import {describe, it, expect} from 'test/lib/common';
import {QueryVariable} from '../query_variable'; import {QueryVariable} from '../query_variable';
...@@ -7,7 +7,7 @@ describe('QueryVariable', () => { ...@@ -7,7 +7,7 @@ describe('QueryVariable', () => {
describe('when creating from model', () => { describe('when creating from model', () => {
it('should set defaults', () => { it('should set defaults', () => {
var variable = new QueryVariable({}, null, null, null, null, null); var variable = new QueryVariable({}, null, null, null, null);
expect(variable.datasource).to.be(null); expect(variable.datasource).to.be(null);
expect(variable.refresh).to.be(0); expect(variable.refresh).to.be(0);
expect(variable.sort).to.be(0); expect(variable.sort).to.be(0);
...@@ -19,7 +19,7 @@ describe('QueryVariable', () => { ...@@ -19,7 +19,7 @@ describe('QueryVariable', () => {
}); });
it('get model should copy changes back to model', () => { it('get model should copy changes back to model', () => {
var variable = new QueryVariable({}, null, null, null, null, null); var variable = new QueryVariable({}, null, null, null, null);
variable.options = [{text: 'test'}]; variable.options = [{text: 'test'}];
variable.datasource = 'google'; variable.datasource = 'google';
variable.regex = 'asd'; variable.regex = 'asd';
...@@ -34,7 +34,7 @@ describe('QueryVariable', () => { ...@@ -34,7 +34,7 @@ describe('QueryVariable', () => {
}); });
it('if refresh != 0 then remove options in presisted mode', () => { it('if refresh != 0 then remove options in presisted mode', () => {
var variable = new QueryVariable({}, null, null, null, null, null); var variable = new QueryVariable({}, null, null, null, null);
variable.options = [{text: 'test'}]; variable.options = [{text: 'test'}];
variable.refresh = 1; variable.refresh = 1;
...@@ -44,7 +44,7 @@ describe('QueryVariable', () => { ...@@ -44,7 +44,7 @@ describe('QueryVariable', () => {
}); });
describe('can convert and sort metric names',() => { describe('can convert and sort metric names',() => {
var variable = new QueryVariable({}, null, null, null, null, null); var variable = new QueryVariable({}, null, null, null, null);
variable.sort = 3; // Numerical (asc) variable.sort = 3; // Numerical (asc)
describe('can sort a mixed array of metric variables', () => { describe('can sort a mixed array of metric variables', () => {
...@@ -79,4 +79,3 @@ describe('QueryVariable', () => { ...@@ -79,4 +79,3 @@ describe('QueryVariable', () => {
}); });
}); });
}); });
import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common'; import {describe, beforeEach, it, expect, angularMocks} from 'test/lib/common';
import '../all'; import '../all';
import {Emitter} from 'app/core/core'; import {Emitter} from 'app/core/core';
......
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