[Security Solutions] Create a new User Details Flyout #154310
[Security Solutions] Create a new User Details Flyout #154310machadoum merged 7 commits intoelastic:mainfrom
Conversation
1c4f619 to
ad33d0f
Compare
92dc72e to
7a90532
Compare
x-pack/plugins/security_solution/public/explore/components/stat_items/use_kpi_matrix_status.ts
Outdated
Show resolved
Hide resolved
...strategy/security_solution/factory/users/observed_details/query.observed_user_details.dsl.ts
Outdated
Show resolved
Hide resolved
b810197 to
ab23557
Compare
|
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
|
Pinging @elastic/security-solution (Team: SecuritySolution) |
47b38d2 to
fdd6107
Compare
|
Desk tested with
|
...ugins/security_solution/public/timelines/components/side_panel/new_user_detail/hooks.test.ts
Outdated
Show resolved
Hide resolved
...ck/plugins/security_solution/public/timelines/components/side_panel/new_user_detail/hooks.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/types.ts
Outdated
Show resolved
Hide resolved
...ty_solution/server/search_strategy/security_solution/factory/users/observed_details/index.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/server/search_strategy/security_solution/index.ts
Outdated
Show resolved
Hide resolved
ce8abc3 to
ec5d798
Compare
angorayc
left a comment
There was a problem hiding this comment.
Awesome work Pablo, thanks for adding this feature!
logeekal
left a comment
There was a problem hiding this comment.
LGTM mostly. Commented some comments/queries?
...lution/server/search_strategy/security_solution/factory/users/managed_details/index.test.tsx
Outdated
Show resolved
Hide resolved
...ategy/security_solution/factory/users/managed_details/query.managed_user_details.dsl.test.ts
Outdated
Show resolved
Hide resolved
...ty_solution/server/search_strategy/security_solution/factory/users/observed_details/index.ts
Outdated
Show resolved
Hide resolved
...ns/security_solution/common/search_strategy/security_solution/users/managed_details/index.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
👍 . @PhilippeOberti , I guess you might have already implemented this in your own flyout PR. In case not, this might help you.
x-pack/plugins/security_solution/public/timelines/components/side_panel/index.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
nit: Might make sense to extract it out to a separate config.
There was a problem hiding this comment.
Do you mean placing it in a constants.ts file?
There was a problem hiding this comment.
yes something like that. The reason I said it because labels and fields are hard coded and the array is quite big for both userData and managedUserDetails. You will have to pass userData/ managedUserDetails to get the complete object.
I don't have strong opinion about it.. you can decide. But at a later stage if more fields are added, I would prefer that /plugins/security_solution/public/timelines/components/side_panel/new_user_detail/hooks.ts is not changed at all.
...ugins/security_solution/public/timelines/components/side_panel/new_user_detail/hooks.test.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
should this file be under __mocks__ directory or was it intentional?
There was a problem hiding this comment.
I just noticed that sometimes the mock folder is called mocks and other times __mocks__. I will rename it to __mock__ because it is used more often.
@logeekal Do you know what the difference is?
There was a problem hiding this comment.
so from __mocks__ folder jest automatically picks up the mocks. It is a good way to create typesafe mocks. Here is the documentation: https://jestjs.io/docs/manual-mocks#mocking-user-modules.
But mocks can be used to mock one module in one file. Advantage is that you do not need to separately import mocks. It is automatically used.
There was a problem hiding this comment.
I didn't know that. It is very convenient. I will use it frequently. Thanks!
c74798d to
3414cd7
Compare
3414cd7 to
07049ac
Compare
|
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @machadoum |
…ng in a flyout (#155814) With #154310 a global decorator was added which caused all `security_solution` stories to be rendered in a flyout. This PR changes the decorator to be local instead so the `UserDetailsContentComponent` still renders in a flyout as expected, but all other components are still within the main canvas. ### Before <p align="center"> <img width="400" src="https://user-images.githubusercontent.com/2946766/234429269-46cf527d-f7f2-4229-9ca1-ae227ce8e1b6.png" /> <img width="400" alt="image" src="https://user-images.githubusercontent.com/2946766/234429444-f38229ef-1113-4416-9bb4-233cc058ee44.png"> </p> ### After <p align="center"> <img width="400" src="https://user-images.githubusercontent.com/2946766/234429580-82c99bb1-9064-4fc3-8b16-446fc418729d.png" /> <img width="400" alt="image" src="https://user-images.githubusercontent.com/2946766/234429444-f38229ef-1113-4416-9bb4-233cc058ee44.png"> </p>


issue: https://github.com/elastic/security-team/issues/6154
Summary
Main changes
newUserDetailsFlyout(disabled by default)managedUserDetailsAPI which fetches data from the index created by the Azure integration.Miscellaneous
lastSeenandfirst_seentypes.jobKeyproperty from anomaly score componentsuserDetailsAPI and hook toobservedUserDetails.filterQueryproperty touseFirstLastSeen.TestProvidersComponentfor Storybook namedStorybookProvidersexperimentalFeaturesproperty toqueryFactory.buildDsl.Out of scope:
Storybook
Please check the "💚 Build Succeeded" message
How to test it
newUserDetailsFlyoutHow to install the new Azure integration
The integration is under development, so you have to follow a series of steps:
elastic-package stack up -vd --version 8.8.0-SNAPSHOTcd packages/entityanalytics_azure/elastic-package buildelastic-package stack up -vd --services package-registryChecklist
Delete any items that are not applicable to this PR.
[x] This renders correctly on smaller devices using a responsive layout. (You can test this in your browser)