mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Cloud Posture] Dashboard - fix navigation query on resource click (#145274)
This commit is contained in:
parent
74e6282b24
commit
5b71ec33ce
1 changed files with 14 additions and 4 deletions
|
@ -35,10 +35,15 @@ const getFindingsQuery = (queryValue: Query['query']): Pick<FindingsBaseURLQuery
|
|||
export const useNavigateFindings = () => {
|
||||
const history = useHistory();
|
||||
|
||||
return (query?: Query['query']) => {
|
||||
return (query: Query['query'] = {}) => {
|
||||
history.push({
|
||||
pathname: findingsNavigation.findings_default.path,
|
||||
...(query && { search: encodeQuery(getFindingsQuery(query)) }),
|
||||
...(query && {
|
||||
search: encodeQuery({
|
||||
...getFindingsQuery(query),
|
||||
filters: [],
|
||||
}),
|
||||
}),
|
||||
});
|
||||
};
|
||||
};
|
||||
|
@ -46,10 +51,15 @@ export const useNavigateFindings = () => {
|
|||
export const useNavigateFindingsByResource = () => {
|
||||
const history = useHistory();
|
||||
|
||||
return (query?: Query['query']) => {
|
||||
return (query: Query['query'] = {}) => {
|
||||
history.push({
|
||||
pathname: findingsNavigation.findings_by_resource.path,
|
||||
...(query && { search: encodeQuery(getFindingsQuery(query)) }),
|
||||
...(query && {
|
||||
search: encodeQuery({
|
||||
...getFindingsQuery(query),
|
||||
filters: [],
|
||||
}),
|
||||
}),
|
||||
});
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue