mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
added jsdoc-format rule and fixed files that didn't follow new rule (#13107)
This commit is contained in:
parent
944c1da27b
commit
abbb6f933c
@ -36,7 +36,7 @@ export class FormDropdownCtrl {
|
||||
startOpen: any;
|
||||
debounce: number;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor(private $scope, $element, private $sce, private templateSrv, private $q) {
|
||||
this.inputElement = $element.find('input').first();
|
||||
this.linkElement = $element.find('a').first();
|
||||
|
@ -15,7 +15,7 @@ const template = `
|
||||
export class LayoutSelectorCtrl {
|
||||
mode: string;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor(private $rootScope) {
|
||||
this.mode = store.get('grafana.list.layout.mode') || 'grid';
|
||||
}
|
||||
@ -33,7 +33,7 @@ export class LayoutSelectorCtrl {
|
||||
}
|
||||
}
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
export function layoutSelector() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
@ -45,7 +45,7 @@ export function layoutSelector() {
|
||||
};
|
||||
}
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
export function layoutMode($rootScope) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
|
@ -18,7 +18,7 @@ function getBlockNodes(nodes) {
|
||||
return blockNodes || nodes;
|
||||
}
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
function rebuildOnChange($animate) {
|
||||
return {
|
||||
multiElement: true,
|
||||
|
@ -2,7 +2,7 @@ import _ from 'lodash';
|
||||
import coreModule from 'app/core/core_module';
|
||||
import Drop from 'tether-drop';
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
function popoverSrv(this: any, $compile, $rootScope, $timeout) {
|
||||
let openDrop = null;
|
||||
|
||||
|
@ -8,7 +8,7 @@ import coreModule from 'app/core/core_module';
|
||||
class AdminSettingsCtrl {
|
||||
navModel: any;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor($scope, backendSrv, navModelSrv) {
|
||||
this.navModel = navModelSrv.getNav('cfg', 'admin', 'server-settings', 1);
|
||||
|
||||
@ -21,7 +21,7 @@ class AdminSettingsCtrl {
|
||||
class AdminHomeCtrl {
|
||||
navModel: any;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor(navModelSrv) {
|
||||
this.navModel = navModelSrv.getNav('cfg', 'admin', 1);
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ import $ from 'jquery';
|
||||
import coreModule from 'app/core/core_module';
|
||||
import alertDef from '../alerting/alert_def';
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
export function annotationTooltipDirective($sanitize, dashboardSrv, contextSrv, $compile) {
|
||||
function sanitizeString(str) {
|
||||
try {
|
||||
|
@ -12,7 +12,7 @@ export class EventEditorCtrl {
|
||||
close: any;
|
||||
timeFormated: string;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor(private annotationsSrv) {
|
||||
this.event.panelId = this.panelCtrl.panel.id;
|
||||
this.event.dashboardId = this.panelCtrl.dashboard.id;
|
||||
|
@ -8,7 +8,7 @@ export class CreateFolderCtrl {
|
||||
hasValidationError: boolean;
|
||||
validationError: any;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor(private backendSrv, private $location, private validationSrv, navModelSrv) {
|
||||
this.navModel = navModelSrv.getNav('dashboards', 'manage-dashboards', 0);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ const template = `
|
||||
</div>
|
||||
`;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
function dashRepeatOptionDirective(variableSrv) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
|
@ -2,7 +2,7 @@ import angular from 'angular';
|
||||
import _ from 'lodash';
|
||||
|
||||
export class ShareSnapshotCtrl {
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor($scope, $rootScope, $location, backendSrv, $timeout, timeSrv) {
|
||||
$scope.snapshot = {
|
||||
name: $scope.dashboard.title,
|
||||
|
@ -13,7 +13,7 @@ export class TimeSrv {
|
||||
timeAtLoad: any;
|
||||
private autoRefreshBlocked: boolean;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor(private $rootScope, private $timeout, private $location, private timer, private contextSrv) {
|
||||
// default time
|
||||
this.time = { from: '6h', to: 'now' };
|
||||
|
@ -2,7 +2,7 @@ import angular from 'angular';
|
||||
import config from 'app/core/config';
|
||||
|
||||
export class ChangePasswordCtrl {
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor($scope, backendSrv, $location, navModelSrv) {
|
||||
$scope.command = {};
|
||||
$scope.authProxyEnabled = config.authProxyEnabled;
|
||||
|
@ -5,7 +5,7 @@ export default class CreateTeamCtrl {
|
||||
email: string;
|
||||
navModel: any;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor(private backendSrv, private $location, navModelSrv) {
|
||||
this.navModel = navModelSrv.getNav('cfg', 'teams', 0);
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ import angular from 'angular';
|
||||
import config from 'app/core/config';
|
||||
|
||||
export class NewOrgCtrl {
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor($scope, $http, backendSrv, navModelSrv) {
|
||||
$scope.navModel = navModelSrv.getNav('cfg', 'admin', 'global-orgs', 1);
|
||||
$scope.newOrg = { name: '' };
|
||||
|
@ -1,7 +1,7 @@
|
||||
import angular from 'angular';
|
||||
|
||||
export class OrgApiKeysCtrl {
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor($scope, $http, backendSrv, navModelSrv) {
|
||||
$scope.navModel = navModelSrv.getNav('cfg', 'apikeys', 0);
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import angular from 'angular';
|
||||
|
||||
export class OrgDetailsCtrl {
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor($scope, $http, backendSrv, contextSrv, navModelSrv) {
|
||||
$scope.init = function() {
|
||||
$scope.getOrgInfo();
|
||||
|
@ -14,7 +14,7 @@ export class PrefsControlCtrl {
|
||||
];
|
||||
themes: any = [{ value: '', text: 'Default' }, { value: 'dark', text: 'Dark' }, { value: 'light', text: 'Light' }];
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor(private backendSrv, private $location) {}
|
||||
|
||||
$onInit() {
|
||||
|
@ -12,7 +12,7 @@ export class ProfileCtrl {
|
||||
readonlyLoginFields = config.disableLoginForm;
|
||||
navModel: any;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor(private backendSrv, private contextSrv, private $location, navModelSrv) {
|
||||
this.getUser();
|
||||
this.getUserTeams();
|
||||
|
@ -2,7 +2,7 @@ import angular from 'angular';
|
||||
import config from 'app/core/config';
|
||||
|
||||
export class SelectOrgCtrl {
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor($scope, backendSrv, contextSrv) {
|
||||
contextSrv.sidemenu = false;
|
||||
|
||||
|
@ -5,7 +5,7 @@ export class UserInviteCtrl {
|
||||
invite: any;
|
||||
inviteForm: any;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor(private backendSrv, navModelSrv, private $location) {
|
||||
this.navModel = navModelSrv.getNav('cfg', 'users', 0);
|
||||
|
||||
|
@ -110,7 +110,7 @@ export class MetricsTabCtrl {
|
||||
}
|
||||
}
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
export function metricsTabDirective() {
|
||||
'use strict';
|
||||
return {
|
||||
|
@ -80,7 +80,7 @@ function createMenuTemplate(ctrl) {
|
||||
return html;
|
||||
}
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
function panelHeader($compile) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
|
@ -87,7 +87,7 @@ export class QueryRowCtrl {
|
||||
}
|
||||
}
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
function queryEditorRowDirective() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
|
@ -40,7 +40,7 @@ export class QueryTroubleshooterCtrl {
|
||||
mockedResponse: string;
|
||||
jsonExplorer: JsonExplorer;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor($scope, private $timeout) {
|
||||
this.onRequestErrorEventListener = this.onRequestError.bind(this);
|
||||
this.onRequestResponseEventListener = this.onRequestResponse.bind(this);
|
||||
|
@ -7,7 +7,7 @@ import { importPluginModule } from './plugin_loader';
|
||||
|
||||
import { UnknownPanelCtrl } from 'app/plugins/panel/unknown/module';
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
function pluginDirectiveLoader($compile, datasourceSrv, $rootScope, $q, $http, $templateCache) {
|
||||
function getTemplate(component) {
|
||||
if (component.template) {
|
||||
|
@ -8,7 +8,7 @@ class StyleGuideCtrl {
|
||||
buttonVariants = ['-'];
|
||||
navModel: any;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor(private $routeParams, private backendSrv, navModelSrv) {
|
||||
this.navModel = navModelSrv.getNav('cfg', 'admin', 'styleguide', 1);
|
||||
this.theme = config.bootData.user.lightTheme ? 'light' : 'dark';
|
||||
|
@ -15,7 +15,7 @@ export class AdhocVariable implements Variable {
|
||||
skipUrlSync: false,
|
||||
};
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor(private model) {
|
||||
assignModelProperties(this, model, this.defaults);
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ export class ConstantVariable implements Variable {
|
||||
skipUrlSync: false,
|
||||
};
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor(private model, private variableSrv) {
|
||||
assignModelProperties(this, model, this.defaults);
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ export class CustomVariable implements Variable {
|
||||
skipUrlSync: false,
|
||||
};
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor(private model, private variableSrv) {
|
||||
assignModelProperties(this, model, this.defaults);
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ export class DatasourceVariable implements Variable {
|
||||
skipUrlSync: false,
|
||||
};
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor(private model, private datasourceSrv, private variableSrv, private templateSrv) {
|
||||
assignModelProperties(this, model, this.defaults);
|
||||
this.refresh = 1;
|
||||
|
@ -4,7 +4,7 @@ import { variableTypes } from './variable';
|
||||
import appEvents from 'app/core/app_events';
|
||||
|
||||
export class VariableEditorCtrl {
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor($scope, datasourceSrv, variableSrv, templateSrv) {
|
||||
$scope.variableTypes = variableTypes;
|
||||
$scope.ctrl = {};
|
||||
|
@ -28,7 +28,7 @@ export class IntervalVariable implements Variable {
|
||||
skipUrlSync: false,
|
||||
};
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor(private model, private timeSrv, private templateSrv, private variableSrv) {
|
||||
assignModelProperties(this, model, this.defaults);
|
||||
this.refresh = 2;
|
||||
|
@ -46,7 +46,7 @@ export class QueryVariable implements Variable {
|
||||
skipUrlSync: false,
|
||||
};
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor(private model, private datasourceSrv, private templateSrv, private variableSrv, private timeSrv) {
|
||||
// copy model properties to this instance
|
||||
assignModelProperties(this, model, this.defaults);
|
||||
|
@ -6,7 +6,7 @@ export class CloudWatchQueryCtrl extends QueryCtrl {
|
||||
|
||||
aliasSyntax: string;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor($scope, $injector) {
|
||||
super($scope, $injector);
|
||||
this.aliasSyntax = '{{metric}} {{stat}} {{namespace}} {{region}} {{<dimension name>}}';
|
||||
|
@ -12,7 +12,7 @@ export class ElasticQueryCtrl extends QueryCtrl {
|
||||
esVersion: any;
|
||||
rawQueryOld: string;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor($scope, $injector, private $rootScope, private uiSegmentSrv) {
|
||||
super($scope, $injector);
|
||||
|
||||
|
@ -19,7 +19,7 @@ export class GraphiteQueryCtrl extends QueryCtrl {
|
||||
supportsTags: boolean;
|
||||
paused: boolean;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor($scope, $injector, private uiSegmentSrv, private templateSrv, $timeout) {
|
||||
super($scope, $injector);
|
||||
this.supportsTags = this.datasource.supportsTags;
|
||||
|
@ -19,7 +19,7 @@ export class InfluxQueryCtrl extends QueryCtrl {
|
||||
measurementSegment: any;
|
||||
removeTagFilterSegment: any;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor($scope, $injector, private templateSrv, private $q, private uiSegmentSrv) {
|
||||
super($scope, $injector);
|
||||
this.target = this.target;
|
||||
|
@ -6,7 +6,7 @@ export class MssqlDatasource {
|
||||
name: any;
|
||||
responseParser: ResponseParser;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor(instanceSettings, private backendSrv, private $q, private templateSrv) {
|
||||
this.name = instanceSettings.name;
|
||||
this.id = instanceSettings.id;
|
||||
|
@ -21,7 +21,7 @@ class MssqlAnnotationsQueryCtrl {
|
||||
|
||||
annotation: any;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor() {
|
||||
this.annotation.rawQuery = this.annotation.rawQuery || defaultQuery;
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ export class MssqlQueryCtrl extends QueryCtrl {
|
||||
lastQueryError: string;
|
||||
showHelp: boolean;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor($scope, $injector) {
|
||||
super($scope, $injector);
|
||||
|
||||
|
@ -6,7 +6,7 @@ export class MysqlDatasource {
|
||||
name: any;
|
||||
responseParser: ResponseParser;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor(instanceSettings, private backendSrv, private $q, private templateSrv) {
|
||||
this.name = instanceSettings.name;
|
||||
this.id = instanceSettings.id;
|
||||
|
@ -20,7 +20,7 @@ class MysqlAnnotationsQueryCtrl {
|
||||
|
||||
annotation: any;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor() {
|
||||
this.annotation.rawQuery = this.annotation.rawQuery || defaultQuery;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ export class MysqlQueryCtrl extends QueryCtrl {
|
||||
lastQueryError: string;
|
||||
showHelp: boolean;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor($scope, $injector) {
|
||||
super($scope, $injector);
|
||||
|
||||
|
@ -19,7 +19,7 @@ export class OpenTsQueryCtrl extends QueryCtrl {
|
||||
addTagMode: boolean;
|
||||
addFilterMode: boolean;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor($scope, $injector) {
|
||||
super($scope, $injector);
|
||||
|
||||
|
@ -6,7 +6,7 @@ export class PostgresDatasource {
|
||||
name: any;
|
||||
responseParser: ResponseParser;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor(instanceSettings, private backendSrv, private $q, private templateSrv) {
|
||||
this.name = instanceSettings.name;
|
||||
this.id = instanceSettings.id;
|
||||
|
@ -6,7 +6,7 @@ class PostgresConfigCtrl {
|
||||
|
||||
current: any;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor($scope) {
|
||||
this.current.jsonData.sslmode = this.current.jsonData.sslmode || 'verify-full';
|
||||
}
|
||||
@ -27,7 +27,7 @@ class PostgresAnnotationsQueryCtrl {
|
||||
|
||||
annotation: any;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor() {
|
||||
this.annotation.rawQuery = this.annotation.rawQuery || defaultQuery;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ export class PostgresQueryCtrl extends QueryCtrl {
|
||||
lastQueryError: string;
|
||||
showHelp: boolean;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor($scope, $injector) {
|
||||
super($scope, $injector);
|
||||
|
||||
|
@ -12,7 +12,7 @@ export class TestDataQueryCtrl extends QueryCtrl {
|
||||
newPointTime: any;
|
||||
selectedPoint: any;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor($scope, $injector, private backendSrv) {
|
||||
super($scope, $injector);
|
||||
|
||||
|
@ -8,7 +8,7 @@ class GettingStartedPanelCtrl extends PanelCtrl {
|
||||
stepIndex: number;
|
||||
steps: any;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor($scope, $injector, private backendSrv, datasourceSrv, private $q) {
|
||||
super($scope, $injector);
|
||||
|
||||
|
@ -9,7 +9,7 @@ export class AxesEditorCtrl {
|
||||
xAxisStatOptions: any;
|
||||
xNameSegment: any;
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor(private $scope, private $q) {
|
||||
this.panelCtrl = $scope.ctrl;
|
||||
this.panel = this.panelCtrl.panel;
|
||||
@ -76,7 +76,7 @@ export class AxesEditorCtrl {
|
||||
}
|
||||
}
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
export function axesEditorComponent() {
|
||||
'use strict';
|
||||
return {
|
||||
|
@ -735,7 +735,7 @@ class GraphElement {
|
||||
}
|
||||
}
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
function graphDirective(timeSrv, popoverSrv, contextSrv) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
|
@ -14,7 +14,7 @@ export class TextPanelCtrl extends PanelCtrl {
|
||||
content: '# title',
|
||||
};
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
constructor($scope, $injector, private templateSrv, private $sce) {
|
||||
super($scope, $injector);
|
||||
|
||||
|
@ -8,7 +8,7 @@ import FolderPermissions from 'app/containers/ManageDashboards/FolderPermissions
|
||||
import TeamPages from 'app/containers/Teams/TeamPages';
|
||||
import TeamList from 'app/containers/Teams/TeamList';
|
||||
|
||||
/** @ngInject **/
|
||||
/** @ngInject */
|
||||
export function setupAngularRoutes($routeProvider, $locationProvider) {
|
||||
$locationProvider.html5Mode(true);
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
"eofline": true,
|
||||
"forin": false,
|
||||
"indent": [true, "spaces", 2],
|
||||
"jsdoc-format": true,
|
||||
"label-position": true,
|
||||
"max-line-length": [true, 150],
|
||||
"member-access": [true, "no-public"],
|
||||
|
Loading…
Reference in New Issue
Block a user