Skip to content

Commit 8ba11e3

Browse files
authored
[Tests] update disable bucket agg feature for tests (opensearch-project#1284)
Test failure introduced: opensearch-project#1196 Updating to handle the if that configuration is not found or if it is not an array. Issue: n/a Signed-off-by: Kawika Avilla <[email protected]>
1 parent 749c858 commit 8ba11e3

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/plugins/data/common/search/aggs/agg_types_registry.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,10 @@ export class AggTypesRegistry {
9191
start = ({ uiSettings }: AggTypesRegistryStartDependencies) => {
9292
const disabledBucketAgg = uiSettings.get('visualize:disableBucketAgg');
9393

94-
for (const k of this.bucketAggs.keys()) {
95-
if (disabledBucketAgg.includes(k)) this.bucketAggs.delete(k);
94+
if (disabledBucketAgg !== undefined && Array.isArray(disabledBucketAgg)) {
95+
for (const k of this.bucketAggs.keys()) {
96+
if (disabledBucketAgg.includes(k)) this.bucketAggs.delete(k);
97+
}
9698
}
9799

98100
return {

src/plugins/data/server/search/aggs/aggs_service.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@
3232

3333
import { pick } from 'lodash';
3434

35-
import {
36-
UiSettingsServiceSetup,
37-
UiSettingsServiceStart,
38-
SavedObjectsClientContract,
39-
} from 'src/core/server';
35+
import { UiSettingsServiceStart, SavedObjectsClientContract } from 'src/core/server';
4036
import { ExpressionsServiceSetup } from 'src/plugins/expressions/common';
4137
import {
4238
AggsCommonService,
@@ -52,7 +48,6 @@ import { AggsSetup, AggsStart } from './types';
5248
/** @internal */
5349
export interface AggsSetupDependencies {
5450
registerFunction: ExpressionsServiceSetup['registerFunction'];
55-
uiSettings: UiSettingsServiceSetup;
5651
}
5752

5853
/** @internal */

0 commit comments

Comments
 (0)