-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Security Solution] - Timeline UI refactor #168230
Merged
+3,229
−2,142
Merged
Changes from all commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
54bf025
feat/intial_timeline_ui
logeekal 69d6538
more experimental UI
logeekal 1f4dd53
incremental save
logeekal b3a13bd
incremental save
logeekal b5c17d7
feat: added timeline action menu + fixed filter badges
logeekal ef13b22
timeline ui all changes
logeekal 133756f
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine 70002c6
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine ba4bcc0
fix: add missing translations
logeekal 74b3cb8
Merged main -> current branch
logeekal eb76e7f
fix: types + some tests
logeekal fee5b8c
fix: more tests
logeekal c3c11b9
fix: cypress tests
logeekal e80341b
Merged main -> current branch
logeekal f244f03
fix: adapt UI according to new timeline saving strategy
logeekal 84997b1
fix: cypress+ftr tests
logeekal 9b20c0e
fix: some tests
logeekal 5266dce
fix: types
logeekal 580b0f0
fix: jest tests
logeekal 790576d
Merged main -> current branch
logeekal 8fa0e74
fix: review feedback
logeekal 2ae0cdc
fix: data provider redesign
logeekal 92b5f91
fix: tests + housekeeping
logeekal 7dbf8dc
fix: organise tests + more fixes
logeekal 2174293
Merge branch 'main' into expr/new_timeline_ui
logeekal 9877b9b
fix: remove unnecssary eslint exception
logeekal 780b5fd
fix: types
logeekal 1219c20
Merge branch 'main' into expr/new_timeline_ui
kibanamachine 9e78fbf
Merge branch 'main' into expr/new_timeline_ui
logeekal b63a5bc
fix: review feedback
logeekal 4c99fb5
Merge branch 'main' into expr/new_timeline_ui
logeekal 8d06e2c
Merge branch 'main' into expr/new_timeline_ui
logeekal 9147e34
fix: translations title
logeekal 7e05d5d
fix: hide standard filters
logeekal 64b500c
Merge branch 'main' into expr/new_timeline_ui
logeekal 39fe8cb
Merged main -> current branch
logeekal 528366e
fix: more UI Fixes as per PR feedback
logeekal 5ba8785
hide kpis till lens embeddables are working
logeekal 4ed7d4e
fix: modal padding + radius + alignment + more nits
logeekal d5a0630
fix: more fixes
logeekal 8d9376f
Merged main -> current branch
logeekal d1d72d0
fix: notes tab spacing inconsistencies
logeekal 6213e11
fix: cypress tests
logeekal 772a300
fix: more spacing on notes tab
logeekal 1f9853e
Merge branch 'main' into expr/new_timeline_ui
logeekal 5f891f0
fix: review feedback
logeekal a2502d4
fix: revert some unncessary changes
logeekal bfc1246
fix:filter-search-popover-width
logeekal 53c6c39
Merged main -> current branch
logeekal af2d737
fix: review feedback
logeekal 7451a7d
Merge branch 'main' into expr/new_timeline_ui
logeekal ac257e3
fix: revert some changes
logeekal ef489cf
fix: remove data-test-subj from styles
logeekal 05b43e2
fix: spellings
logeekal 05d764c
fix: flyout footer
logeekal 2ed673e
fix: cypress test
logeekal 304b99a
Merge branch 'main' into expr/new_timeline_ui
logeekal 5273e4c
fix: misc
logeekal bb377ed
Merge branch 'main' into expr/new_timeline_ui
logeekal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion
2
...curity_solution/public/common/components/header_section/__snapshots__/index.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
139 changes: 139 additions & 0 deletions
139
...ck/plugins/security_solution/public/common/components/sourcerer/alerts_sourcerer.test.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,139 @@ | ||
/* | ||
* 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'; | ||
|
||
import { Sourcerer } from '.'; | ||
import { sourcererModel } from '../../store/sourcerer'; | ||
import { | ||
createSecuritySolutionStorageMock, | ||
kibanaObservable, | ||
mockGlobalState, | ||
SUB_PLUGINS_REDUCER, | ||
TestProviders, | ||
} from '../../mock'; | ||
import { createStore } from '../../store'; | ||
import { useSourcererDataView } from '../../containers/sourcerer'; | ||
import { useSignalHelpers } from '../../containers/sourcerer/use_signal_helpers'; | ||
import { fireEvent, render, screen, waitFor } from '@testing-library/react'; | ||
|
||
const mockDispatch = jest.fn(); | ||
|
||
jest.mock('../../containers/sourcerer'); | ||
jest.mock('../../containers/sourcerer/use_signal_helpers'); | ||
const mockUseUpdateDataView = jest.fn().mockReturnValue(() => true); | ||
jest.mock('./use_update_data_view', () => ({ | ||
useUpdateDataView: () => mockUseUpdateDataView, | ||
})); | ||
jest.mock('react-redux', () => { | ||
const original = jest.requireActual('react-redux'); | ||
|
||
return { | ||
...original, | ||
useDispatch: () => mockDispatch, | ||
}; | ||
}); | ||
|
||
jest.mock('@kbn/kibana-react-plugin/public', () => { | ||
const original = jest.requireActual('@kbn/kibana-react-plugin/public'); | ||
|
||
return { | ||
...original, | ||
toMountPoint: jest.fn(), | ||
}; | ||
}); | ||
|
||
const mockUpdateUrlParam = jest.fn(); | ||
jest.mock('../../utils/global_query_string', () => { | ||
const original = jest.requireActual('../../utils/global_query_string'); | ||
|
||
return { | ||
...original, | ||
useUpdateUrlParam: () => mockUpdateUrlParam, | ||
}; | ||
}); | ||
|
||
let store: ReturnType<typeof createStore>; | ||
const sourcererDataView = { | ||
indicesExist: true, | ||
loading: false, | ||
}; | ||
describe('sourcerer on alerts page or rules details page', () => { | ||
const { storage } = createSecuritySolutionStorageMock(); | ||
store = createStore(mockGlobalState, SUB_PLUGINS_REDUCER, kibanaObservable, storage); | ||
const testProps = { | ||
scope: sourcererModel.SourcererScopeName.detections, | ||
}; | ||
|
||
const pollForSignalIndexMock = jest.fn(); | ||
|
||
beforeEach(async () => { | ||
jest.clearAllMocks(); | ||
|
||
(useSignalHelpers as jest.Mock).mockReturnValue({ | ||
pollForSignalIndex: pollForSignalIndexMock, | ||
signalIndexNeedsInit: false, | ||
}); | ||
|
||
(useSourcererDataView as jest.Mock).mockReturnValue({ | ||
...sourcererDataView, | ||
indicesExist: true, | ||
}); | ||
|
||
render( | ||
<TestProviders store={store}> | ||
<Sourcerer {...testProps} /> | ||
</TestProviders> | ||
); | ||
|
||
fireEvent.click(screen.getByTestId('sourcerer-trigger')); | ||
await waitFor(() => { | ||
expect(screen.getByTestId('sourcerer-advanced-options-toggle')).toBeVisible(); | ||
}); | ||
fireEvent.click(screen.getByTestId('sourcerer-advanced-options-toggle')); | ||
}); | ||
|
||
it('renders an alerts badge in sourcerer button', () => { | ||
expect(screen.getByTestId('sourcerer-advanced-options-toggle')).toHaveTextContent( | ||
/Advanced options/ | ||
); | ||
}); | ||
|
||
it('renders a callout', () => { | ||
expect(screen.getByTestId('sourcerer-callout')).toHaveTextContent( | ||
'Data view cannot be modified on this page' | ||
); | ||
}); | ||
|
||
it('disable data view selector', () => { | ||
expect(screen.getByTestId('sourcerer-select')).toBeDisabled(); | ||
}); | ||
|
||
it('data view selector is default to Security Data View', () => { | ||
expect(screen.getByTestId('sourcerer-select')).toHaveTextContent(/security data view/i); | ||
}); | ||
|
||
it('renders an alert badge in data view selector', () => { | ||
expect(screen.getByTestId('security-alerts-option-badge')).toHaveTextContent('Alerts'); | ||
}); | ||
|
||
it('disable index pattern selector', () => { | ||
expect(screen.getByTestId('sourcerer-combo-box')).toHaveAttribute('disabled'); | ||
}); | ||
|
||
it('shows signal index as index pattern option', () => { | ||
expect(screen.getByTestId('euiComboBoxPill')).toHaveTextContent('.siem-signals-spacename'); | ||
}); | ||
|
||
it('does not render reset button', () => { | ||
expect(screen.queryByTestId('sourcerer-reset')).toBeFalsy(); | ||
}); | ||
|
||
it('does not render save button', () => { | ||
expect(screen.queryByTestId('sourcerer-save')).toBeFalsy(); | ||
}); | ||
}); |
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small thing I noticed that has probably always been there. When you update the query in either the main security application or in discover the
refresh
button changes toupdate
. Would it be a huge lift to implement that here as well? If so, we can pull it out to a separate issueThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michaelolo24 , I can see it happening today.
Screen.Recording.2023-11-15.at.09.45.54.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yea, I agree it's not a bug you introduced. Was just wondering if it could be done as part of this refactor to align with the other experiences, but that can be done separately.