diff --git a/public/app/core/components/PasswordStrength.tsx b/public/app/core/components/PasswordStrength.tsx index c376042ce75..ff62f90d0c9 100644 --- a/public/app/core/components/PasswordStrength.tsx +++ b/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 { diff --git a/public/app/core/components/colorpicker.ts b/public/app/core/components/colorpicker.ts index 1834a1eb8a1..f64903ad0b6 100644 --- a/public/app/core/components/colorpicker.ts +++ b/public/app/core/components/colorpicker.ts @@ -1,8 +1,5 @@ /// -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; diff --git a/public/app/core/components/dashboard_selector.ts b/public/app/core/components/dashboard_selector.ts index 4209ff3f8dc..f68e70a17c0 100644 --- a/public/app/core/components/dashboard_selector.ts +++ b/public/app/core/components/dashboard_selector.ts @@ -1,8 +1,5 @@ /// -import config from 'app/core/config'; -import _ from 'lodash'; -import $ from 'jquery'; import coreModule from 'app/core/core_module'; var template = ` diff --git a/public/app/core/components/form_dropdown/form_dropdown.ts b/public/app/core/components/form_dropdown/form_dropdown.ts index 6e3156df1fc..b1cbd9b6ced 100644 --- a/public/app/core/components/form_dropdown/form_dropdown.ts +++ b/public/app/core/components/form_dropdown/form_dropdown.ts @@ -1,6 +1,5 @@ /// -import config from 'app/core/config'; import _ from 'lodash'; import $ from 'jquery'; import coreModule from '../../core_module'; diff --git a/public/app/core/components/grafana_app.ts b/public/app/core/components/grafana_app.ts index ff5751f33dc..0eee3ae43fd 100644 --- a/public/app/core/components/grafana_app.ts +++ b/public/app/core/components/grafana_app.ts @@ -1,9 +1,7 @@ /// 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'; diff --git a/public/app/core/components/help/help.ts b/public/app/core/components/help/help.ts index 943a21f3c5f..bf84b43b5f9 100644 --- a/public/app/core/components/help/help.ts +++ b/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': [ diff --git a/public/app/core/components/info_popover.ts b/public/app/core/components/info_popover.ts index df90728157d..a6ea853b7bb 100644 --- a/public/app/core/components/info_popover.ts +++ b/public/app/core/components/info_popover.ts @@ -1,7 +1,6 @@ /// import _ from 'lodash'; -import $ from 'jquery'; import coreModule from 'app/core/core_module'; import Drop from 'tether-drop'; diff --git a/public/app/core/components/json_explorer/json_explorer.ts b/public/app/core/components/json_explorer/json_explorer.ts index c2810f23b54..07184dba19b 100644 --- a/public/app/core/components/json_explorer/json_explorer.ts +++ b/public/app/core/components/json_explorer/json_explorer.ts @@ -6,7 +6,6 @@ import { getObjectName, getType, getValuePreview, - getPreview, cssClass, createElement } from './helpers'; diff --git a/public/app/core/components/layout_selector/layout_selector.ts b/public/app/core/components/layout_selector/layout_selector.ts index e9d90aa1f48..b2071723677 100644 --- a/public/app/core/components/layout_selector/layout_selector.ts +++ b/public/app/core/components/layout_selector/layout_selector.ts @@ -1,9 +1,6 @@ /// -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 = ` diff --git a/public/app/core/components/navbar/navbar.html b/public/app/core/components/navbar/navbar.html index 085e2eef920..e160d3b3eed 100644 --- a/public/app/core/components/navbar/navbar.html +++ b/public/app/core/components/navbar/navbar.html @@ -1,5 +1,5 @@ diff --git a/public/app/features/dashboard/export/export_modal.ts b/public/app/features/dashboard/export/export_modal.ts index 6c76b7e824f..6b877ffd239 100644 --- a/public/app/features/dashboard/export/export_modal.ts +++ b/public/app/features/dashboard/export/export_modal.ts @@ -1,11 +1,7 @@ /// -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 => { diff --git a/public/app/features/dashboard/export/exporter.ts b/public/app/features/dashboard/export/exporter.ts index d76e782905b..13c76ad4a44 100644 --- a/public/app/features/dashboard/export/exporter.ts +++ b/public/app/features/dashboard/export/exporter.ts @@ -1,9 +1,7 @@ /// import config from 'app/core/config'; -import angular from 'angular'; import _ from 'lodash'; - import {DynamicDashboardSrv} from '../dynamic_dashboard_srv'; export class DashboardExporter { diff --git a/public/app/features/dashboard/export_data/export_data_modal.ts b/public/app/features/dashboard/export_data/export_data_modal.ts index 559d03c5dca..f4bc5d3f2ea 100644 --- a/public/app/features/dashboard/export_data/export_data_modal.ts +++ b/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') { diff --git a/public/app/features/dashboard/history/history.ts b/public/app/features/dashboard/history/history.ts index f199d84ffb4..bddcf6bf8d6 100644 --- a/public/app/features/dashboard/history/history.ts +++ b/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'; diff --git a/public/app/features/dashboard/import/dash_import.ts b/public/app/features/dashboard/import/dash_import.ts index ff71df82dd6..8f3de6adc60 100644 --- a/public/app/features/dashboard/import/dash_import.ts +++ b/public/app/features/dashboard/import/dash_import.ts @@ -1,8 +1,6 @@ /// -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; diff --git a/public/app/features/dashboard/model.ts b/public/app/features/dashboard/model.ts index f407ec3dd4e..3eb3d25f4fe 100644 --- a/public/app/features/dashboard/model.ts +++ b/public/app/features/dashboard/model.ts @@ -1,6 +1,5 @@ /// -import config from 'app/core/config'; import angular from 'angular'; import moment from 'moment'; import _ from 'lodash'; diff --git a/public/app/features/dashboard/row/add_panel.ts b/public/app/features/dashboard/row/add_panel.ts index 1ea0cc5159e..13269bdb8b4 100644 --- a/public/app/features/dashboard/row/add_panel.ts +++ b/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; diff --git a/public/app/features/dashboard/row/options.ts b/public/app/features/dashboard/row/options.ts index 8f19b734d8a..5de0186ac95 100644 --- a/public/app/features/dashboard/row/options.ts +++ b/public/app/features/dashboard/row/options.ts @@ -1,8 +1,5 @@ /// -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'; diff --git a/public/app/features/dashboard/row/row_ctrl.ts b/public/app/features/dashboard/row/row_ctrl.ts index 34b03b3c3be..496335eaac5 100644 --- a/public/app/features/dashboard/row/row_ctrl.ts +++ b/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'); diff --git a/public/app/features/dashboard/row/row_model.ts b/public/app/features/dashboard/row/row_model.ts index 037a7ad1a4a..ecdffb8c8a8 100644 --- a/public/app/features/dashboard/row/row_model.ts +++ b/public/app/features/dashboard/row/row_model.ts @@ -1,7 +1,7 @@ /// 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; diff --git a/public/app/features/dashboard/save_as_modal.ts b/public/app/features/dashboard/save_as_modal.ts index 3a0a877f1eb..7e0b754d559 100644 --- a/public/app/features/dashboard/save_as_modal.ts +++ b/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; diff --git a/public/app/features/dashboard/save_modal.ts b/public/app/features/dashboard/save_modal.ts index 36bae222243..d9b5349fbf6 100644 --- a/public/app/features/dashboard/save_modal.ts +++ b/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; } diff --git a/public/app/features/dashboard/specs/dashboard_model_specs.ts b/public/app/features/dashboard/specs/dashboard_model_specs.ts index 1c7415d342e..6ca84ba89f3 100644 --- a/public/app/features/dashboard/specs/dashboard_model_specs.ts +++ b/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'; diff --git a/public/app/features/dashboard/specs/dashboard_srv_specs.ts b/public/app/features/dashboard/specs/dashboard_srv_specs.ts index 666a3bc0bf2..634f0e82f38 100644 --- a/public/app/features/dashboard/specs/dashboard_srv_specs.ts +++ b/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'; diff --git a/public/app/features/dashboard/specs/dynamic_dashboard_srv_specs.ts b/public/app/features/dashboard/specs/dynamic_dashboard_srv_specs.ts index 93feddc0654..cb7ea3bed46 100644 --- a/public/app/features/dashboard/specs/dynamic_dashboard_srv_specs.ts +++ b/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) { diff --git a/public/app/features/dashboard/specs/exporter_specs.ts b/public/app/features/dashboard/specs/exporter_specs.ts index 0aaadae2b63..9364cea8c47 100644 --- a/public/app/features/dashboard/specs/exporter_specs.ts +++ b/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'; diff --git a/public/app/features/dashboard/specs/history_ctrl_specs.ts b/public/app/features/dashboard/specs/history_ctrl_specs.ts index 0bb09546a34..d6365470887 100644 --- a/public/app/features/dashboard/specs/history_ctrl_specs.ts +++ b/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() { diff --git a/public/app/features/dashboard/specs/history_srv_specs.ts b/public/app/features/dashboard/specs/history_srv_specs.ts index 4678759c438..e72a626467e 100644 --- a/public/app/features/dashboard/specs/history_srv_specs.ts +++ b/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(); diff --git a/public/app/features/dashboard/specs/row_model_specs.ts b/public/app/features/dashboard/specs/row_model_specs.ts deleted file mode 100644 index d7f573b485a..00000000000 --- a/public/app/features/dashboard/specs/row_model_specs.ts +++ /dev/null @@ -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() { - -}); - - diff --git a/public/app/features/dashboard/specs/time_srv_specs.ts b/public/app/features/dashboard/specs/time_srv_specs.ts index 3b008738430..3c0f2637f0e 100644 --- a/public/app/features/dashboard/specs/time_srv_specs.ts +++ b/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() { diff --git a/public/app/features/dashboard/submenu/submenu.ts b/public/app/features/dashboard/submenu/submenu.ts index 69081f01cab..a18ca217f63 100644 --- a/public/app/features/dashboard/submenu/submenu.ts +++ b/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; diff --git a/public/app/features/dashboard/time_srv.ts b/public/app/features/dashboard/time_srv.ts index 2c16915b5aa..db6ba437e73 100644 --- a/public/app/features/dashboard/time_srv.ts +++ b/public/app/features/dashboard/time_srv.ts @@ -1,7 +1,5 @@ /// -import config from 'app/core/config'; -import angular from 'angular'; import moment from 'moment'; import _ from 'lodash'; import coreModule from 'app/core/core_module'; diff --git a/public/app/features/dashboard/unsaved_changes_modal.ts b/public/app/features/dashboard/unsaved_changes_modal.ts index 31889a33d2e..cacfbe0f045 100644 --- a/public/app/features/dashboard/unsaved_changes_modal.ts +++ b/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() { diff --git a/public/app/features/dashboard/upload.ts b/public/app/features/dashboard/upload.ts index 57be7b8fd11..45a1f1b4a0c 100644 --- a/public/app/features/dashboard/upload.ts +++ b/public/app/features/dashboard/upload.ts @@ -1,6 +1,5 @@ /// -import kbn from 'app/core/utils/kbn'; import coreModule from 'app/core/core_module'; var template = ` diff --git a/public/app/features/org/org_users_ctrl.ts b/public/app/features/org/org_users_ctrl.ts index 1fa624e4a7e..5b77139ebe5 100644 --- a/public/app/features/org/org_users_ctrl.ts +++ b/public/app/features/org/org_users_ctrl.ts @@ -1,7 +1,6 @@ /// 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', diff --git a/public/app/features/org/prefs_control.ts b/public/app/features/org/prefs_control.ts index 3ea3ec95b5f..07b277680ad 100644 --- a/public/app/features/org/prefs_control.ts +++ b/public/app/features/org/prefs_control.ts @@ -1,7 +1,6 @@ /// import config from 'app/core/config'; -import _ from 'lodash'; import coreModule from 'app/core/core_module'; export class PrefsControlCtrl { diff --git a/public/app/features/org/profile_ctrl.ts b/public/app/features/org/profile_ctrl.ts index 02f20553e3f..84999abafad 100644 --- a/public/app/features/org/profile_ctrl.ts +++ b/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; diff --git a/public/app/features/panel/metrics_panel_ctrl.ts b/public/app/features/panel/metrics_panel_ctrl.ts index 0e94df437a8..df73efb9cdb 100644 --- a/public/app/features/panel/metrics_panel_ctrl.ts +++ b/public/app/features/panel/metrics_panel_ctrl.ts @@ -1,6 +1,5 @@ /// -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 { diff --git a/public/app/features/panel/metrics_tab.ts b/public/app/features/panel/metrics_tab.ts index 53d53cdbbff..026d6fce650 100644 --- a/public/app/features/panel/metrics_tab.ts +++ b/public/app/features/panel/metrics_tab.ts @@ -1,6 +1,5 @@ /// -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}; } diff --git a/public/app/features/panel/panel_ctrl.ts b/public/app/features/panel/panel_ctrl.ts index b61f722974d..767f61d971a 100644 --- a/public/app/features/panel/panel_ctrl.ts +++ b/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); diff --git a/public/app/features/panel/panel_directive.ts b/public/app/features/panel/panel_directive.ts index 1b6805179c0..13a4c2be368 100644 --- a/public/app/features/panel/panel_directive.ts +++ b/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'); diff --git a/public/app/features/panel/panel_editor_tab.ts b/public/app/features/panel/panel_editor_tab.ts index 9bbb979bcc0..e9851f5fe15 100644 --- a/public/app/features/panel/panel_editor_tab.ts +++ b/public/app/features/panel/panel_editor_tab.ts @@ -1,7 +1,6 @@ /// import angular from 'angular'; -import config from 'app/core/config'; var directiveModule = angular.module('grafana.directives'); diff --git a/public/app/features/panel/query_ctrl.ts b/public/app/features/panel/query_ctrl.ts index 148322360bc..56ed240f4e1 100644 --- a/public/app/features/panel/query_ctrl.ts +++ b/public/app/features/panel/query_ctrl.ts @@ -1,6 +1,5 @@ /// -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); } diff --git a/public/app/features/panel/query_editor_row.ts b/public/app/features/panel/query_editor_row.ts index 1241d45db69..612ede2fc6b 100644 --- a/public/app/features/panel/query_editor_row.ts +++ b/public/app/features/panel/query_editor_row.ts @@ -1,7 +1,6 @@ /// import angular from 'angular'; -import _ from 'lodash'; var module = angular.module('grafana.directives'); diff --git a/public/app/features/playlist/playlist_edit_ctrl.ts b/public/app/features/playlist/playlist_edit_ctrl.ts index 9919e0b3b21..95f284acbbb 100644 --- a/public/app/features/playlist/playlist_edit_ctrl.ts +++ b/public/app/features/playlist/playlist_edit_ctrl.ts @@ -1,9 +1,7 @@ /// -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); diff --git a/public/app/features/playlist/playlist_search.ts b/public/app/features/playlist/playlist_search.ts index b0ccd58eaeb..96fd2b428cd 100644 --- a/public/app/features/playlist/playlist_search.ts +++ b/public/app/features/playlist/playlist_search.ts @@ -1,9 +1,5 @@ /// -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(() => { diff --git a/public/app/features/playlist/playlist_srv.ts b/public/app/features/playlist/playlist_srv.ts index c9553dcdcca..51d664ec02b 100644 --- a/public/app/features/playlist/playlist_srv.ts +++ b/public/app/features/playlist/playlist_srv.ts @@ -1,6 +1,5 @@ /// -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, diff --git a/public/app/features/playlist/playlists_ctrl.ts b/public/app/features/playlist/playlists_ctrl.ts index 0f7b863e6a6..5db615a4e50 100644 --- a/public/app/features/playlist/playlists_ctrl.ts +++ b/public/app/features/playlist/playlists_ctrl.ts @@ -1,6 +1,5 @@ /// -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 => { diff --git a/public/app/features/playlist/specs/playlist_edit_ctrl_specs.ts b/public/app/features/playlist/specs/playlist_edit_ctrl_specs.ts index e27eb53e644..7e6007cccf5 100644 --- a/public/app/features/playlist/specs/playlist_edit_ctrl_specs.ts +++ b/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' }, diff --git a/public/app/features/plugins/ds_edit_ctrl.ts b/public/app/features/plugins/ds_edit_ctrl.ts index f8e53b8ec4e..0513487dce7 100644 --- a/public/app/features/plugins/ds_edit_ctrl.ts +++ b/public/app/features/plugins/ds_edit_ctrl.ts @@ -1,6 +1,5 @@ /// -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; diff --git a/public/app/features/plugins/ds_list_ctrl.ts b/public/app/features/plugins/ds_list_ctrl.ts index b26883bd4b5..f91a1ed005e 100644 --- a/public/app/features/plugins/ds_list_ctrl.ts +++ b/public/app/features/plugins/ds_list_ctrl.ts @@ -1,7 +1,5 @@ /// -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 diff --git a/public/app/features/plugins/import_list/import_list.ts b/public/app/features/plugins/import_list/import_list.ts index 0c5006b09ba..08156cb506f 100644 --- a/public/app/features/plugins/import_list/import_list.ts +++ b/public/app/features/plugins/import_list/import_list.ts @@ -1,6 +1,5 @@ /// -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 => { diff --git a/public/app/features/plugins/plugin_edit_ctrl.ts b/public/app/features/plugins/plugin_edit_ctrl.ts index 50a9138e7f8..0b8119f2125 100644 --- a/public/app/features/plugins/plugin_edit_ctrl.ts +++ b/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 = {}; diff --git a/public/app/features/styleguide/styleguide.ts b/public/app/features/styleguide/styleguide.ts index 36afdd1d7c2..7bcb60aee3c 100644 --- a/public/app/features/styleguide/styleguide.ts +++ b/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 = {}; diff --git a/public/app/features/templating/adhoc_variable.ts b/public/app/features/templating/adhoc_variable.ts index 7262173a72e..21c5bcf7e7e 100644 --- a/public/app/features/templating/adhoc_variable.ts +++ b/public/app/features/templating/adhoc_variable.ts @@ -1,9 +1,7 @@ /// 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[]; diff --git a/public/app/features/templating/constant_variable.ts b/public/app/features/templating/constant_variable.ts index 1dcc473740f..dd4553989cb 100644 --- a/public/app/features/templating/constant_variable.ts +++ b/public/app/features/templating/constant_variable.ts @@ -1,8 +1,6 @@ /// -import _ from 'lodash'; import {Variable, assignModelProperties, variableTypes} from './variable'; -import {VariableSrv} from './variable_srv'; export class ConstantVariable implements Variable { query: string; diff --git a/public/app/features/templating/custom_variable.ts b/public/app/features/templating/custom_variable.ts index 4fadcd26742..72ddea5ac6a 100644 --- a/public/app/features/templating/custom_variable.ts +++ b/public/app/features/templating/custom_variable.ts @@ -1,9 +1,7 @@ /// 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); } diff --git a/public/app/features/templating/datasource_variable.ts b/public/app/features/templating/datasource_variable.ts index 41f2262ab4a..d5c85b0b321 100644 --- a/public/app/features/templating/datasource_variable.ts +++ b/public/app/features/templating/datasource_variable.ts @@ -1,9 +1,7 @@ /// -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; diff --git a/public/app/features/templating/editor_ctrl.ts b/public/app/features/templating/editor_ctrl.ts index beed1534f5d..44a73b75f72 100644 --- a/public/app/features/templating/editor_ctrl.ts +++ b/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 = /^(?!__).*$/; diff --git a/public/app/features/templating/interval_variable.ts b/public/app/features/templating/interval_variable.ts index ffd30392cc7..79c1860d0cf 100644 --- a/public/app/features/templating/interval_variable.ts +++ b/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; diff --git a/public/app/features/templating/query_variable.ts b/public/app/features/templating/query_variable.ts index 257f6b49dc6..862b031212d 100644 --- a/public/app/features/templating/query_variable.ts +++ b/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); } diff --git a/public/app/features/templating/specs/adhoc_variable_specs.ts b/public/app/features/templating/specs/adhoc_variable_specs.ts index a7b14a4c0e1..65086ee7751 100644 --- a/public/app/features/templating/specs/adhoc_variable_specs.ts +++ b/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'; diff --git a/public/app/features/templating/specs/query_variable_specs.ts b/public/app/features/templating/specs/query_variable_specs.ts index fda44161fb9..bf50b759a13 100644 --- a/public/app/features/templating/specs/query_variable_specs.ts +++ b/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', () => { }); }); }); - diff --git a/public/app/features/templating/specs/template_srv_specs.ts b/public/app/features/templating/specs/template_srv_specs.ts index 3c8b146dc18..f8a006fc83c 100644 --- a/public/app/features/templating/specs/template_srv_specs.ts +++ b/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'; diff --git a/public/app/features/templating/specs/variable_specs.ts b/public/app/features/templating/specs/variable_specs.ts index 0031c2df79a..9f9c5ce6c22 100644 --- a/public/app/features/templating/specs/variable_specs.ts +++ b/public/app/features/templating/specs/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 {containsVariable, assignModelProperties} from '../variable'; diff --git a/public/app/features/templating/variable.ts b/public/app/features/templating/variable.ts index d451b66ffb1..de7a444aece 100644 --- a/public/app/features/templating/variable.ts +++ b/public/app/features/templating/variable.ts @@ -1,6 +1,5 @@ /// -import _ from 'lodash'; import kbn from 'app/core/utils/kbn'; import {assignModelProperties} from 'app/core/core'; diff --git a/public/app/features/templating/variable_srv.ts b/public/app/features/templating/variable_srv.ts index 9c2bf26b368..e8f1a9b1ff6 100644 --- a/public/app/features/templating/variable_srv.ts +++ b/public/app/features/templating/variable_srv.ts @@ -3,7 +3,7 @@ import angular from 'angular'; import _ from 'lodash'; import coreModule from 'app/core/core_module'; -import {Variable, variableTypes} from './variable'; +import {variableTypes} from './variable'; export class VariableSrv { dashboard: any; diff --git a/public/app/plugins/app/testdata/datasource/query_ctrl.ts b/public/app/plugins/app/testdata/datasource/query_ctrl.ts index 6b0ad93f26c..e783584eb5d 100644 --- a/public/app/plugins/app/testdata/datasource/query_ctrl.ts +++ b/public/app/plugins/app/testdata/datasource/query_ctrl.ts @@ -2,7 +2,6 @@ import _ from 'lodash'; -import {TestDataDatasource} from './datasource'; import {QueryCtrl} from 'app/plugins/sdk'; export class TestDataQueryCtrl extends QueryCtrl { diff --git a/public/app/plugins/datasource/cloudwatch/config_ctrl.ts b/public/app/plugins/datasource/cloudwatch/config_ctrl.ts index ee76b0d15fa..7f96b8060b6 100644 --- a/public/app/plugins/datasource/cloudwatch/config_ctrl.ts +++ b/public/app/plugins/datasource/cloudwatch/config_ctrl.ts @@ -1,8 +1,5 @@ /// -import angular from 'angular'; -import _ from 'lodash'; - export class CloudWatchConfigCtrl { static templateUrl = 'partials/config.html'; current: any; diff --git a/public/app/plugins/datasource/cloudwatch/query_ctrl.ts b/public/app/plugins/datasource/cloudwatch/query_ctrl.ts index 1a64d199603..f7f785f5261 100644 --- a/public/app/plugins/datasource/cloudwatch/query_ctrl.ts +++ b/public/app/plugins/datasource/cloudwatch/query_ctrl.ts @@ -1,7 +1,6 @@ /// import './query_parameter_ctrl'; -import _ from 'lodash'; import {QueryCtrl} from 'app/plugins/sdk'; export class CloudWatchQueryCtrl extends QueryCtrl { diff --git a/public/app/plugins/datasource/cloudwatch/specs/annotation_query_specs.ts b/public/app/plugins/datasource/cloudwatch/specs/annotation_query_specs.ts index e3a8fc3f9cb..d469ca8685b 100644 --- a/public/app/plugins/datasource/cloudwatch/specs/annotation_query_specs.ts +++ b/public/app/plugins/datasource/cloudwatch/specs/annotation_query_specs.ts @@ -1,5 +1,5 @@ import "../datasource"; -import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common'; +import {describe, beforeEach, it, expect, angularMocks} from 'test/lib/common'; import moment from 'moment'; import helpers from 'test/specs/helpers'; import {CloudWatchDatasource} from "../datasource"; diff --git a/public/app/plugins/datasource/cloudwatch/specs/datasource_specs.ts b/public/app/plugins/datasource/cloudwatch/specs/datasource_specs.ts index dbb2ffd6129..0130aee60d3 100644 --- a/public/app/plugins/datasource/cloudwatch/specs/datasource_specs.ts +++ b/public/app/plugins/datasource/cloudwatch/specs/datasource_specs.ts @@ -1,7 +1,6 @@ import "../datasource"; -import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common'; -import moment from 'moment'; +import {describe, beforeEach, it, expect, angularMocks} from 'test/lib/common'; import helpers from 'test/specs/helpers'; import {CloudWatchDatasource} from "../datasource"; diff --git a/public/app/plugins/datasource/elasticsearch/config_ctrl.ts b/public/app/plugins/datasource/elasticsearch/config_ctrl.ts index 5c5704eb22c..fdf941e81f7 100644 --- a/public/app/plugins/datasource/elasticsearch/config_ctrl.ts +++ b/public/app/plugins/datasource/elasticsearch/config_ctrl.ts @@ -1,6 +1,5 @@ /// -import angular from 'angular'; import _ from 'lodash'; export class ElasticConfigCtrl { diff --git a/public/app/plugins/datasource/elasticsearch/query_ctrl.ts b/public/app/plugins/datasource/elasticsearch/query_ctrl.ts index ef6f1c5cdc7..025410c5205 100644 --- a/public/app/plugins/datasource/elasticsearch/query_ctrl.ts +++ b/public/app/plugins/datasource/elasticsearch/query_ctrl.ts @@ -15,7 +15,7 @@ export class ElasticQueryCtrl extends QueryCtrl { rawQueryOld: string; /** @ngInject **/ - constructor($scope, $injector, private $rootScope, private $timeout, private uiSegmentSrv) { + constructor($scope, $injector, private $rootScope, private uiSegmentSrv) { super($scope, $injector); this.esVersion = this.datasource.esVersion; diff --git a/public/app/plugins/datasource/elasticsearch/specs/datasource_specs.ts b/public/app/plugins/datasource/elasticsearch/specs/datasource_specs.ts index 0838dc33654..4ea574064fe 100644 --- a/public/app/plugins/datasource/elasticsearch/specs/datasource_specs.ts +++ b/public/app/plugins/datasource/elasticsearch/specs/datasource_specs.ts @@ -1,5 +1,5 @@ import _ from 'lodash'; -import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common'; +import {describe, beforeEach, it, expect, angularMocks} from 'test/lib/common'; import moment from 'moment'; import angular from 'angular'; import helpers from 'test/specs/helpers'; @@ -7,7 +7,6 @@ import {ElasticDatasource} from "../datasource"; describe('ElasticDatasource', function() { var ctx = new helpers.ServiceTestContext(); - var instanceSettings: any = {jsonData: {}}; beforeEach(angularMocks.module('grafana.core')); beforeEach(angularMocks.module('grafana.services')); @@ -113,7 +112,7 @@ describe('ElasticDatasource', function() { }); describe('When getting fields', function() { - var requestOptions, parts, header; + var requestOptions; beforeEach(function() { createDatasource({url: 'http://es.com', index: 'metricbeat'}); diff --git a/public/app/plugins/datasource/elasticsearch/specs/index_pattern_specs.ts b/public/app/plugins/datasource/elasticsearch/specs/index_pattern_specs.ts index db000fb999d..3fee81083b7 100644 --- a/public/app/plugins/datasource/elasticsearch/specs/index_pattern_specs.ts +++ b/public/app/plugins/datasource/elasticsearch/specs/index_pattern_specs.ts @@ -1,6 +1,6 @@ /// -import {describe, beforeEach, it, sinon, expect} from 'test/lib/common'; +import {describe, it, expect} from 'test/lib/common'; import moment from 'moment'; import IndexPattern from '../index_pattern'; diff --git a/public/app/plugins/datasource/elasticsearch/specs/query_builder_specs.ts b/public/app/plugins/datasource/elasticsearch/specs/query_builder_specs.ts index 8b05236d823..3440309897b 100644 --- a/public/app/plugins/datasource/elasticsearch/specs/query_builder_specs.ts +++ b/public/app/plugins/datasource/elasticsearch/specs/query_builder_specs.ts @@ -1,5 +1,5 @@ -import {describe, beforeEach, it, sinon, expect} from 'test/lib/common'; +import {describe, beforeEach, it, expect} from 'test/lib/common'; import ElasticQueryBuilder from '../query_builder'; describe('ElasticQueryBuilder', function() { diff --git a/public/app/plugins/datasource/elasticsearch/specs/query_def_specs.ts b/public/app/plugins/datasource/elasticsearch/specs/query_def_specs.ts index ed09f17a7c5..e89c9774769 100644 --- a/public/app/plugins/datasource/elasticsearch/specs/query_def_specs.ts +++ b/public/app/plugins/datasource/elasticsearch/specs/query_def_specs.ts @@ -1,5 +1,5 @@ -import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common'; +import {describe, it, expect} from 'test/lib/common'; import queryDef from '../query_def'; diff --git a/public/app/plugins/datasource/grafana-live/datasource.ts b/public/app/plugins/datasource/grafana-live/datasource.ts index 36605e5b6bc..c2ee5ec8655 100644 --- a/public/app/plugins/datasource/grafana-live/datasource.ts +++ b/public/app/plugins/datasource/grafana-live/datasource.ts @@ -2,8 +2,6 @@ import {liveSrv} from 'app/core/core'; -import {Observable} from 'vendor/npm/rxjs/Observable'; - class DataObservable { target: any; diff --git a/public/app/plugins/datasource/grafana-live/module.ts b/public/app/plugins/datasource/grafana-live/module.ts index b17abd02feb..6835eaf622b 100644 --- a/public/app/plugins/datasource/grafana-live/module.ts +++ b/public/app/plugins/datasource/grafana-live/module.ts @@ -1,6 +1,5 @@ /// -import angular from 'angular'; import {GrafanaStreamDS} from './datasource'; import {QueryCtrl} from 'app/plugins/sdk'; diff --git a/public/app/plugins/datasource/grafana/module.ts b/public/app/plugins/datasource/grafana/module.ts index 615a0b2d175..d03914bda19 100644 --- a/public/app/plugins/datasource/grafana/module.ts +++ b/public/app/plugins/datasource/grafana/module.ts @@ -1,6 +1,5 @@ /// -import angular from 'angular'; import {GrafanaDatasource} from './datasource'; import {QueryCtrl} from 'app/plugins/sdk'; diff --git a/public/app/plugins/datasource/graphite/config_ctrl.ts b/public/app/plugins/datasource/graphite/config_ctrl.ts index 497c73a7c28..4f6ebef77ea 100644 --- a/public/app/plugins/datasource/graphite/config_ctrl.ts +++ b/public/app/plugins/datasource/graphite/config_ctrl.ts @@ -1,8 +1,5 @@ /// -import angular from 'angular'; -import _ from 'lodash'; - export class GraphiteConfigCtrl { static templateUrl = 'public/app/plugins/datasource/graphite/partials/config.html'; current: any; diff --git a/public/app/plugins/datasource/graphite/datasource.ts b/public/app/plugins/datasource/graphite/datasource.ts index fd13f66c7b5..2c846ee6be8 100644 --- a/public/app/plugins/datasource/graphite/datasource.ts +++ b/public/app/plugins/datasource/graphite/datasource.ts @@ -1,9 +1,6 @@ /// -import angular from 'angular'; import _ from 'lodash'; -import moment from 'moment'; - import * as dateMath from 'app/core/utils/datemath'; /** @ngInject */ diff --git a/public/app/plugins/datasource/graphite/query_ctrl.ts b/public/app/plugins/datasource/graphite/query_ctrl.ts index 545e59ed3ec..7127636d47f 100644 --- a/public/app/plugins/datasource/graphite/query_ctrl.ts +++ b/public/app/plugins/datasource/graphite/query_ctrl.ts @@ -3,9 +3,7 @@ import './add_graphite_func'; import './func_editor'; -import angular from 'angular'; import _ from 'lodash'; -import moment from 'moment'; import gfunc from './gfunc'; import {Parser} from './parser'; import {QueryCtrl} from 'app/plugins/sdk'; diff --git a/public/app/plugins/datasource/graphite/specs/datasource_specs.ts b/public/app/plugins/datasource/graphite/specs/datasource_specs.ts index 0fd6f7b118a..47c2fa070fe 100644 --- a/public/app/plugins/datasource/graphite/specs/datasource_specs.ts +++ b/public/app/plugins/datasource/graphite/specs/datasource_specs.ts @@ -1,5 +1,5 @@ -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 {GraphiteDatasource} from "../datasource"; diff --git a/public/app/plugins/datasource/influxdb/datasource.ts b/public/app/plugins/datasource/influxdb/datasource.ts index ddab664f570..a29e520c159 100644 --- a/public/app/plugins/datasource/influxdb/datasource.ts +++ b/public/app/plugins/datasource/influxdb/datasource.ts @@ -1,6 +1,5 @@ /// -import angular from 'angular'; import _ from 'lodash'; import * as dateMath from 'app/core/utils/datemath'; diff --git a/public/app/plugins/datasource/influxdb/query_part.ts b/public/app/plugins/datasource/influxdb/query_part.ts index 4c6609d0f74..3ce29b10d5b 100644 --- a/public/app/plugins/datasource/influxdb/query_part.ts +++ b/public/app/plugins/datasource/influxdb/query_part.ts @@ -6,8 +6,6 @@ import { QueryPart, functionRenderer, suffixRenderer, - identityRenderer, - quotedIdentityRenderer, } from 'app/core/components/query_part/query_part'; var index = []; diff --git a/public/app/plugins/datasource/influxdb/specs/influx_query_specs.ts b/public/app/plugins/datasource/influxdb/specs/influx_query_specs.ts index 88963f9c132..47ad3498ece 100644 --- a/public/app/plugins/datasource/influxdb/specs/influx_query_specs.ts +++ b/public/app/plugins/datasource/influxdb/specs/influx_query_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 InfluxQuery from '../influx_query'; diff --git a/public/app/plugins/datasource/influxdb/specs/influx_series_specs.ts b/public/app/plugins/datasource/influxdb/specs/influx_series_specs.ts index 2daa21d7e30..ef0a742528f 100644 --- a/public/app/plugins/datasource/influxdb/specs/influx_series_specs.ts +++ b/public/app/plugins/datasource/influxdb/specs/influx_series_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 InfluxSeries from '../influx_series'; describe('when generating timeseries from influxdb response', function() { diff --git a/public/app/plugins/datasource/influxdb/specs/query_builder_specs.ts b/public/app/plugins/datasource/influxdb/specs/query_builder_specs.ts index 0120e349b50..86b1d4f08dd 100644 --- a/public/app/plugins/datasource/influxdb/specs/query_builder_specs.ts +++ b/public/app/plugins/datasource/influxdb/specs/query_builder_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 InfluxQueryBuilder from '../query_builder'; describe('InfluxQueryBuilder', function() { diff --git a/public/app/plugins/datasource/influxdb/specs/query_part_specs.ts b/public/app/plugins/datasource/influxdb/specs/query_part_specs.ts index ba32c961909..131eea80806 100644 --- a/public/app/plugins/datasource/influxdb/specs/query_part_specs.ts +++ b/public/app/plugins/datasource/influxdb/specs/query_part_specs.ts @@ -1,5 +1,5 @@ -import {describe, beforeEach, it, sinon, expect} from 'test/lib/common'; +import {describe, it, expect} from 'test/lib/common'; import queryPart from '../query_part'; diff --git a/public/app/plugins/datasource/influxdb/specs/response_parser_specs.ts b/public/app/plugins/datasource/influxdb/specs/response_parser_specs.ts index f545753d10e..b24baec8f89 100644 --- a/public/app/plugins/datasource/influxdb/specs/response_parser_specs.ts +++ b/public/app/plugins/datasource/influxdb/specs/response_parser_specs.ts @@ -1,5 +1,5 @@ import _ from 'lodash'; -import {describe, beforeEach, it, sinon, expect} from 'test/lib/common'; +import {describe, it, expect} from 'test/lib/common'; import ResponseParser from '../response_parser'; describe("influxdb response parser", () => { diff --git a/public/app/plugins/datasource/mixed/module.ts b/public/app/plugins/datasource/mixed/module.ts index cdc740cf11a..54d4eeb700e 100644 --- a/public/app/plugins/datasource/mixed/module.ts +++ b/public/app/plugins/datasource/mixed/module.ts @@ -1,7 +1,5 @@ /// -import angular from 'angular'; import {MixedDatasource} from './datasource'; - export {MixedDatasource, MixedDatasource as Datasource}; diff --git a/public/app/plugins/datasource/mysql/module.ts b/public/app/plugins/datasource/mysql/module.ts index 156cff61b61..c32c832d6a0 100644 --- a/public/app/plugins/datasource/mysql/module.ts +++ b/public/app/plugins/datasource/mysql/module.ts @@ -1,7 +1,5 @@ /// -import angular from 'angular'; -import _ from 'lodash'; import {MysqlDatasource} from './datasource'; import {MysqlQueryCtrl} from './query_ctrl'; diff --git a/public/app/plugins/datasource/mysql/query_ctrl.ts b/public/app/plugins/datasource/mysql/query_ctrl.ts index cf3fe9f2830..6774efe9b81 100644 --- a/public/app/plugins/datasource/mysql/query_ctrl.ts +++ b/public/app/plugins/datasource/mysql/query_ctrl.ts @@ -1,8 +1,6 @@ /// -import angular from 'angular'; import _ from 'lodash'; -import {MysqlDatasource} from './datasource'; import {QueryCtrl} from 'app/plugins/sdk'; export interface MysqlQuery { diff --git a/public/app/plugins/datasource/mysql/specs/datasource_specs.ts b/public/app/plugins/datasource/mysql/specs/datasource_specs.ts index 11ddaa34086..08d2f8922a5 100644 --- a/public/app/plugins/datasource/mysql/specs/datasource_specs.ts +++ b/public/app/plugins/datasource/mysql/specs/datasource_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 moment from 'moment'; import helpers from 'test/specs/helpers'; import {MysqlDatasource} from '../datasource'; diff --git a/public/app/plugins/datasource/opentsdb/config_ctrl.ts b/public/app/plugins/datasource/opentsdb/config_ctrl.ts index a9259337926..6c450ffdd12 100644 --- a/public/app/plugins/datasource/opentsdb/config_ctrl.ts +++ b/public/app/plugins/datasource/opentsdb/config_ctrl.ts @@ -1,8 +1,5 @@ /// -import angular from 'angular'; -import _ from 'lodash'; - export class OpenTsConfigCtrl { static templateUrl = 'public/app/plugins/datasource/opentsdb/partials/config.html'; current: any; diff --git a/public/app/plugins/datasource/opentsdb/specs/datasource-specs.ts b/public/app/plugins/datasource/opentsdb/specs/datasource-specs.ts index 1f63dc88667..cddcd621c01 100644 --- a/public/app/plugins/datasource/opentsdb/specs/datasource-specs.ts +++ b/public/app/plugins/datasource/opentsdb/specs/datasource-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 helpers from 'test/specs/helpers'; import {OpenTsDatasource} from "../datasource"; diff --git a/public/app/plugins/datasource/prometheus/completer.ts b/public/app/plugins/datasource/prometheus/completer.ts index e1b0984399d..2651f75df98 100644 --- a/public/app/plugins/datasource/prometheus/completer.ts +++ b/public/app/plugins/datasource/prometheus/completer.ts @@ -39,7 +39,6 @@ export class PromCompleter { } var query = prefix; - var line = editor.session.getLine(pos.row); return this.datasource.performSuggestQuery(query, true).then(metricNames => { callback(null, metricNames.map(name => { diff --git a/public/app/plugins/datasource/prometheus/datasource.ts b/public/app/plugins/datasource/prometheus/datasource.ts index dd071d09fe6..235198b21ba 100644 --- a/public/app/plugins/datasource/prometheus/datasource.ts +++ b/public/app/plugins/datasource/prometheus/datasource.ts @@ -1,6 +1,5 @@ /// -import angular from 'angular'; import _ from 'lodash'; import moment from 'moment'; @@ -120,7 +119,6 @@ export class PrometheusDatasource { return this.$q.all(allQueryPromise).then(responseList => { var result = []; - var index = 0; _.each(responseList, (response, index) => { if (response.status === 'error') { diff --git a/public/app/plugins/datasource/prometheus/query_ctrl.ts b/public/app/plugins/datasource/prometheus/query_ctrl.ts index 17a564d0b46..e2fe305b550 100644 --- a/public/app/plugins/datasource/prometheus/query_ctrl.ts +++ b/public/app/plugins/datasource/prometheus/query_ctrl.ts @@ -2,9 +2,7 @@ import angular from 'angular'; import _ from 'lodash'; -import moment from 'moment'; -import * as dateMath from 'app/core/utils/datemath'; import {QueryCtrl} from 'app/plugins/sdk'; import {PromCompleter} from './completer'; diff --git a/public/app/plugins/datasource/prometheus/specs/completer_specs.ts b/public/app/plugins/datasource/prometheus/specs/completer_specs.ts index 903ce0b5d3b..37d428859ae 100644 --- a/public/app/plugins/datasource/prometheus/specs/completer_specs.ts +++ b/public/app/plugins/datasource/prometheus/specs/completer_specs.ts @@ -1,4 +1,4 @@ -import {describe, beforeEach, it, sinon, expect} from 'test/lib/common'; +import {describe, it, sinon, expect} from 'test/lib/common'; import {PromCompleter} from '../completer'; import {PrometheusDatasource} from '../datasource'; diff --git a/public/app/plugins/datasource/prometheus/specs/datasource_specs.ts b/public/app/plugins/datasource/prometheus/specs/datasource_specs.ts index 9588090c7bb..9051110bd52 100644 --- a/public/app/plugins/datasource/prometheus/specs/datasource_specs.ts +++ b/public/app/plugins/datasource/prometheus/specs/datasource_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 moment from 'moment'; import helpers from 'test/specs/helpers'; import {PrometheusDatasource} from '../datasource'; diff --git a/public/app/plugins/datasource/prometheus/specs/metric_find_query_specs.ts b/public/app/plugins/datasource/prometheus/specs/metric_find_query_specs.ts index 54300e7ac05..9186d9c4403 100644 --- a/public/app/plugins/datasource/prometheus/specs/metric_find_query_specs.ts +++ b/public/app/plugins/datasource/prometheus/specs/metric_find_query_specs.ts @@ -1,4 +1,5 @@ -import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common'; +import {describe, beforeEach, it, expect, angularMocks} from 'test/lib/common'; + import moment from 'moment'; import helpers from 'test/specs/helpers'; import {PrometheusDatasource} from '../datasource'; diff --git a/public/app/plugins/panel/alertlist/module.ts b/public/app/plugins/panel/alertlist/module.ts index 17d06132751..d0b6ddc3db7 100644 --- a/public/app/plugins/panel/alertlist/module.ts +++ b/public/app/plugins/panel/alertlist/module.ts @@ -3,10 +3,8 @@ import _ from 'lodash'; import moment from 'moment'; import alertDef from '../../../features/alerting/alert_def'; -import config from 'app/core/config'; import {PanelCtrl} from 'app/plugins/sdk'; -import * as rangeUtil from 'app/core/utils/rangeutil'; import * as dateMath from 'app/core/utils/datemath'; class AlertListPanel extends PanelCtrl { @@ -37,7 +35,7 @@ class AlertListPanel extends PanelCtrl { }; /** @ngInject */ - constructor($scope, $injector, private $location, private backendSrv, private timeSrv, private templateSrv) { + constructor($scope, $injector, private backendSrv) { super($scope, $injector); _.defaults(this.panel, this.panelDefaults); diff --git a/public/app/plugins/panel/dashlist/module.ts b/public/app/plugins/panel/dashlist/module.ts index 2c4f98fc205..231a59493a7 100644 --- a/public/app/plugins/panel/dashlist/module.ts +++ b/public/app/plugins/panel/dashlist/module.ts @@ -1,7 +1,6 @@ /// import _ from 'lodash'; -import config from 'app/core/config'; import {PanelCtrl} from 'app/plugins/sdk'; import {impressions} from 'app/features/dashboard/impression_store'; diff --git a/public/app/plugins/panel/gettingstarted/module.ts b/public/app/plugins/panel/gettingstarted/module.ts index 8b3dca60d3d..43c0a249820 100644 --- a/public/app/plugins/panel/gettingstarted/module.ts +++ b/public/app/plugins/panel/gettingstarted/module.ts @@ -11,7 +11,7 @@ class GettingStartedPanelCtrl extends PanelCtrl { steps: any; /** @ngInject **/ - constructor($scope, $injector, private backendSrv, private datasourceSrv, private $q) { + constructor($scope, $injector, private backendSrv, datasourceSrv, private $q) { super($scope, $injector); this.stepIndex = 0; diff --git a/public/app/plugins/panel/graph/axes_editor.ts b/public/app/plugins/panel/graph/axes_editor.ts index 86789db9fce..8db42d7250e 100644 --- a/public/app/plugins/panel/graph/axes_editor.ts +++ b/public/app/plugins/panel/graph/axes_editor.ts @@ -15,7 +15,7 @@ export class AxesEditorCtrl { constructor(private $scope, private $q) { this.panelCtrl = $scope.ctrl; this.panel = this.panelCtrl.panel; - $scope.ctrl = this; + this.$scope.ctrl = this; this.unitFormats = kbn.getUnitFormats(); diff --git a/public/app/plugins/panel/graph/data_processor.ts b/public/app/plugins/panel/graph/data_processor.ts index 87b48f78550..5b784c85608 100644 --- a/public/app/plugins/panel/graph/data_processor.ts +++ b/public/app/plugins/panel/graph/data_processor.ts @@ -1,8 +1,6 @@ /// -import kbn from 'app/core/utils/kbn'; import _ from 'lodash'; -import moment from 'moment'; import TimeSeries from 'app/core/time_series2'; import {colors} from 'app/core/core'; diff --git a/public/app/plugins/panel/graph/graph.ts b/public/app/plugins/panel/graph/graph.ts index 2887f2f4504..4374c033f57 100755 --- a/public/app/plugins/panel/graph/graph.ts +++ b/public/app/plugins/panel/graph/graph.ts @@ -146,16 +146,12 @@ coreModule.directive('grafanaGraph', function($rootScope, timeSrv, popoverSrv) { // add left axis labels if (panel.yaxes[0].label && panel.yaxes[0].show) { - var yaxisLabel = $("
") - .text(panel.yaxes[0].label) - .appendTo(elem); + $("
").text(panel.yaxes[0].label).appendTo(elem); } // add right axis labels if (panel.yaxes[1].label && panel.yaxes[1].show) { - var rightLabel = $("
") - .text(panel.yaxes[1].label) - .appendTo(elem); + $("
").text(panel.yaxes[1].label).appendTo(elem); } thresholdManager.draw(plot); @@ -619,12 +615,6 @@ coreModule.directive('grafanaGraph', function($rootScope, timeSrv, popoverSrv) { return ticks; } - function decimalPlaces(num) { - if (!num) { return 0; } - - return (num.toString().split('.')[1] || []).length; - } - function configureAxisMode(axis, format) { axis.tickFormatter = function(val, axis) { return kbn.valueFormats[format](val, axis.tickDecimals, axis.scaledDecimals); diff --git a/public/app/plugins/panel/graph/module.ts b/public/app/plugins/panel/graph/module.ts index e9ca8c5c4e2..d698e33b5af 100644 --- a/public/app/plugins/panel/graph/module.ts +++ b/public/app/plugins/panel/graph/module.ts @@ -6,10 +6,7 @@ import './series_overrides_ctrl'; import './thresholds_form'; import template from './template'; -import angular from 'angular'; -import moment from 'moment'; import _ from 'lodash'; -import TimeSeries from 'app/core/time_series2'; import config from 'app/core/config'; import {MetricsPanelCtrl, alertTab} from 'app/plugins/sdk'; import {DataProcessor} from './data_processor'; diff --git a/public/app/plugins/panel/graph/specs/data_processor_specs.ts b/public/app/plugins/panel/graph/specs/data_processor_specs.ts index bdc1943e9fb..85f88aa157c 100644 --- a/public/app/plugins/panel/graph/specs/data_processor_specs.ts +++ b/public/app/plugins/panel/graph/specs/data_processor_specs.ts @@ -1,6 +1,6 @@ /// -import {describe, beforeEach, it, sinon, expect, angularMocks} from '../../../../../test/lib/common'; +import {describe, beforeEach, it, expect} from '../../../../../test/lib/common'; import {DataProcessor} from '../data_processor'; diff --git a/public/app/plugins/panel/graph/specs/graph_ctrl_specs.ts b/public/app/plugins/panel/graph/specs/graph_ctrl_specs.ts index ab91b87ece9..d4cefbce5b0 100644 --- a/public/app/plugins/panel/graph/specs/graph_ctrl_specs.ts +++ b/public/app/plugins/panel/graph/specs/graph_ctrl_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 angular from 'angular'; import moment from 'moment'; import {GraphCtrl} from '../module'; import helpers from '../../../../../test/specs/helpers'; diff --git a/public/app/plugins/panel/graph/specs/threshold_manager_specs.ts b/public/app/plugins/panel/graph/specs/threshold_manager_specs.ts index 742ce69ec7c..cc9b037758f 100644 --- a/public/app/plugins/panel/graph/specs/threshold_manager_specs.ts +++ b/public/app/plugins/panel/graph/specs/threshold_manager_specs.ts @@ -1,6 +1,6 @@ /// -import {describe, beforeEach, it, sinon, expect, angularMocks} from '../../../../../test/lib/common'; +import {describe, it, expect} from '../../../../../test/lib/common'; import {ThresholdManager} from '../threshold_manager'; diff --git a/public/app/plugins/panel/graph/specs/tooltip_specs.ts b/public/app/plugins/panel/graph/specs/tooltip_specs.ts index e4436c0f52d..6842f610cce 100644 --- a/public/app/plugins/panel/graph/specs/tooltip_specs.ts +++ b/public/app/plugins/panel/graph/specs/tooltip_specs.ts @@ -1,6 +1,6 @@ /// -import {describe, beforeEach, it, sinon, expect, angularMocks} from '../../../../../test/lib/common'; +import {describe, beforeEach, it, sinon, expect} from '../../../../../test/lib/common'; import $ from 'jquery'; import GraphTooltip from '../graph_tooltip'; diff --git a/public/app/plugins/panel/graph/threshold_manager.ts b/public/app/plugins/panel/graph/threshold_manager.ts index 03e3ae3c737..24e1618eb5c 100644 --- a/public/app/plugins/panel/graph/threshold_manager.ts +++ b/public/app/plugins/panel/graph/threshold_manager.ts @@ -61,8 +61,6 @@ export class ThresholdManager { graphValue = parseInt(graphValue.toFixed(0)); model.value = graphValue; - var valueCanvasPos = plot.p2c({x: 0, y: graphValue}); - handleElem.off("mousemove", dragging); handleElem.off("mouseup", dragging); handleElem.off("mouseleave", dragging); diff --git a/public/app/plugins/panel/graph/thresholds_form.ts b/public/app/plugins/panel/graph/thresholds_form.ts index 1eac74b2539..acf9c4e0030 100644 --- a/public/app/plugins/panel/graph/thresholds_form.ts +++ b/public/app/plugins/panel/graph/thresholds_form.ts @@ -1,7 +1,5 @@ /// - -import _ from 'lodash'; import coreModule from 'app/core/core_module'; export class ThresholdFormCtrl { diff --git a/public/app/plugins/panel/heatmap/color_legend.ts b/public/app/plugins/panel/heatmap/color_legend.ts index 60bbe38d689..ff9ae089bd8 100644 --- a/public/app/plugins/panel/heatmap/color_legend.ts +++ b/public/app/plugins/panel/heatmap/color_legend.ts @@ -1,4 +1,5 @@ /// + import angular from 'angular'; import _ from 'lodash'; import $ from 'jquery'; @@ -143,7 +144,6 @@ function drawLegendValues(elem, colorScale, rangeFrom, rangeTo, maxValue, minVal return; } - let legendValueDomain = _.sortBy(colorScale.domain()); let legendValueScale = d3.scaleLinear() .domain([0, rangeTo]) .range([0, legendWidth]); @@ -156,6 +156,7 @@ function drawLegendValues(elem, colorScale, rangeFrom, rangeTo, maxValue, minVal let colorRect = legendElem.find(":first-child"); let posY = colorRect.height() + 2; let posX = getSvgElemX(colorRect); + d3.select(legendElem.get(0)).append("g") .attr("class", "axis") .attr("transform", "translate(" + posX + "," + posY + ")") diff --git a/public/app/plugins/panel/heatmap/display_editor.ts b/public/app/plugins/panel/heatmap/display_editor.ts index 1cea9505567..775017b00da 100644 --- a/public/app/plugins/panel/heatmap/display_editor.ts +++ b/public/app/plugins/panel/heatmap/display_editor.ts @@ -1,10 +1,4 @@ /// -import _ from 'lodash'; -import $ from 'jquery'; -import d3 from 'd3'; -import {contextSrv} from 'app/core/core'; - -const COLOR_LEGEND_SELECTOR = '.heatmap-color-legend'; export class HeatmapDisplayEditorCtrl { panel: any; diff --git a/public/app/plugins/panel/heatmap/heatmap_data_converter.ts b/public/app/plugins/panel/heatmap/heatmap_data_converter.ts index 993c32c0fca..d179619b12a 100644 --- a/public/app/plugins/panel/heatmap/heatmap_data_converter.ts +++ b/public/app/plugins/panel/heatmap/heatmap_data_converter.ts @@ -1,7 +1,6 @@ /// import _ from 'lodash'; -import TimeSeries from 'app/core/time_series2'; let VALUE_INDEX = 0; let TIME_INDEX = 1; diff --git a/public/app/plugins/panel/heatmap/specs/heatmap_ctrl_specs.ts b/public/app/plugins/panel/heatmap/specs/heatmap_ctrl_specs.ts index 1d82ba01c23..f8ee4285815 100644 --- a/public/app/plugins/panel/heatmap/specs/heatmap_ctrl_specs.ts +++ b/public/app/plugins/panel/heatmap/specs/heatmap_ctrl_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 angular from 'angular'; import moment from 'moment'; import {HeatmapCtrl} from '../heatmap_ctrl'; import helpers from '../../../../../test/specs/helpers'; diff --git a/public/app/plugins/panel/heatmap/specs/heatmap_data_converter_specs.ts b/public/app/plugins/panel/heatmap/specs/heatmap_data_converter_specs.ts index a898a14ff10..e9be85b2784 100644 --- a/public/app/plugins/panel/heatmap/specs/heatmap_data_converter_specs.ts +++ b/public/app/plugins/panel/heatmap/specs/heatmap_data_converter_specs.ts @@ -1,7 +1,7 @@ /// import _ from 'lodash'; -import { describe, beforeEach, it, sinon, expect, angularMocks } from '../../../../../test/lib/common'; +import { describe, beforeEach, it, expect } from '../../../../../test/lib/common'; import TimeSeries from 'app/core/time_series2'; import {convertToHeatMap, convertToCards, elasticHistogramToHeatmap, calculateBucketSize, isHeatmapDataEqual} from '../heatmap_data_converter'; @@ -272,17 +272,14 @@ describe('convertToCards', () => { {x: 1422774000000, y: 2, count: 1, values: [2], yBounds: {}}, {x: 1422774060000, y: 2, count: 2, values: [2, 3], yBounds: {}} ]; - let {cards, cardStats} = convertToCards(buckets); - expect(cards).to.eql(expectedCards); + let res = convertToCards(buckets); + expect(res.cards).to.eql(expectedCards); }); it('should build proper cards stats', () => { - let expectedStats = { - min: 1, - max: 2 - }; - let {cards, cardStats} = convertToCards(buckets); - expect(cardStats).to.eql(expectedStats); + let expectedStats = {min: 1, max: 2}; + let res = convertToCards(buckets); + expect(res.cardStats).to.eql(expectedStats); }); }); diff --git a/public/app/plugins/panel/heatmap/specs/renderer_specs.ts b/public/app/plugins/panel/heatmap/specs/renderer_specs.ts index 01d09a84228..c3d172bbb55 100644 --- a/public/app/plugins/panel/heatmap/specs/renderer_specs.ts +++ b/public/app/plugins/panel/heatmap/specs/renderer_specs.ts @@ -5,7 +5,6 @@ import { describe, beforeEach, it, sinon, expect, angularMocks } from '../../../ import '../module'; import angular from 'angular'; import $ from 'jquery'; -import _ from 'lodash'; import helpers from 'test/specs/helpers'; import TimeSeries from 'app/core/time_series2'; import moment from 'moment'; @@ -131,7 +130,7 @@ describe('grafanaHeatmap', function () { ctrl.data = ctx.data; ctx.element = element; - let render = rendering(scope, $(element), [], ctrl); + rendering(scope, $(element), [], ctrl); ctrl.events.emit('render'); })); }; diff --git a/public/app/plugins/panel/pluginlist/module.ts b/public/app/plugins/panel/pluginlist/module.ts index 2695a0af5c0..6c67a66302b 100644 --- a/public/app/plugins/panel/pluginlist/module.ts +++ b/public/app/plugins/panel/pluginlist/module.ts @@ -1,7 +1,6 @@ /// import _ from 'lodash'; -import config from 'app/core/config'; import {PanelCtrl} from '../../../features/panel/panel_ctrl'; class PluginListCtrl extends PanelCtrl { diff --git a/public/app/plugins/panel/singlestat/module.ts b/public/app/plugins/panel/singlestat/module.ts index 0ea3e02e5aa..3e9515378e5 100644 --- a/public/app/plugins/panel/singlestat/module.ts +++ b/public/app/plugins/panel/singlestat/module.ts @@ -1,11 +1,9 @@ /// -import angular from 'angular'; import _ from 'lodash'; import $ from 'jquery'; import 'jquery.flot'; import 'jquery.flot.gauge'; -import moment from 'moment'; import kbn from 'app/core/utils/kbn'; import config from 'app/core/config'; @@ -182,8 +180,6 @@ class SingleStatCtrl extends MetricsPanelCtrl { return; } - let highestValue = 0; - let lowestValue = Number.MAX_VALUE; const datapoint = tableData[0][0]; data.value = datapoint[this.panel.tableColumn]; @@ -638,8 +634,7 @@ class SingleStatCtrl extends MetricsPanelCtrl { if ($(evt).parents('.panel-header').length > 0) { return; } if (linkInfo.target === '_blank') { - var redirectWindow = window.open(linkInfo.href, '_blank'); - redirectWindow.location; + window.open(linkInfo.href, '_blank'); return; } diff --git a/public/app/plugins/panel/singlestat/specs/singlestat_panel_spec.ts b/public/app/plugins/panel/singlestat/specs/singlestat_panel_spec.ts index 87922a3523b..0799f006f8b 100644 --- a/public/app/plugins/panel/singlestat/specs/singlestat_panel_spec.ts +++ b/public/app/plugins/panel/singlestat/specs/singlestat_panel_spec.ts @@ -1,4 +1,4 @@ -import {describe, beforeEach, it, sinon, expect} from 'test/lib/common'; +import {describe, it, expect} from 'test/lib/common'; import {getColorForValue} from '../module'; diff --git a/public/app/plugins/panel/singlestat/specs/singlestat_specs.ts b/public/app/plugins/panel/singlestat/specs/singlestat_specs.ts index 6098769e940..84f8d961c8e 100644 --- a/public/app/plugins/panel/singlestat/specs/singlestat_specs.ts +++ b/public/app/plugins/panel/singlestat/specs/singlestat_specs.ts @@ -2,7 +2,6 @@ import {describe, beforeEach, afterEach, it, sinon, expect, angularMocks} from '../../../../../test/lib/common'; -import angular from 'angular'; import helpers from '../../../../../test/specs/helpers'; import {SingleStatCtrl} from '../module'; import moment from 'moment'; diff --git a/public/app/plugins/panel/table/column_options.ts b/public/app/plugins/panel/table/column_options.ts index 5109f87f86d..2191de2bb8d 100644 --- a/public/app/plugins/panel/table/column_options.ts +++ b/public/app/plugins/panel/table/column_options.ts @@ -2,10 +2,6 @@ import _ from 'lodash'; -import $ from 'jquery'; -import moment from 'moment'; -import angular from 'angular'; - import kbn from 'app/core/utils/kbn'; export class ColumnOptionsCtrl { @@ -22,8 +18,9 @@ export class ColumnOptionsCtrl { activeStyleIndex: number; /** @ngInject */ - constructor($scope, private $q, private uiSegmentSrv) { + constructor($scope) { $scope.editor = this; + this.activeStyleIndex = 0; this.panelCtrl = $scope.ctrl; this.panel = this.panelCtrl.panel; diff --git a/public/app/plugins/panel/table/editor.ts b/public/app/plugins/panel/table/editor.ts index a4fd72ed6f2..756d3bf9687 100644 --- a/public/app/plugins/panel/table/editor.ts +++ b/public/app/plugins/panel/table/editor.ts @@ -2,12 +2,7 @@ import _ from 'lodash'; -import $ from 'jquery'; -import moment from 'moment'; -import angular from 'angular'; - import {transformers} from './transformers'; -import kbn from 'app/core/utils/kbn'; export class TablePanelEditorCtrl { panel: any; diff --git a/public/app/plugins/panel/table/module.ts b/public/app/plugins/panel/table/module.ts index 13852b359a7..413eff05b88 100644 --- a/public/app/plugins/panel/table/module.ts +++ b/public/app/plugins/panel/table/module.ts @@ -1,16 +1,12 @@ /// -import angular from 'angular'; import _ from 'lodash'; import $ from 'jquery'; -import moment from 'moment'; -import * as FileExport from 'app/core/utils/file_export'; import {MetricsPanelCtrl} from 'app/plugins/sdk'; import {transformDataToTable} from './transformers'; import {tablePanelEditor} from './editor'; import {columnOptionsTab} from './column_options'; import {TableRenderer} from './renderer'; -import Drop from 'tether-drop'; class TablePanelCtrl extends MetricsPanelCtrl { static templateUrl = 'module.html'; @@ -160,11 +156,10 @@ class TablePanelCtrl extends MetricsPanelCtrl { }); } - link(scope, elem, attrs, ctrl) { + link(scope, elem, attrs, ctrl: TablePanelCtrl) { var data; var panel = ctrl.panel; var pageCount = 0; - var formaters = []; function getTableHeight() { var panelHeight = ctrl.height; diff --git a/public/app/plugins/panel/table/specs/renderer_specs.ts b/public/app/plugins/panel/table/specs/renderer_specs.ts index 71a5a776803..0726755dfe0 100644 --- a/public/app/plugins/panel/table/specs/renderer_specs.ts +++ b/public/app/plugins/panel/table/specs/renderer_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 _ from 'lodash'; import TableModel from 'app/core/table_model'; diff --git a/public/app/plugins/panel/table/specs/transformers_specs.ts b/public/app/plugins/panel/table/specs/transformers_specs.ts index ee34100e30a..38b8355fa9e 100644 --- a/public/app/plugins/panel/table/specs/transformers_specs.ts +++ b/public/app/plugins/panel/table/specs/transformers_specs.ts @@ -1,4 +1,4 @@ -import {describe, beforeEach, it, sinon, expect} from 'test/lib/common'; +import {describe, beforeEach, it, expect} from 'test/lib/common'; import {transformers, transformDataToTable} from '../transformers'; diff --git a/public/app/plugins/panel/table/transformers.ts b/public/app/plugins/panel/table/transformers.ts index cb6d30e627d..232ae07b4db 100644 --- a/public/app/plugins/panel/table/transformers.ts +++ b/public/app/plugins/panel/table/transformers.ts @@ -1,11 +1,9 @@ /// import _ from 'lodash'; -import moment from 'moment'; import flatten from '../../../core/utils/flatten'; import TimeSeries from '../../../core/time_series2'; import TableModel from '../../../core/table_model'; -import angular from "angular"; var transformers = {}; diff --git a/public/test/core/table_model_specs.ts b/public/test/core/table_model_specs.ts index 2531d34eb76..20a90498d50 100644 --- a/public/test/core/table_model_specs.ts +++ b/public/test/core/table_model_specs.ts @@ -1,4 +1,4 @@ -import {describe, beforeEach, it, sinon, expect} from 'test/lib/common'; +import {describe, beforeEach, it, expect} from 'test/lib/common'; import TableModel from 'app/core/table_model'; diff --git a/public/test/core/utils/emitter_specs.ts b/public/test/core/utils/emitter_specs.ts index e0d24a63b6b..1cdf55842c0 100644 --- a/public/test/core/utils/emitter_specs.ts +++ b/public/test/core/utils/emitter_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 {Emitter} from 'app/core/core'; diff --git a/public/test/core/utils/flatten_specs.ts b/public/test/core/utils/flatten_specs.ts index fd2440c41fb..5dc6c1535af 100644 --- a/public/test/core/utils/flatten_specs.ts +++ b/public/test/core/utils/flatten_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 flatten from 'app/core/utils/flatten'; diff --git a/public/test/core/utils/rangeutil_specs.ts b/public/test/core/utils/rangeutil_specs.ts index 93994f65850..f2ce34f0edd 100644 --- a/public/test/core/utils/rangeutil_specs.ts +++ b/public/test/core/utils/rangeutil_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 * as rangeUtil from 'app/core/utils/rangeutil'; import _ from 'lodash'; diff --git a/public/test/specs/app_specs.ts b/public/test/specs/app_specs.ts index 3c57f2d625a..f82946c20a2 100644 --- a/public/test/specs/app_specs.ts +++ b/public/test/specs/app_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 {GrafanaApp} from 'app/app'; diff --git a/tsconfig.json b/tsconfig.json index f6bc060746a..42aaf88f46a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,7 +15,6 @@ "noImplicitReturns":false, "noImplicitThis": false, "noImplicitUseStrict":false, - "noUnusedLocals":false, "moduleResolution": "classic" }, "include": [ diff --git a/tslint.json b/tslint.json index 30a9e7bbf3c..89963472a28 100644 --- a/tslint.json +++ b/tslint.json @@ -1,5 +1,8 @@ { "rules": { + "no-unused-expression": true, + "no-duplicate-variable": true, + "no-unused-variable": true, "class-name": true, "comment-format": [false, "check-space"], "curly": true, @@ -28,7 +31,6 @@ "no-string-literal": false, "no-switch-case-fall-through": false, "no-trailing-whitespace": true, - "no-unused-expression": false, "no-use-before-declare": true, "no-var-keyword": false, "object-literal-sort-keys": false,