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] Update get started page UI (elastic#171078)
## Summary [Test env](https://p.elstc.co/paste/Y83spa-G#0BRN87aMZxLJfbVok3W0U-7D/sss9OGfH9IIqw4oHL6) 1. When landing on the page the first time, all the tasks are collapsed. If visited before, it keeps the last expanded task. 2. When clicking on the task, the url has the task id appended as `#{taskId}` 3. When visiting the page, if url has `#{taskId}`, the relevant task should be expanded. If no `#{taskId}` in the url, it expands the last expanded task according to **local storage**. 4. Tasks completion are checked automatically, users are not able to undo any tasks unless the **local storage** is cleanned. 5. Task completion criteria: elastic/security-team#8032 `Onboarding tasks with success criteria`: - [x] "create first project" -> ~unexpandable~, already complete when user arrives - [x] "watch overview video" -> user clicks to expand (success == users opens section/clicks "Start") - [x] "add integrations" -> users clicks to expand and goes to integration page (success == query fleet to confirm an agent exists with an integration) `Update we use **indicesExist** from sourcerer to replace fleet api as some performance issue found when running locally, not sure how it will affect the production.` - [x] - after user clicks "Start" and expands, if success criteria is already met (e.g. agent is installed with an integration), notify user agent is installed and mark step as complete. - [x] "view and analyze dashboards" -> users clicks to expand (success == click action) - [x] "enable prebuilt rules" -> clicks to expand (success == at least one rule **enabled**, show enabled rules like integrations above) - [x] "view alerts" -> user clicks to expand (success == click action) 6. Design: elastic#171078 (comment) elastic#170643 <img width="2556" alt="Screenshot 2023-12-04 at 16 47 48" src="https://github.com/elastic/kibana/assets/6295984/c98eb2f5-6b31-43f9-9db5-0829e78bb3c2"> <img width="2548" alt="Screenshot 2023-12-04 at 16 29 50" src="https://github.com/elastic/kibana/assets/6295984/41cb329c-417f-4b95-b19b-67663380a9a3"> <img width="2546" alt="Screenshot 2023-12-04 at 16 30 47" src="https://github.com/elastic/kibana/assets/6295984/daa3cf3b-9d2e-4c69-83f1-fcc4817f6b8f"> - Integration added: https://github.com/elastic/kibana/assets/6295984/1f9aefe4-c20b-4d46-b8b0-1aabf8bd7091 - Integration not added: https://github.com/elastic/kibana/assets/6295984/8b0d6c6b-0bae-4857-aeb1-715f9f4080b8 https://github.com/elastic/kibana/assets/6295984/29432bfe-f270-4e5e-a1c9-86ad806ea5bb ### 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) - [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]> Co-authored-by: Sergi Massaneda <[email protected]>
- Loading branch information
1 parent
4a308c6
commit e84d0a0
Showing
83 changed files
with
2,841 additions
and
3,655 deletions.
There are no files selected for viewing
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
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
27 changes: 27 additions & 0 deletions
27
x-pack/plugins/security_solution_serverless/public/common/hooks/use_user_name.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,27 @@ | ||
/* | ||
* 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 { useEffect, useState } from 'react'; | ||
import { useKibana } from '../services'; | ||
|
||
export const useUserName = () => { | ||
const [userName, setUserName] = useState<string>(); | ||
const { | ||
services: { | ||
security: { authc }, | ||
}, | ||
} = useKibana(); | ||
useEffect(() => { | ||
const getUser = async () => { | ||
const { username } = await authc.getCurrentUser(); | ||
setUserName(username); | ||
}; | ||
|
||
getUser(); | ||
}); | ||
|
||
return userName; | ||
}; |
32 changes: 32 additions & 0 deletions
32
x-pack/plugins/security_solution_serverless/public/get_started/apis/index.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,32 @@ | ||
/* | ||
* 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 { FetchRulesResponse } from '@kbn/security-solution-plugin/public'; | ||
import { DETECTION_ENGINE_RULES_URL_FIND } from '@kbn/security-solution-plugin/common'; | ||
import type { HttpSetup } from '@kbn/core/public'; | ||
|
||
export const fetchRuleManagementFilters = async ({ | ||
http, | ||
signal, | ||
query, | ||
}: { | ||
http: HttpSetup; | ||
signal?: AbortSignal; | ||
query?: { | ||
page: number; | ||
per_page: number; | ||
sort_field: string; | ||
sort_order: string; | ||
filter: string; | ||
}; | ||
}): Promise<FetchRulesResponse> => | ||
http.fetch<FetchRulesResponse>(DETECTION_ENGINE_RULES_URL_FIND, { | ||
method: 'GET', | ||
version: '2023-10-31', | ||
signal, | ||
query, | ||
}); |
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.