From 60e3da73b6118e34ec250a1cb4a2f4904097b532 Mon Sep 17 00:00:00 2001 From: Xavier Mouligneau Date: Thu, 24 Oct 2024 13:49:14 -0400 Subject: [PATCH] [CLOUD] add the term search for es in kibana (#197667) ## Summary The cloud can pass the term `search` for the solution type. It will be ideal to only have one term but for now let's merge this fix and I will check with CP that we only pass one term for `search` and `elasticsearch`. ### Checklist Delete any items that are not applicable to this PR. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) --- .../common/parse_onboarding_default_solution.test.ts | 2 ++ .../cloud/common/parse_onboarding_default_solution.ts | 6 +++++- .../spaces/server/routes/lib/parse_cloud_solution.test.ts | 8 ++++++++ .../spaces/server/routes/lib/parse_cloud_solution.ts | 1 + 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/cloud/common/parse_onboarding_default_solution.test.ts b/x-pack/plugins/cloud/common/parse_onboarding_default_solution.test.ts index de8b305ee452b..05173c612f411 100644 --- a/x-pack/plugins/cloud/common/parse_onboarding_default_solution.test.ts +++ b/x-pack/plugins/cloud/common/parse_onboarding_default_solution.test.ts @@ -16,6 +16,8 @@ describe('parseOnboardingSolution', () => { [ ['elasticsearch', 'es'], ['Elasticsearch', 'es'], + ['search', 'es'], + ['Search', 'es'], ['observability', 'oblt'], ['Observability', 'oblt'], ['security', 'security'], diff --git a/x-pack/plugins/cloud/common/parse_onboarding_default_solution.ts b/x-pack/plugins/cloud/common/parse_onboarding_default_solution.ts index e5938f77af92f..5b064eecce12d 100644 --- a/x-pack/plugins/cloud/common/parse_onboarding_default_solution.ts +++ b/x-pack/plugins/cloud/common/parse_onboarding_default_solution.ts @@ -18,9 +18,13 @@ export function parseOnboardingSolution(value?: string): OnBoardingDefaultSoluti if (!value) return; const solutions: Array<{ - cloudValue: 'elasticsearch' | 'observability' | 'security'; + cloudValue: 'search' | 'elasticsearch' | 'observability' | 'security'; kibanaValue: OnBoardingDefaultSolution; }> = [ + { + cloudValue: 'search', + kibanaValue: 'es', + }, { cloudValue: 'elasticsearch', kibanaValue: 'es', diff --git a/x-pack/plugins/spaces/server/routes/lib/parse_cloud_solution.test.ts b/x-pack/plugins/spaces/server/routes/lib/parse_cloud_solution.test.ts index 92ab37ec7359a..95a224b165ad5 100644 --- a/x-pack/plugins/spaces/server/routes/lib/parse_cloud_solution.test.ts +++ b/x-pack/plugins/spaces/server/routes/lib/parse_cloud_solution.test.ts @@ -13,6 +13,10 @@ describe('parseCloudSolution', () => { expect(parseCloudSolution('elasticsearch')).toBe('es'); }); + it('should return "es" for "search"', () => { + expect(parseCloudSolution('search')).toBe('es'); + }); + it('should return "oblt" for "observability"', () => { expect(parseCloudSolution('observability')).toBe('oblt'); }); @@ -26,6 +30,10 @@ describe('parseCloudSolution', () => { expect(parseCloudSolution('ELASTICSEARCH')).toBe('es'); }); + it('should return "es" for "SEARCH"', () => { + expect(parseCloudSolution('SEARCH')).toBe('es'); + }); + it('should return "oblt" for "OBSERVABILITY"', () => { expect(parseCloudSolution('OBSERVABILITY')).toBe('oblt'); }); diff --git a/x-pack/plugins/spaces/server/routes/lib/parse_cloud_solution.ts b/x-pack/plugins/spaces/server/routes/lib/parse_cloud_solution.ts index 4532c26fc6686..1238d9a356d32 100644 --- a/x-pack/plugins/spaces/server/routes/lib/parse_cloud_solution.ts +++ b/x-pack/plugins/spaces/server/routes/lib/parse_cloud_solution.ts @@ -8,6 +8,7 @@ import type { SolutionView } from '../../../common'; const CLOUD_TO_KIBANA_SOLUTION_MAP = new Map([ + ['search', 'es'], ['elasticsearch', 'es'], ['observability', 'oblt'], ['security', 'security'],