forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SecuritySolution] Share getStartedPage between ESS and serverless (e…
…lastic#174867) ## Summary elastic#174742 This PR move the get_started component from `security_solution_serverless` plugin to `security_solution` plugin, so we can share the same UI between ESS and serverless. Parameters are set via `x-pack/plugins/security_solution/public/contract_get_started_page.ts` 1. productTypes - set by serverless only 2. projectsUrl - set by serverless only (when running serverless locally, this value is empty) 3. projectFeaturesUrl - set by serverless only (when running serverless locally, this value is empty) 4. availableSteps - set by both serverless and ESS (ESS doesn't contain `create your first project` step) Known issue: elastic#175296 --- #### Serverless: 6 steps in total + the first step is finished by default ![serverless](https://github.com/elastic/kibana/assets/6295984/8bbf6557-8c8e-42c6-843b-fc24ac1dd178) #### ESS: 5 steps in total ![Screenshot 2024-01-24 at 20 04 19](https://github.com/elastic/kibana/assets/6295984/6486916a-9976-4fb5-bf07-721ba4d411aa) ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
52c42ff
commit fffb572
Showing
131 changed files
with
1,289 additions
and
1,381 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
x-pack/plugins/security_solution/public/app/components/onboarding/onboarding_page_service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import type { Observable } from 'rxjs'; | ||
import { BehaviorSubject } from 'rxjs'; | ||
import type { SecurityProductTypes } from '../../../common/components/landing_page/onboarding/configs'; | ||
import type { StepId } from '../../../common/components/landing_page/onboarding/types'; | ||
|
||
export class OnboardingPageService { | ||
private productTypesSubject$: BehaviorSubject<SecurityProductTypes | undefined>; | ||
private projectsUrlSubject$: BehaviorSubject<string | undefined>; | ||
private projectFeaturesUrlSubject$: BehaviorSubject<string | undefined>; | ||
private availableStepsSubject$: BehaviorSubject<StepId[]>; | ||
|
||
public productTypes$: Observable<SecurityProductTypes | undefined>; | ||
public projectsUrl$: Observable<string | undefined>; | ||
public projectFeaturesUrl$: Observable<string | undefined>; | ||
public availableSteps$: Observable<StepId[]>; | ||
|
||
constructor() { | ||
this.productTypesSubject$ = new BehaviorSubject<SecurityProductTypes | undefined>(undefined); | ||
this.projectsUrlSubject$ = new BehaviorSubject<string | undefined>(undefined); | ||
this.projectFeaturesUrlSubject$ = new BehaviorSubject<string | undefined>(undefined); | ||
this.availableStepsSubject$ = new BehaviorSubject<StepId[]>([]); | ||
|
||
this.productTypes$ = this.productTypesSubject$.asObservable(); | ||
this.projectsUrl$ = this.projectsUrlSubject$.asObservable(); | ||
this.projectFeaturesUrl$ = this.projectFeaturesUrlSubject$.asObservable(); | ||
this.availableSteps$ = this.availableStepsSubject$.asObservable(); | ||
} | ||
|
||
setProductTypes(productTypes: SecurityProductTypes) { | ||
this.productTypesSubject$.next(productTypes); | ||
} | ||
setProjectFeaturesUrl(projectFeaturesUrl: string | undefined) { | ||
this.projectFeaturesUrlSubject$.next(projectFeaturesUrl); | ||
} | ||
setProjectsUrl(projectsUrl: string | undefined) { | ||
this.projectsUrlSubject$.next(projectsUrl); | ||
} | ||
setAvailableSteps(availableSteps: StepId[]) { | ||
this.availableStepsSubject$.next(availableSteps); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...ns/security_solution/public/common/components/landing_page/onboarding/__mocks__/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
import React from 'react'; | ||
|
||
export const getOnboardingComponent = jest | ||
.fn() | ||
.mockReturnValue(() => <div data-test-subj="onboarding-with-settings" />); |
12 changes: 12 additions & 0 deletions
12
...n/public/common/components/landing_page/onboarding/__mocks__/onboarding_with_settings.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
export const OnboardingWithSettingsComponent = () => ( | ||
<div data-test-subj="onboarding-with-settings" /> | ||
); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.