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
This commit is contained in:
Patrick O'Carroll
2018-09-03 11:00:46 +02:00
committed by Torkel Ödegaard
parent 0d25aa08fa
commit 7837ee4466
26 changed files with 246 additions and 239 deletions

View File

@@ -490,8 +490,8 @@ export function GraphiteDatasource(this: any, instanceSettings, $q, backendSrv,
this._seriesRefLetters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
this.buildGraphiteParams = function(options, scopedVars) {
const graphite_options = ['from', 'until', 'rawData', 'format', 'maxDataPoints', 'cacheTimeout'];
const clean_options = [],
const graphiteOptions = ['from', 'until', 'rawData', 'format', 'maxDataPoints', 'cacheTimeout'];
const cleanOptions = [],
targets = {};
let target, targetValue, i;
const regex = /\#([A-Z])/g;
@@ -535,16 +535,16 @@ export function GraphiteDatasource(this: any, instanceSettings, $q, backendSrv,
if (!target.hide) {
hasTargets = true;
clean_options.push('target=' + encodeURIComponent(targetValue));
cleanOptions.push('target=' + encodeURIComponent(targetValue));
}
}
_.each(options, function(value, key) {
if (_.indexOf(graphite_options, key) === -1) {
if (_.indexOf(graphiteOptions, key) === -1) {
return;
}
if (value) {
clean_options.push(key + '=' + encodeURIComponent(value));
cleanOptions.push(key + '=' + encodeURIComponent(value));
}
});
@@ -552,7 +552,7 @@ export function GraphiteDatasource(this: any, instanceSettings, $q, backendSrv,
return [];
}
return clean_options;
return cleanOptions;
};
}