Sfoglia il codice sorgente

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

Torkel Ödegaard 8 anni fa
parent
commit
b8d9722b4f
100 ha cambiato i file con 81 aggiunte e 243 eliminazioni
  1. 1 1
      public/app/core/components/PasswordStrength.tsx
  2. 1 4
      public/app/core/components/colorpicker.ts
  3. 0 3
      public/app/core/components/dashboard_selector.ts
  4. 0 1
      public/app/core/components/form_dropdown/form_dropdown.ts
  5. 0 2
      public/app/core/components/grafana_app.ts
  6. 1 1
      public/app/core/components/help/help.ts
  7. 0 1
      public/app/core/components/info_popover.ts
  8. 0 1
      public/app/core/components/json_explorer/json_explorer.ts
  9. 0 3
      public/app/core/components/layout_selector/layout_selector.ts
  10. 1 1
      public/app/core/components/navbar/navbar.html
  11. 5 4
      public/app/core/components/navbar/navbar.ts
  12. 1 4
      public/app/core/components/search/search.ts
  13. 1 2
      public/app/core/components/sidemenu/sidemenu.ts
  14. 0 4
      public/app/core/components/switch.ts
  15. 3 3
      public/app/core/controllers/signup_ctrl.ts
  16. 1 1
      public/app/core/directives/diff-view.ts
  17. 0 2
      public/app/core/directives/rebuild_on_change.ts
  18. 0 1
      public/app/core/live/live_srv.ts
  19. 0 1
      public/app/core/profiler.ts
  20. 0 1
      public/app/core/routes/routes.ts
  21. 1 2
      public/app/core/services/alert_srv.ts
  22. 1 3
      public/app/core/services/backend_srv.ts
  23. 1 1
      public/app/core/services/dynamic_directive_srv.ts
  24. 1 4
      public/app/core/services/keybindingSrv.ts
  25. 0 2
      public/app/core/services/popover_srv.ts
  26. 0 4
      public/app/core/services/util_srv.ts
  27. 0 6
      public/app/core/utils/emitter.ts
  28. 1 1
      public/app/features/admin/admin_list_users_ctrl.ts
  29. 1 2
      public/app/features/alerting/alert_list_ctrl.ts
  30. 0 11
      public/app/features/alerting/alert_model.ts
  31. 1 4
      public/app/features/alerting/alert_tab_ctrl.ts
  32. 0 2
      public/app/features/alerting/notification_edit_ctrl.ts
  33. 1 6
      public/app/features/alerting/notifications_list_ctrl.ts
  34. 2 3
      public/app/features/alerting/specs/alert_tab_specs.ts
  35. 1 1
      public/app/features/alerting/specs/threshold_mapper_specs.ts
  36. 0 2
      public/app/features/alerting/threshold_mapper.ts
  37. 0 1
      public/app/features/annotations/annotation_tooltip.ts
  38. 0 1
      public/app/features/annotations/annotations_srv.ts
  39. 0 1
      public/app/features/annotations/event_editor.ts
  40. 1 2
      public/app/features/dashboard/ad_hoc_filters.ts
  41. 0 5
      public/app/features/dashboard/alerting_srv.ts
  42. 1 3
      public/app/features/dashboard/dashboard_ctrl.ts
  43. 0 1
      public/app/features/dashboard/dashboard_srv.ts
  44. 2 6
      public/app/features/dashboard/dashnav/dashnav.ts
  45. 0 1
      public/app/features/dashboard/dynamic_dashboard_srv.ts
  46. 1 1
      public/app/features/dashboard/export/export_modal.html
  47. 1 5
      public/app/features/dashboard/export/export_modal.ts
  48. 0 2
      public/app/features/dashboard/export/exporter.ts
  49. 0 2
      public/app/features/dashboard/export_data/export_data_modal.ts
  50. 3 5
      public/app/features/dashboard/history/history.ts
  51. 1 3
      public/app/features/dashboard/import/dash_import.ts
  52. 0 1
      public/app/features/dashboard/model.ts
  53. 2 2
      public/app/features/dashboard/row/add_panel.ts
  54. 1 4
      public/app/features/dashboard/row/options.ts
  55. 1 2
      public/app/features/dashboard/row/row_ctrl.ts
  56. 1 1
      public/app/features/dashboard/row/row_model.ts
  57. 1 1
      public/app/features/dashboard/save_as_modal.ts
  58. 1 1
      public/app/features/dashboard/save_modal.ts
  59. 1 1
      public/app/features/dashboard/specs/dashboard_model_specs.ts
  60. 1 1
      public/app/features/dashboard/specs/dashboard_srv_specs.ts
  61. 2 2
      public/app/features/dashboard/specs/dynamic_dashboard_srv_specs.ts
  62. 1 1
      public/app/features/dashboard/specs/exporter_specs.ts
  63. 4 4
      public/app/features/dashboard/specs/history_ctrl_specs.ts
  64. 3 3
      public/app/features/dashboard/specs/history_srv_specs.ts
  65. 0 10
      public/app/features/dashboard/specs/row_model_specs.ts
  66. 2 3
      public/app/features/dashboard/specs/time_srv_specs.ts
  67. 0 1
      public/app/features/dashboard/submenu/submenu.ts
  68. 0 2
      public/app/features/dashboard/time_srv.ts
  69. 1 1
      public/app/features/dashboard/unsaved_changes_modal.ts
  70. 0 1
      public/app/features/dashboard/upload.ts
  71. 1 2
      public/app/features/org/org_users_ctrl.ts
  72. 0 1
      public/app/features/org/prefs_control.ts
  73. 0 1
      public/app/features/org/profile_ctrl.ts
  74. 0 2
      public/app/features/panel/metrics_panel_ctrl.ts
  75. 1 3
      public/app/features/panel/metrics_tab.ts
  76. 0 2
      public/app/features/panel/panel_ctrl.ts
  77. 0 2
      public/app/features/panel/panel_directive.ts
  78. 0 1
      public/app/features/panel/panel_editor_tab.ts
  79. 1 2
      public/app/features/panel/query_ctrl.ts
  80. 0 1
      public/app/features/panel/query_editor_row.ts
  81. 2 5
      public/app/features/playlist/playlist_edit_ctrl.ts
  82. 1 5
      public/app/features/playlist/playlist_search.ts
  83. 0 2
      public/app/features/playlist/playlist_srv.ts
  84. 1 2
      public/app/features/playlist/playlists_ctrl.ts
  85. 1 1
      public/app/features/playlist/specs/playlist_edit_ctrl_specs.ts
  86. 1 3
      public/app/features/plugins/ds_edit_ctrl.ts
  87. 0 4
      public/app/features/plugins/ds_list_ctrl.ts
  88. 1 2
      public/app/features/plugins/import_list/import_list.ts
  89. 2 4
      public/app/features/plugins/plugin_edit_ctrl.ts
  90. 1 1
      public/app/features/styleguide/styleguide.ts
  91. 0 2
      public/app/features/templating/adhoc_variable.ts
  92. 0 2
      public/app/features/templating/constant_variable.ts
  93. 1 3
      public/app/features/templating/custom_variable.ts
  94. 0 2
      public/app/features/templating/datasource_variable.ts
  95. 1 1
      public/app/features/templating/editor_ctrl.ts
  96. 0 1
      public/app/features/templating/interval_variable.ts
  97. 1 2
      public/app/features/templating/query_variable.ts
  98. 1 1
      public/app/features/templating/specs/adhoc_variable_specs.ts
  99. 5 6
      public/app/features/templating/specs/query_variable_specs.ts
  100. 1 1
      public/app/features/templating/specs/template_srv_specs.ts

