-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace discover threat hunting (#6254)
* Add styles to discover components * Add customize pagination settings and unit test * Add file with data discover data grid columns definitions * Replace event tab render * Add chart min height to prevent layout errors * Change chart file name * Add date range in search method * Add saved query management in search bar * Clean wz-discover file * Fix maximize chart style * Update CHANGELOG * Fix type import * Fix data grid fullscreen with dock navigation * Fix data grid fullscreen flyout layout with docked sidenav --------- Co-authored-by: Federico Rodriguez <[email protected]>
- Loading branch information
1 parent
3c06a65
commit c1329d8
Showing
14 changed files
with
254 additions
and
89 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
23 changes: 23 additions & 0 deletions
23
plugins/main/public/components/common/data-grid/use-data-grid.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,23 @@ | ||
import { useDataGrid, tDataGridProps } from './use-data-grid'; | ||
import { renderHook } from '@testing-library/react-hooks'; | ||
import React from 'react'; | ||
|
||
describe('useDataGrid hook', () => { | ||
it('should return override the numbers of rows per page', () => { | ||
|
||
const dataGridProps: tDataGridProps = { | ||
indexPattern: 'mocked-index-pattern', | ||
results: {}, | ||
defaultColumns: [], | ||
DocViewInspectButton: () => <div></div>, | ||
ariaLabelledBy: '', | ||
pagination: { | ||
pageSize: 10, | ||
pageSizeOptions: [10, 20, 30], | ||
} | ||
} | ||
const { result } = renderHook(() => useDataGrid(dataGridProps)); | ||
expect(result.current.pagination.pageSize).toEqual(10); | ||
expect(result.current.pagination.pageSizeOptions).toEqual([10, 20, 30]); | ||
}) | ||
}); |
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
20 changes: 20 additions & 0 deletions
20
plugins/main/public/components/common/hooks/useDockedSideNav.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,20 @@ | ||
import { useEffect, useState } from 'react'; | ||
import { getChrome } from '../../../kibana-services'; | ||
|
||
export const useDockedSideNav = () => { | ||
const [sideNavDocked, setSideNavDocked] = useState<boolean>(false); | ||
|
||
useEffect(() => { | ||
const isNavDrawerSubscription = getChrome() | ||
.getIsNavDrawerLocked$() | ||
.subscribe((value: boolean) => { | ||
setSideNavDocked(value); | ||
}); | ||
|
||
return () => { | ||
isNavDrawerSubscription.unsubscribe(); | ||
}; | ||
}, []); | ||
|
||
return sideNavDocked; | ||
}; |
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
21 changes: 21 additions & 0 deletions
21
plugins/main/public/components/common/wazuh-discover/config/data-grid-columns.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,21 @@ | ||
import React from 'react'; | ||
import { tDataGridColumn } from '../../data-grid'; | ||
|
||
export const threatHuntingColumns: tDataGridColumn[] = [{ | ||
id: 'timestamp' | ||
}, | ||
{ | ||
id: 'agent.name' | ||
}, | ||
{ | ||
id: 'rule.description' | ||
}, | ||
{ | ||
id: 'rule.level' | ||
}, | ||
{ | ||
id: 'rule.id' | ||
}] | ||
|
||
|
||
|
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
28 changes: 28 additions & 0 deletions
28
plugins/main/public/components/common/wazuh-discover/discover.scss
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,28 @@ | ||
.discoverContainer { | ||
height: calc(100vh - 104px); | ||
|
||
.euiDataGrid--fullScreen { | ||
height: calc(100vh - 49px); | ||
bottom: 0; | ||
top: auto; | ||
} | ||
|
||
.discoverDataGrid { | ||
height: calc(100vh - 496px); | ||
} | ||
|
||
.discoverChartContainer { | ||
min-height: 234px; | ||
.dshLayout-isMaximizedPanel { | ||
top: 0; | ||
left: 0; | ||
min-height: calc(100vh - 49px); | ||
position: fixed; | ||
z-index: 9999; | ||
} | ||
} | ||
} | ||
|
||
.headerIsExpanded .discoverContainer { | ||
height: calc(100vh - 153px); | ||
} |
Oops, something went wrong.