diff --git a/public/app/core/components/PasswordStrength.tsx b/public/app/core/components/PasswordStrength.tsx index c376042ce75..52e8a44165d 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 '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/helpers.ts b/public/app/core/components/json_explorer/helpers.ts index 2f2b80e73ea..7c4429d7c76 100644 --- a/public/app/core/components/json_explorer/helpers.ts +++ b/public/app/core/components/json_explorer/helpers.ts @@ -60,7 +60,7 @@ export function getValuePreview (object: Object, value: string): string { if (type === 'string') { value = '"' + escapeString(value) + '"'; } - if (type === 'function'){ + if (type === 'function') { // Remove content of the function return object.toString() diff --git a/public/app/core/components/json_explorer/json_explorer.ts b/public/app/core/components/json_explorer/json_explorer.ts index c2810f23b54..a7079477abc 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'; @@ -191,7 +190,7 @@ export class JsonExplorer { if (this.element) { if (this.isOpen) { this.appendChildren(this.config.animateOpen); - } else{ + } else { this.removeChildren(this.config.animateClose); } this.element.classList.toggle(cssClass('open')); 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..9bbcd8ab3dc 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 { @@ -40,7 +38,7 @@ export class DashboardExporter { var templateizeDatasourceUsage = obj => { // ignore data source properties that contain a variable if (obj.datasource && obj.datasource.indexOf('$') === 0) { - if (variableLookup[obj.datasource.substring(1)]){ + if (variableLookup[obj.datasource.substring(1)]) { return; } } 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..4be19d23595 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); } @@ -65,7 +64,7 @@ export class QueryVariable implements Variable { return this.model; } - setValue(option){ + setValue(option) { return this.variableSrv.setOptionAsCurrent(this, option); } 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..62b7d5b8fca 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; @@ -82,7 +82,7 @@ export class VariableSrv { createVariableFromModel(model) { var ctor = variableTypes[model.type].ctor; if (!ctor) { - throw "Unable to find variable constructor for " + model.type; + throw {message: "Unable to find variable constructor for " + model.type}; } var variable = this.$injector.instantiate(ctor, {model: model}); diff --git a/public/app/headers/es6-shim/es6-shim.d.ts b/public/app/headers/es6-shim/es6-shim.d.ts deleted file mode 100644 index 265c19e08f9..00000000000 --- a/public/app/headers/es6-shim/es6-shim.d.ts +++ /dev/null @@ -1,670 +0,0 @@ -// Generated by typings -// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/es6-shim/es6-shim.d.ts -// Type definitions for es6-shim v0.31.2 -// Project: https://github.com/paulmillr/es6-shim -// Definitions by: Ron Buckton -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare type PropertyKey = string | number | symbol; - -interface IteratorResult { - done: boolean; - value?: T; -} - -interface IterableShim { - /** - * Shim for an ES6 iterable. Not intended for direct use by user code. - */ - "_es6-shim iterator_"(): Iterator; -} - -interface Iterator { - next(value?: any): IteratorResult; - return?(value?: any): IteratorResult; - throw?(e?: any): IteratorResult; -} - -interface IterableIteratorShim extends IterableShim, Iterator { - /** - * Shim for an ES6 iterable iterator. Not intended for direct use by user code. - */ - "_es6-shim iterator_"(): IterableIteratorShim; -} - -interface StringConstructor { - /** - * Return the String value whose elements are, in order, the elements in the List elements. - * If length is 0, the empty string is returned. - */ - fromCodePoint(...codePoints: number[]): string; - - /** - * String.raw is intended for use as a tag function of a Tagged Template String. When called - * as such the first argument will be a well formed template call site object and the rest - * parameter will contain the substitution values. - * @param template A well-formed template string call site representation. - * @param substitutions A set of substitution values. - */ - raw(template: TemplateStringsArray, ...substitutions: any[]): string; -} - -interface String { - /** - * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point - * value of the UTF-16 encoded code point starting at the string element at position pos in - * the String resulting from converting this object to a String. - * If there is no element at that position, the result is undefined. - * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. - */ - codePointAt(pos: number): number; - - /** - * Returns true if searchString appears as a substring of the result of converting this - * object to a String, at one or more positions that are - * greater than or equal to position; otherwise, returns false. - * @param searchString search string - * @param position If position is undefined, 0 is assumed, so as to search all of the String. - */ - includes(searchString: string, position?: number): boolean; - - /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * endPosition – length(this). Otherwise returns false. - */ - endsWith(searchString: string, endPosition?: number): boolean; - - /** - * Returns a String value that is made from count copies appended together. If count is 0, - * T is the empty String is returned. - * @param count number of copies to append - */ - repeat(count: number): string; - - /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * position. Otherwise returns false. - */ - startsWith(searchString: string, position?: number): boolean; - - /** - * Returns an HTML anchor element and sets the name attribute to the text value - * @param name - */ - anchor(name: string): string; - - /** Returns a HTML element */ - big(): string; - - /** Returns a HTML element */ - blink(): string; - - /** Returns a HTML element */ - bold(): string; - - /** Returns a HTML element */ - fixed(): string - - /** Returns a HTML element and sets the color attribute value */ - fontcolor(color: string): string - - /** Returns a HTML element and sets the size attribute value */ - fontsize(size: number): string; - - /** Returns a HTML element and sets the size attribute value */ - fontsize(size: string): string; - - /** Returns an HTML element */ - italics(): string; - - /** Returns an HTML element and sets the href attribute value */ - link(url: string): string; - - /** Returns a HTML element */ - small(): string; - - /** Returns a HTML element */ - strike(): string; - - /** Returns a HTML element */ - sub(): string; - - /** Returns a HTML element */ - sup(): string; - - /** - * Shim for an ES6 iterable. Not intended for direct use by user code. - */ - "_es6-shim iterator_"(): IterableIteratorShim; -} - -interface ArrayConstructor { - /** - * Creates an array from an array-like object. - * @param arrayLike An array-like object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - - /** - * Creates an array from an iterable object. - * @param iterable An iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(iterable: IterableShim, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - - /** - * Creates an array from an array-like object. - * @param arrayLike An array-like object to convert to an array. - */ - from(arrayLike: ArrayLike): Array; - - /** - * Creates an array from an iterable object. - * @param iterable An iterable object to convert to an array. - */ - from(iterable: IterableShim): Array; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: T[]): Array; -} - -interface Array { - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; - - /** - * Returns the index of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: T) => boolean, thisArg?: any): number; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: T, start?: number, end?: number): T[]; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): T[]; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIteratorShim<[number, T]>; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIteratorShim; - - /** - * Returns an list of values in the array - */ - values(): IterableIteratorShim; - - /** - * Shim for an ES6 iterable. Not intended for direct use by user code. - */ - "_es6-shim iterator_"(): IterableIteratorShim; -} - -interface NumberConstructor { - /** - * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 - * that is representable as a Number value, which is approximately: - * 2.2204460492503130808472633361816 x 10‍−‍16. - */ - EPSILON: number; - - /** - * Returns true if passed value is finite. - * Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a - * number. Only finite values of the type number, result in true. - * @param number A numeric value. - */ - isFinite(number: number): boolean; - - /** - * Returns true if the value passed is an integer, false otherwise. - * @param number A numeric value. - */ - isInteger(number: number): boolean; - - /** - * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a - * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter - * to a number. Only values of the type number, that are also NaN, result in true. - * @param number A numeric value. - */ - isNaN(number: number): boolean; - - /** - * Returns true if the value passed is a safe integer. - * @param number A numeric value. - */ - isSafeInteger(number: number): boolean; - - /** - * The value of the largest integer n such that n and n + 1 are both exactly representable as - * a Number value. - * The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1. - */ - MAX_SAFE_INTEGER: number; - - /** - * The value of the smallest integer n such that n and n − 1 are both exactly representable as - * a Number value. - * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)). - */ - MIN_SAFE_INTEGER: number; - - /** - * Converts a string to a floating-point number. - * @param string A string that contains a floating-point number. - */ - parseFloat(string: string): number; - - /** - * Converts A string to an integer. - * @param s A string to convert into a number. - * @param radix A value between 2 and 36 that specifies the base of the number in numString. - * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. - * All other strings are considered decimal. - */ - parseInt(string: string, radix?: number): number; -} - -interface ObjectConstructor { - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param sources One or more source objects to copy properties from. - */ - assign(target: any, ...sources: any[]): any; - - /** - * Returns true if the values are the same value, false otherwise. - * @param value1 The first value. - * @param value2 The second value. - */ - is(value1: any, value2: any): boolean; - - /** - * Sets the prototype of a specified object o to object proto or null. Returns the object o. - * @param o The object to change its prototype. - * @param proto The value of the new prototype or null. - * @remarks Requires `__proto__` support. - */ - setPrototypeOf(o: any, proto: any): any; -} - -interface RegExp { - /** - * Returns a string indicating the flags of the regular expression in question. This field is read-only. - * The characters in this string are sequenced and concatenated in the following order: - * - * - "g" for global - * - "i" for ignoreCase - * - "m" for multiline - * - "u" for unicode - * - "y" for sticky - * - * If no flags are set, the value is the empty string. - */ - flags: string; -} - -interface Math { - /** - * Returns the number of leading zero bits in the 32-bit binary representation of a number. - * @param x A numeric expression. - */ - clz32(x: number): number; - - /** - * Returns the result of 32-bit multiplication of two numbers. - * @param x First number - * @param y Second number - */ - imul(x: number, y: number): number; - - /** - * Returns the sign of the x, indicating whether x is positive, negative or zero. - * @param x The numeric expression to test - */ - sign(x: number): number; - - /** - * Returns the base 10 logarithm of a number. - * @param x A numeric expression. - */ - log10(x: number): number; - - /** - * Returns the base 2 logarithm of a number. - * @param x A numeric expression. - */ - log2(x: number): number; - - /** - * Returns the natural logarithm of 1 + x. - * @param x A numeric expression. - */ - log1p(x: number): number; - - /** - * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of - * the natural logarithms). - * @param x A numeric expression. - */ - expm1(x: number): number; - - /** - * Returns the hyperbolic cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - cosh(x: number): number; - - /** - * Returns the hyperbolic sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - sinh(x: number): number; - - /** - * Returns the hyperbolic tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - tanh(x: number): number; - - /** - * Returns the inverse hyperbolic cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - acosh(x: number): number; - - /** - * Returns the inverse hyperbolic sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - asinh(x: number): number; - - /** - * Returns the inverse hyperbolic tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - atanh(x: number): number; - - /** - * Returns the square root of the sum of squares of its arguments. - * @param values Values to compute the square root for. - * If no arguments are passed, the result is +0. - * If there is only one argument, the result is the absolute value. - * If any argument is +Infinity or -Infinity, the result is +Infinity. - * If any argument is NaN, the result is NaN. - * If all arguments are either +0 or −0, the result is +0. - */ - hypot(...values: number[]): number; - - /** - * Returns the integral part of the a numeric expression, x, removing any fractional digits. - * If x is already an integer, the result is x. - * @param x A numeric expression. - */ - trunc(x: number): number; - - /** - * Returns the nearest single precision float representation of a number. - * @param x A numeric expression. - */ - fround(x: number): number; - - /** - * Returns an implementation-dependent approximation to the cube root of number. - * @param x A numeric expression. - */ - cbrt(x: number): number; -} - -interface PromiseLike { - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): PromiseLike; -} - -/** - * Represents the completion of an asynchronous operation - */ -interface Promise { - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): Promise; - - /** - * Attaches a callback for only the rejection of the Promise. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of the callback. - */ - catch(onrejected?: (reason: any) => T | PromiseLike): Promise; - catch(onrejected?: (reason: any) => void): Promise; -} - -interface PromiseConstructor { - /** - * A reference to the prototype. - */ - prototype: Promise; - - /** - * Creates a new Promise. - * @param executor A callback used to initialize the promise. This callback is passed two arguments: - * a resolve callback used resolve the promise with a value or the result of another promise, - * and a reject callback used to reject the promise with a provided reason or error. - */ - new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: IterableShim>): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: IterableShim>): Promise; - - /** - * Creates a new rejected promise for the provided reason. - * @param reason The reason the promise was rejected. - * @returns A new rejected Promise. - */ - reject(reason: any): Promise; - - /** - * Creates a new rejected promise for the provided reason. - * @param reason The reason the promise was rejected. - * @returns A new rejected Promise. - */ - reject(reason: any): Promise; - - /** - * Creates a new resolved promise for the provided value. - * @param value A promise. - * @returns A promise whose internal state matches the provided promise. - */ - resolve(value: T | PromiseLike): Promise; - - /** - * Creates a new resolved promise . - * @returns A resolved promise. - */ - resolve(): Promise; -} - -declare var Promise: PromiseConstructor; - -interface Map { - clear(): void; - delete(key: K): boolean; - forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; - get(key: K): V; - has(key: K): boolean; - set(key: K, value?: V): Map; - size: number; - entries(): IterableIteratorShim<[K, V]>; - keys(): IterableIteratorShim; - values(): IterableIteratorShim; -} - -interface MapConstructor { - new (): Map; - new (iterable: IterableShim<[K, V]>): Map; - prototype: Map; -} - -declare var Map: MapConstructor; - -interface Set { - add(value: T): Set; - clear(): void; - delete(value: T): boolean; - forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; - has(value: T): boolean; - size: number; - entries(): IterableIteratorShim<[T, T]>; - keys(): IterableIteratorShim; - values(): IterableIteratorShim; -} - -interface SetConstructor { - new (): Set; - new (iterable: IterableShim): Set; - prototype: Set; -} - -declare var Set: SetConstructor; - -interface WeakMap { - delete(key: K): boolean; - get(key: K): V; - has(key: K): boolean; - set(key: K, value?: V): WeakMap; -} - -interface WeakMapConstructor { - new (): WeakMap; - new (iterable: IterableShim<[K, V]>): WeakMap; - prototype: WeakMap; -} - -declare var WeakMap: WeakMapConstructor; - -interface WeakSet { - add(value: T): WeakSet; - delete(value: T): boolean; - has(value: T): boolean; -} - -interface WeakSetConstructor { - new (): WeakSet; - new (iterable: IterableShim): WeakSet; - prototype: WeakSet; -} - -declare var WeakSet: WeakSetConstructor; - -declare namespace Reflect { - function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; - function construct(target: Function, argumentsList: ArrayLike): any; - function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; - function deleteProperty(target: any, propertyKey: PropertyKey): boolean; - function enumerate(target: any): IterableIteratorShim; - function get(target: any, propertyKey: PropertyKey, receiver?: any): any; - function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; - function getPrototypeOf(target: any): any; - function has(target: any, propertyKey: PropertyKey): boolean; - function isExtensible(target: any): boolean; - function ownKeys(target: any): Array; - function preventExtensions(target: any): boolean; - function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; - function setPrototypeOf(target: any, proto: any): boolean; -} - -declare module "es6-shim" { - var String: StringConstructor; - var Array: ArrayConstructor; - var Number: NumberConstructor; - var Math: Math; - var Object: ObjectConstructor; - var Map: MapConstructor; - var Set: SetConstructor; - var WeakMap: WeakMapConstructor; - var WeakSet: WeakSetConstructor; - var Promise: PromiseConstructor; - namespace Reflect { - function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; - function construct(target: Function, argumentsList: ArrayLike): any; - function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; - function deleteProperty(target: any, propertyKey: PropertyKey): boolean; - function enumerate(target: any): Iterator; - function get(target: any, propertyKey: PropertyKey, receiver?: any): any; - function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; - function getPrototypeOf(target: any): any; - function has(target: any, propertyKey: PropertyKey): boolean; - function isExtensible(target: any): boolean; - function ownKeys(target: any): Array; - function preventExtensions(target: any): boolean; - function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; - function setPrototypeOf(target: any, proto: any): boolean; - } -} diff --git a/public/app/headers/mocha/mocha.d.ts b/public/app/headers/mocha/mocha.d.ts deleted file mode 100644 index 3f5d3e57104..00000000000 --- a/public/app/headers/mocha/mocha.d.ts +++ /dev/null @@ -1,147 +0,0 @@ -// Type definitions for mocha 2.0.1 -// Project: http://mochajs.org/ -// Definitions by: Kazi Manzur Rashid , otiai10 , jt000 -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -interface Mocha { - // Setup mocha with the given setting options. - setup(options: MochaSetupOptions): Mocha; - - //Run tests and invoke `fn()` when complete. - run(callback?: () => void): void; - - // Set reporter as function - reporter(reporter: () => void): Mocha; - - // Set reporter, defaults to "dot" - reporter(reporter: string): Mocha; - - // Enable growl support. - growl(): Mocha -} - -interface MochaSetupOptions { - //milliseconds to wait before considering a test slow - slow?: number; - - // timeout in milliseconds - timeout?: number; - - // ui name "bdd", "tdd", "exports" etc - ui?: string; - - //array of accepted globals - globals?: any[]; - - // reporter instance (function or string), defaults to `mocha.reporters.Dot` - reporter?: any; - - // bail on the first test failure - bail?: boolean; - - // ignore global leaks - ignoreLeaks?: boolean; - - // grep string or regexp to filter tests with - grep?: any; -} - -interface MochaDone { - (error?: Error): void; -} - -declare var mocha: Mocha; - -declare var describe : { - (description: string, spec: () => void): void; - only(description: string, spec: () => void): void; - skip(description: string, spec: () => void): void; - timeout(ms: number): void; -} - -// alias for `describe` -declare var context : { - (contextTitle: string, spec: () => void): void; - only(contextTitle: string, spec: () => void): void; - skip(contextTitle: string, spec: () => void): void; - timeout(ms: number): void; -} - -declare var it: { - (expectation: string, assertion?: () => void): void; - (expectation: string, assertion?: (done: MochaDone) => void): void; - only(expectation: string, assertion?: () => void): void; - only(expectation: string, assertion?: (done: MochaDone) => void): void; - skip(expectation: string, assertion?: () => void): void; - skip(expectation: string, assertion?: (done: MochaDone) => void): void; - timeout(ms: number): void; -}; - -declare function before(action: () => void): void; - -declare function before(action: (done: MochaDone) => void): void; - -declare function setup(action: () => void): void; - -declare function setup(action: (done: MochaDone) => void): void; - -declare function after(action: () => void): void; - -declare function after(action: (done: MochaDone) => void): void; - -declare function teardown(action: () => void): void; - -declare function teardown(action: (done: MochaDone) => void): void; - -declare function beforeEach(action: () => void): void; - -declare function beforeEach(action: (done: MochaDone) => void): void; - -declare function suiteSetup(action: () => void): void; - -declare function suiteSetup(action: (done: MochaDone) => void): void; - -declare function afterEach(action: () => void): void; - -declare function afterEach(action: (done: MochaDone) => void): void; - -declare function suiteTeardown(action: () => void): void; - -declare function suiteTeardown(action: (done: MochaDone) => void): void; - -declare module "mocha" { - - class Mocha { - constructor(options?: { - grep?: RegExp; - ui?: string; - reporter?: string; - timeout?: number; - bail?: boolean; - }); - - bail(value?: boolean): Mocha; - addFile(file: string): Mocha; - reporter(value: string): Mocha; - ui(value: string): Mocha; - grep(value: string): Mocha; - grep(value: RegExp): Mocha; - invert(): Mocha; - ignoreLeaks(value: boolean): Mocha; - checkLeaks(): Mocha; - growl(): Mocha; - globals(value: string): Mocha; - globals(values: string[]): Mocha; - useColors(value: boolean): Mocha; - useInlineDiffs(value: boolean): Mocha; - timeout(value: number): Mocha; - slow(value: number): Mocha; - enableTimeouts(value: boolean): Mocha; - asyncOnly(value: boolean): Mocha; - noHighlighting(value: boolean): Mocha; - - run(onComplete?: (failures: number) => void): void; - } - - export = Mocha; -} diff --git a/public/app/headers/zone/zone.d.ts b/public/app/headers/zone/zone.d.ts deleted file mode 100644 index 7549079a40c..00000000000 --- a/public/app/headers/zone/zone.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -declare module Zone { - export class Stacktrace { - constructor(e: Error); - get(): string; - } -} - - -declare class Zone { - constructor(parentZone: Zone, data: any); - fork(locals: any): Zone; - bind(fn, skipEnqueue): void; - bindOnce(fn): any; - run(fn, applyTo?, applyWith?): void; - beforeTask(): void; - onZoneCreated(): void; - afterTask(): void; - enqueueTask(): void; - dequeueTask(): void; - - static patchSetClearFn(obj, fnNames): string; - static patchPrototype(obj, fnNames): any; - static bindArguments(args: any[]): any; - static bindArgumentsOnce(args: any[]): any; - static patchableFn(obj, fnNames): any - static patchProperty(obj, prop): void; - static patchProperties(obj, properties): void; - static patchEventTargetMethods(obj): void; - static patch(): void; - static canPatchViaPropertyDescriptor(): boolean; - static patchViaPropertyDescriptor(): void; - static patchViaCapturingAllTheEvents(): void; - static patchWebSocket(): void; - static patchClass(className: string): void; - static patchMutationObserverClass(className: string): void; - static patchDefineProperty(): void; - static patchRegisterElement(): void; - static eventNames: string; - static onEventNames: string; - static init(): void; - static exceptZone: { - boringZone: Zone; - interestingZone: Zone, - beforeTask: () => void; - afterTask: () => void; - fork: (ops: any) => Zone; - }; - static longStackTraceZone: { - getLongStacktrace(exception: any): string; - stackFramesFilter(line: string): boolean; - onError(exception): void; - fork(locals): Zone; - }; - static getStacktrace(): Zone.Stacktrace; - static countingZone: { - '+enqueueTask': () => void; - '-dequeueTask': () => void; - '+afterTask': () => void; - counter: () => void; - data: { - count: number; - flushed: boolean; - }; - onFlush: () => void; - }; -} 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/response_parser.ts b/public/app/plugins/datasource/mysql/response_parser.ts index 1b89cc78599..5501e4fc17a 100644 --- a/public/app/plugins/datasource/mysql/response_parser.ts +++ b/public/app/plugins/datasource/mysql/response_parser.ts @@ -3,7 +3,7 @@ import _ from 'lodash'; export default class ResponseParser { - constructor(private $q){} + constructor(private $q) {} processQueryResult(res) { var data = []; @@ -47,7 +47,7 @@ export default class ResponseParser { const textColIndex = this.findColIndex(columns, '__text'); const valueColIndex = this.findColIndex(columns, '__value'); - if (columns.length === 2 && textColIndex !== -1 && valueColIndex !== -1){ + if (columns.length === 2 && textColIndex !== -1 && valueColIndex !== -1) { return this.transformToKeyValueList(rows, textColIndex, valueColIndex); } 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..b9238c1cb3e 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'; @@ -158,7 +156,7 @@ export class DataProcessor { }); fieldParts.pop(); } - if (firstItem.type === 'docs'){ + if (firstItem.type === 'docs') { if (firstItem.datapoints.length === 0) { return []; } 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..a7eaa37441b 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'; @@ -115,7 +113,7 @@ class SingleStatCtrl extends MetricsPanelCtrl { onDataReceived(dataList) { const data: any = {}; - if (dataList.length > 0 && dataList[0].type === 'table'){ + if (dataList.length > 0 && dataList[0].type === 'table') { this.dataType = 'table'; const tableData = dataList.map(this.tableHandler.bind(this)); this.setTableValues(tableData, data); @@ -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..39559fdc32d 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'; @@ -47,7 +47,7 @@ describe("Emitter", () => { events.on('test', () => { sub1Called++; - throw "hello"; + throw {message: "hello"}; }); events.on('test', () => { 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..d0dfe33cce3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,13 +9,12 @@ "rootDir": "public/", "module": "system", "jsx": "react", - "noEmitOnError": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "noImplicitReturns":false, + "noEmitOnError": false, + "emitDecoratorMetadata": false, + "experimentalDecorators": false, + "noImplicitReturns": false, "noImplicitThis": false, "noImplicitUseStrict":false, - "noUnusedLocals":false, "moduleResolution": "classic" }, "include": [ diff --git a/tslint.json b/tslint.json index 30a9e7bbf3c..1f74b95bfdd 100644 --- a/tslint.json +++ b/tslint.json @@ -1,11 +1,17 @@ { "rules": { - "class-name": true, - "comment-format": [false, "check-space"], + "no-string-throw": true, + "no-unused-expression": true, + "no-duplicate-variable": true, + "no-unused-variable": true, "curly": true, + "class-name": true, + "semicolon": ["always"], + "triple-equals": [true, "allow-null-check"], + "comment-format": [false, "check-space"], "eofline": true, "forin": false, - "indent": [true, "spaces"], + "indent": [true, "spaces", 2], "label-position": true, "max-line-length": [true, 140], "member-access": false, @@ -28,7 +34,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, @@ -38,8 +43,6 @@ "check-else" ], "radix": false, - "semicolon": true, - "triple-equals": [true, "allow-null-check"], "typedef-whitespace": [true, { "call-signature": "nospace", "index-signature": "nospace", @@ -51,7 +54,8 @@ "whitespace": [true, "check-branch", "check-decl", - "check-type" + "check-type", + "check-preblock" ] } }