+ 1 - 1
public/app/core/components/PasswordStrength.tsx

@@ -1,5 +1,5 @@
 import * as React from 'react';
-import * as ReactDOM from 'react-dom';
+// import from 'react-dom';
 import coreModule from '../core_module';
 
 export interface IProps {

+ 1 - 4
public/app/core/components/colorpicker.ts

@@ -1,8 +1,5 @@
 ///<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';
 
 var template = `
@@ -37,7 +34,7 @@ export class ColorPickerCtrl {
   showAxisControls: boolean;
 
   /** @ngInject */
-  constructor(private $scope, private $rootScope) {
+  constructor(private $scope, $rootScope) {
     this.colors = $rootScope.colors;
     this.autoClose = $scope.autoClose;
     this.series = $scope.series;

+ 0 - 3
public/app/core/components/dashboard_selector.ts

@@ -1,8 +1,5 @@
 ///<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';
 
 var template = `

+ 0 - 1
public/app/core/components/form_dropdown/form_dropdown.ts

@@ -1,6 +1,5 @@
 ///<reference path="../../../headers/common.d.ts" />
 
-import config from 'app/core/config';
 import _ from 'lodash';
 import $ from 'jquery';
 import coreModule from '../../core_module';

+ 0 - 2
public/app/core/components/grafana_app.ts

@@ -1,9 +1,7 @@
 ///<reference path="../../headers/common.d.ts" />
 
 import config from 'app/core/config';
-import store from 'app/core/store';
 import _ from 'lodash';
-import angular from 'angular';
 import $ from 'jquery';
 
 import coreModule from 'app/core/core_module';

+ 1 - 1
public/app/core/components/help/help.ts

@@ -8,7 +8,7 @@ export class HelpCtrl {
   shortcuts: any;
 
   /** @ngInject */
-  constructor(private $scope, $sce) {
+  constructor() {
     this.tabIndex = 0;
     this.shortcuts = {
       'Global': [

+ 0 - 1
public/app/core/components/info_popover.ts

@@ -1,7 +1,6 @@
 ///<reference path="../../headers/common.d.ts" />
 
 import _ from 'lodash';
-import $ from 'jquery';
 import coreModule from 'app/core/core_module';
 import Drop from 'tether-drop';
 

+ 0 - 1
public/app/core/components/json_explorer/json_explorer.ts

@@ -6,7 +6,6 @@ import {
   getObjectName,
   getType,
   getValuePreview,
-  getPreview,
   cssClass,
   createElement
 } from './helpers';

+ 0 - 3
public/app/core/components/layout_selector/layout_selector.ts

@@ -1,9 +1,6 @@
 ///<reference path="../../../headers/common.d.ts" />
 
-import config from 'app/core/config';
 import store from 'app/core/store';
-import _ from 'lodash';
-import $ from 'jquery';
 import coreModule from 'app/core/core_module';
 
 var template = `

+ 1 - 1
public/app/core/components/navbar/navbar.html

@@ -1,5 +1,5 @@
 <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">
 			<img src="public/img/grafana_icon.svg"></img>
 		</span>

+ 5 - 4
public/app/core/components/navbar/navbar.ts

@@ -1,8 +1,5 @@
 ///<reference path="../../../headers/common.d.ts" />
 
-import config from 'app/core/config';
-import _ from 'lodash';
-import $ from 'jquery';
 import coreModule from '../../core_module';
 import {NavModel, NavModelItem}  from '../../nav_model_srv';
 
@@ -12,7 +9,7 @@ export class NavbarCtrl {
   hasMenu: boolean;
 
   /** @ngInject */
-  constructor(private $scope, private $rootScope, private contextSrv) {
+  constructor(private $rootScope, private contextSrv) {
     this.section = this.model.section;
     this.hasMenu = this.model.menu.length > 0;
   }
@@ -21,6 +18,10 @@ export class NavbarCtrl {
     this.$rootScope.appEvent('show-dash-search');
   }
 
+  toggleSideMenu() {
+    this.contextSrv.toggleSideMenu();
+  }
+
   navItemClicked(navItem, evt) {
     if (navItem.clickHandler) {
       navItem.clickHandler();

+ 1 - 4
public/app/core/components/search/search.ts

@@ -1,11 +1,8 @@
 ///<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_module';
-import appEvents from 'app/core/app_events';
 
 export class SearchCtrl {
   isOpen: boolean;
@@ -22,7 +19,7 @@ export class SearchCtrl {
   openCompleted: boolean;
 
   /** @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('hide-dash-search', this.closeSearch.bind(this), $scope);
   }

+ 1 - 2
public/app/core/components/sidemenu/sidemenu.ts

@@ -1,7 +1,6 @@
 ///<reference path="../../../headers/common.d.ts" />
 
 import config from 'app/core/config';
-import _ from 'lodash';
 import $ from 'jquery';
 import coreModule from '../../core_module';
 
@@ -19,7 +18,7 @@ export class SideMenuCtrl {
   maxShownOrgs: number;
 
   /** @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.user = contextSrv.user;
     this.appSubUrl = config.appSubUrl;

+ 0 - 4
public/app/core/components/switch.ts

@@ -1,10 +1,6 @@
 ///<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 Drop from 'tether-drop';
 
 var template = `
 <label for="check-{{ctrl.id}}" class="gf-form-label {{ctrl.labelClass}} pointer" ng-show="ctrl.label">

+ 3 - 3
public/app/core/controllers/signup_ctrl.ts

@@ -8,9 +8,9 @@ export class SignUpCtrl {
   /** @ngInject */
   constructor(
       private $scope: any,
-      private $location: any,
-      private contextSrv: any,
-      private backendSrv: any) {
+      private backendSrv: any,
+      $location: any,
+      contextSrv: any) {
 
     contextSrv.sidemenu = false;
     $scope.ctrl = this;

+ 1 - 1
public/app/core/directives/diff-view.ts

@@ -7,7 +7,7 @@ export class DeltaCtrl {
   observer: any;
 
   /** @ngInject */
-  constructor(private $rootScope) {
+  constructor($rootScope) {
     const waitForCompile = function(mutations) {
       if (mutations.length === 1) {
         this.$rootScope.appEvent('json-diff-ready');

+ 0 - 2
public/app/core/directives/rebuild_on_change.ts

@@ -1,7 +1,5 @@
 ///<reference path="../../headers/common.d.ts" />
 
-import angular from 'angular';
-import _ from 'lodash';
 import $ from 'jquery';
 
 import coreModule from '../core_module';

+ 0 - 1
public/app/core/live/live_srv.ts

@@ -2,7 +2,6 @@
 
 import _ from 'lodash';
 import config from 'app/core/config';
-import coreModule from 'app/core/core_module';
 
 import {Observable} from 'vendor/npm/rxjs/Observable';
 

+ 0 - 1
public/app/core/profiler.ts

@@ -1,7 +1,6 @@
 ///<reference path="../headers/common.d.ts" />
 
 import $ from 'jquery';
-import _ from 'lodash';
 import angular from 'angular';
 
 export class Profiler {

+ 0 - 1
public/app/core/routes/routes.ts

@@ -2,7 +2,6 @@
 
 import './dashboard_loaders';
 
-import angular from 'angular';
 import coreModule from 'app/core/core_module';
 import {BundleLoader} from './bundle_loader';
 

+ 1 - 2
public/app/core/services/alert_srv.ts

@@ -2,7 +2,6 @@
 
 import angular from 'angular';
 import _ from 'lodash';
-import $ from 'jquery';
 import coreModule from 'app/core/core_module';
 import appEvents from 'app/core/app_events';
 
@@ -10,7 +9,7 @@ export class AlertSrv {
   list: any[];
 
   /** @ngInject */
-  constructor(private $timeout, private $sce, private $rootScope, private $modal) {
+  constructor(private $timeout, private $rootScope, private $modal) {
     this.list = [];
   }
 

+ 1 - 3
public/app/core/services/backend_srv.ts

@@ -1,8 +1,6 @@
 ///<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_module';
 import appEvents from 'app/core/app_events';
 
@@ -12,7 +10,7 @@ export class BackendSrv {
   private noBackendCache: boolean;
 
   /** @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?) {

+ 1 - 1
public/app/core/services/dynamic_directive_srv.ts

@@ -6,7 +6,7 @@ import coreModule from '../core_module';
 class DynamicDirectiveSrv {
 
   /** @ngInject */
-  constructor(private $compile, private $parse, private $rootScope) {}
+  constructor(private $compile, private $rootScope) {}
 
   addDirective(element, name, scope) {
     var child = angular.element(document.createElement(name));

+ 1 - 4
public/app/core/services/keybindingSrv.ts

@@ -14,10 +14,7 @@ export class KeybindingSrv {
   /** @ngInject */
   constructor(
     private $rootScope,
-    private $modal,
-    private $location,
-    private contextSrv,
-    private $timeout) {
+    private $location) {
 
     // clear out all shortcuts on route change
     $rootScope.$on('$routeChangeSuccess', () => {

+ 0 - 2
public/app/core/services/popover_srv.ts

@@ -1,8 +1,6 @@
 ///<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 Drop from 'tether-drop';
 

+ 0 - 4
public/app/core/services/util_srv.ts

@@ -1,9 +1,5 @@
 ///<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 appEvents from 'app/core/app_events';
 

+ 0 - 6
public/app/core/utils/emitter.ts

@@ -2,12 +2,6 @@
 
 import EventEmitter from 'eventemitter3';
 
-var hasOwnProp = {}.hasOwnProperty;
-
-function createName(name) {
-    return '$' + name;
-}
-
 export class Emitter {
   emitter: any;
 

+ 1 - 1
public/app/features/admin/admin_list_users_ctrl.ts

@@ -11,7 +11,7 @@ export default class AdminListUsersCtrl {
   navModel: any;
 
   /** @ngInject */
-  constructor(private $scope, private backendSrv, private navModelSrv) {
+  constructor(private $scope, private backendSrv, navModelSrv) {
     this.navModel = navModelSrv.getAdminNav();
     this.query = '';
     this.getUsers();

+ 1 - 2
public/app/features/alerting/alert_list_ctrl.ts

@@ -1,6 +1,5 @@
 ///<reference path="../../headers/common.d.ts" />
 
-import angular from 'angular';
 import _ from 'lodash';
 import moment from 'moment';
 
@@ -22,7 +21,7 @@ export class AlertListCtrl {
   navModel: any;
 
   /** @ngInject */
-  constructor(private backendSrv, private $location, private $scope, navModelSrv) {
+  constructor(private backendSrv, private $location, navModelSrv) {
     this.navModel = navModelSrv.getAlertingNav(0);
 
     var params = $location.search();

+ 0 - 11
public/app/features/alerting/alert_model.ts

@@ -1,11 +0,0 @@
- ///<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() {
-  }
-}
-

+ 1 - 4
public/app/features/alerting/alert_tab_ctrl.ts

@@ -5,7 +5,6 @@ import {ThresholdMapper} from './threshold_mapper';
 import {QueryPart} from 'app/core/components/query_part/query_part';
 import alertDef from './alert_def';
 import config from 'app/core/config';
-import moment from 'moment';
 import appEvents from 'app/core/app_events';
 
 export class AlertTabCtrl {
@@ -30,13 +29,11 @@ export class AlertTabCtrl {
 
   /** @ngInject */
   constructor(private $scope,
-              private $timeout,
               private backendSrv,
               private dashboardSrv,
               private uiSegmentSrv,
               private $q,
-              private datasourceSrv,
-              private templateSrv) {
+              private datasourceSrv) {
     this.panelCtrl = $scope.ctrl;
     this.panel = this.panelCtrl.panel;
     this.$scope.ctrl = this;

+ 0 - 2
public/app/features/alerting/notification_edit_ctrl.ts

@@ -1,8 +1,6 @@
 ///<reference path="../../headers/common.d.ts" />
 
-import angular from 'angular';
 import _ from 'lodash';
-import config from 'app/core/config';
 import {appEvents, coreModule} from 'app/core/core';
 
 export class AlertNotificationEditCtrl {

+ 1 - 6
public/app/features/alerting/notifications_list_ctrl.ts

@@ -1,18 +1,13 @@
 ///<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';
 
-
 export class AlertNotificationsListCtrl {
   notifications: any;
   navModel: any;
 
   /** @ngInject */
-  constructor(private backendSrv, private $scope, navModelSrv) {
+  constructor(private backendSrv, navModelSrv) {
     this.loadNotifications();
     this.navModel = navModelSrv.getAlertingNav(1);
   }

+ 2 - 3
public/app/features/alerting/specs/alert_tab_specs.ts

@@ -1,7 +1,6 @@
-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 helpers from '../../../../test/specs/helpers';
 
 describe('AlertTabCtrl', () => {
   var $scope = {
@@ -10,7 +9,7 @@ describe('AlertTabCtrl', () => {
 
   describe('with null parameters', () => {
     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);
     });

+ 1 - 1
public/app/features/alerting/specs/threshold_mapper_specs.ts

@@ -1,4 +1,4 @@
-import {describe, beforeEach, it, sinon, expect} from 'test/lib/common';
+import {describe, it, expect} from 'test/lib/common';
 
 import {ThresholdMapper} from '../threshold_mapper';
 

+ 0 - 2
public/app/features/alerting/threshold_mapper.ts

@@ -2,8 +2,6 @@
 export class ThresholdMapper {
 
   static alertToGraphThresholds(panel) {
-    var alert = panel.alert;
-
     if (panel.type !== 'graph') {
       return false;
     }

+ 0 - 1
public/app/features/annotations/annotation_tooltip.ts

@@ -1,6 +1,5 @@
 ///<reference path="../../headers/common.d.ts" />
 
-import angular from 'angular';
 import _ from 'lodash';
 import $ from 'jquery';
 import coreModule from 'app/core/core_module';

+ 0 - 1
public/app/features/annotations/annotations_srv.ts

@@ -4,7 +4,6 @@ import './editor_ctrl';
 
 import angular from 'angular';
 import _ from 'lodash';
-import $ from 'jquery';
 import coreModule from 'app/core/core_module';
 
 export class AnnotationsSrv {

+ 0 - 1
public/app/features/annotations/event_editor.ts

@@ -1,7 +1,6 @@
 ///<reference path="../../headers/common.d.ts" />
 
 import _ from 'lodash';
-import moment from 'moment';
 import {coreModule} from 'app/core/core';
 import {MetricsPanelCtrl} from 'app/plugins/sdk';
 import {AnnotationEvent} from './event';

+ 1 - 2
public/app/features/dashboard/ad_hoc_filters.ts

@@ -10,7 +10,7 @@ export class AdHocFiltersCtrl {
   removeTagFilterSegment: any;
 
   /** @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.buildSegmentModel();
     this.$rootScope.onAppEvent('template-variable-value-updated', this.buildSegmentModel.bind(this), $scope);
@@ -107,7 +107,6 @@ export class AdHocFiltersCtrl {
   updateVariableModel() {
     var filters = [];
     var filterIndex = -1;
-    var operator = "";
     var hasFakes = false;
 
     this.segments.forEach(segment => {

+ 0 - 5
public/app/features/dashboard/alerting_srv.ts

@@ -1,10 +1,5 @@
 ///<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';
 
 export class AlertingSrv {

+ 1 - 3
public/app/features/dashboard/dashboard_ctrl.ts

@@ -2,8 +2,6 @@
 
 import config from 'app/core/config';
 import angular from 'angular';
-import moment from 'moment';
-import _ from 'lodash';
 
 import coreModule from 'app/core/core_module';
 
@@ -12,7 +10,7 @@ export class DashboardCtrl {
   /** @ngInject */
   constructor(
     private $scope,
-    private $rootScope,
+    $rootScope,
     keybindingSrv,
     timeSrv,
     variableSrv,

+ 0 - 1
public/app/features/dashboard/dashboard_srv.ts

@@ -1,6 +1,5 @@
 ///<reference path="../../headers/common.d.ts" />
 
-import _ from 'lodash';
 import coreModule from 'app/core/core_module';
 import {DashboardModel} from './model';
 

+ 2 - 6
public/app/features/dashboard/dashnav/dashnav.ts

@@ -5,7 +5,6 @@ import moment from 'moment';
 import angular from 'angular';
 import {appEvents, NavModel} from 'app/core/core';
 import {DashboardModel} from '../model';
-import {DashboardExporter} from '../export/exporter';
 
 export class DashNavCtrl {
   dashboard: DashboardModel;
@@ -18,12 +17,9 @@ export class DashNavCtrl {
     private $rootScope,
     private dashboardSrv,
     private $location,
-    private playlistSrv,
     private backendSrv,
-    private $timeout,
-    private datasourceSrv,
-    private navModelSrv,
-    private contextSrv) {
+    private contextSrv,
+    navModelSrv) {
       this.navModel = navModelSrv.getDashboardNav(this.dashboard, this);
 
       appEvents.on('save-dashboard', this.saveDashboard.bind(this), $scope);

+ 0 - 1
public/app/features/dashboard/dynamic_dashboard_srv.ts

@@ -1,6 +1,5 @@
 ///<reference path="../../headers/common.d.ts" />
 
-import config from 'app/core/config';
 import angular from 'angular';
 import _ from 'lodash';
 

+ 1 - 1
public/app/features/dashboard/export/export_modal.html

@@ -22,7 +22,7 @@
 			<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
 			</button>
-			<a class="btn btn-link" ng-click="dismiss()">Cancel</a>
+			<a class="btn btn-link" ng-click="ctrl.dismiss()">Cancel</a>
 		</div>
 
 	</div>

+ 1 - 5
public/app/features/dashboard/export/export_modal.ts

@@ -1,11 +1,7 @@
 ///<reference path="../../../headers/common.d.ts" />
 
-import kbn from 'app/core/utils/kbn';
 import angular from 'angular';
 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';
 
@@ -15,7 +11,7 @@ export class DashExportCtrl {
   dismiss: () => void;
 
   /** @ngInject */
-  constructor(private backendSrv, private dashboardSrv, datasourceSrv, private $scope) {
+  constructor(private dashboardSrv, datasourceSrv, private $scope) {
     this.exporter = new DashboardExporter(datasourceSrv);
 
     this.exporter.makeExportable(this.dashboardSrv.getCurrent()).then(dash => {

+ 0 - 2
public/app/features/dashboard/export/exporter.ts

@@ -1,9 +1,7 @@
 ///<reference path="../../../headers/common.d.ts" />
 
 import config from 'app/core/config';
-import angular from 'angular';
 import _ from 'lodash';
-
 import {DynamicDashboardSrv} from '../dynamic_dashboard_srv';
 
 export class DashboardExporter {

+ 0 - 2
public/app/features/dashboard/export_data/export_data_modal.ts

@@ -10,8 +10,6 @@ export class ExportDataModalCtrl {
   asRows: Boolean = true;
   dateTimeFormat: String = 'YYYY-MM-DDTHH:mm:ssZ';
   excel: false;
-  /** @ngInject */
-  constructor(private $scope) { }
 
   export() {
     if (this.panel === 'table') {

+ 3 - 5
public/app/features/dashboard/history/history.ts

@@ -26,14 +26,12 @@ export class HistoryListCtrl {
   isNewLatest: boolean;
 
   /** @ngInject */
-  constructor(private $scope,
-              private $route,
+  constructor(private $route,
               private $rootScope,
               private $location,
-              private $window,
-              private $timeout,
               private $q,
-              private historySrv: HistorySrv) {
+              private historySrv: HistorySrv,
+              public $scope) {
 
     this.appending = false;
     this.diff = 'basic';

+ 1 - 3
public/app/features/dashboard/import/dash_import.ts

@@ -1,8 +1,6 @@
 ///<reference path="../../../headers/common.d.ts" />
 
-import kbn from 'app/core/utils/kbn';
 import coreModule from 'app/core/core_module';
-import appEvents from 'app/core/app_events';
 import config from 'app/core/config';
 import _ from 'lodash';
 
@@ -19,7 +17,7 @@ export class DashImportCtrl {
   gnetInfo: any;
 
   /** @ngInject */
-  constructor(private backendSrv, private $location, private $scope, private $routeParams) {
+  constructor(private backendSrv, private $location, private $scope, $routeParams) {
     this.step = 1;
     this.nameExists = false;
 

+ 0 - 1
public/app/features/dashboard/model.ts

@@ -1,6 +1,5 @@
 ///<reference path="../../headers/common.d.ts" />
 
-import config from 'app/core/config';
 import angular from 'angular';
 import moment from 'moment';
 import _ from 'lodash';

+ 2 - 2
public/app/features/dashboard/row/add_panel.ts

@@ -3,7 +3,7 @@
 import _ from 'lodash';
 
 import config from 'app/core/config';
-import {coreModule, appEvents} from 'app/core/core';
+import {coreModule} from 'app/core/core';
 
 export class AddPanelCtrl {
   row: any;
@@ -15,7 +15,7 @@ export class AddPanelCtrl {
   panelSearch: any;
 
   /** @ngInject */
-  constructor(private $scope, private $timeout, private $rootScope) {
+  constructor(private $timeout, private $rootScope) {
     this.row = this.rowCtrl.row;
     this.dashboard = this.rowCtrl.dashboard;
     this.activeIndex = 0;

+ 1 - 4
public/app/features/dashboard/row/options.ts

@@ -1,8 +1,5 @@
 ///<reference path="../../../headers/common.d.ts" />
 
-import _ from 'lodash';
-
-import config from 'app/core/config';
 import {coreModule} from 'app/core/core';
 // import VirtualScroll from 'virtual-scroll';
 // console.log(VirtualScroll);
@@ -14,7 +11,7 @@ export class RowOptionsCtrl {
   fontSizes = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
 
   /** @ngInject */
-  constructor(private $scope, private $timeout, private $rootScope) {
+  constructor() {
     this.row = this.rowCtrl.row;
     this.dashboard = this.rowCtrl.dashboard;
     this.row.titleSize = this.row.titleSize || 'h6';

+ 1 - 2
public/app/features/dashboard/row/row_ctrl.ts

@@ -3,7 +3,7 @@
 import _ from 'lodash';
 
 import config from 'app/core/config';
-import {coreModule, appEvents} from 'app/core/core';
+import {coreModule} from 'app/core/core';
 
 import './options';
 import './add_panel';
@@ -186,7 +186,6 @@ coreModule.directive('panelWidth', function($rootScope) {
 coreModule.directive('panelDropZone', function($timeout) {
   return function(scope, element) {
     var row = scope.ctrl.row;
-    var dashboard = scope.ctrl.dashboard;
     var indrag = false;
     var textEl = element.find('.panel-drop-zone-text');
 

+ 1 - 1
public/app/features/dashboard/row/row_model.ts

@@ -1,7 +1,7 @@
 ///<reference path="../../../headers/common.d.ts" />
 
 import _ from 'lodash';
-import {Emitter, contextSrv, appEvents, assignModelProperties} from 'app/core/core';
+import {Emitter, appEvents, assignModelProperties} from 'app/core/core';
 
 export class DashboardRow {
   panels: any;

+ 1 - 1
public/app/features/dashboard/save_as_modal.ts

@@ -36,7 +36,7 @@ export class SaveDashboardAsModalCtrl {
   dismiss: () => void;
 
   /** @ngInject */
-  constructor(private $scope, private dashboardSrv) {
+  constructor(private dashboardSrv) {
     var dashboard = this.dashboardSrv.getCurrent();
     this.clone = dashboard.getSaveModelClone();
     this.clone.id = null;

+ 1 - 1
public/app/features/dashboard/save_modal.ts

@@ -55,7 +55,7 @@ export class SaveDashboardModalCtrl {
   dismiss: () => void;
 
   /** @ngInject */
-  constructor(private $scope, private dashboardSrv) {
+  constructor(private dashboardSrv) {
     this.message = '';
     this.max = 64;
   }

+ 1 - 1
public/app/features/dashboard/specs/dashboard_model_specs.ts

@@ -1,4 +1,4 @@
-import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common';
+import {describe, beforeEach, it, expect} from 'test/lib/common';
 
 import _ from 'lodash';
 import {DashboardModel} from '../model';

+ 1 - 1
public/app/features/dashboard/specs/dashboard_srv_specs.ts

@@ -1,4 +1,4 @@
-import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common';
+import {describe, beforeEach} from 'test/lib/common';
 
 import {DashboardSrv} from '../dashboard_srv';
 

+ 2 - 2
public/app/features/dashboard/specs/dynamic_dashboard_srv_specs.ts

@@ -1,6 +1,6 @@
-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';
 
 function dynamicDashScenario(desc, func)  {

+ 1 - 1
public/app/features/dashboard/specs/exporter_specs.ts

@@ -1,4 +1,4 @@
-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 config from 'app/core/config';

+ 4 - 4
public/app/features/dashboard/specs/history_ctrl_specs.ts

@@ -3,14 +3,14 @@ import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/co
 import _ from 'lodash';
 import {HistoryListCtrl} from 'app/features/dashboard/history/history';
 import { versions, compare, restore } from 'test/mocks/history-mocks';
-import config from 'app/core/config';
 
 describe('HistoryListCtrl', function() {
   var RESTORE_ID = 4;
 
   var ctx: any = {};
   var versionsResponse: any = versions();
-  var restoreResponse: any = restore(7, RESTORE_ID);
+
+  restore(7, RESTORE_ID);
 
   beforeEach(angularMocks.module('grafana.core'));
   beforeEach(angularMocks.module('grafana.services'));
@@ -65,7 +65,7 @@ describe('HistoryListCtrl', function() {
         expect(ctx.ctrl.mode).to.be('list');
         expect(ctx.ctrl.delta).to.eql({ basic: '', json: '' });
         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() {
@@ -103,7 +103,7 @@ describe('HistoryListCtrl', function() {
       it('should reset the controller\'s state', function() {
         expect(ctx.ctrl.mode).to.be('list');
         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() {

+ 3 - 3
public/app/features/dashboard/specs/history_srv_specs.ts

@@ -1,8 +1,8 @@
-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 HistorySrv from '../history/history_srv';
-import { versions, compare, restore } from 'test/mocks/history-mocks';
+import '../history/history_srv';
+import {versions, restore} from 'test/mocks/history-mocks';
 
 describe('historySrv', function() {
   var ctx = new helpers.ServiceTestContext();

+ 0 - 10
public/app/features/dashboard/specs/row_model_specs.ts

@@ -1,10 +0,0 @@
-import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common';
-
-import _ from 'lodash';
-import {DashboardRow} from '../row/row_model';
-
-describe('DashboardRow', function() {
-
-});
-
-

+ 2 - 3
public/app/features/dashboard/specs/time_srv_specs.ts

@@ -1,8 +1,7 @@
-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 _ from 'lodash';
-import TimeSrv from '../time_srv';
+import '../time_srv';
 import moment from 'moment';
 
 describe('timeSrv', function() {

+ 0 - 1
public/app/features/dashboard/submenu/submenu.ts

@@ -11,7 +11,6 @@ export class SubmenuCtrl {
   /** @ngInject */
   constructor(private $rootScope,
               private variableSrv,
-              private templateSrv,
               private $location) {
     this.annotations = this.dashboard.templating.list;
     this.variables = this.variableSrv.variables;

+ 0 - 2
public/app/features/dashboard/time_srv.ts

@@ -1,7 +1,5 @@
 ///<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';

+ 1 - 1
public/app/features/dashboard/unsaved_changes_modal.ts

@@ -35,7 +35,7 @@ export class UnsavedChangesModalCtrl {
   dismiss: () => void;
 
   /** @ngInject */
-  constructor(private $rootScope, private unsavedChangesSrv) {
+  constructor(private unsavedChangesSrv) {
   }
 
   discard() {

+ 0 - 1
public/app/features/dashboard/upload.ts

@@ -1,6 +1,5 @@
 ///<reference path="../../headers/common.d.ts" />
 
-import kbn from 'app/core/utils/kbn';
 import coreModule from 'app/core/core_module';
 
 var template = `

+ 1 - 2
public/app/features/org/org_users_ctrl.ts

@@ -1,7 +1,6 @@
 ///<reference path="../../headers/common.d.ts" />
 
 import config from 'app/core/config';
-import _ from 'lodash';
 import coreModule from 'app/core/core_module';
 import Remarkable from 'remarkable';
 
@@ -18,7 +17,7 @@ export class OrgUsersCtrl {
   addUsersBtnName: string;
 
   /** @ngInject */
-  constructor(private $scope, private $http, private backendSrv, navModelSrv, $sce) {
+  constructor(private $scope, private backendSrv, navModelSrv, $sce) {
     this.user = {
       loginOrEmail: '',
       role: 'Viewer',

+ 0 - 1
public/app/features/org/prefs_control.ts

@@ -1,7 +1,6 @@
 ///<reference path="../../headers/common.d.ts" />
 
 import config from 'app/core/config';
-import _ from 'lodash';
 import coreModule from 'app/core/core_module';
 
 export class PrefsControlCtrl {

+ 0 - 1
public/app/features/org/profile_ctrl.ts

@@ -2,7 +2,6 @@
 
 import config from 'app/core/config';
 import {coreModule} from 'app/core/core';
-import _ from 'lodash';
 
 export class ProfileCtrl {
   user: any;

+ 0 - 2
public/app/features/panel/metrics_panel_ctrl.ts

@@ -1,6 +1,5 @@
 ///<reference path="../../headers/common.d.ts" />
 
-import angular from 'angular';
 import config from 'app/core/config';
 import $ from 'jquery';
 import _ from 'lodash';
@@ -10,7 +9,6 @@ import {PanelCtrl} from './panel_ctrl';
 import * as rangeUtil from 'app/core/utils/rangeutil';
 import * as dateMath from 'app/core/utils/datemath';
 
-import {Subject} from 'vendor/npm/rxjs/Subject';
 import {metricsTabDirective} from './metrics_tab';
 
 class MetricsPanelCtrl extends PanelCtrl {

+ 1 - 3
public/app/features/panel/metrics_tab.ts

@@ -1,6 +1,5 @@
 ///<reference path="../../headers/common.d.ts" />
 
-import _ from 'lodash';
 import {DashboardModel} from '../dashboard/model';
 import Remarkable from 'remarkable';
 
@@ -22,7 +21,7 @@ export class MetricsTabCtrl {
   queryOptions: any;
 
   /** @ngInject */
-  constructor($scope, private $sce, private datasourceSrv, private backendSrv, private $timeout) {
+  constructor($scope, private $sce, datasourceSrv, private backendSrv) {
     this.panelCtrl = $scope.ctrl;
     $scope.ctrl = this;
 
@@ -74,7 +73,6 @@ export class MetricsTabCtrl {
       return;
     }
 
-    var target: any = {isNew: true};
     this.panelCtrl.addQuery({isNew: true, datasource: option.datasource.name});
     this.addQueryDropdown = {text: 'Add Query', value: null, fake: true};
   }

+ 0 - 2
public/app/features/panel/panel_ctrl.ts

@@ -2,7 +2,6 @@
 
 import config from 'app/core/config';
 import _ from 'lodash';
-import angular from 'angular';
 import $ from 'jquery';
 import {profiler} from 'app/core/profiler';
 import Remarkable from 'remarkable';
@@ -213,7 +212,6 @@ export class PanelCtrl {
   }
 
   replacePanel(newPanel, oldPanel) {
-    var row = this.row;
     var index = _.indexOf(this.row.panels, oldPanel);
     this.row.panels.splice(index, 1);
 

+ 0 - 2
public/app/features/panel/panel_directive.ts

@@ -2,9 +2,7 @@
 
 import angular from 'angular';
 import $ from 'jquery';
-import _ from 'lodash';
 import Drop from 'tether-drop';
-import {appEvents} from 'app/core/core';
 
 var module = angular.module('grafana.directives');
 

+ 0 - 1
public/app/features/panel/panel_editor_tab.ts

@@ -1,7 +1,6 @@
 ///<reference path="../../headers/common.d.ts" />
 
 import angular from 'angular';
-import config from 'app/core/config';
 
 var directiveModule = angular.module('grafana.directives');
 

+ 1 - 2
public/app/features/panel/query_ctrl.ts

@@ -1,6 +1,5 @@
 ///<reference path="../../headers/common.d.ts" />
 
-import angular from 'angular';
 import _ from 'lodash';
 
 export class QueryCtrl {
@@ -12,7 +11,7 @@ export class QueryCtrl {
   error: string;
   isLastQuery: boolean;
 
-  constructor(public $scope, private $injector) {
+  constructor(public $scope, public $injector) {
     this.panel = this.panelCtrl.panel;
     this.isLastQuery = _.indexOf(this.panel.targets, this.target) === (this.panel.targets.length - 1);
   }

+ 0 - 1
public/app/features/panel/query_editor_row.ts

@@ -1,7 +1,6 @@
 ///<reference path="../../headers/common.d.ts" />
 
 import angular from 'angular';
-import _ from 'lodash';
 
 var module = angular.module('grafana.directives');
 

+ 2 - 5
public/app/features/playlist/playlist_edit_ctrl.ts

@@ -1,9 +1,7 @@
 ///<reference path="../../headers/common.d.ts" />
 
-import angular from 'angular';
 import _ from 'lodash';
 import coreModule from '../../core/core_module';
-import config from 'app/core/config';
 
 export class PlaylistEditCtrl {
   filteredDashboards: any = [];
@@ -21,11 +19,10 @@ export class PlaylistEditCtrl {
   /** @ngInject */
   constructor(
     private $scope,
-    private playlistSrv,
     private backendSrv,
     private $location,
-    private $route,
-    private navModelSrv
+    $route,
+    navModelSrv
   ) {
 
     this.navModel = navModelSrv.getPlaylistsNav(0);

+ 1 - 5
public/app/features/playlist/playlist_search.ts

@@ -1,9 +1,5 @@
 ///<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';
 
 export class PlaylistSearchCtrl {
@@ -13,7 +9,7 @@ export class PlaylistSearchCtrl {
   searchStarted: any;
 
   /** @ngInject */
-  constructor(private $scope, private $location, private $timeout, private backendSrv, private contextSrv) {
+  constructor($timeout, private backendSrv) {
     this.query = {query: '', tag: [], starred: false, limit: 30};
 
     $timeout(() => {

+ 0 - 2
public/app/features/playlist/playlist_srv.ts

@@ -1,6 +1,5 @@
 ///<reference path="../../headers/common.d.ts" />
 
-import angular from 'angular';
 import coreModule from '../../core/core_module';
 import kbn from 'app/core/utils/kbn';
 import appEvents from 'app/core/app_events';
@@ -16,7 +15,6 @@ class PlaylistSrv {
 
   /** @ngInject */
   constructor(
-    private $rootScope: any,
     private $location: any,
     private $timeout: any,
     private backendSrv: any,

+ 1 - 2
public/app/features/playlist/playlists_ctrl.ts

@@ -1,6 +1,5 @@
 ///<reference path="../../headers/common.d.ts" />
 
-import angular from 'angular';
 import _ from 'lodash';
 import coreModule from '../../core/core_module';
 
@@ -9,7 +8,7 @@ export class PlaylistsCtrl {
   navModel: any;
 
   /** @ngInject */
-  constructor(private $scope, private $location, private backendSrv, private navModelSrv) {
+  constructor(private $scope, private backendSrv, navModelSrv) {
     this.navModel = navModelSrv.getPlaylistsNav(0);
 
     backendSrv.get('/api/playlists').then(result => {

+ 1 - 1
public/app/features/playlist/specs/playlist_edit_ctrl_specs.ts

@@ -9,7 +9,7 @@ describe('PlaylistEditCtrl', () => {
       getPlaylistsNav: page => {},
     };
 
-    ctx = new PlaylistEditCtrl(null, null, null, null, { current: { params: {} } }, navModelSrv);
+    ctx = new PlaylistEditCtrl(null, null, null, { current: { params: {} } }, navModelSrv);
 
     ctx.dashboardresult = [
       { id: 2, title: 'dashboard: 2' },

+ 1 - 3
public/app/features/plugins/ds_edit_ctrl.ts

@@ -1,6 +1,5 @@
 ///<reference path="../../headers/common.d.ts" />
 
-import angular from 'angular';
 import _ from 'lodash';
 
 import config from 'app/core/config';
@@ -34,7 +33,6 @@ export class DataSourceEditCtrl {
 
   /** @ngInject */
   constructor(
-    private $scope,
     private $q,
     private backendSrv,
     private $routeParams,
@@ -43,7 +41,7 @@ export class DataSourceEditCtrl {
     private navModelSrv,
   ) {
 
-    this.navModel = navModelSrv.getDatasourceNav(0);
+    this.navModel = this.navModelSrv.getDatasourceNav(0);
     this.isNew = true;
     this.datasources = [];
     this.tabIndex = 0;

+ 0 - 4
public/app/features/plugins/ds_list_ctrl.ts

@@ -1,7 +1,5 @@
 ///<reference path="../../headers/common.d.ts" />
 
-import angular from 'angular';
-import _ from 'lodash';
 import coreModule from '../../core/core_module';
 
 export class DataSourcesCtrl {
@@ -11,8 +9,6 @@ export class DataSourcesCtrl {
   /** @ngInject */
   constructor(
     private $scope,
-    private $location,
-    private $http,
     private backendSrv,
     private datasourceSrv,
     private navModelSrv

+ 1 - 2
public/app/features/plugins/import_list/import_list.ts

@@ -1,6 +1,5 @@
 ///<reference path="../../../headers/common.d.ts" />
 
-import angular from 'angular';
 import _ from 'lodash';
 import coreModule from 'app/core/core_module';
 import appEvents from 'app/core/app_events';
@@ -11,7 +10,7 @@ export class DashImportListCtrl {
   datasource: any;
 
   /** @ngInject */
-  constructor($scope, private $http, private backendSrv, private $rootScope) {
+  constructor($scope, private backendSrv, private $rootScope) {
     this.dashboards = [];
 
     backendSrv.get(`/api/plugins/${this.plugin.id}/dashboards`).then(dashboards => {

+ 2 - 4
public/app/features/plugins/plugin_edit_ctrl.ts

@@ -2,7 +2,6 @@
 
 import angular from 'angular';
 import _ from 'lodash';
-import appEvents from 'app/core/app_events';
 import Remarkable from 'remarkable';
 
 export class PluginEditCtrl {
@@ -24,10 +23,9 @@ export class PluginEditCtrl {
     private $scope,
     private $rootScope,
     private backendSrv,
-    private $routeParams,
     private $sce,
-    private $http,
-    private navModelSrv,
+    $routeParams,
+    navModelSrv,
   ) {
     this.navModel = navModelSrv.getPluginsNav();
     this.model = {};

+ 1 - 1
public/app/features/styleguide/styleguide.ts

@@ -15,7 +15,7 @@ class StyleGuideCtrl {
   navModel: any;
 
   /** @ngInject **/
-  constructor(private $http, private $routeParams, private $location, private backendSrv, navModelSrv) {
+  constructor(private $http, private $routeParams, private backendSrv, navModelSrv) {
     this.navModel = navModelSrv.getAdminNav();
     this.theme = config.bootData.user.lightTheme ? 'light': 'dark';
     this.page = {};

+ 0 - 2
public/app/features/templating/adhoc_variable.ts

@@ -1,9 +1,7 @@
 ///<reference path="../../headers/common.d.ts" />
 
 import _ from 'lodash';
-import kbn from 'app/core/utils/kbn';
 import {Variable, assignModelProperties, variableTypes} from './variable';
-import {VariableSrv} from './variable_srv';
 
 export class AdhocVariable implements Variable {
   filters: any[];

+ 0 - 2
public/app/features/templating/constant_variable.ts

@@ -1,8 +1,6 @@
 ///<reference path="../../headers/common.d.ts" />
 
-import _ from 'lodash';
 import {Variable, assignModelProperties, variableTypes} from './variable';
-import {VariableSrv} from './variable_srv';
 
 export class ConstantVariable implements Variable {
   query: string;

+ 1 - 3
public/app/features/templating/custom_variable.ts

@@ -1,9 +1,7 @@
 ///<reference path="../../headers/common.d.ts" />
 
 import _ from 'lodash';
-import kbn from 'app/core/utils/kbn';
 import {Variable, assignModelProperties, variableTypes} from './variable';
-import {VariableSrv} from './variable_srv';
 
 export class CustomVariable implements Variable {
   query: string;
@@ -26,7 +24,7 @@ export class CustomVariable implements Variable {
   };
 
   /** @ngInject **/
-  constructor(private model, private timeSrv, private templateSrv, private variableSrv) {
+  constructor(private model, private variableSrv) {
     assignModelProperties(this, model, this.defaults);
   }
 

+ 0 - 2
public/app/features/templating/datasource_variable.ts

@@ -1,9 +1,7 @@
 ///<reference path="../../headers/common.d.ts" />
 
-import _ from 'lodash';
 import kbn from 'app/core/utils/kbn';
 import {Variable, containsVariable, assignModelProperties, variableTypes} from './variable';
-import {VariableSrv} from './variable_srv';
 
 export class DatasourceVariable implements Variable {
   regex: any;

+ 1 - 1
public/app/features/templating/editor_ctrl.ts

@@ -7,7 +7,7 @@ import {variableTypes} from './variable';
 export class VariableEditorCtrl {
 
   /** @ngInject **/
-  constructor(private $scope, private datasourceSrv, private variableSrv, templateSrv) {
+  constructor($scope, datasourceSrv, variableSrv, templateSrv) {
     $scope.variableTypes = variableTypes;
     $scope.ctrl = {};
     $scope.namePattern = /^(?!__).*$/;

+ 0 - 1
public/app/features/templating/interval_variable.ts

@@ -3,7 +3,6 @@
 import _ from 'lodash';
 import kbn from 'app/core/utils/kbn';
 import {Variable, assignModelProperties, variableTypes} from './variable';
-import {VariableSrv} from './variable_srv';
 
 export class IntervalVariable implements Variable {
   auto_count: number;

+ 1 - 2
public/app/features/templating/query_variable.ts

@@ -3,7 +3,6 @@
 import _ from 'lodash';
 import kbn from 'app/core/utils/kbn';
 import {Variable, containsVariable, assignModelProperties, variableTypes} from './variable';
-import {VariableSrv} from './variable_srv';
 
 function getNoneOption() {
   return { text: 'None', value: '', isNone: true };
@@ -48,7 +47,7 @@ export class QueryVariable implements Variable {
   };
 
   /** @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
     assignModelProperties(this, model, this.defaults);
   }

+ 1 - 1
public/app/features/templating/specs/adhoc_variable_specs.ts

@@ -1,4 +1,4 @@
-import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common';
+import {describe, it, expect} from 'test/lib/common';
 
 import {AdhocVariable} from '../adhoc_variable';
 

+ 5 - 6
public/app/features/templating/specs/query_variable_specs.ts

@@ -1,4 +1,4 @@
-import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common';
+import {describe, it, expect} from 'test/lib/common';
 
 import {QueryVariable} from '../query_variable';
 
@@ -7,7 +7,7 @@ describe('QueryVariable', () => {
   describe('when creating from model', () => {
 
     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.refresh).to.be(0);
       expect(variable.sort).to.be(0);
@@ -19,7 +19,7 @@ describe('QueryVariable', () => {
     });
 
     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.datasource = 'google';
       variable.regex = 'asd';
@@ -34,7 +34,7 @@ describe('QueryVariable', () => {
     });
 
     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.refresh = 1;
 
@@ -44,7 +44,7 @@ describe('QueryVariable', () => {
   });
 
   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)
 
     describe('can sort a mixed array of metric variables', () => {
@@ -79,4 +79,3 @@ describe('QueryVariable', () => {
     });
   });
 });
-

+ 1 - 1
public/app/features/templating/specs/template_srv_specs.ts

@@ -1,4 +1,4 @@
-import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common';
+import {describe, beforeEach, it, expect, angularMocks} from 'test/lib/common';
 
 import '../all';
 import {Emitter} from 'app/core/core';

Some files were not shown because too many files changed in this diff