From 369b41647a46aef6e8d54122727df42dbc1fd656 Mon Sep 17 00:00:00 2001 From: Sander Philipse Date: Wed, 6 Nov 2024 14:29:02 +0100 Subject: [PATCH 1/2] [AI Assistant] Enable Search in Solution View --- .../spaces/server/lib/utils/space_solution_disabled_features.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/plugins/spaces/server/lib/utils/space_solution_disabled_features.ts b/x-pack/plugins/spaces/server/lib/utils/space_solution_disabled_features.ts index 066166e7e87dd..6a7dd9168a248 100644 --- a/x-pack/plugins/spaces/server/lib/utils/space_solution_disabled_features.ts +++ b/x-pack/plugins/spaces/server/lib/utils/space_solution_disabled_features.ts @@ -61,7 +61,6 @@ export function withSpaceSolutionDisabledFeatures( ]).filter((featureId) => !enabledFeaturesPerSolution.es.includes(featureId)); } else if (spaceSolution === 'oblt') { disabledFeatureKeysFromSolution = getFeatureIdsForCategories(features, [ - 'enterpriseSearch', 'securitySolution', ]).filter((featureId) => !enabledFeaturesPerSolution.oblt.includes(featureId)); } else if (spaceSolution === 'security') { From 0be84a62b4e375574160ed8620908b99eae69d5e Mon Sep 17 00:00:00 2001 From: Sander Philipse Date: Thu, 7 Nov 2024 15:05:33 +0100 Subject: [PATCH 2/2] Fix tests --- .../server/capabilities/capabilities_switcher.test.ts | 6 ++---- .../lib/utils/space_solution_disabled_features.test.ts | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/x-pack/plugins/spaces/server/capabilities/capabilities_switcher.test.ts b/x-pack/plugins/spaces/server/capabilities/capabilities_switcher.test.ts index d48095638babf..d4f3457ea277c 100644 --- a/x-pack/plugins/spaces/server/capabilities/capabilities_switcher.test.ts +++ b/x-pack/plugins/spaces/server/capabilities/capabilities_switcher.test.ts @@ -366,14 +366,12 @@ describe('capabilitiesSwitcher', () => { { space.solution = 'oblt'; - // It should disable enterpriseSearch and securitySolution features - // which correspond to feature_1 and feature_3 + // It should disable securitySolution features + // which corresponds to feature_3 const result = await switcher(request, capabilities, false); const expectedCapabilities = buildCapabilities(); - expectedCapabilities.feature_1.bar = false; - expectedCapabilities.feature_1.foo = false; expectedCapabilities.feature_3.bar = false; expectedCapabilities.feature_3.foo = false; diff --git a/x-pack/plugins/spaces/server/lib/utils/space_solution_disabled_features.test.ts b/x-pack/plugins/spaces/server/lib/utils/space_solution_disabled_features.test.ts index 908a4ee2ced57..f19b4d585dc22 100644 --- a/x-pack/plugins/spaces/server/lib/utils/space_solution_disabled_features.test.ts +++ b/x-pack/plugins/spaces/server/lib/utils/space_solution_disabled_features.test.ts @@ -58,7 +58,7 @@ describe('#withSpaceSolutionDisabledFeatures', () => { }); describe('when the space solution is "oblt"', () => { - test('it removes the "search" and "security" features', () => { + test('it removes the "security" features', () => { const spaceDisabledFeatures: string[] = []; const spaceSolution = 'oblt'; @@ -68,7 +68,7 @@ describe('#withSpaceSolutionDisabledFeatures', () => { spaceSolution ); - expect(result).toEqual(['feature2', 'feature3']); + expect(result).toEqual(['feature3']); }); });