-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add auto refresh button to events page #20996
Conversation
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.
Works well and looks good!
import useSearchConfiguration from 'hooks/useSearchConfiguration'; | ||
import useMinimumRefreshInterval from 'views/hooks/useMinimumRefreshInterval'; | ||
|
||
export const durationToMS = (duration: string) => moment.duration(duration).asMilliseconds(); |
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.
This would be a good addition to the DateTime
utils. It would be nice to add a comment with an example input.
humanName: string, | ||
} | ||
|
||
const CommonRefreshControls = ({ humanName, disable, onToggle = null, onEnable = null, onDisable = null, intervalOptions, onSelectInterval = null, isLoadingMinimumInterval, minimumRefreshInterval, defaultInterval }: Props) => { |
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.
Since we are already in the common
dir, let's just call it RefreshControls
? If you want to avoid having two components with the name, you could rename the one in the views
directory to ViewsRefreshControls
? Similar to how you named EventsRefreshControls
.
If we can avoid having the name of the directory in the component name, I would do that for the common refresh controls component.
changelog/unreleased/pr-20996.toml
Outdated
@@ -0,0 +1,5 @@ | |||
type = "a" | |||
message = "Add auto refresh to events page" |
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.
This sounds like the events list is now refreshing automatically when you open it.
Description
This PR refactor creates CommonRefreshControls components to reuse most of the logic in RefreshControls components.
Also, we add a refresh action to events page.
Motivation and Context
fix: https://github.com/Graylog2/graylog-plugin-enterprise/issues/8661
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist:
/jpd https://github.com/Graylog2/graylog-plugin-enterprise/pull/9269