Skip to content

Commit

Permalink
removing angular from AggConfigs
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar committed Apr 18, 2018
1 parent 4577138 commit 5d626fe
Show file tree
Hide file tree
Showing 5 changed files with 167 additions and 179 deletions.
3 changes: 0 additions & 3 deletions src/ui/public/agg_types/__tests__/buckets/_geo_hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import sinon from 'sinon';
import { geoHashBucketAgg } from 'ui/agg_types/buckets/geo_hash';
import * as AggConfigModule from 'ui/vis/agg_config';
import * as BucketAggTypeModule from 'ui/agg_types/buckets/_bucket_agg_type';
import { aggTypes } from 'ui/agg_types/index';

AggConfigModule.AggConfig.aggTypes = aggTypes;

describe('Geohash Agg', () => {

Expand Down
4 changes: 1 addition & 3 deletions src/ui/public/vis/__tests__/_agg_configs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,18 @@ import expect from 'expect.js';
import ngMock from 'ng_mock';
import { AggConfig } from 'ui/vis/agg_config';
import { VisProvider } from 'ui/vis';
import { VisAggConfigsProvider } from 'ui/vis/agg_configs';
import { AggConfigs } from 'ui/vis/agg_configs';
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
import { Schemas } from 'ui/vis/editors/default/schemas';
import { IndexedArray } from 'ui/indexed_array';

describe('AggConfigs', function () {

let Vis;
let AggConfigs;
let indexPattern;

beforeEach(ngMock.module('kibana'));
beforeEach(ngMock.inject(function (Private) {
AggConfigs = Private(VisAggConfigsProvider);
// replace the AggConfig module with a spy

const spy = sinon.spy(AggConfig);
Expand Down
7 changes: 3 additions & 4 deletions src/ui/public/vis/agg_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

import _ from 'lodash';
import { fieldFormats } from 'ui/registry/field_formats';
import { aggTypes } from 'ui/agg_types/index';


function AggConfig(vis, opts) {
export function AggConfig(vis, opts) {
const self = this;

self.id = String(opts.id || AggConfig.nextId(vis.aggs));
Expand All @@ -29,6 +29,7 @@ function AggConfig(vis, opts) {
self.setParams(opts.params || {});
}

AggConfig.aggTypes = aggTypes;
/**
* Ensure that all of the objects in the list have ids, the objects
* and list are modified by reference.
Expand Down Expand Up @@ -337,5 +338,3 @@ AggConfig.prototype.fieldIsTimeField = function () {
const timeFieldName = this.vis.indexPattern.timeFieldName;
return timeFieldName && this.fieldName() === timeFieldName;
};

export { AggConfig };
Loading

0 comments on commit 5d626fe

Please sign in to comment.