Merge pull request #6653 from epixa/letconst
[internal] Replace empty var declarations with let
This commit is contained in:
commit
914763874d
|
@ -85,7 +85,7 @@ describe('lib/config/config', function () {
|
||||||
|
|
||||||
describe('#resetTo(object)', function () {
|
describe('#resetTo(object)', function () {
|
||||||
|
|
||||||
var config;
|
let config;
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
config = new Config(schema);
|
config = new Config(schema);
|
||||||
});
|
});
|
||||||
|
@ -102,7 +102,7 @@ describe('lib/config/config', function () {
|
||||||
|
|
||||||
describe('#has(key)', function () {
|
describe('#has(key)', function () {
|
||||||
|
|
||||||
var config;
|
let config;
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
config = new Config(schema);
|
config = new Config(schema);
|
||||||
});
|
});
|
||||||
|
@ -122,7 +122,7 @@ describe('lib/config/config', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('#set(key, value)', function () {
|
describe('#set(key, value)', function () {
|
||||||
var config;
|
let config;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
config = new Config(schema);
|
config = new Config(schema);
|
||||||
|
@ -171,7 +171,7 @@ describe('lib/config/config', function () {
|
||||||
|
|
||||||
describe('#get(key)', function () {
|
describe('#get(key)', function () {
|
||||||
|
|
||||||
var config;
|
let config;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
config = new Config(schema);
|
config = new Config(schema);
|
||||||
|
@ -210,7 +210,7 @@ describe('lib/config/config', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('#extendSchema(key, schema)', function () {
|
describe('#extendSchema(key, schema)', function () {
|
||||||
var config;
|
let config;
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
config = new Config(schema);
|
config = new Config(schema);
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
module.exports = function (dot, nestedObj, flattenArrays) {
|
module.exports = function (dot, nestedObj, flattenArrays) {
|
||||||
var key; // original key
|
let key; // original key
|
||||||
var stack = []; // track key stack
|
var stack = []; // track key stack
|
||||||
var flatObj = {};
|
var flatObj = {};
|
||||||
(function flattenObj(obj) {
|
(function flattenObj(obj) {
|
||||||
|
|
|
@ -7,8 +7,8 @@ import Status from '../status';
|
||||||
import ServerStatus from '../server_status';
|
import ServerStatus from '../server_status';
|
||||||
|
|
||||||
describe('ServerStatus class', function () {
|
describe('ServerStatus class', function () {
|
||||||
var server;
|
let server;
|
||||||
var serverStatus;
|
let serverStatus;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
server = { expose: sinon.stub(), log: sinon.stub() };
|
server = { expose: sinon.stub(), log: sinon.stub() };
|
||||||
|
|
|
@ -4,8 +4,8 @@ import Status from '../status';
|
||||||
import ServerStatus from '../server_status';
|
import ServerStatus from '../server_status';
|
||||||
|
|
||||||
describe('Status class', function () {
|
describe('Status class', function () {
|
||||||
var server;
|
let server;
|
||||||
var serverStatus;
|
let serverStatus;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
server = { expose: sinon.stub(), log: sinon.stub() };
|
server = { expose: sinon.stub(), log: sinon.stub() };
|
||||||
|
|
|
@ -9,11 +9,11 @@ import AggResponseTabifyTabifyProvider from 'ui/agg_response/tabify/tabify';
|
||||||
import AggResponseGeoJsonGeoJsonProvider from 'ui/agg_response/geo_json/geo_json';
|
import AggResponseGeoJsonGeoJsonProvider from 'ui/agg_response/geo_json/geo_json';
|
||||||
|
|
||||||
describe('GeoJson Agg Response Converter', function () {
|
describe('GeoJson Agg Response Converter', function () {
|
||||||
var vis;
|
let vis;
|
||||||
var tabify;
|
let tabify;
|
||||||
var convert;
|
let convert;
|
||||||
var esResponse;
|
let esResponse;
|
||||||
var aggs;
|
let aggs;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
|
@ -108,10 +108,10 @@ describe('GeoJson Agg Response Converter', function () {
|
||||||
describe('includes one feature per row in the table', function () {
|
describe('includes one feature per row in the table', function () {
|
||||||
this.timeout(60000);
|
this.timeout(60000);
|
||||||
|
|
||||||
var table;
|
let table;
|
||||||
var chart;
|
let chart;
|
||||||
var geoColI;
|
let geoColI;
|
||||||
var metricColI;
|
let metricColI;
|
||||||
|
|
||||||
before(function () {
|
before(function () {
|
||||||
table = makeTable();
|
table = makeTable();
|
||||||
|
|
|
@ -4,7 +4,7 @@ import expect from 'expect.js';
|
||||||
describe('buildHierarchicalData()', function () {
|
describe('buildHierarchicalData()', function () {
|
||||||
describe('arrayToLinkedList', function () {
|
describe('arrayToLinkedList', function () {
|
||||||
|
|
||||||
var results;
|
let results;
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
results = arrayToLinkedList([
|
results = arrayToLinkedList([
|
||||||
{ id: 1 },
|
{ id: 1 },
|
||||||
|
|
|
@ -9,11 +9,11 @@ import VisAggConfigsProvider from 'ui/vis/agg_configs';
|
||||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||||
import AggResponseHierarchicalBuildHierarchicalDataProvider from 'ui/agg_response/hierarchical/build_hierarchical_data';
|
import AggResponseHierarchicalBuildHierarchicalDataProvider from 'ui/agg_response/hierarchical/build_hierarchical_data';
|
||||||
|
|
||||||
var Vis;
|
let Vis;
|
||||||
var Notifier;
|
let Notifier;
|
||||||
var AggConfigs;
|
let AggConfigs;
|
||||||
var indexPattern;
|
let indexPattern;
|
||||||
var buildHierarchicalData;
|
let buildHierarchicalData;
|
||||||
|
|
||||||
describe('buildHierarchicalData', function () {
|
describe('buildHierarchicalData', function () {
|
||||||
|
|
||||||
|
@ -31,8 +31,8 @@ describe('buildHierarchicalData', function () {
|
||||||
|
|
||||||
|
|
||||||
describe('metric only', function () {
|
describe('metric only', function () {
|
||||||
var vis;
|
let vis;
|
||||||
var results;
|
let results;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
var id = 1;
|
var id = 1;
|
||||||
|
@ -103,8 +103,8 @@ describe('buildHierarchicalData', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('threeTermBuckets', function () {
|
describe('threeTermBuckets', function () {
|
||||||
var vis;
|
let vis;
|
||||||
var results;
|
let results;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
var id = 1;
|
var id = 1;
|
||||||
|
@ -145,8 +145,8 @@ describe('buildHierarchicalData', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('oneHistogramBucket', function () {
|
describe('oneHistogramBucket', function () {
|
||||||
var vis;
|
let vis;
|
||||||
var results;
|
let results;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
var id = 1;
|
var id = 1;
|
||||||
|
@ -177,8 +177,8 @@ describe('buildHierarchicalData', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('oneRangeBucket', function () {
|
describe('oneRangeBucket', function () {
|
||||||
var vis;
|
let vis;
|
||||||
var results;
|
let results;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
var id = 1;
|
var id = 1;
|
||||||
|
@ -218,8 +218,8 @@ describe('buildHierarchicalData', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('oneFilterBucket', function () {
|
describe('oneFilterBucket', function () {
|
||||||
var vis;
|
let vis;
|
||||||
var results;
|
let results;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
var id = 1;
|
var id = 1;
|
||||||
|
@ -254,8 +254,8 @@ describe('buildHierarchicalData', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('oneFilterBucket that is a split', function () {
|
describe('oneFilterBucket that is a split', function () {
|
||||||
var vis;
|
let vis;
|
||||||
var results;
|
let results;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
var id = 1;
|
var id = 1;
|
||||||
|
|
|
@ -3,7 +3,7 @@ import _ from 'lodash';
|
||||||
import collectBranch from 'ui/agg_response/hierarchical/_collect_branch';
|
import collectBranch from 'ui/agg_response/hierarchical/_collect_branch';
|
||||||
import expect from 'expect.js';
|
import expect from 'expect.js';
|
||||||
describe('collectBranch()', function () {
|
describe('collectBranch()', function () {
|
||||||
var results;
|
let results;
|
||||||
var convert = function (name) {
|
var convert = function (name) {
|
||||||
return 'converted:' + name;
|
return 'converted:' + name;
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,14 +9,14 @@ import VisProvider from 'ui/vis';
|
||||||
import VisAggConfigsProvider from 'ui/vis/agg_configs';
|
import VisAggConfigsProvider from 'ui/vis/agg_configs';
|
||||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||||
|
|
||||||
var AggConfigs;
|
let AggConfigs;
|
||||||
var Vis;
|
let Vis;
|
||||||
var indexPattern;
|
let indexPattern;
|
||||||
|
|
||||||
describe('buildHierarchicalData()', function () {
|
describe('buildHierarchicalData()', function () {
|
||||||
describe('createRawData()', function () {
|
describe('createRawData()', function () {
|
||||||
var vis;
|
let vis;
|
||||||
var results;
|
let results;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,8 @@ import AggResponseHierarchicalTransformAggregationProvider from 'ui/agg_response
|
||||||
|
|
||||||
describe('buildHierarchicalData()', function () {
|
describe('buildHierarchicalData()', function () {
|
||||||
describe('transformAggregation()', function () {
|
describe('transformAggregation()', function () {
|
||||||
var transform;
|
let transform;
|
||||||
var fixture;
|
let fixture;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
export default function (buckets) {
|
export default function (buckets) {
|
||||||
var previous;
|
let previous;
|
||||||
_.each(buckets, function (bucket) {
|
_.each(buckets, function (bucket) {
|
||||||
if (previous) {
|
if (previous) {
|
||||||
bucket._previous = previous;
|
bucket._previous = previous;
|
||||||
|
|
|
@ -21,7 +21,7 @@ export default function HierarchicalTooltipFormaterProvider($rootScope, $compile
|
||||||
_.forEachRight($tooltipScope.rows, function (row, i, rows) {
|
_.forEachRight($tooltipScope.rows, function (row, i, rows) {
|
||||||
row.spacer = $sce.trustAsHtml(_.repeat(' ', row.depth));
|
row.spacer = $sce.trustAsHtml(_.repeat(' ', row.depth));
|
||||||
|
|
||||||
var percent;
|
let percent;
|
||||||
if (row.item.percentOfGroup != null) {
|
if (row.item.percentOfGroup != null) {
|
||||||
percent = row.item.percentOfGroup;
|
percent = row.item.percentOfGroup;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ import expect from 'expect.js';
|
||||||
import ngMock from 'ng_mock';
|
import ngMock from 'ng_mock';
|
||||||
import AggResponsePointSeriesAddToSiriProvider from 'ui/agg_response/point_series/_add_to_siri';
|
import AggResponsePointSeriesAddToSiriProvider from 'ui/agg_response/point_series/_add_to_siri';
|
||||||
describe('addToSiri', function () {
|
describe('addToSiri', function () {
|
||||||
var addToSiri;
|
let addToSiri;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
|
|
|
@ -6,11 +6,11 @@ import AggTypesAggTypeProvider from 'ui/agg_types/agg_type';
|
||||||
import AggResponsePointSeriesFakeXAspectProvider from 'ui/agg_response/point_series/_fake_x_aspect';
|
import AggResponsePointSeriesFakeXAspectProvider from 'ui/agg_response/point_series/_fake_x_aspect';
|
||||||
describe('makeFakeXAspect', function () {
|
describe('makeFakeXAspect', function () {
|
||||||
|
|
||||||
var makeFakeXAspect;
|
let makeFakeXAspect;
|
||||||
var Vis;
|
let Vis;
|
||||||
var AggType;
|
let AggType;
|
||||||
var AggConfig;
|
let AggConfig;
|
||||||
var indexPattern;
|
let indexPattern;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
|
|
|
@ -9,11 +9,11 @@ import AggResponsePointSeriesGetAspectsProvider from 'ui/agg_response/point_seri
|
||||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||||
describe('getAspects', function () {
|
describe('getAspects', function () {
|
||||||
|
|
||||||
var Vis;
|
let Vis;
|
||||||
var Table;
|
let Table;
|
||||||
var AggConfig;
|
let AggConfig;
|
||||||
var indexPattern;
|
let indexPattern;
|
||||||
var getAspects;
|
let getAspects;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
|
@ -24,8 +24,8 @@ describe('getAspects', function () {
|
||||||
indexPattern = Private(FixturesStubbedLogstashIndexPatternProvider);
|
indexPattern = Private(FixturesStubbedLogstashIndexPatternProvider);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
var vis;
|
let vis;
|
||||||
var table;
|
let table;
|
||||||
|
|
||||||
var date = _.memoize(function (n) {
|
var date = _.memoize(function (n) {
|
||||||
return moment().startOf('day').add(n, 'hour').valueOf();
|
return moment().startOf('day').add(n, 'hour').valueOf();
|
||||||
|
|
|
@ -5,7 +5,7 @@ import AggResponsePointSeriesGetPointProvider from 'ui/agg_response/point_series
|
||||||
|
|
||||||
describe('getPoint', function () {
|
describe('getPoint', function () {
|
||||||
|
|
||||||
var getPoint;
|
let getPoint;
|
||||||
|
|
||||||
var truthFormatted = { fieldFormatter: _.constant(_.constant(true)) };
|
var truthFormatted = { fieldFormatter: _.constant(_.constant(true)) };
|
||||||
var identFormatted = { fieldFormatter: _.constant(_.identity) };
|
var identFormatted = { fieldFormatter: _.constant(_.identity) };
|
||||||
|
@ -16,10 +16,10 @@ describe('getPoint', function () {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
describe('Without series aspect', function () {
|
describe('Without series aspect', function () {
|
||||||
var seriesAspect;
|
let seriesAspect;
|
||||||
var xAspect;
|
let xAspect;
|
||||||
var yAspect;
|
let yAspect;
|
||||||
var yScale;
|
let yScale;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
seriesAspect = null;
|
seriesAspect = null;
|
||||||
|
@ -49,10 +49,10 @@ describe('getPoint', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('With series aspect', function () {
|
describe('With series aspect', function () {
|
||||||
var row;
|
let row;
|
||||||
var xAspect;
|
let xAspect;
|
||||||
var yAspect;
|
let yAspect;
|
||||||
var yScale;
|
let yScale;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
row = [ { value: 1 }, { value: 2 }, { value: 3 }];
|
row = [ { value: 1 }, { value: 2 }, { value: 3 }];
|
||||||
|
|
|
@ -3,7 +3,7 @@ import expect from 'expect.js';
|
||||||
import ngMock from 'ng_mock';
|
import ngMock from 'ng_mock';
|
||||||
import AggResponsePointSeriesGetSeriesProvider from 'ui/agg_response/point_series/_get_series';
|
import AggResponsePointSeriesGetSeriesProvider from 'ui/agg_response/point_series/_get_series';
|
||||||
describe('getSeries', function () {
|
describe('getSeries', function () {
|
||||||
var getSeries;
|
let getSeries;
|
||||||
|
|
||||||
var agg = { fieldFormatter: _.constant(_.identity) };
|
var agg = { fieldFormatter: _.constant(_.identity) };
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import ngMock from 'ng_mock';
|
||||||
import AggResponsePointSeriesInitXAxisProvider from 'ui/agg_response/point_series/_init_x_axis';
|
import AggResponsePointSeriesInitXAxisProvider from 'ui/agg_response/point_series/_init_x_axis';
|
||||||
describe('initXAxis', function () {
|
describe('initXAxis', function () {
|
||||||
|
|
||||||
var initXAxis;
|
let initXAxis;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import ngMock from 'ng_mock';
|
||||||
import AggResponsePointSeriesInitYAxisProvider from 'ui/agg_response/point_series/_init_y_axis';
|
import AggResponsePointSeriesInitYAxisProvider from 'ui/agg_response/point_series/_init_y_axis';
|
||||||
describe('initYAxis', function () {
|
describe('initYAxis', function () {
|
||||||
|
|
||||||
var initYAxis;
|
let initYAxis;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
|
|
|
@ -11,10 +11,10 @@ describe('pointSeriesChartDataFromTable', function () {
|
||||||
this.slow(1000);
|
this.slow(1000);
|
||||||
|
|
||||||
|
|
||||||
var pointSeriesChartDataFromTable;
|
let pointSeriesChartDataFromTable;
|
||||||
var indexPattern;
|
let indexPattern;
|
||||||
var Table;
|
let Table;
|
||||||
var Vis;
|
let Vis;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
|
|
|
@ -28,7 +28,7 @@ describe('orderedDateAxis', function () {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var orderedDateAxis;
|
let orderedDateAxis;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import ngMock from 'ng_mock';
|
||||||
import AggResponsePointSeriesTooltipFormatterProvider from 'ui/agg_response/point_series/_tooltip_formatter';
|
import AggResponsePointSeriesTooltipFormatterProvider from 'ui/agg_response/point_series/_tooltip_formatter';
|
||||||
describe('tooltipFormatter', function () {
|
describe('tooltipFormatter', function () {
|
||||||
|
|
||||||
var tooltipFormatter;
|
let tooltipFormatter;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
|
|
|
@ -37,7 +37,7 @@ export default function PointSeriesGetSeries(Private) {
|
||||||
if (multiY) {
|
if (multiY) {
|
||||||
series = _.sortBy(series, function (siri) {
|
series = _.sortBy(series, function (siri) {
|
||||||
var firstVal = siri.values[0];
|
var firstVal = siri.values[0];
|
||||||
var y;
|
let y;
|
||||||
|
|
||||||
if (firstVal) {
|
if (firstVal) {
|
||||||
var agg = firstVal.aggConfigResult.aggConfig;
|
var agg = firstVal.aggConfigResult.aggConfig;
|
||||||
|
|
|
@ -2,7 +2,7 @@ import expect from 'expect.js';
|
||||||
import ngMock from 'ng_mock';
|
import ngMock from 'ng_mock';
|
||||||
import AggResponseTabifyBucketsProvider from 'ui/agg_response/tabify/_buckets';
|
import AggResponseTabifyBucketsProvider from 'ui/agg_response/tabify/_buckets';
|
||||||
describe('Buckets wrapper', function () {
|
describe('Buckets wrapper', function () {
|
||||||
var Buckets;
|
let Buckets;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private, $injector) {
|
beforeEach(ngMock.inject(function (Private, $injector) {
|
||||||
|
|
|
@ -4,9 +4,9 @@ import AggResponseTabifyGetColumnsProvider from 'ui/agg_response/tabify/_get_col
|
||||||
import VisProvider from 'ui/vis';
|
import VisProvider from 'ui/vis';
|
||||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||||
describe('get columns', function () {
|
describe('get columns', function () {
|
||||||
var getColumns;
|
let getColumns;
|
||||||
var Vis;
|
let Vis;
|
||||||
var indexPattern;
|
let indexPattern;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private, $injector) {
|
beforeEach(ngMock.inject(function (Private, $injector) {
|
||||||
|
|
|
@ -7,10 +7,10 @@ import VisProvider from 'ui/vis';
|
||||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||||
describe('tabifyAggResponse Integration', function () {
|
describe('tabifyAggResponse Integration', function () {
|
||||||
|
|
||||||
var Vis;
|
let Vis;
|
||||||
var Buckets;
|
let Buckets;
|
||||||
var indexPattern;
|
let indexPattern;
|
||||||
var tabifyAggResponse;
|
let tabifyAggResponse;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private, $injector) {
|
beforeEach(ngMock.inject(function (Private, $injector) {
|
||||||
|
@ -46,12 +46,12 @@ describe('tabifyAggResponse Integration', function () {
|
||||||
describe('transforms a complex response', function () {
|
describe('transforms a complex response', function () {
|
||||||
this.slow(1000);
|
this.slow(1000);
|
||||||
|
|
||||||
var vis;
|
let vis;
|
||||||
var avg;
|
let avg;
|
||||||
var ext;
|
let ext;
|
||||||
var src;
|
let src;
|
||||||
var os;
|
let os;
|
||||||
var esResp;
|
let esResp;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
vis = new Vis(indexPattern, {
|
vis = new Vis(indexPattern, {
|
||||||
|
|
|
@ -10,14 +10,14 @@ import VisProvider from 'ui/vis';
|
||||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||||
describe('ResponseWriter class', function () {
|
describe('ResponseWriter class', function () {
|
||||||
|
|
||||||
var Vis;
|
let Vis;
|
||||||
var Table;
|
let Table;
|
||||||
var Buckets;
|
let Buckets;
|
||||||
var Private;
|
let Private;
|
||||||
var TableGroup;
|
let TableGroup;
|
||||||
var getColumns;
|
let getColumns;
|
||||||
var indexPattern;
|
let indexPattern;
|
||||||
var ResponseWriter;
|
let ResponseWriter;
|
||||||
|
|
||||||
function defineSetup(stubGetColumns) {
|
function defineSetup(stubGetColumns) {
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
|
|
@ -4,7 +4,7 @@ import ngMock from 'ng_mock';
|
||||||
import AggResponseTabifyTableProvider from 'ui/agg_response/tabify/_table';
|
import AggResponseTabifyTableProvider from 'ui/agg_response/tabify/_table';
|
||||||
describe('Table class', function () {
|
describe('Table class', function () {
|
||||||
|
|
||||||
var Table;
|
let Table;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private, $injector) {
|
beforeEach(ngMock.inject(function (Private, $injector) {
|
||||||
|
|
|
@ -2,7 +2,7 @@ import expect from 'expect.js';
|
||||||
import ngMock from 'ng_mock';
|
import ngMock from 'ng_mock';
|
||||||
import AggResponseTabifyTableGroupProvider from 'ui/agg_response/tabify/_table_group';
|
import AggResponseTabifyTableGroupProvider from 'ui/agg_response/tabify/_table_group';
|
||||||
describe('Table Group class', function () {
|
describe('Table Group class', function () {
|
||||||
var TableGroup;
|
let TableGroup;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private, $injector) {
|
beforeEach(ngMock.inject(function (Private, $injector) {
|
||||||
|
|
|
@ -8,11 +8,11 @@ import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logsta
|
||||||
import VisProvider from 'ui/vis';
|
import VisProvider from 'ui/vis';
|
||||||
describe('AggTableGroup Directive', function () {
|
describe('AggTableGroup Directive', function () {
|
||||||
|
|
||||||
var $rootScope;
|
let $rootScope;
|
||||||
var $compile;
|
let $compile;
|
||||||
var tabifyAggResponse;
|
let tabifyAggResponse;
|
||||||
var Vis;
|
let Vis;
|
||||||
var indexPattern;
|
let indexPattern;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function ($injector, Private) {
|
beforeEach(ngMock.inject(function ($injector, Private) {
|
||||||
|
@ -24,7 +24,7 @@ describe('AggTableGroup Directive', function () {
|
||||||
$compile = $injector.get('$compile');
|
$compile = $injector.get('$compile');
|
||||||
}));
|
}));
|
||||||
|
|
||||||
var $scope;
|
let $scope;
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
$scope = $rootScope.$new();
|
$scope = $rootScope.$new();
|
||||||
});
|
});
|
||||||
|
|
|
@ -9,11 +9,11 @@ import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logsta
|
||||||
import VisProvider from 'ui/vis';
|
import VisProvider from 'ui/vis';
|
||||||
describe('AggTable Directive', function () {
|
describe('AggTable Directive', function () {
|
||||||
|
|
||||||
var $rootScope;
|
let $rootScope;
|
||||||
var $compile;
|
let $compile;
|
||||||
var tabifyAggResponse;
|
let tabifyAggResponse;
|
||||||
var Vis;
|
let Vis;
|
||||||
var indexPattern;
|
let indexPattern;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function ($injector, Private) {
|
beforeEach(ngMock.inject(function ($injector, Private) {
|
||||||
|
@ -25,7 +25,7 @@ describe('AggTable Directive', function () {
|
||||||
$compile = $injector.get('$compile');
|
$compile = $injector.get('$compile');
|
||||||
}));
|
}));
|
||||||
|
|
||||||
var $scope;
|
let $scope;
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
$scope = $rootScope.$new();
|
$scope = $rootScope.$new();
|
||||||
});
|
});
|
||||||
|
@ -134,7 +134,7 @@ describe('AggTable Directive', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('aggTable.exportAsCsv()', function () {
|
describe('aggTable.exportAsCsv()', function () {
|
||||||
var origBlob;
|
let origBlob;
|
||||||
function FakeBlob(slices, opts) {
|
function FakeBlob(slices, opts) {
|
||||||
this.slices = slices;
|
this.slices = slices;
|
||||||
this.opts = opts;
|
this.opts = opts;
|
||||||
|
|
|
@ -8,11 +8,11 @@ import AggTypesParamTypesOptionedProvider from 'ui/agg_types/param_types/optione
|
||||||
import AggTypesParamTypesRegexProvider from 'ui/agg_types/param_types/regex';
|
import AggTypesParamTypesRegexProvider from 'ui/agg_types/param_types/regex';
|
||||||
describe('AggParams class', function () {
|
describe('AggParams class', function () {
|
||||||
|
|
||||||
var AggParams;
|
let AggParams;
|
||||||
var BaseAggParam;
|
let BaseAggParam;
|
||||||
var FieldAggParam;
|
let FieldAggParam;
|
||||||
var OptionedAggParam;
|
let OptionedAggParam;
|
||||||
var RegexAggParam;
|
let RegexAggParam;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
// stub out the param classes before we get the AggParams
|
// stub out the param classes before we get the AggParams
|
||||||
|
|
|
@ -10,12 +10,12 @@ import AggTypesAggTypeProvider from 'ui/agg_types/agg_type';
|
||||||
import VisAggConfigProvider from 'ui/vis/agg_config';
|
import VisAggConfigProvider from 'ui/vis/agg_config';
|
||||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||||
describe('AggType Class', function () {
|
describe('AggType Class', function () {
|
||||||
var AggType;
|
let AggType;
|
||||||
var AggParams;
|
let AggParams;
|
||||||
var AggConfig;
|
let AggConfig;
|
||||||
var indexPattern;
|
let indexPattern;
|
||||||
var fieldFormat;
|
let fieldFormat;
|
||||||
var Vis;
|
let Vis;
|
||||||
|
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
|
|
@ -8,12 +8,12 @@ import AggTypesIndexProvider from 'ui/agg_types/index';
|
||||||
import VisAggConfigProvider from 'ui/vis/agg_config';
|
import VisAggConfigProvider from 'ui/vis/agg_config';
|
||||||
import AggTypesBucketsBucketCountBetweenProvider from 'ui/agg_types/buckets/_bucket_count_between';
|
import AggTypesBucketsBucketCountBetweenProvider from 'ui/agg_types/buckets/_bucket_count_between';
|
||||||
describe('bucketCountBetween util', function () {
|
describe('bucketCountBetween util', function () {
|
||||||
var indexPattern;
|
let indexPattern;
|
||||||
var Vis;
|
let Vis;
|
||||||
var visTypes;
|
let visTypes;
|
||||||
var aggTypes;
|
let aggTypes;
|
||||||
var AggConfig;
|
let AggConfig;
|
||||||
var bucketCountBetween;
|
let bucketCountBetween;
|
||||||
|
|
||||||
// http://cwestblog.com/2014/02/25/javascript-testing-for-negative-zero/
|
// http://cwestblog.com/2014/02/25/javascript-testing-for-negative-zero/
|
||||||
// works for -0 and +0
|
// works for -0 and +0
|
||||||
|
|
|
@ -6,7 +6,7 @@ import AggParamWriterProvider from '../agg_param_writer';
|
||||||
describe('Histogram Agg', function () {
|
describe('Histogram Agg', function () {
|
||||||
|
|
||||||
describe('ordered', function () {
|
describe('ordered', function () {
|
||||||
var histogram;
|
let histogram;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
|
@ -24,7 +24,7 @@ describe('Histogram Agg', function () {
|
||||||
|
|
||||||
|
|
||||||
describe('params', function () {
|
describe('params', function () {
|
||||||
var paramWriter;
|
let paramWriter;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
|
|
|
@ -11,9 +11,9 @@ describe('Range Agg', function () {
|
||||||
|
|
||||||
var buckets = values(resp.aggregations[1].buckets);
|
var buckets = values(resp.aggregations[1].buckets);
|
||||||
|
|
||||||
var range;
|
let range;
|
||||||
var Vis;
|
let Vis;
|
||||||
var indexPattern;
|
let indexPattern;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
|
|
|
@ -12,16 +12,16 @@ import AggTypesBucketsIntervalOptionsProvider from 'ui/agg_types/buckets/_interv
|
||||||
describe('AggConfig Filters', function () {
|
describe('AggConfig Filters', function () {
|
||||||
describe('date_histogram', function () {
|
describe('date_histogram', function () {
|
||||||
|
|
||||||
var vis;
|
let vis;
|
||||||
var agg;
|
let agg;
|
||||||
var field;
|
let field;
|
||||||
var filter;
|
let filter;
|
||||||
var bucketKey;
|
let bucketKey;
|
||||||
var bucketStart;
|
let bucketStart;
|
||||||
var getIntervalStub;
|
let getIntervalStub;
|
||||||
var intervalOptions;
|
let intervalOptions;
|
||||||
|
|
||||||
var init;
|
let init;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private, $injector) {
|
beforeEach(ngMock.inject(function (Private, $injector) {
|
||||||
|
@ -84,7 +84,7 @@ describe('AggConfig Filters', function () {
|
||||||
|
|
||||||
it('extends the filter edge to 1ms before the next bucket for all interval options', function () {
|
it('extends the filter edge to 1ms before the next bucket for all interval options', function () {
|
||||||
intervalOptions.forEach(function (option) {
|
intervalOptions.forEach(function (option) {
|
||||||
var duration;
|
let duration;
|
||||||
if (option.val !== 'custom' && moment(1, option.val).isValid()) {
|
if (option.val !== 'custom' && moment(1, option.val).isValid()) {
|
||||||
duration = moment.duration(10, option.val);
|
duration = moment.duration(10, option.val);
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,10 @@ import AggTypesBucketsCreateFilterDateRangeProvider from 'ui/agg_types/buckets/c
|
||||||
|
|
||||||
describe('AggConfig Filters', function () {
|
describe('AggConfig Filters', function () {
|
||||||
describe('Date range', function () {
|
describe('Date range', function () {
|
||||||
var AggConfig;
|
let AggConfig;
|
||||||
var indexPattern;
|
let indexPattern;
|
||||||
var Vis;
|
let Vis;
|
||||||
var createFilter;
|
let createFilter;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
|
|
|
@ -9,10 +9,10 @@ import AggTypesBucketsCreateFilterFiltersProvider from 'ui/agg_types/buckets/cre
|
||||||
|
|
||||||
describe('AggConfig Filters', function () {
|
describe('AggConfig Filters', function () {
|
||||||
describe('filters', function () {
|
describe('filters', function () {
|
||||||
var AggConfig;
|
let AggConfig;
|
||||||
var indexPattern;
|
let indexPattern;
|
||||||
var Vis;
|
let Vis;
|
||||||
var createFilter;
|
let createFilter;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
|
|
|
@ -9,10 +9,10 @@ import AggTypesBucketsCreateFilterHistogramProvider from 'ui/agg_types/buckets/c
|
||||||
|
|
||||||
describe('AggConfig Filters', function () {
|
describe('AggConfig Filters', function () {
|
||||||
describe('histogram', function () {
|
describe('histogram', function () {
|
||||||
var AggConfig;
|
let AggConfig;
|
||||||
var indexPattern;
|
let indexPattern;
|
||||||
var Vis;
|
let Vis;
|
||||||
var createFilter;
|
let createFilter;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
|
|
|
@ -7,10 +7,10 @@ import AggTypesBucketsCreateFilterIpRangeProvider from 'ui/agg_types/buckets/cre
|
||||||
describe('AggConfig Filters', function () {
|
describe('AggConfig Filters', function () {
|
||||||
|
|
||||||
describe('IP range', function () {
|
describe('IP range', function () {
|
||||||
var AggConfig;
|
let AggConfig;
|
||||||
var indexPattern;
|
let indexPattern;
|
||||||
var Vis;
|
let Vis;
|
||||||
var createFilter;
|
let createFilter;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
|
|
|
@ -7,10 +7,10 @@ import AggTypesBucketsCreateFilterRangeProvider from 'ui/agg_types/buckets/creat
|
||||||
describe('AggConfig Filters', function () {
|
describe('AggConfig Filters', function () {
|
||||||
|
|
||||||
describe('range', function () {
|
describe('range', function () {
|
||||||
var AggConfig;
|
let AggConfig;
|
||||||
var indexPattern;
|
let indexPattern;
|
||||||
var Vis;
|
let Vis;
|
||||||
var createFilter;
|
let createFilter;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
|
|
|
@ -7,10 +7,10 @@ import AggTypesBucketsCreateFilterTermsProvider from 'ui/agg_types/buckets/creat
|
||||||
describe('AggConfig Filters', function () {
|
describe('AggConfig Filters', function () {
|
||||||
|
|
||||||
describe('terms', function () {
|
describe('terms', function () {
|
||||||
var AggConfig;
|
let AggConfig;
|
||||||
var indexPattern;
|
let indexPattern;
|
||||||
var Vis;
|
let Vis;
|
||||||
var createFilter;
|
let createFilter;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
|
|
|
@ -7,11 +7,11 @@ import VisProvider from 'ui/vis';
|
||||||
import AggTypesBucketsIntervalOptionsProvider from 'ui/agg_types/buckets/_interval_options';
|
import AggTypesBucketsIntervalOptionsProvider from 'ui/agg_types/buckets/_interval_options';
|
||||||
describe('editor', function () {
|
describe('editor', function () {
|
||||||
|
|
||||||
var indexPattern;
|
let indexPattern;
|
||||||
var vis;
|
let vis;
|
||||||
var agg;
|
let agg;
|
||||||
var render;
|
let render;
|
||||||
var $scope;
|
let $scope;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private, $injector, $compile) {
|
beforeEach(ngMock.inject(function (Private, $injector, $compile) {
|
||||||
|
@ -69,9 +69,9 @@ describe('editor', function () {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
describe('random field/interval', function () {
|
describe('random field/interval', function () {
|
||||||
var params;
|
let params;
|
||||||
var field;
|
let field;
|
||||||
var interval;
|
let interval;
|
||||||
|
|
||||||
beforeEach(ngMock.inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
field = _.sample(indexPattern.fields);
|
field = _.sample(indexPattern.fields);
|
||||||
|
@ -97,7 +97,7 @@ describe('editor', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('interval "auto" and indexPattern timeField', function () {
|
describe('interval "auto" and indexPattern timeField', function () {
|
||||||
var params;
|
let params;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
params = render({ field: indexPattern.timeFieldName, interval: 'auto' });
|
params = render({ field: indexPattern.timeFieldName, interval: 'auto' });
|
||||||
|
|
|
@ -8,13 +8,13 @@ import AggTypesIndexProvider from 'ui/agg_types/index';
|
||||||
import VisAggConfigProvider from 'ui/vis/agg_config';
|
import VisAggConfigProvider from 'ui/vis/agg_config';
|
||||||
describe('params', function () {
|
describe('params', function () {
|
||||||
|
|
||||||
var paramWriter;
|
let paramWriter;
|
||||||
var writeInterval;
|
let writeInterval;
|
||||||
|
|
||||||
var aggTypes;
|
let aggTypes;
|
||||||
var AggConfig;
|
let AggConfig;
|
||||||
var setTimeBounds;
|
let setTimeBounds;
|
||||||
var timeField;
|
let timeField;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private, $injector) {
|
beforeEach(ngMock.inject(function (Private, $injector) {
|
||||||
|
|
|
@ -7,9 +7,9 @@ import 'ui/number_list';
|
||||||
describe('NumberList directive', function () {
|
describe('NumberList directive', function () {
|
||||||
|
|
||||||
|
|
||||||
var $el;
|
let $el;
|
||||||
var $scope;
|
let $scope;
|
||||||
var compile;
|
let compile;
|
||||||
|
|
||||||
function onlyValidValues() {
|
function onlyValidValues() {
|
||||||
return $el.find('[ng-model]').toArray().map(function (el) {
|
return $el.find('[ng-model]').toArray().map(function (el) {
|
||||||
|
|
|
@ -12,8 +12,8 @@ import AggTypesMetricsMetricAggTypeProvider from 'ui/agg_types/metrics/metric_ag
|
||||||
describe('AggTypesComponent', function () {
|
describe('AggTypesComponent', function () {
|
||||||
|
|
||||||
describe('bucket aggs', function () {
|
describe('bucket aggs', function () {
|
||||||
var bucketAggs;
|
let bucketAggs;
|
||||||
var BucketAggType;
|
let BucketAggType;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
|
@ -29,8 +29,8 @@ describe('AggTypesComponent', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('metric aggs', function () {
|
describe('metric aggs', function () {
|
||||||
var metricAggs;
|
let metricAggs;
|
||||||
var MetricAggType;
|
let MetricAggType;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
|
|
|
@ -7,11 +7,11 @@ import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logsta
|
||||||
import AggTypesParamTypesCalculateIntervalProvider from 'ui/agg_types/param_types/_calculate_interval';
|
import AggTypesParamTypesCalculateIntervalProvider from 'ui/agg_types/param_types/_calculate_interval';
|
||||||
|
|
||||||
describe('calculateInterval()', function () {
|
describe('calculateInterval()', function () {
|
||||||
var AggConfig;
|
let AggConfig;
|
||||||
var indexPattern;
|
let indexPattern;
|
||||||
var Vis;
|
let Vis;
|
||||||
var createFilter;
|
let createFilter;
|
||||||
var calculateInterval;
|
let calculateInterval;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
|
|
|
@ -5,8 +5,8 @@ import AggTypesParamTypesBaseProvider from 'ui/agg_types/param_types/base';
|
||||||
import AggTypesParamTypesFieldProvider from 'ui/agg_types/param_types/field';
|
import AggTypesParamTypesFieldProvider from 'ui/agg_types/param_types/field';
|
||||||
describe('Field', function () {
|
describe('Field', function () {
|
||||||
|
|
||||||
var BaseAggParam;
|
let BaseAggParam;
|
||||||
var FieldAggParam;
|
let FieldAggParam;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
// fetch out deps
|
// fetch out deps
|
||||||
|
|
|
@ -5,8 +5,8 @@ import AggTypesParamTypesBaseProvider from 'ui/agg_types/param_types/base';
|
||||||
import AggTypesParamTypesOptionedProvider from 'ui/agg_types/param_types/optioned';
|
import AggTypesParamTypesOptionedProvider from 'ui/agg_types/param_types/optioned';
|
||||||
describe('Optioned', function () {
|
describe('Optioned', function () {
|
||||||
|
|
||||||
var BaseAggParam;
|
let BaseAggParam;
|
||||||
var OptionedAggParam;
|
let OptionedAggParam;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
// fetch out deps
|
// fetch out deps
|
||||||
|
|
|
@ -7,11 +7,11 @@ import AggTypesParamTypesRawJsonProvider from 'ui/agg_types/param_types/raw_json
|
||||||
|
|
||||||
module.exports = describe('JSON', function () {
|
module.exports = describe('JSON', function () {
|
||||||
var paramName = 'json_test';
|
var paramName = 'json_test';
|
||||||
var BaseAggParam;
|
let BaseAggParam;
|
||||||
var JsonAggParam;
|
let JsonAggParam;
|
||||||
var aggParam;
|
let aggParam;
|
||||||
var aggConfig;
|
let aggConfig;
|
||||||
var output;
|
let output;
|
||||||
|
|
||||||
function initAggParam(config) {
|
function initAggParam(config) {
|
||||||
config = config || {};
|
config = config || {};
|
||||||
|
|
|
@ -7,10 +7,10 @@ import VisProvider from 'ui/vis';
|
||||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||||
describe('Regex', function () {
|
describe('Regex', function () {
|
||||||
|
|
||||||
var BaseAggParam;
|
let BaseAggParam;
|
||||||
var RegexAggParam;
|
let RegexAggParam;
|
||||||
var Vis;
|
let Vis;
|
||||||
var indexPattern;
|
let indexPattern;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
// fetch out deps
|
// fetch out deps
|
||||||
|
@ -34,8 +34,8 @@ describe('Regex', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('write results', function () {
|
describe('write results', function () {
|
||||||
var aggParam;
|
let aggParam;
|
||||||
var aggConfig;
|
let aggConfig;
|
||||||
var output = { params: {} };
|
var output = { params: {} };
|
||||||
var paramName = 'exclude';
|
var paramName = 'exclude';
|
||||||
|
|
||||||
|
|
|
@ -6,11 +6,11 @@ import AggTypesParamTypesStringProvider from 'ui/agg_types/param_types/string';
|
||||||
|
|
||||||
module.exports = describe('String', function () {
|
module.exports = describe('String', function () {
|
||||||
var paramName = 'json_test';
|
var paramName = 'json_test';
|
||||||
var BaseAggParam;
|
let BaseAggParam;
|
||||||
var StringAggParam;
|
let StringAggParam;
|
||||||
var aggParam;
|
let aggParam;
|
||||||
var aggConfig;
|
let aggConfig;
|
||||||
var output;
|
let output;
|
||||||
|
|
||||||
function initAggParam(config) {
|
function initAggParam(config) {
|
||||||
config = config || {};
|
config = config || {};
|
||||||
|
|
|
@ -2,7 +2,7 @@ import CidrMask from 'ui/utils/cidr_mask';
|
||||||
import buildRangeFilter from 'ui/filter_manager/lib/range';
|
import buildRangeFilter from 'ui/filter_manager/lib/range';
|
||||||
export default function createIpRangeFilterProvider() {
|
export default function createIpRangeFilterProvider() {
|
||||||
return function (aggConfig, key) {
|
return function (aggConfig, key) {
|
||||||
var range;
|
let range;
|
||||||
if (aggConfig.params.ipRangeType === 'mask') {
|
if (aggConfig.params.ipRangeType === 'mask') {
|
||||||
range = new CidrMask(key).getRange();
|
range = new CidrMask(key).getRange();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -45,7 +45,7 @@ export default function DateHistogramAggType(timefilter, config, Private) {
|
||||||
},
|
},
|
||||||
createFilter: createFilter,
|
createFilter: createFilter,
|
||||||
decorateAggConfig: function () {
|
decorateAggConfig: function () {
|
||||||
var buckets;
|
let buckets;
|
||||||
return {
|
return {
|
||||||
buckets: {
|
buckets: {
|
||||||
configurable: true,
|
configurable: true,
|
||||||
|
|
|
@ -25,7 +25,7 @@ export default function RawJSONAggParamFactory(Private) {
|
||||||
* @return {undefined}
|
* @return {undefined}
|
||||||
*/
|
*/
|
||||||
RawJSONAggParam.prototype.write = function (aggConfig, output) {
|
RawJSONAggParam.prototype.write = function (aggConfig, output) {
|
||||||
var paramJSON;
|
let paramJSON;
|
||||||
var param = aggConfig.params[this.name];
|
var param = aggConfig.params[this.name];
|
||||||
|
|
||||||
if (!param) {
|
if (!param) {
|
||||||
|
|
|
@ -3,8 +3,8 @@ import expect from 'expect.js';
|
||||||
import ngMock from 'ng_mock';
|
import ngMock from 'ng_mock';
|
||||||
describe('$scope.$bind', function () {
|
describe('$scope.$bind', function () {
|
||||||
|
|
||||||
var $rootScope;
|
let $rootScope;
|
||||||
var $scope;
|
let $scope;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function ($injector) {
|
beforeEach(ngMock.inject(function ($injector) {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import Binder from 'ui/binder';
|
||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
|
|
||||||
describe('Binder class', function () {
|
describe('Binder class', function () {
|
||||||
var $scope;
|
let $scope;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function ($rootScope) {
|
beforeEach(ngMock.inject(function ($rootScope) {
|
||||||
|
|
|
@ -12,7 +12,7 @@ import 'ui/chrome';
|
||||||
import '../app_switcher';
|
import '../app_switcher';
|
||||||
|
|
||||||
describe('appSwitcher directive', function () {
|
describe('appSwitcher directive', function () {
|
||||||
var env;
|
let env;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ uiModules
|
||||||
|
|
||||||
// Break the recursion loop by removing the contents
|
// Break the recursion loop by removing the contents
|
||||||
var contents = element.contents().remove();
|
var contents = element.contents().remove();
|
||||||
var compiledContents;
|
let compiledContents;
|
||||||
return {
|
return {
|
||||||
pre: (link && link.pre) ? link.pre : null,
|
pre: (link && link.pre) ? link.pre : null,
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,9 +2,9 @@ import expect from 'expect.js';
|
||||||
import ngMock from 'ng_mock';
|
import ngMock from 'ng_mock';
|
||||||
import ConfigDefaultsProvider from 'ui/config/defaults';
|
import ConfigDefaultsProvider from 'ui/config/defaults';
|
||||||
describe('config component', function () {
|
describe('config component', function () {
|
||||||
var $scope;
|
let $scope;
|
||||||
var config;
|
let config;
|
||||||
var defaults;
|
let defaults;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function ($injector, Private) {
|
beforeEach(ngMock.inject(function ($injector, Private) {
|
||||||
|
|
|
@ -12,7 +12,7 @@ export default function DelayedUpdaterFactory(Private, $rootScope, Promise) {
|
||||||
var updater = this;
|
var updater = this;
|
||||||
var queue = [];
|
var queue = [];
|
||||||
var log = {};
|
var log = {};
|
||||||
var timer;
|
let timer;
|
||||||
|
|
||||||
updater.fire = function () {
|
updater.fire = function () {
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
|
@ -21,8 +21,8 @@ export default function DelayedUpdaterFactory(Private, $rootScope, Promise) {
|
||||||
if (updater.fired) return;
|
if (updater.fired) return;
|
||||||
updater.fired = true;
|
updater.fired = true;
|
||||||
|
|
||||||
var method;
|
let method;
|
||||||
var body;
|
let body;
|
||||||
var updated = [];
|
var updated = [];
|
||||||
var deleted = [];
|
var deleted = [];
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ module.service('config', function (Private, kbnVersion, kbnIndex, $rootScope, bu
|
||||||
|
|
||||||
// active or previous instance of DelayedUpdater. This will log and then process an
|
// active or previous instance of DelayedUpdater. This will log and then process an
|
||||||
// update once it is requested by calling #set() or #clear().
|
// update once it is requested by calling #set() or #clear().
|
||||||
var updater;
|
let updater;
|
||||||
|
|
||||||
var DocSource = Private(DocSourceProvider);
|
var DocSource = Private(DocSourceProvider);
|
||||||
var doc = (new DocSource())
|
var doc = (new DocSource())
|
||||||
|
@ -82,7 +82,7 @@ module.service('config', function (Private, kbnVersion, kbnIndex, $rootScope, bu
|
||||||
});
|
});
|
||||||
|
|
||||||
config.get = function (key, defaultVal) {
|
config.get = function (key, defaultVal) {
|
||||||
var keyVal;
|
let keyVal;
|
||||||
|
|
||||||
if (vals[key] == null) {
|
if (vals[key] == null) {
|
||||||
if (defaultVal == null) {
|
if (defaultVal == null) {
|
||||||
|
|
|
@ -6,13 +6,13 @@ import DecorateQueryProvider from 'ui/courier/data_source/_decorate_query';
|
||||||
|
|
||||||
describe('Query decorator', function () {
|
describe('Query decorator', function () {
|
||||||
|
|
||||||
var config;
|
let config;
|
||||||
|
|
||||||
var indexPattern;
|
let indexPattern;
|
||||||
|
|
||||||
var getComputedFields;
|
let getComputedFields;
|
||||||
|
|
||||||
var fn;
|
let fn;
|
||||||
beforeEach(ngMock.module(
|
beforeEach(ngMock.module(
|
||||||
'kibana',
|
'kibana',
|
||||||
function ($provide) {
|
function ($provide) {
|
||||||
|
|
|
@ -5,9 +5,9 @@ import NormalizeSortRequestProvider from 'ui/courier/data_source/_normalize_sort
|
||||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||||
|
|
||||||
describe('SearchSource#normalizeSortRequest', function () {
|
describe('SearchSource#normalizeSortRequest', function () {
|
||||||
var normalizeSortRequest;
|
let normalizeSortRequest;
|
||||||
var indexPattern;
|
let indexPattern;
|
||||||
var normalizedSort;
|
let normalizedSort;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(ngMock.inject(function (Private) {
|
beforeEach(ngMock.inject(function (Private) {
|
||||||
|
|
|
@ -33,7 +33,7 @@ export default function (Promise, Private, es) {
|
||||||
doc._storeVersion(resp._version);
|
doc._storeVersion(resp._version);
|
||||||
doc.id(resp._id);
|
doc.id(resp._id);
|
||||||
|
|
||||||
var docFetchProm;
|
let docFetchProm;
|
||||||
if (method !== 'index') {
|
if (method !== 'index') {
|
||||||
docFetchProm = doc.fetch();
|
docFetchProm = doc.fetch();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -28,7 +28,7 @@ export default function normalizeSortRequest(config) {
|
||||||
var indexField = indexPattern.fields.byName[sortField];
|
var indexField = indexPattern.fields.byName[sortField];
|
||||||
|
|
||||||
if (indexField && indexField.scripted && indexField.sortable) {
|
if (indexField && indexField.scripted && indexField.sortable) {
|
||||||
var direction;
|
let direction;
|
||||||
if (_.isString(sortValue)) direction = sortValue;
|
if (_.isString(sortValue)) direction = sortValue;
|
||||||
if (_.isObject(sortValue) && sortValue.order) direction = sortValue.order;
|
if (_.isObject(sortValue) && sortValue.order) direction = sortValue.order;
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ export default function RootSearchSource(Private, $rootScope, timefilter, Notifi
|
||||||
return timefilter.get(globalSource.get('index'));
|
return timefilter.get(globalSource.get('index'));
|
||||||
});
|
});
|
||||||
|
|
||||||
var appSource; // set in setAppSource()
|
let appSource; // set in setAppSource()
|
||||||
resetAppSource();
|
resetAppSource();
|
||||||
|
|
||||||
// when the route changes, clear the appSource
|
// when the route changes, clear the appSource
|
||||||
|
|
|
@ -151,7 +151,7 @@ export default function SavedObjectFactory(es, kbnIndex, Promise, Private, Notif
|
||||||
if (!self.searchSource) return;
|
if (!self.searchSource) return;
|
||||||
|
|
||||||
// if we have a searchSource, set its state based on the searchSourceJSON field
|
// if we have a searchSource, set its state based on the searchSourceJSON field
|
||||||
var state;
|
let state;
|
||||||
try {
|
try {
|
||||||
state = JSON.parse(searchSourceJson);
|
state = JSON.parse(searchSourceJson);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -3,9 +3,9 @@ import sinon from 'auto-release-sinon';
|
||||||
import expect from 'expect.js';
|
import expect from 'expect.js';
|
||||||
import ngMock from 'ng_mock';
|
import ngMock from 'ng_mock';
|
||||||
|
|
||||||
var debounce;
|
let debounce;
|
||||||
var $timeout;
|
let $timeout;
|
||||||
var $timeoutSpy;
|
let $timeoutSpy;
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
ngMock.module('kibana');
|
ngMock.module('kibana');
|
||||||
|
@ -19,7 +19,7 @@ function init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
describe('debounce service', function () {
|
describe('debounce service', function () {
|
||||||
var spy;
|
let spy;
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
spy = sinon.spy(function () {});
|
spy = sinon.spy(function () {});
|
||||||
init();
|
init();
|
||||||
|
|
|
@ -7,10 +7,10 @@ var module = uiModules.get('kibana');
|
||||||
|
|
||||||
module.service('debounce', ['$timeout', function ($timeout) {
|
module.service('debounce', ['$timeout', function ($timeout) {
|
||||||
return function (func, wait, options) {
|
return function (func, wait, options) {
|
||||||
var timeout;
|
let timeout;
|
||||||
var args;
|
let args;
|
||||||
var self;
|
let self;
|
||||||
var result;
|
let result;
|
||||||
options = _.defaults(options || {}, {
|
options = _.defaults(options || {}, {
|
||||||
leading: false,
|
leading: false,
|
||||||
trailing: true
|
trailing: true
|
||||||
|
|
|
@ -5,8 +5,8 @@ import ngMock from 'ng_mock';
|
||||||
import 'ui/directives/auto_select_if_only_one';
|
import 'ui/directives/auto_select_if_only_one';
|
||||||
|
|
||||||
describe('Auto-select if only one directive', function () {
|
describe('Auto-select if only one directive', function () {
|
||||||
var $compile;
|
let $compile;
|
||||||
var $rootScope;
|
let $rootScope;
|
||||||
var zeroOptions = [];
|
var zeroOptions = [];
|
||||||
var oneOption = [{label: 'foo'}];
|
var oneOption = [{label: 'foo'}];
|
||||||
var multiOptions = [{label: 'foo'}, {label: 'bar'}];
|
var multiOptions = [{label: 'foo'}, {label: 'bar'}];
|
||||||
|
|
|
@ -7,11 +7,11 @@ import 'ui/directives/confirm_click';
|
||||||
import 'plugins/kibana/discover/index';
|
import 'plugins/kibana/discover/index';
|
||||||
|
|
||||||
|
|
||||||
var $parentScope;
|
let $parentScope;
|
||||||
|
|
||||||
var $scope;
|
let $scope;
|
||||||
|
|
||||||
var $elem;
|
let $elem;
|
||||||
|
|
||||||
var init = function (text) {
|
var init = function (text) {
|
||||||
// Load the application
|
// Load the application
|
||||||
|
@ -47,7 +47,7 @@ describe('confirmClick directive', function () {
|
||||||
|
|
||||||
|
|
||||||
describe('event handlers', function () {
|
describe('event handlers', function () {
|
||||||
var events;
|
let events;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
init();
|
init();
|
||||||
|
@ -71,7 +71,7 @@ describe('confirmClick directive', function () {
|
||||||
|
|
||||||
|
|
||||||
describe('confirmed', function () {
|
describe('confirmed', function () {
|
||||||
var confirmed;
|
let confirmed;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
init();
|
init();
|
||||||
|
@ -98,7 +98,7 @@ describe('confirmClick directive', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('not confirmed', function () {
|
describe('not confirmed', function () {
|
||||||
var confirmed;
|
let confirmed;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
init();
|
init();
|
||||||
|
|
|
@ -4,11 +4,11 @@ import ngMock from 'ng_mock';
|
||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import 'plugins/kibana/discover/index';
|
import 'plugins/kibana/discover/index';
|
||||||
|
|
||||||
var $parentScope;
|
let $parentScope;
|
||||||
|
|
||||||
var $scope;
|
let $scope;
|
||||||
|
|
||||||
var $elem;
|
let $elem;
|
||||||
|
|
||||||
var init = function (expandable) {
|
var init = function (expandable) {
|
||||||
// Load the application
|
// Load the application
|
||||||
|
|
|
@ -8,7 +8,7 @@ import Promise from 'bluebird';
|
||||||
|
|
||||||
describe('FixedScroll directive', function () {
|
describe('FixedScroll directive', function () {
|
||||||
|
|
||||||
var compile;
|
let compile;
|
||||||
var trash = [];
|
var trash = [];
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
@ -112,10 +112,10 @@ describe('FixedScroll directive', function () {
|
||||||
{ from: '$scroller', to: '$container' }
|
{ from: '$scroller', to: '$container' }
|
||||||
].forEach(function (names) {
|
].forEach(function (names) {
|
||||||
describe('scroll events ' + JSON.stringify(names), function () {
|
describe('scroll events ' + JSON.stringify(names), function () {
|
||||||
var spy;
|
let spy;
|
||||||
var els;
|
let els;
|
||||||
var $from;
|
let $from;
|
||||||
var $to;
|
let $to;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
spy = sinon.spy($.fn, 'scrollLeft');
|
spy = sinon.spy($.fn, 'scrollLeft');
|
||||||
|
|
|
@ -4,9 +4,9 @@ import ngMock from 'ng_mock';
|
||||||
import 'ui/directives/inequality';
|
import 'ui/directives/inequality';
|
||||||
|
|
||||||
describe('greater_than model validator directive', function () {
|
describe('greater_than model validator directive', function () {
|
||||||
var $compile;
|
let $compile;
|
||||||
var $rootScope;
|
let $rootScope;
|
||||||
var html;
|
let html;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ describe('greater_than model validator directive', function () {
|
||||||
|
|
||||||
// no value is the same as 0
|
// no value is the same as 0
|
||||||
describe('without value', function () {
|
describe('without value', function () {
|
||||||
var element;
|
let element;
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
html = '<input type="text" ng-model="value" greater-than />';
|
html = '<input type="text" ng-model="value" greater-than />';
|
||||||
element = $compile(html)($rootScope);
|
element = $compile(html)($rootScope);
|
||||||
|
@ -44,7 +44,7 @@ describe('greater_than model validator directive', function () {
|
||||||
|
|
||||||
[0, 1, 10, 42, -12].forEach(function (num) {
|
[0, 1, 10, 42, -12].forEach(function (num) {
|
||||||
describe('with value ' + num, function () {
|
describe('with value ' + num, function () {
|
||||||
var element;
|
let element;
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
html = '<input type="text" ng-model="value" greater-than="' + num + '" />';
|
html = '<input type="text" ng-model="value" greater-than="' + num + '" />';
|
||||||
element = $compile(html)($rootScope);
|
element = $compile(html)($rootScope);
|
||||||
|
|
|
@ -5,13 +5,13 @@ import $ from 'jquery';
|
||||||
import 'ui/directives/input_focus';
|
import 'ui/directives/input_focus';
|
||||||
|
|
||||||
describe('Input focus directive', function () {
|
describe('Input focus directive', function () {
|
||||||
var $compile;
|
let $compile;
|
||||||
var $rootScope;
|
let $rootScope;
|
||||||
var $timeout;
|
let $timeout;
|
||||||
var element;
|
let element;
|
||||||
var $el;
|
let $el;
|
||||||
var selectedEl;
|
let selectedEl;
|
||||||
var selectedText;
|
let selectedText;
|
||||||
var inputValue = 'Input Text Value';
|
var inputValue = 'Input Text Value';
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
|
|
@ -4,8 +4,8 @@ import ngMock from 'ng_mock';
|
||||||
import 'ui/directives/input_whole_number';
|
import 'ui/directives/input_whole_number';
|
||||||
|
|
||||||
describe('Whole number input directive', function () {
|
describe('Whole number input directive', function () {
|
||||||
var $compile;
|
let $compile;
|
||||||
var $rootScope;
|
let $rootScope;
|
||||||
var html = '<input type="text" ng-model="value" input-whole-number />';
|
var html = '<input type="text" ng-model="value" input-whole-number />';
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
|
|
@ -5,10 +5,10 @@ import 'ui/directives/json_input';
|
||||||
|
|
||||||
|
|
||||||
describe('JSON input validation', function () {
|
describe('JSON input validation', function () {
|
||||||
var $compile;
|
let $compile;
|
||||||
var $rootScope;
|
let $rootScope;
|
||||||
var html = '<input ng-model="value" json-input require-keys=true />';
|
var html = '<input ng-model="value" json-input require-keys=true />';
|
||||||
var element;
|
let element;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
|
||||||
|
|
|
@ -5,18 +5,18 @@ import ngMock from 'ng_mock';
|
||||||
|
|
||||||
// Load the kibana app dependencies.
|
// Load the kibana app dependencies.
|
||||||
|
|
||||||
var $rootScope;
|
let $rootScope;
|
||||||
var $timeout;
|
let $timeout;
|
||||||
var $compile;
|
let $compile;
|
||||||
var Promise;
|
let Promise;
|
||||||
var Private;
|
let Private;
|
||||||
var config;
|
let config;
|
||||||
var $elemScope;
|
let $elemScope;
|
||||||
var $elem;
|
let $elem;
|
||||||
|
|
||||||
var cycleIndex = 0;
|
var cycleIndex = 0;
|
||||||
var markup = '<input ng-model="mockModel" parse-query input-focus type="text">';
|
var markup = '<input ng-model="mockModel" parse-query input-focus type="text">';
|
||||||
var fromUser;
|
let fromUser;
|
||||||
import toUser from 'ui/parse_query/lib/to_user';
|
import toUser from 'ui/parse_query/lib/to_user';
|
||||||
import 'ui/parse_query';
|
import 'ui/parse_query';
|
||||||
import ParseQueryLibFromUserProvider from 'ui/parse_query/lib/from_user';
|
import ParseQueryLibFromUserProvider from 'ui/parse_query/lib/from_user';
|
||||||
|
@ -102,7 +102,7 @@ describe('parse-query directive', function () {
|
||||||
|
|
||||||
describe('model presentation formatter', function () {
|
describe('model presentation formatter', function () {
|
||||||
it('should present undefined as empty string', function () {
|
it('should present undefined as empty string', function () {
|
||||||
var notDefined;
|
let notDefined;
|
||||||
expect(toUser(notDefined)).to.be('');
|
expect(toUser(notDefined)).to.be('');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -12,13 +12,13 @@ import 'plugins/kibana/discover/index';
|
||||||
|
|
||||||
// TODO: This should not be needed, timefilter is only included here, it should move
|
// TODO: This should not be needed, timefilter is only included here, it should move
|
||||||
|
|
||||||
var $parentScope;
|
let $parentScope;
|
||||||
|
|
||||||
var $scope;
|
let $scope;
|
||||||
|
|
||||||
var $elem;
|
let $elem;
|
||||||
var anchor = '2014-01-01T06:06:06.666Z';
|
var anchor = '2014-01-01T06:06:06.666Z';
|
||||||
var clock;
|
let clock;
|
||||||
|
|
||||||
var init = function () {
|
var init = function () {
|
||||||
// Load the application
|
// Load the application
|
||||||
|
@ -85,7 +85,7 @@ describe('timepicker directive', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('refresh interval', function () {
|
describe('refresh interval', function () {
|
||||||
var $courier;
|
let $courier;
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
init();
|
init();
|
||||||
ngMock.inject(function (courier, $rootScope) {
|
ngMock.inject(function (courier, $rootScope) {
|
||||||
|
@ -232,7 +232,7 @@ describe('timepicker directive', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('disables the submit button if the form is invalid', function (done) {
|
it('disables the submit button if the form is invalid', function (done) {
|
||||||
var button;
|
let button;
|
||||||
button = $elem.find('button[disabled]');
|
button = $elem.find('button[disabled]');
|
||||||
expect(button.length).to.be(0);
|
expect(button.length).to.be(0);
|
||||||
|
|
||||||
|
@ -359,7 +359,7 @@ describe('timepicker directive', function () {
|
||||||
|
|
||||||
describe('absolute mode', function () {
|
describe('absolute mode', function () {
|
||||||
|
|
||||||
var inputs;
|
let inputs;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
init();
|
init();
|
||||||
|
|
|
@ -5,11 +5,11 @@ import $ from 'jquery';
|
||||||
import 'plugins/kibana/discover/index';
|
import 'plugins/kibana/discover/index';
|
||||||
|
|
||||||
|
|
||||||
var $parentScope;
|
let $parentScope;
|
||||||
|
|
||||||
var $scope;
|
let $scope;
|
||||||
|
|
||||||
var $elem;
|
let $elem;
|
||||||
|
|
||||||
var init = function (text) {
|
var init = function (text) {
|
||||||
// Load the application
|
// Load the application
|
||||||
|
|
|
@ -9,12 +9,12 @@ import 'plugins/kibana/discover/index';
|
||||||
|
|
||||||
var typeaheadHistoryCount = 10;
|
var typeaheadHistoryCount = 10;
|
||||||
var typeaheadName = 'unittest';
|
var typeaheadName = 'unittest';
|
||||||
var $parentScope;
|
let $parentScope;
|
||||||
var $typeaheadScope;
|
let $typeaheadScope;
|
||||||
var $elem;
|
let $elem;
|
||||||
var $typeaheadInputScope;
|
let $typeaheadInputScope;
|
||||||
var typeaheadCtrl;
|
let typeaheadCtrl;
|
||||||
var PersistedLog;
|
let PersistedLog;
|
||||||
|
|
||||||
var markup = '<div class="typeahead" kbn-typeahead="' + typeaheadName + '">' +
|
var markup = '<div class="typeahead" kbn-typeahead="' + typeaheadName + '">' +
|
||||||
'<input type="text" placeholder="Filter..." class="form-control" ng-model="query" kbn-typeahead-input>' +
|
'<input type="text" placeholder="Filter..." class="form-control" ng-model="query" kbn-typeahead-input>' +
|
||||||
|
|
|
@ -5,8 +5,8 @@ import 'ui/directives/validate_cidr_mask';
|
||||||
|
|
||||||
|
|
||||||
describe('Validate CIDR mask directive', function () {
|
describe('Validate CIDR mask directive', function () {
|
||||||
var $compile;
|
let $compile;
|
||||||
var $rootScope;
|
let $rootScope;
|
||||||
var html = '<input type="text" ng-model="value" validate-cidr-mask />';
|
var html = '<input type="text" ng-model="value" validate-cidr-mask />';
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
|
|
@ -5,8 +5,8 @@ import 'ui/directives/validate_date_math';
|
||||||
|
|
||||||
|
|
||||||
describe('Validate date math directive', function () {
|
describe('Validate date math directive', function () {
|
||||||
var $compile;
|
let $compile;
|
||||||
var $rootScope;
|
let $rootScope;
|
||||||
var html = '<input type="text" ng-model="value" validate-date-math />';
|
var html = '<input type="text" ng-model="value" validate-date-math />';
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
|
|
@ -6,8 +6,8 @@ import 'ui/directives/validate_index_name';
|
||||||
// Load the kibana app dependencies.
|
// Load the kibana app dependencies.
|
||||||
|
|
||||||
describe('Validate index name directive', function () {
|
describe('Validate index name directive', function () {
|
||||||
var $compile;
|
let $compile;
|
||||||
var $rootScope;
|
let $rootScope;
|
||||||
var html = '<input type="text" ng-model="indexName" validate-index-name />';
|
var html = '<input type="text" ng-model="indexName" validate-index-name />';
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
|
|
@ -5,8 +5,8 @@ import 'ui/directives/validate_ip';
|
||||||
|
|
||||||
|
|
||||||
describe('Validate IP directive', function () {
|
describe('Validate IP directive', function () {
|
||||||
var $compile;
|
let $compile;
|
||||||
var $rootScope;
|
let $rootScope;
|
||||||
var html = '<input type="text" ng-model="value" validate-ip />';
|
var html = '<input type="text" ng-model="value" validate-ip />';
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
|
|
@ -5,9 +5,9 @@ import 'ui/directives/validate_json';
|
||||||
|
|
||||||
// Load the kibana app dependencies.
|
// Load the kibana app dependencies.
|
||||||
|
|
||||||
var $parentScope;
|
let $parentScope;
|
||||||
var $elemScope;
|
let $elemScope;
|
||||||
var $elem;
|
let $elem;
|
||||||
var mockScope = '';
|
var mockScope = '';
|
||||||
|
|
||||||
var input = {
|
var input = {
|
||||||
|
|
|
@ -10,7 +10,7 @@ module.directive('kbnInfiniteScroll', function () {
|
||||||
},
|
},
|
||||||
link: function ($scope, $element, attrs) {
|
link: function ($scope, $element, attrs) {
|
||||||
var $window = $(window);
|
var $window = $(window);
|
||||||
var checkTimer;
|
let checkTimer;
|
||||||
|
|
||||||
function onScroll() {
|
function onScroll() {
|
||||||
if (!$scope.more) return;
|
if (!$scope.more) return;
|
||||||
|
|
|
@ -106,7 +106,7 @@ uiModules.get('kibana')
|
||||||
var count = perPage ? Math.ceil($scope.list.length / perPage) : 1;
|
var count = perPage ? Math.ceil($scope.list.length / perPage) : 1;
|
||||||
|
|
||||||
_.times(count, function (i) {
|
_.times(count, function (i) {
|
||||||
var page;
|
let page;
|
||||||
|
|
||||||
if (perPage) {
|
if (perPage) {
|
||||||
var start = perPage * i;
|
var start = perPage * i;
|
||||||
|
|
|
@ -23,7 +23,7 @@ module.directive('prettyDuration', function (config, quickRanges, timeUnits) {
|
||||||
});
|
});
|
||||||
|
|
||||||
function stringify() {
|
function stringify() {
|
||||||
var text;
|
let text;
|
||||||
// If both parts are date math, try to look up a reasonable string
|
// If both parts are date math, try to look up a reasonable string
|
||||||
if ($scope.from && $scope.to && !moment.isMoment($scope.from) && !moment.isMoment($scope.to)) {
|
if ($scope.from && $scope.to && !moment.isMoment($scope.from) && !moment.isMoment($scope.to)) {
|
||||||
var tryLookup = lookupByRange[$scope.from.toString() + ' to ' + $scope.to.toString()];
|
var tryLookup = lookupByRange[$scope.from.toString() + ' to ' + $scope.to.toString()];
|
||||||
|
|
|
@ -38,7 +38,7 @@ module.directive('savedObjectFinder', function ($location, $injector, kbnUrl, Pr
|
||||||
var currentFilter = $scope.filter;
|
var currentFilter = $scope.filter;
|
||||||
|
|
||||||
// the most recently entered search/filter
|
// the most recently entered search/filter
|
||||||
var prevSearch;
|
let prevSearch;
|
||||||
|
|
||||||
// the list of hits, used to render display
|
// the list of hits, used to render display
|
||||||
self.hits = [];
|
self.hits = [];
|
||||||
|
|
|
@ -12,16 +12,16 @@ import FixturesStubbedSearchSourceProvider from 'fixtures/stubbed_search_source'
|
||||||
// Load the kibana app dependencies.
|
// Load the kibana app dependencies.
|
||||||
|
|
||||||
|
|
||||||
var $parentScope;
|
let $parentScope;
|
||||||
|
|
||||||
|
|
||||||
var $scope;
|
let $scope;
|
||||||
|
|
||||||
|
|
||||||
var $timeout;
|
let $timeout;
|
||||||
|
|
||||||
|
|
||||||
var searchSource;
|
let searchSource;
|
||||||
|
|
||||||
var init = function ($elem, props) {
|
var init = function ($elem, props) {
|
||||||
ngMock.inject(function ($rootScope, $compile, _$timeout_) {
|
ngMock.inject(function ($rootScope, $compile, _$timeout_) {
|
||||||
|
@ -47,7 +47,7 @@ var destroy = function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
describe('docTable', function () {
|
describe('docTable', function () {
|
||||||
var $elem;
|
let $elem;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
|
|
|
@ -3,7 +3,7 @@ var defaultSort = {time: 'desc'};
|
||||||
import expect from 'expect.js';
|
import expect from 'expect.js';
|
||||||
import ngMock from 'ng_mock';
|
import ngMock from 'ng_mock';
|
||||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||||
var indexPattern;
|
let indexPattern;
|
||||||
|
|
||||||
describe('docTable', function () {
|
describe('docTable', function () {
|
||||||
beforeEach(ngMock.module('kibana'));
|
beforeEach(ngMock.module('kibana'));
|
||||||
|
|
|
@ -10,14 +10,14 @@ import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logsta
|
||||||
|
|
||||||
describe('Doc Table', function () {
|
describe('Doc Table', function () {
|
||||||
|
|
||||||
var $parentScope;
|
let $parentScope;
|
||||||
|
|
||||||
var $scope;
|
let $scope;
|
||||||
|
|
||||||
var config;
|
let config;
|
||||||
|
|
||||||
// Stub out a minimal mapping of 4 fields
|
// Stub out a minimal mapping of 4 fields
|
||||||
var mapping;
|
let mapping;
|
||||||
|
|
||||||
beforeEach(ngMock.module('kibana', 'apps/discover'));
|
beforeEach(ngMock.module('kibana', 'apps/discover'));
|
||||||
beforeEach(ngMock.inject(function (_config_, $rootScope, Private) {
|
beforeEach(ngMock.inject(function (_config_, $rootScope, Private) {
|
||||||
|
@ -53,7 +53,7 @@ describe('Doc Table', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should be able to add and remove columns', function (done) {
|
it('should be able to add and remove columns', function (done) {
|
||||||
var childElems;
|
let childElems;
|
||||||
// Should include a column for toggling and the time column by default
|
// Should include a column for toggling and the time column by default
|
||||||
$parentScope.columns = ['bytes'];
|
$parentScope.columns = ['bytes'];
|
||||||
parentElem.scope().$digest();
|
parentElem.scope().$digest();
|
||||||
|
@ -245,7 +245,7 @@ describe('Doc Table', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('expanded', function () {
|
describe('expanded', function () {
|
||||||
var $details;
|
let $details;
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
// Open the row
|
// Open the row
|
||||||
$scope.toggleRow();
|
$scope.toggleRow();
|
||||||
|
@ -278,7 +278,7 @@ describe('Doc Table', function () {
|
||||||
'index-pattern="indexPattern"' +
|
'index-pattern="indexPattern"' +
|
||||||
'></tr>'
|
'></tr>'
|
||||||
);
|
);
|
||||||
var $details;
|
let $details;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
var row = getFakeRow(0, mapping);
|
var row = getFakeRow(0, mapping);
|
||||||
|
@ -312,10 +312,10 @@ describe('Doc Table', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('row diffing', function () {
|
describe('row diffing', function () {
|
||||||
var $row;
|
let $row;
|
||||||
var $scope;
|
let $scope;
|
||||||
var $root;
|
let $root;
|
||||||
var $before;
|
let $before;
|
||||||
|
|
||||||
beforeEach(ngMock.inject(function ($rootScope, $compile, Private) {
|
beforeEach(ngMock.inject(function ($rootScope, $compile, Private) {
|
||||||
$root = $rootScope;
|
$root = $rootScope;
|
||||||
|
|
|
@ -46,10 +46,10 @@ module.directive('kbnTableRow', function ($compile) {
|
||||||
};
|
};
|
||||||
|
|
||||||
// when we compile the details, we use this $scope
|
// when we compile the details, we use this $scope
|
||||||
var $detailsScope;
|
let $detailsScope;
|
||||||
|
|
||||||
// when we compile the toggle button in the summary, we use this $scope
|
// when we compile the toggle button in the summary, we use this $scope
|
||||||
var $toggleScope;
|
let $toggleScope;
|
||||||
|
|
||||||
// toggle display of the rows details, a full list of the fields from each row
|
// toggle display of the rows details, a full list of the fields from each row
|
||||||
$scope.toggleRow = function () {
|
$scope.toggleRow = function () {
|
||||||
|
|
|
@ -8,8 +8,8 @@ import _ from 'lodash';
|
||||||
*/
|
*/
|
||||||
function getSort(sort, indexPattern) {
|
function getSort(sort, indexPattern) {
|
||||||
var sortObj = {};
|
var sortObj = {};
|
||||||
var field;
|
let field;
|
||||||
var direction;
|
let direction;
|
||||||
|
|
||||||
function isSortable(field) {
|
function isSortable(field) {
|
||||||
return (indexPattern.fields.byName[field] && indexPattern.fields.byName[field].sortable);
|
return (indexPattern.fields.byName[field] && indexPattern.fields.byName[field].sortable);
|
||||||
|
|
|
@ -5,11 +5,11 @@ import ngMock from 'ng_mock';
|
||||||
import DocTitleProvider from 'ui/doc_title';
|
import DocTitleProvider from 'ui/doc_title';
|
||||||
|
|
||||||
describe('docTitle Service', function () {
|
describe('docTitle Service', function () {
|
||||||
var initialDocTitle;
|
let initialDocTitle;
|
||||||
var MAIN_TITLE = 'Kibana 4';
|
var MAIN_TITLE = 'Kibana 4';
|
||||||
|
|
||||||
var docTitle;
|
let docTitle;
|
||||||
var $rootScope;
|
let $rootScope;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
initialDocTitle = document.title;
|
initialDocTitle = document.title;
|
||||||
|
@ -61,7 +61,7 @@ describe('docTitle Service', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('#change', function () {
|
describe('#change', function () {
|
||||||
var getActiveTabStub;
|
let getActiveTabStub;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
getActiveTabStub = sinon.stub(require('ui/chrome'), 'getActiveTab');
|
getActiveTabStub = sinon.stub(require('ui/chrome'), 'getActiveTab');
|
||||||
|
|
|
@ -14,7 +14,7 @@ uiModules.get('kibana')
|
||||||
var baseTitle = document.title;
|
var baseTitle = document.title;
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
var lastChange;
|
let lastChange;
|
||||||
|
|
||||||
function render() {
|
function render() {
|
||||||
lastChange = lastChange || [];
|
lastChange = lastChange || [];
|
||||||
|
|
|
@ -2,7 +2,7 @@ import 'elasticsearch-browser';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import uiModules from 'ui/modules';
|
import uiModules from 'ui/modules';
|
||||||
|
|
||||||
var es; // share the client amoungst all apps
|
let es; // share the client amoungst all apps
|
||||||
uiModules
|
uiModules
|
||||||
.get('kibana', ['elasticsearch', 'kibana/config'])
|
.get('kibana', ['elasticsearch', 'kibana/config'])
|
||||||
.service('es', function (esFactory, esUrl, $q, esApiVersion, esRequestTimeout) {
|
.service('es', function (esFactory, esUrl, $q, esApiVersion, esRequestTimeout) {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue