[Cloud Posture] onboarding prompts for vul_mgmt#154118
[Cloud Posture] onboarding prompts for vul_mgmt#154118Omolola-Akinleye merged 22 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/kibana-cloud-security-posture (Team:Cloud Security) |
| expect(screen.queryByTestId(ERROR_STATE_TEST_SUBJECT)).not.toBeInTheDocument(); | ||
| }); | ||
|
|
||
| // Todo: fix this test once we have a way to mock the useLocation hook |
There was a problem hiding this comment.
consider the following snippet as an example for mocking useLocation
jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom'),
useLocation: jest.fn().mockReturnValue({ search: '' }),
useHistory: jest.fn().mockReturnValue({
push: jest.fn(),
location: {
search: '',
},
}),
}));| import { VULNERABILITIES_CONTAINER_TEST_SUBJ } from '../../components/test_subjects'; | ||
|
|
||
| export const Vulnerabilities = () => { | ||
| const dataViewQuery = useLatestFindingsDataView(LATEST_VULNERABILITIES_INDEX_DEFAULT_NS); |
There was a problem hiding this comment.
Let's use the useFilteredDataView hook instead, so we don't need to create a data view for vulnerability, available once this PR is merged
|
@elasticmachine merge upstream |
b2c6da5 to
b8e52c3
Compare
- return indexing when there are findings in the datastream but not in the latest index - return index when latest index contains findings
- delete existing documents instead of deleting the entire index. - added refresh: true when adding/deleting findings docs in order to force indexing before moving on with the tests
…k from base CloudPosturePage component
| import { VULNERABILITIES_CONTAINER_TEST_SUBJ } from '../../components/test_subjects'; | ||
|
|
||
| export const Vulnerabilities = () => { | ||
| const dataViewQuery = useLatestFindingsDataView(LATEST_VULNERABILITIES_INDEX_DEFAULT_NS); |
There was a problem hiding this comment.
it's ready to switch for useFilteredDataView now
|
|
||
| export const CLOUD_SECURITY_POSTURE_PACKAGE_NAME = 'cloud_security_posture'; | ||
|
|
||
| // TODO: REMOVE CSP_LATEST_FINDINGS_DATA_VIEW and replace it with LATEST_FINDINGS_INDEX_PATTERN |
There was a problem hiding this comment.
CSP_LATEST_FINDINGS_DATA_VIEW is used in multiple places. We added a todo comment for now. I can create a follow PR to remove the instances where it's being used
There was a problem hiding this comment.
Got it, we can address it in follow-up tickets
…leye/kibana into onboarding-prompts-vul-mngt
💚 Build Succeeded
Metrics [docs]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: |
Summary
This PR adds onboarding prompts for when vulnerability management integration is not installed and when vulnerability management is installed then show scanning empty prompt.
A
<NoVulnerabilitesState/>component checks forvuln_mgmtstatus. If the status isnot-deployedorindexingthen showThe packageNoInstalledRender component will listen for the current tab and renders on
useLocation().pathname. IfcurrentTabis 'vulnerabilities' then we show<VulnerabilitiesFindingsInstalledEmptyPrompt/>. IfcurrentTabisconfigurationsthen show<ConfigurationFindingsInstalledEmptyPrompt/>Installed Prompt


Scanning Envioronment