-
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
[Cloud Security] Fix for issue where date is not retained when opening new tab #205128
Changes from 4 commits
f8bceab
ffceae9
de67b4c
3b1c835
27fbeda
0e8bec2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,14 +16,18 @@ import { URL_PARAM_KEY } from './use_url_state'; | |
export const useNavigateToAlertsPageWithFilters = () => { | ||
const { navigateTo } = useNavigation(); | ||
|
||
return (filterItems: FilterControlConfig | FilterControlConfig[], openInNewTab = false) => { | ||
return ( | ||
filterItems: FilterControlConfig | FilterControlConfig[], | ||
openInNewTab = false, | ||
timerange?: string | ||
) => { | ||
const urlFilterParams = encode( | ||
formatPageFilterSearchParam(Array.isArray(filterItems) ? filterItems : [filterItems]) | ||
); | ||
|
||
const timerangePath = timerange ? `&timerange=${timerange}` : ''; | ||
navigateTo({ | ||
deepLinkId: SecurityPageName.alerts, | ||
path: `?${URL_PARAM_KEY.pageFilter}=${urlFilterParams}`, | ||
path: `?${URL_PARAM_KEY.pageFilter}=${urlFilterParams}${timerangePath}`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Im wondering if we can't use the existing the table file seems to include the needed functions to create this query. and the encoding is happening here on this hook file. so if we can insert the timerange filter from the table it would be ideal. im approving, but please verify if that double timerange filter case can actually happen. if so, we probably need to address it before merging. i might also be missing the reason why this suggestion wont work so ill be glad if you could explain if you already tried it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmmmm so before this actually I Tried adding timerange on the Alerts page filter to no avail There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes this could be a scenario that happens, but I think it is very unlikely, as developers would have to specifically pass a timerange AND a timestamp filter to this hook... Also in the UI when using this hook, chances are that it would show the following message, letting the user know the filters have changed and would encourage them to look at them And finally, I'm not expecting many people to use this new |
||
openInNewTab, | ||
}); | ||
}; | ||
|
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.
Currently, no-one (except the usage in the file
alerts_findings_details_table.tsx
above) is using theopenInNewTab
property. It seems to me that the newtimerange
property is fully related to the fact that we want to open in a new tab. IfopenInNewTab
is false, the user is just navigating to a different page in Kibana within the same browser tab, and the KQL bar and its date time picker remain the same (meaning the date and time are persisted).I've been trying to find a good way to combine
openInNewTab
andtimerange
somehow together?, but I'm not liking any of the solutions I can come up with.I'm ok keeping things as you have right now, but if you have an idea let me know!
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.
would you be ok adding these prop documentations?