mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Move ui/agg_types in to shim data plugin (#56353)
This commit is contained in:
parent
2fc1f791c9
commit
5f9386471b
185 changed files with 1039 additions and 707 deletions
|
@ -21,7 +21,7 @@ import _ from 'lodash';
|
|||
import moment from 'moment';
|
||||
import expect from '@kbn/expect';
|
||||
|
||||
jest.mock('../../../../../ui/public/agg_types/agg_configs', () => ({
|
||||
jest.mock('../../search/aggs', () => ({
|
||||
AggConfigs: function AggConfigs() {
|
||||
return {
|
||||
createAggConfig: ({ params }) => ({
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
|
||||
// /// Define plugin function
|
||||
import { DataPlugin as Plugin, DataStart } from './plugin';
|
||||
import { DataPlugin as Plugin } from './plugin';
|
||||
|
||||
export function plugin() {
|
||||
return new Plugin();
|
||||
|
@ -27,14 +27,58 @@ export function plugin() {
|
|||
// /// Export types & static code
|
||||
|
||||
/** @public types */
|
||||
export { DataStart };
|
||||
export { DataSetup, DataStart } from './plugin';
|
||||
export {
|
||||
SavedQueryAttributes,
|
||||
SavedQuery,
|
||||
SavedQueryTimeFilter,
|
||||
} from '../../../../plugins/data/public';
|
||||
export {
|
||||
// agg_types
|
||||
AggParam,
|
||||
AggParamOption,
|
||||
DateRangeKey,
|
||||
IAggConfig,
|
||||
IAggConfigs,
|
||||
IAggType,
|
||||
IFieldParamType,
|
||||
IMetricAggType,
|
||||
IpRangeKey,
|
||||
ISchemas,
|
||||
OptionedParamEditorProps,
|
||||
OptionedValueProp,
|
||||
} from './search/types';
|
||||
|
||||
/** @public static code */
|
||||
export * from '../common';
|
||||
export { FilterStateManager } from './filter/filter_manager';
|
||||
export { getRequestInspectorStats, getResponseInspectorStats } from './search';
|
||||
export {
|
||||
// agg_types TODO need to group these under a namespace or prefix
|
||||
AggParamType,
|
||||
AggTypeFilters, // TODO convert to interface
|
||||
aggTypeFilters,
|
||||
AggTypeFieldFilters, // TODO convert to interface
|
||||
AggGroupNames,
|
||||
aggGroupNamesMap,
|
||||
BUCKET_TYPES,
|
||||
CidrMask,
|
||||
convertDateRangeToString,
|
||||
convertIPRangeToString,
|
||||
intervalOptions, // only used in Discover
|
||||
isDateHistogramBucketAggConfig,
|
||||
isStringType,
|
||||
isType,
|
||||
isValidInterval,
|
||||
isValidJson,
|
||||
METRIC_TYPES,
|
||||
OptionedParamType,
|
||||
parentPipelineType,
|
||||
propFilter,
|
||||
Schema,
|
||||
Schemas,
|
||||
siblingPipelineType,
|
||||
termsAggFilter,
|
||||
// search_source
|
||||
getRequestInspectorStats,
|
||||
getResponseInspectorStats,
|
||||
} from './search';
|
||||
|
|
|
@ -45,6 +45,8 @@ import {
|
|||
} from '../../../../plugins/embeddable/public/lib/triggers';
|
||||
import { IUiActionsSetup, IUiActionsStart } from '../../../../plugins/ui_actions/public';
|
||||
|
||||
import { SearchSetup, SearchStart, SearchService } from './search/search_service';
|
||||
|
||||
export interface DataPluginSetupDependencies {
|
||||
data: DataPublicPluginSetup;
|
||||
expressions: ExpressionsSetup;
|
||||
|
@ -56,12 +58,23 @@ export interface DataPluginStartDependencies {
|
|||
uiActions: IUiActionsStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface for this plugin's returned `setup` contract.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface DataSetup {
|
||||
search: SearchSetup;
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface for this plugin's returned `start` contract.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface DataStart {} // eslint-disable-line @typescript-eslint/no-empty-interface
|
||||
export interface DataStart {
|
||||
search: SearchStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Data Plugin - public
|
||||
|
@ -76,7 +89,10 @@ export interface DataStart {} // eslint-disable-line @typescript-eslint/no-empty
|
|||
*/
|
||||
|
||||
export class DataPlugin
|
||||
implements Plugin<void, DataStart, DataPluginSetupDependencies, DataPluginStartDependencies> {
|
||||
implements
|
||||
Plugin<DataSetup, DataStart, DataPluginSetupDependencies, DataPluginStartDependencies> {
|
||||
private readonly search = new SearchService();
|
||||
|
||||
public setup(core: CoreSetup, { data, uiActions }: DataPluginSetupDependencies) {
|
||||
setInjectedMetadata(core.injectedMetadata);
|
||||
|
||||
|
@ -89,6 +105,10 @@ export class DataPlugin
|
|||
uiActions.registerAction(
|
||||
valueClickAction(data.query.filterManager, data.query.timefilter.timefilter)
|
||||
);
|
||||
|
||||
return {
|
||||
search: this.search.setup(core),
|
||||
};
|
||||
}
|
||||
|
||||
public start(core: CoreStart, { data, uiActions }: DataPluginStartDependencies): DataStart {
|
||||
|
@ -102,7 +122,9 @@ export class DataPlugin
|
|||
uiActions.attachAction(SELECT_RANGE_TRIGGER, SELECT_RANGE_ACTION);
|
||||
uiActions.attachAction(VALUE_CLICK_TRIGGER, VALUE_CLICK_ACTION);
|
||||
|
||||
return {};
|
||||
return {
|
||||
search: this.search.start(core),
|
||||
};
|
||||
}
|
||||
|
||||
public stop() {}
|
||||
|
|
|
@ -24,7 +24,7 @@ import {
|
|||
mergeOtherBucketAggResponse,
|
||||
updateMissingBucket,
|
||||
} from '../../buckets/_terms_other_bucket_helper';
|
||||
import { Vis } from '../../../../../core_plugins/visualizations/public';
|
||||
import { Vis } from '../../../../../../../core_plugins/visualizations/public';
|
||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||
|
||||
const visConfigSingleTerm = {
|
|
@ -27,17 +27,17 @@
|
|||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { npStart } from 'ui/new_platform';
|
||||
import { AggType } from './agg_type';
|
||||
import { IAggType } from './agg_type';
|
||||
import { AggGroupNames } from './agg_groups';
|
||||
import { writeParams } from './agg_params';
|
||||
import { AggConfigs } from './agg_configs';
|
||||
import { IAggConfigs } from './agg_configs';
|
||||
import { Schema } from './schemas';
|
||||
import {
|
||||
ISearchSource,
|
||||
FetchOptions,
|
||||
fieldFormats,
|
||||
KBN_FIELD_TYPES,
|
||||
} from '../../../../plugins/data/public';
|
||||
} from '../../../../../../plugins/data/public';
|
||||
|
||||
export interface AggConfigOptions {
|
||||
enabled: boolean;
|
||||
|
@ -60,13 +60,13 @@ const unknownSchema: Schema = {
|
|||
group: AggGroupNames.Metrics,
|
||||
};
|
||||
|
||||
const getTypeFromRegistry = (type: string): AggType => {
|
||||
const getTypeFromRegistry = (type: string): IAggType => {
|
||||
// We need to inline require here, since we're having a cyclic dependency
|
||||
// from somewhere inside agg_types back to AggConfig.
|
||||
const aggTypes = require('./agg_types').aggTypes;
|
||||
const aggTypes = require('../aggs').aggTypes;
|
||||
const registeredType =
|
||||
aggTypes.metrics.find((agg: AggType) => agg.name === type) ||
|
||||
aggTypes.buckets.find((agg: AggType) => agg.name === type);
|
||||
aggTypes.metrics.find((agg: IAggType) => agg.name === type) ||
|
||||
aggTypes.buckets.find((agg: IAggType) => agg.name === type);
|
||||
|
||||
if (!registeredType) {
|
||||
throw new Error('unknown type');
|
||||
|
@ -85,6 +85,9 @@ const getSchemaFromRegistry = (schemas: any, schema: string): Schema => {
|
|||
return registeredSchema;
|
||||
};
|
||||
|
||||
// TODO need to make a more explicit interface for this
|
||||
export type IAggConfig = AggConfig;
|
||||
|
||||
export class AggConfig {
|
||||
/**
|
||||
* Ensure that all of the objects in the list have ids, the objects
|
||||
|
@ -122,19 +125,19 @@ export class AggConfig {
|
|||
);
|
||||
}
|
||||
|
||||
public aggConfigs: AggConfigs;
|
||||
public aggConfigs: IAggConfigs;
|
||||
public id: string;
|
||||
public enabled: boolean;
|
||||
public params: any;
|
||||
public parent?: AggConfigs;
|
||||
public parent?: IAggConfigs;
|
||||
public brandNew?: boolean;
|
||||
|
||||
private __schema: Schema;
|
||||
private __type: AggType;
|
||||
private __type: IAggType;
|
||||
private __typeDecorations: any;
|
||||
private subAggs: AggConfig[] = [];
|
||||
|
||||
constructor(aggConfigs: AggConfigs, opts: AggConfigOptions) {
|
||||
constructor(aggConfigs: IAggConfigs, opts: AggConfigOptions) {
|
||||
this.aggConfigs = aggConfigs;
|
||||
this.id = String(opts.id || AggConfig.nextId(aggConfigs.aggs as any));
|
||||
this.enabled = typeof opts.enabled === 'boolean' ? opts.enabled : true;
|
||||
|
@ -207,7 +210,7 @@ export class AggConfig {
|
|||
return _.get(this.params, key);
|
||||
}
|
||||
|
||||
write(aggs?: AggConfigs) {
|
||||
write(aggs?: IAggConfigs) {
|
||||
return writeParams<AggConfig>(this.type.params, this, aggs);
|
||||
}
|
||||
|
||||
|
@ -262,7 +265,7 @@ export class AggConfig {
|
|||
* @return {void|Object} - if the config has a dsl representation, it is
|
||||
* returned, else undefined is returned
|
||||
*/
|
||||
toDsl(aggConfigs?: AggConfigs) {
|
||||
toDsl(aggConfigs?: IAggConfigs) {
|
||||
if (this.type.hasNoDsl) return;
|
||||
const output = this.write(aggConfigs) as any;
|
||||
|
||||
|
@ -360,7 +363,7 @@ export class AggConfig {
|
|||
|
||||
if (!this.type) return '';
|
||||
return percentageMode
|
||||
? i18n.translate('common.ui.vis.aggConfig.percentageOfLabel', {
|
||||
? i18n.translate('data.search.aggs.percentageOfLabel', {
|
||||
defaultMessage: 'Percentage of {label}',
|
||||
values: { label: this.type.makeLabel(this) },
|
||||
})
|
||||
|
@ -448,7 +451,7 @@ export class AggConfig {
|
|||
});
|
||||
}
|
||||
|
||||
public setType(type: string | AggType) {
|
||||
public setType(type: string | IAggType) {
|
||||
this.type = typeof type === 'string' ? getTypeFromRegistry(type) : type;
|
||||
}
|
||||
|
|
@ -35,7 +35,7 @@ import {
|
|||
ISearchSource,
|
||||
FetchOptions,
|
||||
TimeRange,
|
||||
} from '../../../../plugins/data/public';
|
||||
} from '../../../../../../plugins/data/public';
|
||||
|
||||
type Schemas = Record<string, any>;
|
||||
|
||||
|
@ -55,6 +55,9 @@ function parseParentAggs(dslLvlCursor: any, dsl: any) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO need to make a more explicit interface for this
|
||||
export type IAggConfigs = AggConfigs;
|
||||
|
||||
export class AggConfigs {
|
||||
public indexPattern: IndexPattern;
|
||||
public schemas: any;
|
|
@ -28,10 +28,10 @@ export const AggGroupNames = Object.freeze({
|
|||
export type AggGroupNames = $Values<typeof AggGroupNames>;
|
||||
|
||||
export const aggGroupNamesMap = () => ({
|
||||
[AggGroupNames.Metrics]: i18n.translate('common.ui.aggTypes.aggGroups.metricsText', {
|
||||
[AggGroupNames.Metrics]: i18n.translate('data.search.aggs.aggGroups.metricsText', {
|
||||
defaultMessage: 'Metrics',
|
||||
}),
|
||||
[AggGroupNames.Buckets]: i18n.translate('common.ui.aggTypes.aggGroups.bucketsText', {
|
||||
[AggGroupNames.Buckets]: i18n.translate('data.search.aggs.aggGroups.bucketsText', {
|
||||
defaultMessage: 'Buckets',
|
||||
}),
|
||||
});
|
|
@ -21,7 +21,7 @@ import { initParams } from './agg_params';
|
|||
import { BaseParamType } from './param_types/base';
|
||||
import { FieldParamType } from './param_types/field';
|
||||
import { OptionedParamType } from './param_types/optioned';
|
||||
import { AggParamType } from '../agg_types/param_types/agg';
|
||||
import { AggParamType } from '../aggs/param_types/agg';
|
||||
|
||||
jest.mock('ui/new_platform');
|
||||
|
|
@ -25,7 +25,7 @@ import { JsonParamType } from './param_types/json';
|
|||
import { BaseParamType } from './param_types/base';
|
||||
|
||||
import { AggConfig } from './agg_config';
|
||||
import { AggConfigs } from './agg_configs';
|
||||
import { IAggConfigs } from './agg_configs';
|
||||
|
||||
const paramTypeMap = {
|
||||
field: FieldParamType,
|
||||
|
@ -73,7 +73,7 @@ export const writeParams = <
|
|||
>(
|
||||
params: Array<Partial<TAggParam>> = [],
|
||||
aggConfig: TAggConfig,
|
||||
aggs?: AggConfigs,
|
||||
aggs?: IAggConfigs,
|
||||
locals?: Record<string, any>
|
||||
) => {
|
||||
const output = { params: {} as Record<string, any> };
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
|
||||
import { AggType, AggTypeConfig } from './agg_type';
|
||||
import { AggConfig } from './agg_config';
|
||||
import { IAggConfig } from './agg_config';
|
||||
import { npStart } from 'ui/new_platform';
|
||||
|
||||
jest.mock('ui/new_platform');
|
||||
|
@ -48,7 +48,7 @@ describe('AggType Class', () => {
|
|||
describe('makeLabel', () => {
|
||||
it('makes a function when the makeLabel config is not specified', () => {
|
||||
const makeLabel = () => 'label';
|
||||
const aggConfig = {} as AggConfig;
|
||||
const aggConfig = {} as IAggConfig;
|
||||
const config: AggTypeConfig = {
|
||||
name: 'name',
|
||||
title: 'title',
|
||||
|
@ -64,7 +64,7 @@ describe('AggType Class', () => {
|
|||
|
||||
describe('getResponseAggs/getRequestAggs', () => {
|
||||
it('copies the value', () => {
|
||||
const testConfig = (aggConfig: AggConfig) => [aggConfig];
|
||||
const testConfig = (aggConfig: IAggConfig) => [aggConfig];
|
||||
|
||||
const aggType = new AggType({
|
||||
name: 'name',
|
||||
|
@ -78,7 +78,7 @@ describe('AggType Class', () => {
|
|||
});
|
||||
|
||||
it('defaults to noop', () => {
|
||||
const aggConfig = {} as AggConfig;
|
||||
const aggConfig = {} as IAggConfig;
|
||||
const aggType = new AggType({
|
||||
name: 'name',
|
||||
title: 'title',
|
||||
|
@ -130,13 +130,13 @@ describe('AggType Class', () => {
|
|||
});
|
||||
|
||||
describe('getFormat', function() {
|
||||
let aggConfig: AggConfig;
|
||||
let aggConfig: IAggConfig;
|
||||
let field: any;
|
||||
|
||||
beforeEach(() => {
|
||||
aggConfig = ({
|
||||
getField: jest.fn(() => field),
|
||||
} as unknown) as AggConfig;
|
||||
} as unknown) as IAggConfig;
|
||||
});
|
||||
|
||||
it('returns the formatter for the aggConfig', () => {
|
|
@ -23,11 +23,15 @@ import { npStart } from 'ui/new_platform';
|
|||
import { initParams } from './agg_params';
|
||||
|
||||
import { AggConfig } from './agg_config';
|
||||
import { AggConfigs } from './agg_configs';
|
||||
import { Adapters } from '../../../../plugins/inspector/public';
|
||||
import { IAggConfigs } from './agg_configs';
|
||||
import { Adapters } from '../../../../../../plugins/inspector/public';
|
||||
import { BaseParamType } from './param_types/base';
|
||||
import { AggParamType } from '../agg_types/param_types/agg';
|
||||
import { KBN_FIELD_TYPES, fieldFormats, ISearchSource } from '../../../../plugins/data/public';
|
||||
import { AggParamType } from './param_types/agg';
|
||||
import {
|
||||
KBN_FIELD_TYPES,
|
||||
fieldFormats,
|
||||
ISearchSource,
|
||||
} from '../../../../../../plugins/data/public';
|
||||
|
||||
export interface AggTypeConfig<
|
||||
TAggConfig extends AggConfig = AggConfig,
|
||||
|
@ -48,7 +52,7 @@ export interface AggTypeConfig<
|
|||
decorateAggConfig?: () => any;
|
||||
postFlightRequest?: (
|
||||
resp: any,
|
||||
aggConfigs: AggConfigs,
|
||||
aggConfigs: IAggConfigs,
|
||||
aggConfig: TAggConfig,
|
||||
searchSource: ISearchSource,
|
||||
inspectorAdapters: Adapters,
|
||||
|
@ -66,6 +70,9 @@ const getFormat = (agg: AggConfig) => {
|
|||
return field ? field.format : fieldFormatsService.getDefaultInstance(KBN_FIELD_TYPES.STRING);
|
||||
};
|
||||
|
||||
// TODO need to make a more explicit interface for this
|
||||
export type IAggType = AggType;
|
||||
|
||||
export class AggType<
|
||||
TAggConfig extends AggConfig = AggConfig,
|
||||
TParam extends AggParamType<TAggConfig> = AggParamType<TAggConfig>
|
||||
|
@ -178,7 +185,7 @@ export class AggType<
|
|||
*/
|
||||
postFlightRequest: (
|
||||
resp: any,
|
||||
aggConfigs: AggConfigs,
|
||||
aggConfigs: IAggConfigs,
|
||||
aggConfig: TAggConfig,
|
||||
searchSource: ISearchSource,
|
||||
inspectorAdapters: Adapters,
|
||||
|
@ -239,7 +246,7 @@ export class AggType<
|
|||
if (config.customLabels !== false) {
|
||||
params.push({
|
||||
name: 'customLabel',
|
||||
displayName: i18n.translate('common.ui.aggTypes.string.customLabel', {
|
||||
displayName: i18n.translate('data.search.aggs.string.customLabel', {
|
||||
defaultMessage: 'Custom label',
|
||||
}),
|
||||
type: 'string',
|
|
@ -50,8 +50,6 @@ import { bucketAvgMetricAgg } from './metrics/bucket_avg';
|
|||
import { bucketMinMetricAgg } from './metrics/bucket_min';
|
||||
import { bucketMaxMetricAgg } from './metrics/bucket_max';
|
||||
|
||||
export { AggType } from './agg_type';
|
||||
|
||||
export const aggTypes = {
|
||||
metrics: [
|
||||
countMetricAgg,
|
||||
|
@ -90,3 +88,27 @@ export const aggTypes = {
|
|||
geoTileBucketAgg,
|
||||
],
|
||||
};
|
||||
|
||||
export { AggType } from './agg_type';
|
||||
export { AggConfig } from './agg_config';
|
||||
export { AggConfigs } from './agg_configs';
|
||||
export { FieldParamType } from './param_types';
|
||||
export { aggTypeFieldFilters } from './param_types/filter';
|
||||
export { parentPipelineAggHelper } from './metrics/lib/parent_pipeline_agg_helper';
|
||||
|
||||
// static code
|
||||
export { AggParamType } from './param_types/agg';
|
||||
export { AggGroupNames, aggGroupNamesMap } from './agg_groups';
|
||||
export { intervalOptions } from './buckets/_interval_options'; // only used in Discover
|
||||
export { isDateHistogramBucketAggConfig, setBounds } from './buckets/date_histogram';
|
||||
export { termsAggFilter } from './buckets/terms';
|
||||
export { isType, isStringType } from './buckets/migrate_include_exclude_format';
|
||||
export { CidrMask } from './buckets/lib/cidr_mask';
|
||||
export { convertDateRangeToString } from './buckets/date_range';
|
||||
export { convertIPRangeToString } from './buckets/ip_range';
|
||||
export { aggTypeFilters, propFilter } from './filter';
|
||||
export { OptionedParamType } from './param_types/optioned';
|
||||
export { isValidJson, isValidInterval } from './utils';
|
||||
export { BUCKET_TYPES } from './buckets/bucket_agg_types';
|
||||
export { METRIC_TYPES } from './metrics/metric_agg_types';
|
||||
export { ISchemas, Schema, Schemas } from './schemas';
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
|
||||
import { AggConfig } from '../agg_config';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../plugins/data/public';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public';
|
||||
import { AggType, AggTypeConfig } from '../agg_type';
|
||||
import { AggParamType } from '../param_types/agg';
|
||||
|
|
@ -21,7 +21,7 @@ import { IBucketAggConfig } from './_bucket_agg_type';
|
|||
|
||||
export const intervalOptions = [
|
||||
{
|
||||
display: i18n.translate('common.ui.aggTypes.buckets.intervalOptions.autoDisplayName', {
|
||||
display: i18n.translate('data.search.aggs.buckets.intervalOptions.autoDisplayName', {
|
||||
defaultMessage: 'Auto',
|
||||
}),
|
||||
val: 'auto',
|
||||
|
@ -32,49 +32,49 @@ export const intervalOptions = [
|
|||
},
|
||||
},
|
||||
{
|
||||
display: i18n.translate('common.ui.aggTypes.buckets.intervalOptions.millisecondDisplayName', {
|
||||
display: i18n.translate('data.search.aggs.buckets.intervalOptions.millisecondDisplayName', {
|
||||
defaultMessage: 'Millisecond',
|
||||
}),
|
||||
val: 'ms',
|
||||
},
|
||||
{
|
||||
display: i18n.translate('common.ui.aggTypes.buckets.intervalOptions.secondDisplayName', {
|
||||
display: i18n.translate('data.search.aggs.buckets.intervalOptions.secondDisplayName', {
|
||||
defaultMessage: 'Second',
|
||||
}),
|
||||
val: 's',
|
||||
},
|
||||
{
|
||||
display: i18n.translate('common.ui.aggTypes.buckets.intervalOptions.minuteDisplayName', {
|
||||
display: i18n.translate('data.search.aggs.buckets.intervalOptions.minuteDisplayName', {
|
||||
defaultMessage: 'Minute',
|
||||
}),
|
||||
val: 'm',
|
||||
},
|
||||
{
|
||||
display: i18n.translate('common.ui.aggTypes.buckets.intervalOptions.hourlyDisplayName', {
|
||||
display: i18n.translate('data.search.aggs.buckets.intervalOptions.hourlyDisplayName', {
|
||||
defaultMessage: 'Hourly',
|
||||
}),
|
||||
val: 'h',
|
||||
},
|
||||
{
|
||||
display: i18n.translate('common.ui.aggTypes.buckets.intervalOptions.dailyDisplayName', {
|
||||
display: i18n.translate('data.search.aggs.buckets.intervalOptions.dailyDisplayName', {
|
||||
defaultMessage: 'Daily',
|
||||
}),
|
||||
val: 'd',
|
||||
},
|
||||
{
|
||||
display: i18n.translate('common.ui.aggTypes.buckets.intervalOptions.weeklyDisplayName', {
|
||||
display: i18n.translate('data.search.aggs.buckets.intervalOptions.weeklyDisplayName', {
|
||||
defaultMessage: 'Weekly',
|
||||
}),
|
||||
val: 'w',
|
||||
},
|
||||
{
|
||||
display: i18n.translate('common.ui.aggTypes.buckets.intervalOptions.monthlyDisplayName', {
|
||||
display: i18n.translate('data.search.aggs.buckets.intervalOptions.monthlyDisplayName', {
|
||||
defaultMessage: 'Monthly',
|
||||
}),
|
||||
val: 'M',
|
||||
},
|
||||
{
|
||||
display: i18n.translate('common.ui.aggTypes.buckets.intervalOptions.yearlyDisplayName', {
|
||||
display: i18n.translate('data.search.aggs.buckets.intervalOptions.yearlyDisplayName', {
|
||||
defaultMessage: 'Yearly',
|
||||
}),
|
||||
val: 'y',
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import { esFilters, esQuery } from '../../../../../plugins/data/public';
|
||||
import { esFilters, esQuery } from '../../../../../../../plugins/data/public';
|
||||
import { AggGroupNames } from '../agg_groups';
|
||||
|
||||
/**
|
|
@ -23,7 +23,7 @@ import { intervalOptions } from '../_interval_options';
|
|||
import { AggConfigs } from '../../agg_configs';
|
||||
import { IBucketDateHistogramAggConfig } from '../date_histogram';
|
||||
import { BUCKET_TYPES } from '../bucket_agg_types';
|
||||
import { esFilters } from '../../../../../../plugins/data/public';
|
||||
import { esFilters } from '../../../../../../../../plugins/data/public';
|
||||
|
||||
jest.mock('ui/new_platform');
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
import moment from 'moment';
|
||||
import { IBucketDateHistogramAggConfig } from '../date_histogram';
|
||||
import { esFilters } from '../../../../../../plugins/data/public';
|
||||
import { esFilters } from '../../../../../../../../plugins/data/public';
|
||||
|
||||
export const createFilterDateHistogram = (
|
||||
agg: IBucketDateHistogramAggConfig,
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
import moment from 'moment';
|
||||
import { createFilterDateRange } from './date_range';
|
||||
import { fieldFormats } from '../../../../../../plugins/data/public';
|
||||
import { fieldFormats } from '../../../../../../../../plugins/data/public';
|
||||
import { AggConfigs } from '../../agg_configs';
|
||||
import { BUCKET_TYPES } from '../bucket_agg_types';
|
||||
import { IBucketAggConfig } from '../_bucket_agg_type';
|
|
@ -20,7 +20,7 @@
|
|||
import moment from 'moment';
|
||||
import { IBucketAggConfig } from '../_bucket_agg_type';
|
||||
import { DateRangeKey } from '../date_range';
|
||||
import { esFilters } from '../../../../../../plugins/data/public';
|
||||
import { esFilters } from '../../../../../../../../plugins/data/public';
|
||||
|
||||
export const createFilterDateRange = (agg: IBucketAggConfig, { from, to }: DateRangeKey) => {
|
||||
const filter: esFilters.RangeFilterParams = {};
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
import { get } from 'lodash';
|
||||
import { IBucketAggConfig } from '../_bucket_agg_type';
|
||||
import { esFilters } from '../../../../../../plugins/data/public';
|
||||
import { esFilters } from '../../../../../../../../plugins/data/public';
|
||||
|
||||
export const createFilterFilters = (aggConfig: IBucketAggConfig, key: string) => {
|
||||
// have the aggConfig write agg dsl params
|
|
@ -20,7 +20,7 @@ import { createFilterHistogram } from './histogram';
|
|||
import { AggConfigs } from '../../agg_configs';
|
||||
import { BUCKET_TYPES } from '../bucket_agg_types';
|
||||
import { IBucketAggConfig } from '../_bucket_agg_type';
|
||||
import { fieldFormats } from '../../../../../../plugins/data/public';
|
||||
import { fieldFormats } from '../../../../../../../../plugins/data/public';
|
||||
|
||||
jest.mock('ui/new_platform');
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
|
||||
import { IBucketAggConfig } from '../_bucket_agg_type';
|
||||
import { esFilters } from '../../../../../../plugins/data/public';
|
||||
import { esFilters } from '../../../../../../../../plugins/data/public';
|
||||
|
||||
export const createFilterHistogram = (aggConfig: IBucketAggConfig, key: string) => {
|
||||
const value = parseInt(key, 10);
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
import { createFilterIpRange } from './ip_range';
|
||||
import { AggConfigs } from '../../agg_configs';
|
||||
import { fieldFormats } from '../../../../../../plugins/data/public';
|
||||
import { fieldFormats } from '../../../../../../../../plugins/data/public';
|
||||
import { BUCKET_TYPES } from '../bucket_agg_types';
|
||||
import { IBucketAggConfig } from '../_bucket_agg_type';
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
import { CidrMask } from '../lib/cidr_mask';
|
||||
import { IBucketAggConfig } from '../_bucket_agg_type';
|
||||
import { IpRangeKey } from '../ip_range';
|
||||
import { esFilters } from '../../../../../../plugins/data/public';
|
||||
import { esFilters } from '../../../../../../../../plugins/data/public';
|
||||
|
||||
export const createFilterIpRange = (aggConfig: IBucketAggConfig, key: IpRangeKey) => {
|
||||
let range: esFilters.RangeFilterParams;
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
|
||||
import { createFilterRange } from './range';
|
||||
import { fieldFormats } from '../../../../../../plugins/data/public';
|
||||
import { fieldFormats } from '../../../../../../../../plugins/data/public';
|
||||
import { AggConfigs } from '../../agg_configs';
|
||||
import { BUCKET_TYPES } from '../bucket_agg_types';
|
||||
import { IBucketAggConfig } from '../_bucket_agg_type';
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
|
||||
import { IBucketAggConfig } from '../_bucket_agg_type';
|
||||
import { esFilters } from '../../../../../../plugins/data/public';
|
||||
import { esFilters } from '../../../../../../../../plugins/data/public';
|
||||
|
||||
export const createFilterRange = (aggConfig: IBucketAggConfig, params: any) => {
|
||||
return esFilters.buildRangeFilter(
|
|
@ -21,7 +21,7 @@ import { createFilterTerms } from './terms';
|
|||
import { AggConfigs } from '../../agg_configs';
|
||||
import { BUCKET_TYPES } from '../bucket_agg_types';
|
||||
import { IBucketAggConfig } from '../_bucket_agg_type';
|
||||
import { esFilters } from '../../../../../../plugins/data/public';
|
||||
import { esFilters } from '../../../../../../../../plugins/data/public';
|
||||
|
||||
jest.mock('ui/new_platform');
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
|
||||
import { IBucketAggConfig } from '../_bucket_agg_type';
|
||||
import { esFilters } from '../../../../../../plugins/data/public';
|
||||
import { esFilters } from '../../../../../../../../plugins/data/public';
|
||||
|
||||
export const createFilterTerms = (aggConfig: IBucketAggConfig, key: string, params: any) => {
|
||||
const field = aggConfig.params.field;
|
|
@ -22,19 +22,17 @@ import moment from 'moment-timezone';
|
|||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { npStart } from 'ui/new_platform';
|
||||
import { timefilter } from 'ui/timefilter';
|
||||
import { TimeBuckets } from 'ui/time_buckets';
|
||||
import { BucketAggType, IBucketAggConfig } from './_bucket_agg_type';
|
||||
import { BUCKET_TYPES } from './bucket_agg_types';
|
||||
import { createFilterDateHistogram } from './create_filter/date_histogram';
|
||||
import { intervalOptions } from './_interval_options';
|
||||
import { timefilter } from '../../timefilter';
|
||||
import { dateHistogramInterval } from '../../../../core_plugins/data/public';
|
||||
import { dateHistogramInterval } from '../../../../common';
|
||||
import { writeParams } from '../agg_params';
|
||||
import { isMetricAggType } from '../metrics/metric_agg_type';
|
||||
|
||||
import { KBN_FIELD_TYPES } from '../../../../../plugins/data/public';
|
||||
|
||||
// @ts-ignore
|
||||
import { TimeBuckets } from '../../time_buckets';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public';
|
||||
|
||||
const detectedTimezone = moment.tz.guess();
|
||||
const tzOffset = moment().format('Z');
|
||||
|
@ -67,7 +65,7 @@ export function isDateHistogramBucketAggConfig(agg: any): agg is IBucketDateHist
|
|||
|
||||
export const dateHistogramBucketAgg = new BucketAggType<IBucketDateHistogramAggConfig>({
|
||||
name: BUCKET_TYPES.DATE_HISTOGRAM,
|
||||
title: i18n.translate('common.ui.aggTypes.buckets.dateHistogramTitle', {
|
||||
title: i18n.translate('data.search.aggs.buckets.dateHistogramTitle', {
|
||||
defaultMessage: 'Date Histogram',
|
||||
}),
|
||||
ordered: {
|
||||
|
@ -81,7 +79,7 @@ export const dateHistogramBucketAgg = new BucketAggType<IBucketDateHistogramAggC
|
|||
}
|
||||
|
||||
const field = agg.getFieldDisplayName();
|
||||
return i18n.translate('common.ui.aggTypes.buckets.dateHistogramLabel', {
|
||||
return i18n.translate('data.search.aggs.buckets.dateHistogramLabel', {
|
||||
defaultMessage: '{fieldName} per {intervalDescription}',
|
||||
values: {
|
||||
fieldName: field,
|
|
@ -24,9 +24,9 @@ import { BUCKET_TYPES } from './bucket_agg_types';
|
|||
import { BucketAggType, IBucketAggConfig } from './_bucket_agg_type';
|
||||
import { createFilterDateRange } from './create_filter/date_range';
|
||||
|
||||
import { KBN_FIELD_TYPES, fieldFormats } from '../../../../../plugins/data/public';
|
||||
import { KBN_FIELD_TYPES, fieldFormats } from '../../../../../../../plugins/data/public';
|
||||
|
||||
const dateRangeTitle = i18n.translate('common.ui.aggTypes.buckets.dateRangeTitle', {
|
||||
const dateRangeTitle = i18n.translate('data.search.aggs.buckets.dateRangeTitle', {
|
||||
defaultMessage: 'Date Range',
|
||||
});
|
||||
|
|
@ -20,7 +20,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { BucketAggType } from './_bucket_agg_type';
|
||||
import { BUCKET_TYPES } from './bucket_agg_types';
|
||||
|
||||
const filterTitle = i18n.translate('common.ui.aggTypes.buckets.filterTitle', {
|
||||
const filterTitle = i18n.translate('data.search.aggs.buckets.filterTitle', {
|
||||
defaultMessage: 'Filter',
|
||||
});
|
||||
|
|
@ -25,14 +25,14 @@ import { i18n } from '@kbn/i18n';
|
|||
import chrome from 'ui/chrome';
|
||||
import { createFilterFilters } from './create_filter/filters';
|
||||
import { BucketAggType } from './_bucket_agg_type';
|
||||
import { Storage } from '../../../../../plugins/kibana_utils/public';
|
||||
import { getQueryLog, esQuery, Query } from '../../../../../plugins/data/public';
|
||||
import { Storage } from '../../../../../../../plugins/kibana_utils/public';
|
||||
import { getQueryLog, esQuery, Query } from '../../../../../../../plugins/data/public';
|
||||
import { BUCKET_TYPES } from './bucket_agg_types';
|
||||
|
||||
const config = chrome.getUiSettingsClient();
|
||||
const storage = new Storage(window.localStorage);
|
||||
|
||||
const filtersTitle = i18n.translate('common.ui.aggTypes.buckets.filtersTitle', {
|
||||
const filtersTitle = i18n.translate('data.search.aggs.buckets.filtersTitle', {
|
||||
defaultMessage: 'Filters',
|
||||
description:
|
||||
'The name of an aggregation, that allows to specify multiple individual filters to group data by.',
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
|
||||
import { geoHashBucketAgg, IBucketGeoHashGridAggConfig } from './geo_hash';
|
||||
import { AggConfigs } from '../agg_configs';
|
||||
import { AggConfigs, IAggConfigs } from '../agg_configs';
|
||||
import { BUCKET_TYPES } from './bucket_agg_types';
|
||||
|
||||
jest.mock('ui/new_platform');
|
||||
|
@ -121,7 +121,7 @@ describe('Geohash Agg', () => {
|
|||
|
||||
describe('getRequestAggs', () => {
|
||||
describe('initial aggregation creation', () => {
|
||||
let aggConfigs: AggConfigs;
|
||||
let aggConfigs: IAggConfigs;
|
||||
let geoHashGridAgg: IBucketGeoHashGridAggConfig;
|
||||
|
||||
beforeEach(() => {
|
|
@ -19,9 +19,9 @@
|
|||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { geohashColumns } from 'ui/vis/map/decode_geo_hash';
|
||||
import chrome from '../../chrome';
|
||||
import chrome from 'ui/chrome';
|
||||
import { BucketAggType, IBucketAggConfig } from './_bucket_agg_type';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../plugins/data/public';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public';
|
||||
|
||||
import { geoContains, scaleBounds, GeoBoundingBox } from './lib/geo_utils';
|
||||
import { BUCKET_TYPES } from './bucket_agg_types';
|
||||
|
@ -68,7 +68,7 @@ function getPrecision(val: string) {
|
|||
const isOutsideCollar = (bounds: GeoBoundingBox, collar: MapCollar) =>
|
||||
bounds && collar && !geoContains(collar, bounds);
|
||||
|
||||
const geohashGridTitle = i18n.translate('common.ui.aggTypes.buckets.geohashGridTitle', {
|
||||
const geohashGridTitle = i18n.translate('data.search.aggs.buckets.geohashGridTitle', {
|
||||
defaultMessage: 'Geohash',
|
||||
});
|
||||
|
|
@ -23,11 +23,11 @@ import { AggConfigOptions } from '../agg_config';
|
|||
|
||||
import { BucketAggType } from './_bucket_agg_type';
|
||||
import { BUCKET_TYPES } from './bucket_agg_types';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../plugins/data/public';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public';
|
||||
import { IBucketAggConfig } from './_bucket_agg_type';
|
||||
import { METRIC_TYPES } from '../metrics/metric_agg_types';
|
||||
|
||||
const geotileGridTitle = i18n.translate('common.ui.aggTypes.buckets.geotileGridTitle', {
|
||||
const geotileGridTitle = i18n.translate('data.search.aggs.buckets.geotileGridTitle', {
|
||||
defaultMessage: 'Geotile',
|
||||
});
|
||||
|
|
@ -24,7 +24,7 @@ import { toastNotifications } from 'ui/notify';
|
|||
import { npStart } from 'ui/new_platform';
|
||||
import { BucketAggType, IBucketAggConfig } from './_bucket_agg_type';
|
||||
import { createFilterHistogram } from './create_filter/histogram';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../plugins/data/public';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public';
|
||||
import { BUCKET_TYPES } from './bucket_agg_types';
|
||||
|
||||
export interface AutoBounds {
|
||||
|
@ -41,7 +41,7 @@ const getUIConfig = () => npStart.core.uiSettings;
|
|||
|
||||
export const histogramBucketAgg = new BucketAggType<IBucketHistogramAggConfig>({
|
||||
name: BUCKET_TYPES.HISTOGRAM,
|
||||
title: i18n.translate('common.ui.aggTypes.buckets.histogramTitle', {
|
||||
title: i18n.translate('data.search.aggs.buckets.histogramTitle', {
|
||||
defaultMessage: 'Histogram',
|
||||
}),
|
||||
ordered: {},
|
||||
|
@ -117,7 +117,7 @@ export const histogramBucketAgg = new BucketAggType<IBucketHistogramAggConfig>({
|
|||
.catch((e: Error) => {
|
||||
if (e.name === 'AbortError') return;
|
||||
toastNotifications.addWarning(
|
||||
i18n.translate('common.ui.aggTypes.histogram.missingMaxMinValuesWarning', {
|
||||
i18n.translate('data.search.aggs.histogram.missingMaxMinValuesWarning', {
|
||||
defaultMessage:
|
||||
'Unable to retrieve max and min values to auto-scale histogram buckets. This may lead to poor visualization performance.',
|
||||
})
|
|
@ -25,9 +25,9 @@ import { BUCKET_TYPES } from './bucket_agg_types';
|
|||
|
||||
// @ts-ignore
|
||||
import { createFilterIpRange } from './create_filter/ip_range';
|
||||
import { KBN_FIELD_TYPES, fieldFormats } from '../../../../../plugins/data/public';
|
||||
import { KBN_FIELD_TYPES, fieldFormats } from '../../../../../../../plugins/data/public';
|
||||
|
||||
const ipRangeTitle = i18n.translate('common.ui.aggTypes.buckets.ipRangeTitle', {
|
||||
const ipRangeTitle = i18n.translate('data.search.aggs.buckets.ipRangeTitle', {
|
||||
defaultMessage: 'IPv4 Range',
|
||||
});
|
||||
|
||||
|
@ -57,7 +57,7 @@ export const ipRangeBucketAgg = new BucketAggType({
|
|||
return new IpRangeFormat();
|
||||
},
|
||||
makeLabel(aggConfig) {
|
||||
return i18n.translate('common.ui.aggTypes.buckets.ipRangeLabel', {
|
||||
return i18n.translate('data.search.aggs.buckets.ipRangeLabel', {
|
||||
defaultMessage: '{fieldName} IP ranges',
|
||||
values: {
|
||||
fieldName: aggConfig.getFieldDisplayName(),
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import { Ipv4Address } from '../../../../../../plugins/kibana_utils/public';
|
||||
import { Ipv4Address } from '../../../../../../../../plugins/kibana_utils/public';
|
||||
|
||||
const NUM_BITS = 32;
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
import { AggConfigs } from '../agg_configs';
|
||||
import { BUCKET_TYPES } from './bucket_agg_types';
|
||||
import { fieldFormats } from '../../../../../plugins/data/public';
|
||||
import { fieldFormats } from '../../../../../../../plugins/data/public';
|
||||
|
||||
jest.mock('ui/new_platform');
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { BucketAggType } from './_bucket_agg_type';
|
||||
import { fieldFormats, KBN_FIELD_TYPES } from '../../../../../plugins/data/public';
|
||||
import { fieldFormats, KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public';
|
||||
import { RangeKey } from './range_key';
|
||||
import { createFilterRange } from './create_filter/range';
|
||||
import { BUCKET_TYPES } from './bucket_agg_types';
|
||||
|
@ -27,7 +27,7 @@ import { BUCKET_TYPES } from './bucket_agg_types';
|
|||
const keyCaches = new WeakMap();
|
||||
const formats = new WeakMap();
|
||||
|
||||
const rangeTitle = i18n.translate('common.ui.aggTypes.buckets.rangeTitle', {
|
||||
const rangeTitle = i18n.translate('data.search.aggs.buckets.rangeTitle', {
|
||||
defaultMessage: 'Range',
|
||||
});
|
||||
|
||||
|
@ -36,7 +36,7 @@ export const rangeBucketAgg = new BucketAggType({
|
|||
title: rangeTitle,
|
||||
createFilter: createFilterRange,
|
||||
makeLabel(aggConfig) {
|
||||
return i18n.translate('common.ui.aggTypes.buckets.rangesLabel', {
|
||||
return i18n.translate('data.search.aggs.aggTypesLabel', {
|
||||
defaultMessage: '{fieldName} ranges',
|
||||
values: {
|
||||
fieldName: aggConfig.getFieldDisplayName(),
|
||||
|
@ -69,7 +69,7 @@ export const rangeBucketAgg = new BucketAggType({
|
|||
const format = agg.fieldOwnFormatter();
|
||||
const gte = '\u2265';
|
||||
const lt = '\u003c';
|
||||
return i18n.translate('common.ui.aggTypes.buckets.ranges.rangesFormatMessage', {
|
||||
return i18n.translate('data.search.aggs.aggTypes.rangesFormatMessage', {
|
||||
defaultMessage: '{gte} {from} and {lt} {to}',
|
||||
values: {
|
||||
gte,
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import { AggConfigs } from '../index';
|
||||
import { IAggConfigs } from '../types';
|
||||
import { BUCKET_TYPES } from './bucket_agg_types';
|
||||
import { significantTermsBucketAgg } from './significant_terms';
|
||||
import { IBucketAggConfig } from './_bucket_agg_type';
|
||||
|
@ -56,7 +57,7 @@ describe('Significant Terms Agg', () => {
|
|||
);
|
||||
};
|
||||
|
||||
const testSerializeAndWrite = (aggs: AggConfigs) => {
|
||||
const testSerializeAndWrite = (aggs: IAggConfigs) => {
|
||||
const agg = aggs.aggs[0];
|
||||
const { [BUCKET_TYPES.SIGNIFICANT_TERMS]: params } = agg.toDsl();
|
||||
|
|
@ -22,9 +22,9 @@ import { BucketAggType } from './_bucket_agg_type';
|
|||
import { createFilterTerms } from './create_filter/terms';
|
||||
import { isStringType, migrateIncludeExcludeFormat } from './migrate_include_exclude_format';
|
||||
import { BUCKET_TYPES } from './bucket_agg_types';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../plugins/data/public';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public';
|
||||
|
||||
const significantTermsTitle = i18n.translate('common.ui.aggTypes.buckets.significantTermsTitle', {
|
||||
const significantTermsTitle = i18n.translate('data.search.aggs.buckets.significantTermsTitle', {
|
||||
defaultMessage: 'Significant Terms',
|
||||
});
|
||||
|
||||
|
@ -32,7 +32,7 @@ export const significantTermsBucketAgg = new BucketAggType({
|
|||
name: BUCKET_TYPES.SIGNIFICANT_TERMS,
|
||||
title: significantTermsTitle,
|
||||
makeLabel(aggConfig) {
|
||||
return i18n.translate('common.ui.aggTypes.buckets.significantTermsLabel', {
|
||||
return i18n.translate('data.search.aggs.buckets.significantTermsLabel', {
|
||||
defaultMessage: 'Top {size} unusual terms in {fieldName}',
|
||||
values: {
|
||||
size: aggConfig.params.size,
|
||||
|
@ -54,7 +54,7 @@ export const significantTermsBucketAgg = new BucketAggType({
|
|||
},
|
||||
{
|
||||
name: 'exclude',
|
||||
displayName: i18n.translate('common.ui.aggTypes.buckets.significantTerms.excludeLabel', {
|
||||
displayName: i18n.translate('data.search.aggs.buckets.significantTerms.excludeLabel', {
|
||||
defaultMessage: 'Exclude',
|
||||
}),
|
||||
type: 'string',
|
||||
|
@ -64,7 +64,7 @@ export const significantTermsBucketAgg = new BucketAggType({
|
|||
},
|
||||
{
|
||||
name: 'include',
|
||||
displayName: i18n.translate('common.ui.aggTypes.buckets.significantTerms.includeLabel', {
|
||||
displayName: i18n.translate('data.search.aggs.buckets.significantTerms.includeLabel', {
|
||||
defaultMessage: 'Include',
|
||||
}),
|
||||
type: 'string',
|
|
@ -19,19 +19,20 @@
|
|||
|
||||
import { noop } from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import {
|
||||
getRequestInspectorStats,
|
||||
getResponseInspectorStats,
|
||||
} from '../../../../core_plugins/data/public';
|
||||
import { getRequestInspectorStats, getResponseInspectorStats } from '../../../index';
|
||||
import { BucketAggType } from './_bucket_agg_type';
|
||||
import { BUCKET_TYPES } from './bucket_agg_types';
|
||||
import { IBucketAggConfig } from './_bucket_agg_type';
|
||||
import { createFilterTerms } from './create_filter/terms';
|
||||
import { isStringType, migrateIncludeExcludeFormat } from './migrate_include_exclude_format';
|
||||
import { AggConfigs } from '../agg_configs';
|
||||
import { IAggConfigs } from '../agg_configs';
|
||||
|
||||
import { Adapters } from '../../../../../plugins/inspector/public';
|
||||
import { ISearchSource, fieldFormats, KBN_FIELD_TYPES } from '../../../../../plugins/data/public';
|
||||
import { Adapters } from '../../../../../../../plugins/inspector/public';
|
||||
import {
|
||||
ISearchSource,
|
||||
fieldFormats,
|
||||
KBN_FIELD_TYPES,
|
||||
} from '../../../../../../../plugins/data/public';
|
||||
|
||||
import {
|
||||
buildOtherBucketAgg,
|
||||
|
@ -68,7 +69,7 @@ const [orderAggSchema] = new Schemas([
|
|||
},
|
||||
]).all;
|
||||
|
||||
const termsTitle = i18n.translate('common.ui.aggTypes.buckets.termsTitle', {
|
||||
const termsTitle = i18n.translate('data.search.aggs.buckets.termsTitle', {
|
||||
defaultMessage: 'Terms',
|
||||
});
|
||||
|
||||
|
@ -98,7 +99,7 @@ export const termsBucketAgg = new BucketAggType({
|
|||
createFilter: createFilterTerms,
|
||||
postFlightRequest: async (
|
||||
resp: any,
|
||||
aggConfigs: AggConfigs,
|
||||
aggConfigs: IAggConfigs,
|
||||
aggConfig: IBucketAggConfig,
|
||||
searchSource: ISearchSource,
|
||||
inspectorAdapters: Adapters,
|
||||
|
@ -113,11 +114,11 @@ export const termsBucketAgg = new BucketAggType({
|
|||
nestedSearchSource.setField('aggs', filterAgg);
|
||||
|
||||
const request = inspectorAdapters.requests.start(
|
||||
i18n.translate('common.ui.aggTypes.buckets.terms.otherBucketTitle', {
|
||||
i18n.translate('data.search.aggs.buckets.terms.otherBucketTitle', {
|
||||
defaultMessage: 'Other bucket',
|
||||
}),
|
||||
{
|
||||
description: i18n.translate('common.ui.aggTypes.buckets.terms.otherBucketDescription', {
|
||||
description: i18n.translate('data.search.aggs.buckets.terms.otherBucketDescription', {
|
||||
defaultMessage:
|
||||
'This request counts the number of documents that fall ' +
|
||||
'outside the criterion of the data buckets.',
|
||||
|
@ -212,13 +213,13 @@ export const termsBucketAgg = new BucketAggType({
|
|||
default: 'desc',
|
||||
options: [
|
||||
{
|
||||
text: i18n.translate('common.ui.aggTypes.buckets.terms.orderDescendingTitle', {
|
||||
text: i18n.translate('data.search.aggs.buckets.terms.orderDescendingTitle', {
|
||||
defaultMessage: 'Descending',
|
||||
}),
|
||||
value: 'desc',
|
||||
},
|
||||
{
|
||||
text: i18n.translate('common.ui.aggTypes.buckets.terms.orderAscendingTitle', {
|
||||
text: i18n.translate('data.search.aggs.buckets.terms.orderAscendingTitle', {
|
||||
defaultMessage: 'Ascending',
|
||||
}),
|
||||
value: 'asc',
|
||||
|
@ -238,10 +239,10 @@ export const termsBucketAgg = new BucketAggType({
|
|||
{
|
||||
name: 'otherBucketLabel',
|
||||
type: 'string',
|
||||
default: i18n.translate('common.ui.aggTypes.buckets.terms.otherBucketLabel', {
|
||||
default: i18n.translate('data.search.aggs.buckets.terms.otherBucketLabel', {
|
||||
defaultMessage: 'Other',
|
||||
}),
|
||||
displayName: i18n.translate('common.ui.aggTypes.otherBucket.labelForOtherBucketLabel', {
|
||||
displayName: i18n.translate('data.search.aggs.otherBucket.labelForOtherBucketLabel', {
|
||||
defaultMessage: 'Label for other bucket',
|
||||
}),
|
||||
shouldShow: agg => agg.getParam('otherBucket'),
|
||||
|
@ -254,13 +255,13 @@ export const termsBucketAgg = new BucketAggType({
|
|||
},
|
||||
{
|
||||
name: 'missingBucketLabel',
|
||||
default: i18n.translate('common.ui.aggTypes.buckets.terms.missingBucketLabel', {
|
||||
default: i18n.translate('data.search.aggs.buckets.terms.missingBucketLabel', {
|
||||
defaultMessage: 'Missing',
|
||||
description: `Default label used in charts when documents are missing a field.
|
||||
Visible when you create a chart with a terms aggregation and enable "Show missing values"`,
|
||||
}),
|
||||
type: 'string',
|
||||
displayName: i18n.translate('common.ui.aggTypes.otherBucket.labelForMissingValuesLabel', {
|
||||
displayName: i18n.translate('data.search.aggs.otherBucket.labelForMissingValuesLabel', {
|
||||
defaultMessage: 'Label for missing values',
|
||||
}),
|
||||
shouldShow: agg => agg.getParam('missingBucket'),
|
||||
|
@ -268,7 +269,7 @@ export const termsBucketAgg = new BucketAggType({
|
|||
},
|
||||
{
|
||||
name: 'exclude',
|
||||
displayName: i18n.translate('common.ui.aggTypes.buckets.terms.excludeLabel', {
|
||||
displayName: i18n.translate('data.search.aggs.buckets.terms.excludeLabel', {
|
||||
defaultMessage: 'Exclude',
|
||||
}),
|
||||
type: 'string',
|
||||
|
@ -278,7 +279,7 @@ export const termsBucketAgg = new BucketAggType({
|
|||
},
|
||||
{
|
||||
name: 'include',
|
||||
displayName: i18n.translate('common.ui.aggTypes.buckets.terms.includeLabel', {
|
||||
displayName: i18n.translate('data.search.aggs.buckets.terms.includeLabel', {
|
||||
defaultMessage: 'Include',
|
||||
}),
|
||||
type: 'string',
|
|
@ -17,9 +17,10 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import { IndexPattern } from '../../../../../plugins/data/public';
|
||||
import { IndexPattern } from '../../../../../../../plugins/data/public';
|
||||
import { AggTypeFilters } from './agg_type_filters';
|
||||
import { AggConfig, AggType } from '..';
|
||||
import { AggConfig } from '..';
|
||||
import { IAggType } from '../types';
|
||||
|
||||
describe('AggTypeFilters', () => {
|
||||
let registry: AggTypeFilters;
|
||||
|
@ -31,13 +32,13 @@ describe('AggTypeFilters', () => {
|
|||
});
|
||||
|
||||
it('should filter nothing without registered filters', async () => {
|
||||
const aggTypes = [{ name: 'count' }, { name: 'sum' }] as AggType[];
|
||||
const aggTypes = [{ name: 'count' }, { name: 'sum' }] as IAggType[];
|
||||
const filtered = registry.filter(aggTypes, indexPattern, aggConfig);
|
||||
expect(filtered).toEqual(aggTypes);
|
||||
});
|
||||
|
||||
it('should pass all aggTypes to the registered filter', async () => {
|
||||
const aggTypes = [{ name: 'count' }, { name: 'sum' }] as AggType[];
|
||||
const aggTypes = [{ name: 'count' }, { name: 'sum' }] as IAggType[];
|
||||
const filter = jest.fn();
|
||||
registry.addFilter(filter);
|
||||
registry.filter(aggTypes, indexPattern, aggConfig);
|
||||
|
@ -46,7 +47,7 @@ describe('AggTypeFilters', () => {
|
|||
});
|
||||
|
||||
it('should allow registered filters to filter out aggTypes', async () => {
|
||||
const aggTypes = [{ name: 'count' }, { name: 'sum' }, { name: 'avg' }] as AggType[];
|
||||
const aggTypes = [{ name: 'count' }, { name: 'sum' }, { name: 'avg' }] as IAggType[];
|
||||
let filtered = registry.filter(aggTypes, indexPattern, aggConfig);
|
||||
expect(filtered).toEqual(aggTypes);
|
||||
|
|
@ -17,12 +17,12 @@
|
|||
* under the License.
|
||||
*/
|
||||
import { IndexPattern } from 'src/plugins/data/public';
|
||||
import { AggType, AggConfig } from '..';
|
||||
import { IAggConfig, IAggType } from '../types';
|
||||
|
||||
type AggTypeFilter = (
|
||||
aggType: AggType,
|
||||
aggType: IAggType,
|
||||
indexPattern: IndexPattern,
|
||||
aggConfig: AggConfig
|
||||
aggConfig: IAggConfig
|
||||
) => boolean;
|
||||
|
||||
/**
|
||||
|
@ -49,7 +49,7 @@ class AggTypeFilters {
|
|||
* @param aggConfig The aggConfig for which the returning list will be used.
|
||||
* @return A filtered list of the passed aggTypes.
|
||||
*/
|
||||
public filter(aggTypes: AggType[], indexPattern: IndexPattern, aggConfig: AggConfig) {
|
||||
public filter(aggTypes: IAggType[], indexPattern: IndexPattern, aggConfig: IAggConfig) {
|
||||
const allFilters = Array.from(this.filters);
|
||||
const allowedAggTypes = aggTypes.filter(aggType => {
|
||||
const isAggTypeAllowed = allFilters.every(filter => filter(aggType, indexPattern, aggConfig));
|
52
src/legacy/core_plugins/data/public/search/aggs/index.ts
Normal file
52
src/legacy/core_plugins/data/public/search/aggs/index.ts
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
export { aggTypes } from './agg_types';
|
||||
export { AggType } from './agg_type';
|
||||
export { AggConfig } from './agg_config';
|
||||
export { AggConfigs } from './agg_configs';
|
||||
export { FieldParamType } from './param_types';
|
||||
export { MetricAggType } from './metrics/metric_agg_type';
|
||||
export { AggTypeFilters } from './filter';
|
||||
export { aggTypeFieldFilters, AggTypeFieldFilters } from './param_types/filter';
|
||||
export {
|
||||
parentPipelineAggHelper,
|
||||
parentPipelineType,
|
||||
} from './metrics/lib/parent_pipeline_agg_helper';
|
||||
export {
|
||||
siblingPipelineAggHelper,
|
||||
siblingPipelineType,
|
||||
} from './metrics/lib/sibling_pipeline_agg_helper';
|
||||
|
||||
// static code
|
||||
export { AggParamType } from './param_types/agg';
|
||||
export { AggGroupNames, aggGroupNamesMap } from './agg_groups';
|
||||
export { intervalOptions } from './buckets/_interval_options'; // only used in Discover
|
||||
export { isDateHistogramBucketAggConfig, setBounds } from './buckets/date_histogram';
|
||||
export { termsAggFilter } from './buckets/terms';
|
||||
export { isType, isStringType } from './buckets/migrate_include_exclude_format';
|
||||
export { CidrMask } from './buckets/lib/cidr_mask';
|
||||
export { convertDateRangeToString } from './buckets/date_range';
|
||||
export { convertIPRangeToString } from './buckets/ip_range';
|
||||
export { aggTypeFilters, propFilter } from './filter';
|
||||
export { OptionedParamType } from './param_types/optioned';
|
||||
export { isValidJson, isValidInterval } from './utils';
|
||||
export { BUCKET_TYPES } from './buckets/bucket_agg_types';
|
||||
export { METRIC_TYPES } from './metrics/metric_agg_types';
|
||||
export { ISchemas, Schema, Schemas } from './schemas';
|
|
@ -20,9 +20,9 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { MetricAggType } from './metric_agg_type';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../plugins/data/public';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public';
|
||||
|
||||
const averageTitle = i18n.translate('common.ui.aggTypes.metrics.averageTitle', {
|
||||
const averageTitle = i18n.translate('data.search.aggs.metrics.averageTitle', {
|
||||
defaultMessage: 'Average',
|
||||
});
|
||||
|
||||
|
@ -30,7 +30,7 @@ export const avgMetricAgg = new MetricAggType({
|
|||
name: METRIC_TYPES.AVG,
|
||||
title: averageTitle,
|
||||
makeLabel: aggConfig => {
|
||||
return i18n.translate('common.ui.aggTypes.metrics.averageLabel', {
|
||||
return i18n.translate('data.search.aggs.metrics.averageLabel', {
|
||||
defaultMessage: 'Average {field}',
|
||||
values: { field: aggConfig.getFieldDisplayName() },
|
||||
});
|
|
@ -25,11 +25,11 @@ import { makeNestedLabel } from './lib/make_nested_label';
|
|||
import { siblingPipelineAggHelper } from './lib/sibling_pipeline_agg_helper';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
|
||||
const overallAverageLabel = i18n.translate('common.ui.aggTypes.metrics.overallAverageLabel', {
|
||||
const overallAverageLabel = i18n.translate('data.search.aggs.metrics.overallAverageLabel', {
|
||||
defaultMessage: 'overall average',
|
||||
});
|
||||
|
||||
const averageBucketTitle = i18n.translate('common.ui.aggTypes.metrics.averageBucketTitle', {
|
||||
const averageBucketTitle = i18n.translate('data.search.aggs.metrics.averageBucketTitle', {
|
||||
defaultMessage: 'Average Bucket',
|
||||
});
|
||||
|
|
@ -24,11 +24,11 @@ import { makeNestedLabel } from './lib/make_nested_label';
|
|||
import { siblingPipelineAggHelper } from './lib/sibling_pipeline_agg_helper';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
|
||||
const overallMaxLabel = i18n.translate('common.ui.aggTypes.metrics.overallMaxLabel', {
|
||||
const overallMaxLabel = i18n.translate('data.search.aggs.metrics.overallMaxLabel', {
|
||||
defaultMessage: 'overall max',
|
||||
});
|
||||
|
||||
const maxBucketTitle = i18n.translate('common.ui.aggTypes.metrics.maxBucketTitle', {
|
||||
const maxBucketTitle = i18n.translate('data.search.aggs.metrics.maxBucketTitle', {
|
||||
defaultMessage: 'Max Bucket',
|
||||
});
|
||||
|
|
@ -22,11 +22,11 @@ import { makeNestedLabel } from './lib/make_nested_label';
|
|||
import { siblingPipelineAggHelper } from './lib/sibling_pipeline_agg_helper';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
|
||||
const overallMinLabel = i18n.translate('common.ui.aggTypes.metrics.overallMinLabel', {
|
||||
const overallMinLabel = i18n.translate('data.search.aggs.metrics.overallMinLabel', {
|
||||
defaultMessage: 'overall min',
|
||||
});
|
||||
|
||||
const minBucketTitle = i18n.translate('common.ui.aggTypes.metrics.minBucketTitle', {
|
||||
const minBucketTitle = i18n.translate('data.search.aggs.metrics.minBucketTitle', {
|
||||
defaultMessage: 'Min Bucket',
|
||||
});
|
||||
|
|
@ -23,11 +23,11 @@ import { makeNestedLabel } from './lib/make_nested_label';
|
|||
import { siblingPipelineAggHelper } from './lib/sibling_pipeline_agg_helper';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
|
||||
const overallSumLabel = i18n.translate('common.ui.aggTypes.metrics.overallSumLabel', {
|
||||
const overallSumLabel = i18n.translate('data.search.aggs.metrics.overallSumLabel', {
|
||||
defaultMessage: 'overall sum',
|
||||
});
|
||||
|
||||
const sumBucketTitle = i18n.translate('common.ui.aggTypes.metrics.sumBucketTitle', {
|
||||
const sumBucketTitle = i18n.translate('data.search.aggs.metrics.sumBucketTitle', {
|
||||
defaultMessage: 'Sum Bucket',
|
||||
});
|
||||
|
|
@ -21,9 +21,9 @@ import { i18n } from '@kbn/i18n';
|
|||
import { npStart } from 'ui/new_platform';
|
||||
import { MetricAggType } from './metric_agg_type';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../plugins/data/public';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public';
|
||||
|
||||
const uniqueCountTitle = i18n.translate('common.ui.aggTypes.metrics.uniqueCountTitle', {
|
||||
const uniqueCountTitle = i18n.translate('data.search.aggs.metrics.uniqueCountTitle', {
|
||||
defaultMessage: 'Unique Count',
|
||||
});
|
||||
|
||||
|
@ -31,7 +31,7 @@ export const cardinalityMetricAgg = new MetricAggType({
|
|||
name: METRIC_TYPES.CARDINALITY,
|
||||
title: uniqueCountTitle,
|
||||
makeLabel(aggConfig) {
|
||||
return i18n.translate('common.ui.aggTypes.metrics.uniqueCountLabel', {
|
||||
return i18n.translate('data.search.aggs.metrics.uniqueCountLabel', {
|
||||
defaultMessage: 'Unique count of {field}',
|
||||
values: { field: aggConfig.getFieldDisplayName() },
|
||||
});
|
|
@ -19,18 +19,18 @@
|
|||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { npStart } from 'ui/new_platform';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../plugins/data/public';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public';
|
||||
import { MetricAggType } from './metric_agg_type';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
|
||||
export const countMetricAgg = new MetricAggType({
|
||||
name: METRIC_TYPES.COUNT,
|
||||
title: i18n.translate('common.ui.aggTypes.metrics.countTitle', {
|
||||
title: i18n.translate('data.search.aggs.metrics.countTitle', {
|
||||
defaultMessage: 'Count',
|
||||
}),
|
||||
hasNoDsl: true,
|
||||
makeLabel() {
|
||||
return i18n.translate('common.ui.aggTypes.metrics.countLabel', {
|
||||
return i18n.translate('data.search.aggs.metrics.countLabel', {
|
||||
defaultMessage: 'Count',
|
||||
});
|
||||
},
|
|
@ -23,11 +23,11 @@ import { parentPipelineAggHelper } from './lib/parent_pipeline_agg_helper';
|
|||
import { makeNestedLabel } from './lib/make_nested_label';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
|
||||
const cumulativeSumLabel = i18n.translate('common.ui.aggTypes.metrics.cumulativeSumLabel', {
|
||||
const cumulativeSumLabel = i18n.translate('data.search.aggs.metrics.cumulativeSumLabel', {
|
||||
defaultMessage: 'cumulative sum',
|
||||
});
|
||||
|
||||
const cumulativeSumTitle = i18n.translate('common.ui.aggTypes.metrics.cumulativeSumTitle', {
|
||||
const cumulativeSumTitle = i18n.translate('data.search.aggs.metrics.cumulativeSumTitle', {
|
||||
defaultMessage: 'Cumulative Sum',
|
||||
});
|
||||
|
|
@ -23,11 +23,11 @@ import { parentPipelineAggHelper } from './lib/parent_pipeline_agg_helper';
|
|||
import { makeNestedLabel } from './lib/make_nested_label';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
|
||||
const derivativeLabel = i18n.translate('common.ui.aggTypes.metrics.derivativeLabel', {
|
||||
const derivativeLabel = i18n.translate('data.search.aggs.metrics.derivativeLabel', {
|
||||
defaultMessage: 'derivative',
|
||||
});
|
||||
|
||||
const derivativeTitle = i18n.translate('common.ui.aggTypes.metrics.derivativeTitle', {
|
||||
const derivativeTitle = i18n.translate('data.search.aggs.metrics.derivativeTitle', {
|
||||
defaultMessage: 'Derivative',
|
||||
});
|
||||
|
|
@ -20,13 +20,13 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { MetricAggType } from './metric_agg_type';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../plugins/data/public';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public';
|
||||
|
||||
const geoBoundsTitle = i18n.translate('common.ui.aggTypes.metrics.geoBoundsTitle', {
|
||||
const geoBoundsTitle = i18n.translate('data.search.aggs.metrics.geoBoundsTitle', {
|
||||
defaultMessage: 'Geo Bounds',
|
||||
});
|
||||
|
||||
const geoBoundsLabel = i18n.translate('common.ui.aggTypes.metrics.geoBoundsLabel', {
|
||||
const geoBoundsLabel = i18n.translate('data.search.aggs.metrics.geoBoundsLabel', {
|
||||
defaultMessage: 'Geo Bounds',
|
||||
});
|
||||
|
|
@ -20,13 +20,13 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { MetricAggType } from './metric_agg_type';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../plugins/data/public';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public';
|
||||
|
||||
const geoCentroidTitle = i18n.translate('common.ui.aggTypes.metrics.geoCentroidTitle', {
|
||||
const geoCentroidTitle = i18n.translate('data.search.aggs.metrics.geoCentroidTitle', {
|
||||
defaultMessage: 'Geo Centroid',
|
||||
});
|
||||
|
||||
const geoCentroidLabel = i18n.translate('common.ui.aggTypes.metrics.geoCentroidLabel', {
|
||||
const geoCentroidLabel = i18n.translate('data.search.aggs.metrics.geoCentroidLabel', {
|
||||
defaultMessage: 'Geo Centroid',
|
||||
});
|
||||
|
|
@ -36,7 +36,7 @@ const metricAggFilter = [
|
|||
'!geo_centroid',
|
||||
];
|
||||
|
||||
const metricAggTitle = i18n.translate('common.ui.aggTypes.metrics.metricAggTitle', {
|
||||
const metricAggTitle = i18n.translate('data.search.aggs.metrics.metricAggTitle', {
|
||||
defaultMessage: 'Metric agg',
|
||||
});
|
||||
|
||||
|
@ -51,7 +51,7 @@ const [metricAggSchema] = new Schemas([
|
|||
]).all;
|
||||
|
||||
const parentPipelineType = i18n.translate(
|
||||
'common.ui.aggTypes.metrics.parentPipelineAggregationsSubtypeTitle',
|
||||
'data.search.aggs.metrics.parentPipelineAggregationsSubtypeTitle',
|
||||
{
|
||||
defaultMessage: 'Parent Pipeline Aggregations',
|
||||
}
|
|
@ -17,13 +17,13 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import { AggConfigs } from '../../agg_configs';
|
||||
import { IAggConfigs } from '../../agg_configs';
|
||||
import { IMetricAggConfig } from '../metric_agg_type';
|
||||
|
||||
export const parentPipelineAggWriter = (
|
||||
agg: IMetricAggConfig,
|
||||
output: Record<string, any>,
|
||||
aggConfigs?: AggConfigs
|
||||
aggConfigs?: IAggConfigs
|
||||
): void => {
|
||||
const customMetric = agg.getParam('customMetric');
|
||||
const metricAgg = agg.getParam('metricAgg');
|
|
@ -47,7 +47,7 @@ const [metricAggSchema] = new Schemas([
|
|||
{
|
||||
group: 'none',
|
||||
name: 'metricAgg',
|
||||
title: i18n.translate('common.ui.aggTypes.metrics.metricAggTitle', {
|
||||
title: i18n.translate('data.search.aggs.metrics.metricAggTitle', {
|
||||
defaultMessage: 'Metric agg',
|
||||
}),
|
||||
aggFilter: metricAggFilter,
|
||||
|
@ -57,7 +57,7 @@ const [metricAggSchema] = new Schemas([
|
|||
const [bucketAggSchema] = new Schemas([
|
||||
{
|
||||
group: 'none',
|
||||
title: i18n.translate('common.ui.aggTypes.metrics.bucketAggTitle', {
|
||||
title: i18n.translate('data.search.aggs.metrics.bucketAggTitle', {
|
||||
defaultMessage: 'Bucket agg',
|
||||
}),
|
||||
name: 'bucketAgg',
|
||||
|
@ -66,7 +66,7 @@ const [bucketAggSchema] = new Schemas([
|
|||
]).all;
|
||||
|
||||
const siblingPipelineType = i18n.translate(
|
||||
'common.ui.aggTypes.metrics.siblingPipelineAggregationsSubtypeTitle',
|
||||
'data.search.aggs.metrics.siblingPipelineAggregationsSubtypeTitle',
|
||||
{
|
||||
defaultMessage: 'Sibling pipeline aggregations',
|
||||
}
|
|
@ -20,9 +20,9 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { MetricAggType } from './metric_agg_type';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../plugins/data/public';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public';
|
||||
|
||||
const maxTitle = i18n.translate('common.ui.aggTypes.metrics.maxTitle', {
|
||||
const maxTitle = i18n.translate('data.search.aggs.metrics.maxTitle', {
|
||||
defaultMessage: 'Max',
|
||||
});
|
||||
|
||||
|
@ -30,7 +30,7 @@ export const maxMetricAgg = new MetricAggType({
|
|||
name: METRIC_TYPES.MAX,
|
||||
title: maxTitle,
|
||||
makeLabel(aggConfig) {
|
||||
return i18n.translate('common.ui.aggTypes.metrics.maxLabel', {
|
||||
return i18n.translate('data.search.aggs.metrics.maxLabel', {
|
||||
defaultMessage: 'Max {field}',
|
||||
values: { field: aggConfig.getFieldDisplayName() },
|
||||
});
|
|
@ -17,13 +17,13 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import { AggConfigs } from '../agg_configs';
|
||||
import { AggConfigs, IAggConfigs } from '../agg_configs';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
|
||||
jest.mock('ui/new_platform');
|
||||
|
||||
describe('AggTypeMetricMedianProvider class', () => {
|
||||
let aggConfigs: AggConfigs;
|
||||
let aggConfigs: IAggConfigs;
|
||||
|
||||
beforeEach(() => {
|
||||
const field = {
|
|
@ -22,9 +22,9 @@ import { METRIC_TYPES } from './metric_agg_types';
|
|||
|
||||
// @ts-ignore
|
||||
import { percentilesMetricAgg } from './percentiles';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../plugins/data/public';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public';
|
||||
|
||||
const medianTitle = i18n.translate('common.ui.aggTypes.metrics.medianTitle', {
|
||||
const medianTitle = i18n.translate('data.search.aggs.metrics.medianTitle', {
|
||||
defaultMessage: 'Median',
|
||||
});
|
||||
|
||||
|
@ -33,7 +33,7 @@ export const medianMetricAgg = new MetricAggType({
|
|||
dslName: 'percentiles',
|
||||
title: medianTitle,
|
||||
makeLabel(aggConfig) {
|
||||
return i18n.translate('common.ui.aggTypes.metrics.medianLabel', {
|
||||
return i18n.translate('data.search.aggs.metrics.medianLabel', {
|
||||
defaultMessage: 'Median {field}',
|
||||
values: { field: aggConfig.getFieldDisplayName() },
|
||||
});
|
|
@ -23,7 +23,7 @@ import { AggType, AggTypeConfig } from '../agg_type';
|
|||
import { AggParamType } from '../param_types/agg';
|
||||
import { AggConfig } from '../agg_config';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../plugins/data/public';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public';
|
||||
|
||||
export interface IMetricAggConfig extends AggConfig {
|
||||
type: InstanceType<typeof MetricAggType>;
|
||||
|
@ -43,6 +43,9 @@ interface MetricAggTypeConfig<TMetricAggConfig extends AggConfig>
|
|||
subtype?: string;
|
||||
}
|
||||
|
||||
// TODO need to make a more explicit interface for this
|
||||
export type IMetricAggType = MetricAggType;
|
||||
|
||||
export class MetricAggType<TMetricAggConfig extends AggConfig = IMetricAggConfig> extends AggType<
|
||||
TMetricAggConfig,
|
||||
MetricAggParam<TMetricAggConfig>
|
||||
|
@ -83,7 +86,7 @@ export class MetricAggType<TMetricAggConfig extends AggConfig = IMetricAggConfig
|
|||
|
||||
this.subtype =
|
||||
config.subtype ||
|
||||
i18n.translate('common.ui.aggTypes.metrics.metricAggregationsSubtypeTitle', {
|
||||
i18n.translate('data.search.aggs.metrics.metricAggregationsSubtypeTitle', {
|
||||
defaultMessage: 'Metric Aggregations',
|
||||
});
|
||||
|
|
@ -19,9 +19,9 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { MetricAggType } from './metric_agg_type';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../plugins/data/public';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public';
|
||||
|
||||
const minTitle = i18n.translate('common.ui.aggTypes.metrics.minTitle', {
|
||||
const minTitle = i18n.translate('data.search.aggs.metrics.minTitle', {
|
||||
defaultMessage: 'Min',
|
||||
});
|
||||
|
||||
|
@ -29,7 +29,7 @@ export const minMetricAgg = new MetricAggType({
|
|||
name: METRIC_TYPES.MIN,
|
||||
title: minTitle,
|
||||
makeLabel(aggConfig) {
|
||||
return i18n.translate('common.ui.aggTypes.metrics.minLabel', {
|
||||
return i18n.translate('data.search.aggs.metrics.minLabel', {
|
||||
defaultMessage: 'Min {field}',
|
||||
values: { field: aggConfig.getFieldDisplayName() },
|
||||
});
|
|
@ -23,11 +23,11 @@ import { parentPipelineAggHelper } from './lib/parent_pipeline_agg_helper';
|
|||
import { makeNestedLabel } from './lib/make_nested_label';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
|
||||
const movingAvgTitle = i18n.translate('common.ui.aggTypes.metrics.movingAvgTitle', {
|
||||
const movingAvgTitle = i18n.translate('data.search.aggs.metrics.movingAvgTitle', {
|
||||
defaultMessage: 'Moving Avg',
|
||||
});
|
||||
|
||||
const movingAvgLabel = i18n.translate('common.ui.aggTypes.metrics.movingAvgLabel', {
|
||||
const movingAvgLabel = i18n.translate('data.search.aggs.metrics.movingAvgLabel', {
|
||||
defaultMessage: 'moving avg',
|
||||
});
|
||||
|
|
@ -18,13 +18,13 @@
|
|||
*/
|
||||
|
||||
import { IPercentileRanksAggConfig, percentileRanksMetricAgg } from './percentile_ranks';
|
||||
import { AggConfigs } from '../agg_configs';
|
||||
import { AggConfigs, IAggConfigs } from '../agg_configs';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
|
||||
jest.mock('ui/new_platform');
|
||||
|
||||
describe('AggTypesMetricsPercentileRanksProvider class', function() {
|
||||
let aggConfigs: AggConfigs;
|
||||
let aggConfigs: IAggConfigs;
|
||||
|
||||
beforeEach(() => {
|
||||
const field = {
|
|
@ -24,7 +24,7 @@ import { getResponseAggConfigClass, IResponseAggConfig } from './lib/get_respons
|
|||
|
||||
import { getPercentileValue } from './percentiles_get_value';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
import { fieldFormats, KBN_FIELD_TYPES } from '../../../../../plugins/data/public';
|
||||
import { fieldFormats, KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public';
|
||||
|
||||
// required by the values editor
|
||||
|
||||
|
@ -41,7 +41,7 @@ const valueProps = {
|
|||
const customLabel = this.getParam('customLabel');
|
||||
const label = customLabel || this.getFieldDisplayName();
|
||||
|
||||
return i18n.translate('common.ui.aggTypes.metrics.percentileRanks.valuePropsLabel', {
|
||||
return i18n.translate('data.search.aggs.metrics.percentileRanks.valuePropsLabel', {
|
||||
defaultMessage: 'Percentile rank {format} of "{label}"',
|
||||
values: { format: format.convert(this.key, 'text'), label },
|
||||
});
|
||||
|
@ -50,11 +50,11 @@ const valueProps = {
|
|||
|
||||
export const percentileRanksMetricAgg = new MetricAggType<IPercentileRanksAggConfig>({
|
||||
name: METRIC_TYPES.PERCENTILE_RANKS,
|
||||
title: i18n.translate('common.ui.aggTypes.metrics.percentileRanksTitle', {
|
||||
title: i18n.translate('data.search.aggs.metrics.percentileRanksTitle', {
|
||||
defaultMessage: 'Percentile Ranks',
|
||||
}),
|
||||
makeLabel(agg) {
|
||||
return i18n.translate('common.ui.aggTypes.metrics.percentileRanksLabel', {
|
||||
return i18n.translate('data.search.aggs.metrics.percentileRanksLabel', {
|
||||
defaultMessage: 'Percentile ranks of {field}',
|
||||
values: { field: agg.getFieldDisplayName() },
|
||||
});
|
|
@ -18,13 +18,13 @@
|
|||
*/
|
||||
|
||||
import { IPercentileAggConfig, percentilesMetricAgg } from './percentiles';
|
||||
import { AggConfigs } from '../agg_configs';
|
||||
import { AggConfigs, IAggConfigs } from '../agg_configs';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
|
||||
jest.mock('ui/new_platform');
|
||||
|
||||
describe('AggTypesMetricsPercentilesProvider class', () => {
|
||||
let aggConfigs: AggConfigs;
|
||||
let aggConfigs: IAggConfigs;
|
||||
|
||||
beforeEach(() => {
|
||||
const field = {
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
|
||||
import { MetricAggType } from './metric_agg_type';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../plugins/data/public';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public';
|
||||
|
||||
import { getResponseAggConfigClass, IResponseAggConfig } from './lib/get_response_agg_config_class';
|
||||
import { getPercentileValue } from './percentiles_get_value';
|
||||
|
@ -36,7 +36,7 @@ const valueProps = {
|
|||
const customLabel = this.getParam('customLabel');
|
||||
const label = customLabel || this.getFieldDisplayName();
|
||||
|
||||
return i18n.translate('common.ui.aggTypes.metrics.percentiles.valuePropsLabel', {
|
||||
return i18n.translate('data.search.aggs.metrics.percentiles.valuePropsLabel', {
|
||||
defaultMessage: '{percentile} percentile of {label}',
|
||||
values: { percentile: ordinalSuffix(this.key), label },
|
||||
});
|
||||
|
@ -45,11 +45,11 @@ const valueProps = {
|
|||
|
||||
export const percentilesMetricAgg = new MetricAggType<IPercentileAggConfig>({
|
||||
name: METRIC_TYPES.PERCENTILES,
|
||||
title: i18n.translate('common.ui.aggTypes.metrics.percentilesTitle', {
|
||||
title: i18n.translate('data.search.aggs.metrics.percentilesTitle', {
|
||||
defaultMessage: 'Percentiles',
|
||||
}),
|
||||
makeLabel(agg) {
|
||||
return i18n.translate('common.ui.aggTypes.metrics.percentilesLabel', {
|
||||
return i18n.translate('data.search.aggs.metrics.percentilesLabel', {
|
||||
defaultMessage: 'Percentiles of {field}',
|
||||
values: { field: agg.getFieldDisplayName() },
|
||||
});
|
|
@ -23,11 +23,11 @@ import { parentPipelineAggHelper } from './lib/parent_pipeline_agg_helper';
|
|||
import { makeNestedLabel } from './lib/make_nested_label';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
|
||||
const serialDiffTitle = i18n.translate('common.ui.aggTypes.metrics.serialDiffTitle', {
|
||||
const serialDiffTitle = i18n.translate('data.search.aggs.metrics.serialDiffTitle', {
|
||||
defaultMessage: 'Serial Diff',
|
||||
});
|
||||
|
||||
const serialDiffLabel = i18n.translate('common.ui.aggTypes.metrics.serialDiffLabel', {
|
||||
const serialDiffLabel = i18n.translate('data.search.aggs.metrics.serialDiffLabel', {
|
||||
defaultMessage: 'serial diff',
|
||||
});
|
||||
|
|
@ -22,7 +22,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { MetricAggType } from './metric_agg_type';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
import { getResponseAggConfigClass, IResponseAggConfig } from './lib/get_response_agg_config_class';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../plugins/data/public';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public';
|
||||
|
||||
interface ValProp {
|
||||
valProp: string[];
|
||||
|
@ -51,7 +51,7 @@ const responseAggConfigProps = {
|
|||
keyedDetails(this: IStdDevAggConfig, customLabel: string, fieldDisplayName: string) {
|
||||
const label =
|
||||
customLabel ||
|
||||
i18n.translate('common.ui.aggTypes.metrics.standardDeviation.keyDetailsLabel', {
|
||||
i18n.translate('data.search.aggs.metrics.standardDeviation.keyDetailsLabel', {
|
||||
defaultMessage: 'Standard Deviation of {fieldDisplayName}',
|
||||
values: { fieldDisplayName },
|
||||
});
|
||||
|
@ -59,14 +59,14 @@ const responseAggConfigProps = {
|
|||
return {
|
||||
std_lower: {
|
||||
valProp: ['std_deviation_bounds', 'lower'],
|
||||
title: i18n.translate('common.ui.aggTypes.metrics.standardDeviation.lowerKeyDetailsTitle', {
|
||||
title: i18n.translate('data.search.aggs.metrics.standardDeviation.lowerKeyDetailsTitle', {
|
||||
defaultMessage: 'Lower {label}',
|
||||
values: { label },
|
||||
}),
|
||||
},
|
||||
std_upper: {
|
||||
valProp: ['std_deviation_bounds', 'upper'],
|
||||
title: i18n.translate('common.ui.aggTypes.metrics.standardDeviation.upperKeyDetailsTitle', {
|
||||
title: i18n.translate('data.search.aggs.metrics.standardDeviation.upperKeyDetailsTitle', {
|
||||
defaultMessage: 'Upper {label}',
|
||||
values: { label },
|
||||
}),
|
||||
|
@ -78,11 +78,11 @@ const responseAggConfigProps = {
|
|||
export const stdDeviationMetricAgg = new MetricAggType<IStdDevAggConfig>({
|
||||
name: METRIC_TYPES.STD_DEV,
|
||||
dslName: 'extended_stats',
|
||||
title: i18n.translate('common.ui.aggTypes.metrics.standardDeviationTitle', {
|
||||
title: i18n.translate('data.search.aggs.metrics.standardDeviationTitle', {
|
||||
defaultMessage: 'Standard Deviation',
|
||||
}),
|
||||
makeLabel(agg) {
|
||||
return i18n.translate('common.ui.aggTypes.metrics.standardDeviationLabel', {
|
||||
return i18n.translate('data.search.aggs.metrics.standardDeviationLabel', {
|
||||
defaultMessage: 'Standard Deviation of {field}',
|
||||
values: { field: agg.getFieldDisplayName() },
|
||||
});
|
|
@ -20,9 +20,9 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { MetricAggType } from './metric_agg_type';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../plugins/data/public';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public';
|
||||
|
||||
const sumTitle = i18n.translate('common.ui.aggTypes.metrics.sumTitle', {
|
||||
const sumTitle = i18n.translate('data.search.aggs.metrics.sumTitle', {
|
||||
defaultMessage: 'Sum',
|
||||
});
|
||||
|
||||
|
@ -30,7 +30,7 @@ export const sumMetricAgg = new MetricAggType({
|
|||
name: METRIC_TYPES.SUM,
|
||||
title: sumTitle,
|
||||
makeLabel(aggConfig) {
|
||||
return i18n.translate('common.ui.aggTypes.metrics.sumLabel', {
|
||||
return i18n.translate('data.search.aggs.metrics.sumLabel', {
|
||||
defaultMessage: 'Sum of {field}',
|
||||
values: { field: aggConfig.getFieldDisplayName() },
|
||||
});
|
|
@ -21,7 +21,7 @@ import { dropRight, last } from 'lodash';
|
|||
import { topHitMetricAgg } from './top_hit';
|
||||
import { AggConfigs } from '../agg_configs';
|
||||
import { IMetricAggConfig } from './metric_agg_type';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../plugins/data/public';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public';
|
||||
|
||||
jest.mock('ui/new_platform');
|
||||
|
|
@ -22,7 +22,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { IMetricAggConfig, MetricAggType } from './metric_agg_type';
|
||||
import { aggTypeFieldFilters } from '../param_types/filter';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../plugins/data/public';
|
||||
import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public';
|
||||
|
||||
// @ts-ignore
|
||||
import { wrapWithInlineComp } from '../buckets/inline_comp_wrapper';
|
||||
|
@ -46,14 +46,14 @@ aggTypeFieldFilters.addFilter((field, aggConfig) => {
|
|||
|
||||
export const topHitMetricAgg = new MetricAggType({
|
||||
name: METRIC_TYPES.TOP_HITS,
|
||||
title: i18n.translate('common.ui.aggTypes.metrics.topHitTitle', {
|
||||
title: i18n.translate('data.search.aggs.metrics.topHitTitle', {
|
||||
defaultMessage: 'Top Hit',
|
||||
}),
|
||||
makeLabel(aggConfig) {
|
||||
const lastPrefixLabel = i18n.translate('common.ui.aggTypes.metrics.topHit.lastPrefixLabel', {
|
||||
const lastPrefixLabel = i18n.translate('data.search.aggs.metrics.topHit.lastPrefixLabel', {
|
||||
defaultMessage: 'Last',
|
||||
});
|
||||
const firstPrefixLabel = i18n.translate('common.ui.aggTypes.metrics.topHit.firstPrefixLabel', {
|
||||
const firstPrefixLabel = i18n.translate('data.search.aggs.metrics.topHit.firstPrefixLabel', {
|
||||
defaultMessage: 'First',
|
||||
});
|
||||
|
||||
|
@ -106,7 +106,7 @@ export const topHitMetricAgg = new MetricAggType({
|
|||
type: 'optioned',
|
||||
options: [
|
||||
{
|
||||
text: i18n.translate('common.ui.aggTypes.metrics.topHit.minLabel', {
|
||||
text: i18n.translate('data.search.aggs.metrics.topHit.minLabel', {
|
||||
defaultMessage: 'Min',
|
||||
}),
|
||||
isCompatible: isNumericFieldSelected,
|
||||
|
@ -114,7 +114,7 @@ export const topHitMetricAgg = new MetricAggType({
|
|||
value: 'min',
|
||||
},
|
||||
{
|
||||
text: i18n.translate('common.ui.aggTypes.metrics.topHit.maxLabel', {
|
||||
text: i18n.translate('data.search.aggs.metrics.topHit.maxLabel', {
|
||||
defaultMessage: 'Max',
|
||||
}),
|
||||
isCompatible: isNumericFieldSelected,
|
||||
|
@ -122,7 +122,7 @@ export const topHitMetricAgg = new MetricAggType({
|
|||
value: 'max',
|
||||
},
|
||||
{
|
||||
text: i18n.translate('common.ui.aggTypes.metrics.topHit.sumLabel', {
|
||||
text: i18n.translate('data.search.aggs.metrics.topHit.sumLabel', {
|
||||
defaultMessage: 'Sum',
|
||||
}),
|
||||
isCompatible: isNumericFieldSelected,
|
||||
|
@ -130,7 +130,7 @@ export const topHitMetricAgg = new MetricAggType({
|
|||
value: 'sum',
|
||||
},
|
||||
{
|
||||
text: i18n.translate('common.ui.aggTypes.metrics.topHit.averageLabel', {
|
||||
text: i18n.translate('data.search.aggs.metrics.topHit.averageLabel', {
|
||||
defaultMessage: 'Average',
|
||||
}),
|
||||
isCompatible: isNumericFieldSelected,
|
||||
|
@ -138,7 +138,7 @@ export const topHitMetricAgg = new MetricAggType({
|
|||
value: 'average',
|
||||
},
|
||||
{
|
||||
text: i18n.translate('common.ui.aggTypes.metrics.topHit.concatenateLabel', {
|
||||
text: i18n.translate('data.search.aggs.metrics.topHit.concatenateLabel', {
|
||||
defaultMessage: 'Concatenate',
|
||||
}),
|
||||
isCompatible(aggConfig: IMetricAggConfig) {
|
||||
|
@ -174,13 +174,13 @@ export const topHitMetricAgg = new MetricAggType({
|
|||
default: 'desc',
|
||||
options: [
|
||||
{
|
||||
text: i18n.translate('common.ui.aggTypes.metrics.topHit.descendingLabel', {
|
||||
text: i18n.translate('data.search.aggs.metrics.topHit.descendingLabel', {
|
||||
defaultMessage: 'Descending',
|
||||
}),
|
||||
value: 'desc',
|
||||
},
|
||||
{
|
||||
text: i18n.translate('common.ui.aggTypes.metrics.topHit.ascendingLabel', {
|
||||
text: i18n.translate('data.search.aggs.metrics.topHit.ascendingLabel', {
|
||||
defaultMessage: 'Ascending',
|
||||
}),
|
||||
value: 'asc',
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue