Skip to content

Commit

Permalink
removing angular from AggConfigs (#17682) (#18895)
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/ui/public/agg_types/__tests__/buckets/_geo_hash.js
  • Loading branch information
ppisljar committed May 8, 2018
1 parent 5961589 commit 236a7e7
Show file tree
Hide file tree
Showing 5 changed files with 167 additions and 178 deletions.
2 changes: 0 additions & 2 deletions src/ui/public/agg_types/__tests__/buckets/_geo_hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import sinon from 'sinon';
import { geoHashBucketAgg } from '../../buckets/geo_hash';
import * as AggConfigModule from '../../../vis/agg_config';
import * as BucketAggTypeModule from '../../buckets/_bucket_agg_type';
import { aggTypes } from '../..';
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 '../agg_config';
import { VisProvider } from '..';
import { VisAggConfigsProvider } from '../agg_configs';
import { AggConfigs } from '../agg_configs';
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
import { Schemas } from '../editors/default/schemas';
import { IndexedArray } from '../../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 '../registry/field_formats';
import { aggTypes } from '../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 236a7e7

Please sign in to comment.