diff --git a/src/plugins/data/common/search/aggs/agg_types_registry.ts b/src/plugins/data/common/search/aggs/agg_types_registry.ts index e9eb6be9f11d..1af73d21b36b 100644 --- a/src/plugins/data/common/search/aggs/agg_types_registry.ts +++ b/src/plugins/data/common/search/aggs/agg_types_registry.ts @@ -91,8 +91,10 @@ export class AggTypesRegistry { start = ({ uiSettings }: AggTypesRegistryStartDependencies) => { const disabledBucketAgg = uiSettings.get('visualize:disableBucketAgg'); - for (const k of this.bucketAggs.keys()) { - if (disabledBucketAgg.includes(k)) this.bucketAggs.delete(k); + if (disabledBucketAgg !== undefined && Array.isArray(disabledBucketAgg)) { + for (const k of this.bucketAggs.keys()) { + if (disabledBucketAgg.includes(k)) this.bucketAggs.delete(k); + } } return { diff --git a/src/plugins/data/public/search/aggs/aggs_service.ts b/src/plugins/data/public/search/aggs/aggs_service.ts index bb9d7a46d2cb..f1e64aced7bd 100644 --- a/src/plugins/data/public/search/aggs/aggs_service.ts +++ b/src/plugins/data/public/search/aggs/aggs_service.ts @@ -151,7 +151,7 @@ export class AggsService { return { calculateAutoTimeExpression, - createAggConfigs: (indexPattern, configStates = [], schemas) => { + createAggConfigs: (indexPattern: any, configStates = [], schemas: any) => { return new AggConfigs(indexPattern, configStates, { typesRegistry }); }, types: typesRegistry, diff --git a/src/plugins/data/public/ui/query_string_input/fetch_index_patterns.ts b/src/plugins/data/public/ui/query_string_input/fetch_index_patterns.ts index f6747c02ce93..23cb447f25b6 100644 --- a/src/plugins/data/public/ui/query_string_input/fetch_index_patterns.ts +++ b/src/plugins/data/public/ui/query_string_input/fetch_index_patterns.ts @@ -50,7 +50,7 @@ export async function fetchIndexPatterns( searchFields: ['title'], }); - const exactMatches = indexPatternsFromSavedObjects.savedObjects.filter((savedObject) => { + const exactMatches = indexPatternsFromSavedObjects.savedObjects.filter((savedObject: any) => { return indexPatternStrings.includes(savedObject.attributes.title); }); diff --git a/src/plugins/data/server/search/aggs/aggs_service.ts b/src/plugins/data/server/search/aggs/aggs_service.ts index 7d2cc502f370..a2aa9745d82a 100644 --- a/src/plugins/data/server/search/aggs/aggs_service.ts +++ b/src/plugins/data/server/search/aggs/aggs_service.ts @@ -52,7 +52,6 @@ import { AggsSetup, AggsStart } from './types'; /** @internal */ export interface AggsSetupDependencies { registerFunction: ExpressionsServiceSetup['registerFunction']; - uiSettings: UiSettingsServiceSetup; } /** @internal */ @@ -130,7 +129,7 @@ export class AggsService { return { calculateAutoTimeExpression, - createAggConfigs: (indexPattern, configStates = [], schemas) => { + createAggConfigs: (indexPattern: any, configStates = [], schemas: any) => { return new AggConfigs(indexPattern, configStates, { typesRegistry }); }, types: typesRegistry,