Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove angular from AggConfigs #17682

Merged
merged 1 commit into from
May 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 '../../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;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved from AggConfigs to AggConfig directly

/**
* 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