From 7837ee446690e49e7d6eb63edfe164be5e88d2df Mon Sep 17 00:00:00 2001 From: Patrick O'Carroll Date: Mon, 3 Sep 2018 11:00:46 +0200 Subject: [PATCH] Updated rules for variable name (#13106) * updated rules for variable name and fixed files that didn't follow new rules * fixed test so it uses new rule * made exceptions to rule in interval_variable --- public/app/app.ts | 4 +- public/app/core/config.ts | 4 +- public/app/core/utils/outline.ts | 22 +-- public/app/core/utils/ticks.ts | 10 +- public/app/core/utils/version.ts | 4 +- .../features/annotations/events_processing.ts | 32 ++-- .../app/features/dashboard/dashboard_ctrl.ts | 2 +- .../dashboard/dashboard_loader_srv.ts | 10 +- .../features/dashboard/specs/repeat.test.ts | 36 ++--- public/app/features/org/profile_ctrl.ts | 4 +- .../features/templating/interval_variable.ts | 4 +- .../datasource/elasticsearch/datasource.ts | 12 +- .../datasource/elasticsearch/metric_agg.ts | 4 +- .../elasticsearch/specs/query_builder.test.ts | 8 +- .../plugins/datasource/graphite/datasource.ts | 12 +- .../plugins/datasource/opentsdb/datasource.ts | 50 +++--- .../prometheus/metric_find_query.ts | 28 ++-- .../prometheus/result_transformer.ts | 8 +- public/app/plugins/panel/graph/graph.ts | 12 +- .../app/plugins/panel/graph/graph_tooltip.ts | 6 +- public/app/plugins/panel/graph/histogram.ts | 4 +- .../app/plugins/panel/heatmap/heatmap_ctrl.ts | 4 +- .../panel/heatmap/heatmap_data_converter.ts | 38 ++--- public/app/plugins/panel/heatmap/rendering.ts | 146 +++++++++--------- public/app/plugins/panel/table/renderer.ts | 12 +- tslint.json | 9 +- 26 files changed, 246 insertions(+), 239 deletions(-) diff --git a/public/app/app.ts b/public/app/app.ts index d9e31018af9..77f56264504 100644 --- a/public/app/app.ts +++ b/public/app/app.ts @@ -105,9 +105,9 @@ export class GrafanaApp { 'react', ]; - const module_types = ['controllers', 'directives', 'factories', 'services', 'filters', 'routes']; + const moduleTypes = ['controllers', 'directives', 'factories', 'services', 'filters', 'routes']; - _.each(module_types, type => { + _.each(moduleTypes, type => { const moduleName = 'grafana.' + type; this.useModule(angular.module(moduleName, [])); }); diff --git a/public/app/core/config.ts b/public/app/core/config.ts index f522c6340e6..86720ed5dcc 100644 --- a/public/app/core/config.ts +++ b/public/app/core/config.ts @@ -11,9 +11,9 @@ export class Settings { datasources: any; panels: any; appSubUrl: string; - window_title_prefix: string; + windowTitlePrefix: string; buildInfo: BuildInfo; - new_panel_title: string; + newPanelTitle: string; bootData: any; externalUserMngLinkUrl: string; externalUserMngLinkName: string; diff --git a/public/app/core/utils/outline.ts b/public/app/core/utils/outline.ts index ebd4258c66b..975dc1c8b2d 100644 --- a/public/app/core/utils/outline.ts +++ b/public/app/core/utils/outline.ts @@ -2,32 +2,32 @@ function outlineFixer() { const d: any = document; - const style_element = d.createElement('STYLE'); - const dom_events = 'addEventListener' in d; + const styleElement = d.createElement('STYLE'); + const domEvents = 'addEventListener' in d; - const add_event_listener = function(type, callback) { + const addEventListener = function(type, callback) { // Basic cross-browser event handling - if (dom_events) { + if (domEvents) { d.addEventListener(type, callback); } else { d.attachEvent('on' + type, callback); } }; - const set_css = function(css_text) { + const setCss = function(cssText) { // Handle setting of